1234567891011121314151617181920 |
- !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="703a954d984cfadb8e07",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;e<c.length;e++)c[e].call(null,t)}var d,p,m,g=0,v=0,y={},_={},x={};function w(t){return+t+""===t?+t:t}function b(t){if("idle"!==l)throw new Error("check() is only allowed in idle status");return i=t,f("check"),function(t){return t=t||1e4,new Promise(function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var i=new XMLHttpRequest,o=C.p+""+r+".hot-update.json";i.open("GET",o,!0),i.timeout=t,i.send(null)}catch(t){return n(t)}i.onreadystatechange=function(){if(4===i.readyState)if(0===i.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===i.status)e();else if(200!==i.status&&304!==i.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(i.responseText)}catch(t){return void n(t)}e(t)}}})}(o).then(function(t){if(!t)return f("idle"),null;_={},y={},x=t.c,m=t.h,f("prepare");var e=new Promise(function(t,e){d={resolve:t,reject:e}});p={};return M(0),"prepare"===l&&0===v&&0===g&&E(),e})}function M(t){x[t]?(_[t]=!0,g++,function(t){var e=document.getElementsByTagName("head")[0],n=document.createElement("script");n.charset="utf-8",n.src=C.p+""+t+"."+r+".hot-update.js",e.appendChild(n)}(t)):y[t]=!0}function E(){f("ready");var t=d;if(d=null,t)if(i)Promise.resolve().then(function(){return S(i)}).then(function(e){t.resolve(e)},function(e){t.reject(e)});else{var e=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&e.push(w(n));t.resolve(e)}}function S(e){if("ready"!==l)throw new Error("apply() is only allowed in ready status");var n,i,o,h,u;function c(t){for(var e=[t],n={},i=e.slice().map(function(t){return{chain:[t],id:t}});i.length>0;){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<h.parents.length;s++){var u=h.parents[s],c=T[u];if(c){if(c.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([u]),moduleId:o,parentId:u};-1===e.indexOf(u)&&(c.hot._acceptedDependencies[o]?(n[u]||(n[u]=[]),d(n[u],[o])):(delete n[u],e.push(u),i.push({chain:a.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:t,outdatedModules:e,outdatedDependencies:n}}function d(t,e){for(var n=0;n<e.length;n++){var i=e[n];-1===t.indexOf(i)&&t.push(i)}}e=e||{};var g={},v=[],y={},_=function(){console.warn("[HMR] unexpected require("+M.moduleId+") to disposed module")};for(var b in p)if(Object.prototype.hasOwnProperty.call(p,b)){var M;u=w(b);var E=!1,S=!1,P=!1,A="";switch((M=p[b]?c(u):{type:"disposed",moduleId:b}).chain&&(A="\nUpdate propagation: "+M.chain.join(" -> ")),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;i<v.length;i++)u=v[i],T[u]&&T[u].hot._selfAccepted&&R.push({module:u,errorHandler:T[u].hot._selfAccepted});f("dispose"),Object.keys(x).forEach(function(t){!1===x[t]&&function(t){delete installedChunks[t]}(t)});for(var O,I,D=v.slice();D.length>0;)if(u=D.pop(),h=T[u]){var k={},N=h.hot._disposeHandlers;for(o=0;o<N.length;o++)(n=N[o])(k);for(a[u]=k,h.hot.active=!1,delete T[u],delete g[u],o=0;o<h.children.length;o++){var z=T[h.children[o]];z&&((L=z.parents.indexOf(u))>=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<I.length;o++)O=I[o],(L=h.children.indexOf(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<I.length;i++)if(O=I[i],n=h.hot._acceptedDependencies[O]){if(-1!==B.indexOf(n))continue;B.push(n)}for(i=0;i<B.length;i++){n=B[i];try{n(I)}catch(t){e.onErrored&&e.onErrored({type:"accept-errored",moduleId:u,dependencyId:I[i],error:t}),e.ignoreErrored||F||(F=t)}}}for(i=0;i<R.length;i++){var j=R[i];u=j.module,s=[u];try{C(u)}catch(t){if("function"==typeof j.errorHandler)try{j.errorHandler(t)}catch(n){e.onErrored&&e.onErrored({type:"self-accept-error-handler-errored",moduleId:u,error:n,originalError:t}),e.ignoreErrored||F||(F=n),F||(F=t)}else e.onErrored&&e.onErrored({type:"self-accept-errored",moduleId:u,error:t}),e.ignoreErrored||F||(F=t)}}return F?(f("fail"),Promise.reject(F)):(f("idle"),new Promise(function(t){t(v)}))}var T={};function C(e){if(T[e])return T[e].exports;var i=T[e]={i:e,l:!1,exports:{},hot:function(t){var e={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(t,n){if(void 0===t)e._selfAccepted=!0;else if("function"==typeof t)e._selfAccepted=t;else if("object"==typeof t)for(var i=0;i<t.length;i++)e._acceptedDependencies[t[i]]=n||function(){};else e._acceptedDependencies[t]=n||function(){}},decline:function(t){if(void 0===t)e._selfDeclined=!0;else if("object"==typeof t)for(var n=0;n<t.length;n++)e._declinedDependencies[t[n]]=!0;else e._declinedDependencies[t]=!0},dispose:function(t){e._disposeHandlers.push(t)},addDisposeHandler:function(t){e._disposeHandlers.push(t)},removeDisposeHandler:function(t){var n=e._disposeHandlers.indexOf(t);n>=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(135)(C.s=135)}([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(52)("wks"),r=n(35),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(95),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<arguments.length;n++){var i=arguments[n];if(void 0!==i&&null!==i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}),Object.assign(i.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});var r="96",o={LEFT:0,MIDDLE:1,RIGHT:2},a=0,s=1,h=2,u=3,c=0,l=1,f=0,d=1,p=2,m=0,g=1,v=2,y=1,_=2,x=0,w=1,b=2,M=0,E=1,S=2,T=3,C=4,P=5,A=100,L=101,R=102,O=103,I=104,D=200,k=201,N=202,z=203,F=204,B=205,j=206,G=207,H=208,U=209,V=210,W=0,Z=1,q=2,X=3,Y=4,J=5,K=6,Q=7,$=0,tt=1,et=2,nt=0,it=1,rt=2,ot=3,at=4,st=300,ht=301,ut=302,ct=303,lt=304,ft=305,dt=306,pt=307,mt=1e3,gt=1001,vt=1002,yt=1003,_t=1004,xt=1005,wt=1006,bt=1007,Mt=1008,Et=1009,St=1010,Tt=1011,Ct=1012,Pt=1013,At=1014,Lt=1015,Rt=1016,Ot=1017,It=1018,Dt=1019,kt=1020,Nt=1021,zt=1022,Ft=1023,Bt=1024,jt=1025,Gt=Ft,Ht=1026,Ut=1027,Vt=33776,Wt=33777,Zt=33778,qt=33779,Xt=35840,Yt=35841,Jt=35842,Kt=35843,Qt=36196,$t=37808,te=37809,ee=37810,ne=37811,ie=37812,re=37813,oe=37814,ae=37815,se=37816,he=37817,ue=37818,ce=37819,le=37820,fe=37821,de=2200,pe=2201,me=2202,ge=2300,ve=2301,ye=2302,_e=2400,xe=2401,we=2402,be=0,Me=1,Ee=2,Se=3e3,Te=3001,Ce=3007,Pe=3002,Ae=3003,Le=3004,Re=3005,Oe=3006,Ie=3200,De=3201,ke=0,Ne=1,ze={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(t[255&e]+t[e>>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<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix4(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],h=t[13],u=t[2],c=t[6],l=t[10],f=t[14];return t[3]*(+r*s*c-i*h*c-r*a*l+n*h*l+i*a*f-n*s*f)+t[7]*(+e*s*f-e*h*l+r*o*l-i*o*f+i*h*u-r*s*u)+t[11]*(+e*h*c-e*a*f-r*o*c+n*o*f+r*a*u-n*h*u)+t[15]*(-i*a*u-e*s*c+e*a*l+i*o*c-n*o*l+n*s*u)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],h=i[4],u=i[5],c=i[6],l=i[7],f=i[8],d=i[9],p=i[10],m=i[11],g=i[12],v=i[13],y=i[14],_=i[15],x=d*y*l-v*p*l+v*c*m-u*y*m-d*c*_+u*p*_,w=g*p*l-f*y*l-g*c*m+h*y*m+f*c*_-h*p*_,b=f*v*l-g*d*l+g*u*m-h*v*m-f*u*_+h*d*_,M=g*d*c-f*v*c-g*u*p+h*v*p+f*u*y-h*d*y,E=r*x+o*w+a*b+s*M;if(0===E){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var T=1/E;return n[0]=x*T,n[1]=(v*p*s-d*y*s-v*a*m+o*y*m+d*a*_-o*p*_)*T,n[2]=(u*y*s-v*c*s+v*a*l-o*y*l-u*a*_+o*c*_)*T,n[3]=(d*c*s-u*p*s-d*a*l+o*p*l+u*a*m-o*c*m)*T,n[4]=w*T,n[5]=(f*y*s-g*p*s+g*a*m-r*y*m-f*a*_+r*p*_)*T,n[6]=(g*c*s-h*y*s-g*a*l+r*y*l+h*a*_-r*c*_)*T,n[7]=(h*p*s-f*c*s+f*a*l-r*p*l-h*a*m+r*c*m)*T,n[8]=b*T,n[9]=(g*d*s-f*v*s-g*o*m+r*v*m+f*o*_-r*d*_)*T,n[10]=(h*v*s-g*u*s+g*o*l-r*v*l-h*o*_+r*u*_)*T,n[11]=(f*u*s-h*d*s-f*o*l+r*d*l+h*o*m-r*u*m)*T,n[12]=M*T,n[13]=(f*v*a-g*d*a+g*o*p-r*v*p-f*o*y+r*d*y)*T,n[14]=(g*u*a-h*v*a-g*o*c+r*v*c+h*o*y-r*u*y)*T,n[15]=(h*d*a-f*u*a+f*o*c-r*d*c-h*o*p+r*u*p)*T,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,h=r*o,u=r*a;return this.set(h*o+n,h*a-i*s,h*s+i*a,0,h*a+i*s,u*a+n,u*s-i*o,0,h*s-i*a,u*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,h=r+r,u=o+o,c=a+a,l=r*h,f=r*u,d=r*c,p=o*u,m=o*c,g=a*c,v=s*h,y=s*u,_=s*c,x=n.x,w=n.y,b=n.z;return i[0]=(1-(p+g))*x,i[1]=(f+_)*x,i[2]=(d-y)*x,i[3]=0,i[4]=(f-_)*w,i[5]=(1-(l+g))*w,i[6]=(m+v)*w,i[7]=0,i[8]=(d+y)*b,i[9]=(m-v)*b,i[10]=(1-(l+p))*b,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(){var t=new Ge,e=new Be;return function(n,i,r){var o=this.elements,a=t.set(o[0],o[1],o[2]).length(),s=t.set(o[4],o[5],o[6]).length(),h=t.set(o[8],o[9],o[10]).length();this.determinant()<0&&(a=-a),n.x=o[12],n.y=o[13],n.z=o[14],e.copy(this);var u=1/a,c=1/s,l=1/h;return e.elements[0]*=u,e.elements[1]*=u,e.elements[2]*=u,e.elements[4]*=c,e.elements[5]*=c,e.elements[6]*=c,e.elements[8]*=l,e.elements[9]*=l,e.elements[10]*=l,i.setFromRotationMatrix(e),r.x=a,r.y=s,r.z=h,this}}(),makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*r/(e-t),h=2*r/(n-i),u=(e+t)/(e-t),c=(n+i)/(n-i),l=-(o+r)/(o-r),f=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=h,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=l,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),h=1/(n-i),u=1/(o-r),c=(e+t)*s,l=(n+i)*h,f=(o+r)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*h,a[9]=0,a[13]=-l,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}),Object.assign(je,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],h=n[i+1],u=n[i+2],c=n[i+3],l=r[o+0],f=r[o+1],d=r[o+2],p=r[o+3];if(c!==p||s!==l||h!==f||u!==d){var m=1-a,g=s*l+h*f+u*d+c*p,v=g>=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;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix3(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),multiply:function(t){return 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[3],s=n[6],h=n[1],u=n[4],c=n[7],l=n[2],f=n[5],d=n[8],p=i[0],m=i[3],g=i[6],v=i[1],y=i[4],_=i[7],x=i[2],w=i[5],b=i[8];return r[0]=o*p+a*v+s*x,r[3]=o*m+a*y+s*w,r[6]=o*g+a*_+s*b,r[1]=h*p+u*v+c*x,r[4]=h*m+u*y+c*w,r[7]=h*g+u*_+c*b,r[2]=l*p+f*v+d*x,r[5]=l*m+f*y+d*w,r[8]=l*g+f*_+d*b,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],h=t[7],u=t[8];return e*o*u-e*a*h-n*r*u+n*a*s+i*r*h-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],h=n[4],u=n[5],c=n[6],l=n[7],f=n[8],d=f*h-u*l,p=u*c-f*s,m=l*s-h*c,g=r*d+o*p+a*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=d*y,i[1]=(a*l-f*o)*y,i[2]=(u*o-a*h)*y,i[3]=p*y,i[4]=(f*r-a*c)*y,i[5]=(a*s-u*r)*y,i[6]=m*y,i[7]=(o*c-l*r)*y,i[8]=(h*r-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),h=Math.sin(r);this.set(n*s,n*h,-n*(s*o+h*a)+o+t,-i*h,i*s,-i*(-h*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],h=i[4],u=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*h,i[6]=e*a+n*u,i[1]=-n*r+e*s,i[4]=-n*o+e*h,i[7]=-n*a+e*u,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Ue={getDataURL:function(t){var e;if(t instanceof HTMLCanvasElement)e=t;else{(e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=t.width,e.height=t.height;var n=e.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height)}return e.width>2048||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;o<a;o++)r.push(Ue.getDataURL(i[o]))}else r=Ue.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==st)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)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;s<h;s+=3){var u=t[s],c=t[s+1],l=t[s+2];u<e&&(e=u),c<n&&(n=c),l<i&&(i=l),u>r&&(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;s<h;s++){var u=t.getX(s),c=t.getY(s),l=t.getZ(s);u<e&&(e=u),c<n&&(n=c),l<i&&(i=l),u>r&&(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;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new Ge;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Ge),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Ge),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t,e,n,i=new Ge;function r(r){var o=r.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(e=0,n=a.length;e<n;e++)i.copy(a[e]),i.applyMatrix4(r.matrixWorld),t.expandByPoint(i)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(e=0,n=s.count;e<n;e++)i.fromBufferAttribute(s,e).applyMatrix4(r.matrixWorld),t.expandByPoint(i)}}return function(e){return t=this,e.updateMatrixWorld(!0),e.traverse(r),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox: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.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere: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;o<a;o++)r=Math.max(r,i.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Ge),e.copy(t),n>this.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)<i)return!1}return!0},intersectsBox:function(){var t=new Ge;return function(e){for(var n=this.planes,i=0;i<6;i++){var r=n[i];if(t.x=r.normal.x>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 <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\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 <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\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 <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\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 <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#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 <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}\n",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( 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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n"},en={merge:function(t){for(var e={},n=0;n<t.length;n++){var i=this.clone(t[n]);for(var r in i)e[r]=i[r]}return e},clone:function(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}},nn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function rn(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}Object.assign(rn.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB: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+(r<o?6:0);break;case r:e=(o-i)/u+2;break;case o:e=(i-r)/u+4}e/=6}return t.h=e,t.s=n,t.l=h,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(){var t={};return function(e,n,i){return this.getHSL(t),t.h+=e,t.s+=n,t.l+=i,this.setHSL(t.h,t.s,t.l),this}}(),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(){var t={h:0,s:0,l:0},e={h:0,s:0,l:0};return function(n,i){this.getHSL(t),n.getHSL(e);var r=ze.lerp(t.h,e.h,i),o=ze.lerp(t.s,e.s,i),a=ze.lerp(t.l,e.l,i);return this.setHSL(r,o,a),this}}(),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var on={common:{diffuse:{value:new rn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new He},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rn(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new rn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new He}},sprite:{diffuse:{value:new rn(15658734)},opacity:{value:1},center:{value:new Fe(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new He}}},an={basic:{uniforms:en.merge([on.common,on.specularmap,on.envmap,on.aomap,on.lightmap,on.fog]),vertexShader:tn.meshbasic_vert,fragmentShader:tn.meshbasic_frag},lambert:{uniforms:en.merge([on.common,on.specularmap,on.envmap,on.aomap,on.lightmap,on.emissivemap,on.fog,on.lights,{emissive:{value:new rn(0)}}]),vertexShader:tn.meshlambert_vert,fragmentShader:tn.meshlambert_frag},phong:{uniforms:en.merge([on.common,on.specularmap,on.envmap,on.aomap,on.lightmap,on.emissivemap,on.bumpmap,on.normalmap,on.displacementmap,on.gradientmap,on.fog,on.lights,{emissive:{value:new rn(0)},specular:{value:new rn(1118481)},shininess:{value:30}}]),vertexShader:tn.meshphong_vert,fragmentShader:tn.meshphong_frag},standard:{uniforms:en.merge([on.common,on.envmap,on.aomap,on.lightmap,on.emissivemap,on.bumpmap,on.normalmap,on.displacementmap,on.roughnessmap,on.metalnessmap,on.fog,on.lights,{emissive:{value:new rn(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:tn.meshphysical_vert,fragmentShader:tn.meshphysical_frag},points:{uniforms:en.merge([on.points,on.fog]),vertexShader:tn.points_vert,fragmentShader:tn.points_frag},dashed:{uniforms:en.merge([on.common,on.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:tn.linedashed_vert,fragmentShader:tn.linedashed_frag},depth:{uniforms:en.merge([on.common,on.displacementmap]),vertexShader:tn.depth_vert,fragmentShader:tn.depth_frag},normal:{uniforms:en.merge([on.common,on.bumpmap,on.normalmap,on.displacementmap,{opacity:{value:1}}]),vertexShader:tn.normal_vert,fragmentShader:tn.normal_frag},sprite:{uniforms:en.merge([on.sprite,on.fog]),vertexShader:tn.sprite_vert,fragmentShader:tn.sprite_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:tn.cube_vert,fragmentShader:tn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:tn.equirect_vert,fragmentShader:tn.equirect_frag},distanceRGBA:{uniforms:en.merge([on.common,on.displacementmap,{referencePosition:{value:new Ge},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:tn.distanceRGBA_vert,fragmentShader:tn.distanceRGBA_frag},shadow:{uniforms:en.merge([on.lights,on.fog,{color:{value:new rn(0)},opacity:{value:1}}]),vertexShader:tn.shadow_vert,fragmentShader:tn.shadow_frag}};function sn(){var t=null,e=!1,n=null;function i(r,o){!1!==e&&(n(r,o),t.requestAnimationFrame(i))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(i),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function hn(t){var e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=e.get(n);void 0===r?e.set(n,function(e,n){var i=e.array,r=e.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,i,r),e.onUploadCallback();var a=t.FLOAT;return i instanceof Float32Array?a=t.FLOAT:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?a=t.UNSIGNED_SHORT:i instanceof Int16Array?a=t.SHORT:i instanceof Uint32Array?a=t.UNSIGNED_INT:i instanceof Int32Array?a=t.INT:i instanceof Int8Array?a=t.BYTE:i instanceof Uint8Array&&(a=t.UNSIGNED_BYTE),{buffer:o,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(n,i)):r.version<n.version&&(function(e,n,i){var r=n.array,o=n.updateRange;t.bindBuffer(i,e),!1===n.dynamic?t.bufferData(i,r,t.STATIC_DRAW):-1===o.count?t.bufferSubData(i,0,r):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(i,o.offset*r.BYTES_PER_ELEMENT,r.subarray(o.offset,o.offset+o.count)),o.count=-1)}(r.buffer,n,i),r.version=n.version)}}}function un(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||un.DefaultOrder}function cn(){this.mask=1}an.physical={uniforms:en.merge([an.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:tn.meshphysical_vert,fragmentShader:tn.meshphysical_frag},un.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],un.DefaultOrder="XYZ",Object.defineProperties(un.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(un.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=ze.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],h=r[1],u=r[5],c=r[9],l=r[2],f=r[6],d=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-l,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(f,-1,1)),Math.abs(f)<.99999?(this._y=Math.atan2(-l,d),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(h,o))):"ZYX"===e?(this._y=Math.asin(-i(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(f,d),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-a,u))):"YZX"===e?(this._z=Math.asin(i(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-l,o)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-c,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new Be;return function(e,n,i){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,n,i)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new je;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Ge(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(cn.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var ln=0;function fn(){Object.defineProperty(this,"id",{value:ln++}),this.uuid=ze.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=fn.DefaultUp.clone();var t=new Ge,e=new un,n=new je,i=new Ge(1,1,1);e.onChange(function(){n.setFromEuler(e,!1)}),n.onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:i},modelViewMatrix:{value:new Be},normalMatrix:{value:new He}}),this.matrix=new Be,this.matrixWorld=new Be,this.matrixAutoUpdate=fn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new cn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function dn(){fn.call(this),this.type="Camera",this.matrixWorldInverse=new Be,this.projectionMatrix=new Be,this.projectionMatrixInverse=new Be}function pn(t,e,n,i,r,o){dn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function mn(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new Ge,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new rn,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}fn.DefaultUp=new Ge(0,1,0),fn.DefaultMatrixAutoUpdate=!0,fn.prototype=Object.assign(Object.create(i.prototype),{constructor:fn,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new je;return function(e,n){return t.setFromAxisAngle(e,n),this.quaternion.multiply(t),this}}(),rotateOnWorldAxis:function(){var t=new je;return function(e,n){return t.setFromAxisAngle(e,n),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new Ge(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new Ge(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new Ge(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new Ge;return function(e,n){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(n)),this}}(),translateX:function(){var t=new Ge(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new Ge(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new Ge(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new Be;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new je,e=new Be,n=new Ge,i=new Ge;return function(r,o,a){r.isVector3?n.copy(r):n.set(r,o,a);var s=this.parent;this.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(this.matrixWorld),this.isCamera?e.lookAt(i,n,this.up):e.lookAt(n,i,this.up),this.quaternion.setFromRotationMatrix(e),s&&(e.extractRotation(s.matrixWorld),t.setFromRotationMatrix(e),this.quaternion.premultiply(t.inverse()))}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Ge),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new Ge,e=new Ge;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),n=new je),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,n,e),n}}(),getWorldScale:function(){var t=new Ge,e=new je;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),n=new Ge),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Ge),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,h=a.length;s<h;s++){var u=a[s];r(t.shapes,u)}else r(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var c=[];for(s=0,h=this.material.length;s<h;s++)c.push(r(t.materials,this.material[s]));i.material=c}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(t).object)}if(e){var l=m(t.geometries),f=m(t.materials),d=m(t.textures),p=m(t.images);a=m(t.shapes);l.length>0&&(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;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}}),dn.prototype=Object.assign(Object.create(fn.prototype),{constructor:dn,isCamera:!0,copy:function(t,e){return fn.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Ge),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){fn.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),pn.prototype=Object.assign(Object.create(dn.prototype),{constructor:pn,isOrthographicCamera:!0,copy:function(t,e){return dn.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,o=n+t,a=i+e,s=i-e;if(null!==this.view&&this.view.enabled){var h=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,l=(this.top-this.bottom)/this.view.height;o=(r+=c*(this.view.offsetX/h))+c*(this.view.width/h),s=(a-=l*(this.view.offsetY/u))-l*(this.view.height/u)}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=fn.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Object.assign(mn.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var gn=0;function vn(){Object.defineProperty(this,"id",{value:gn+=2}),this.uuid=ze.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function yn(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function _n(t,e,n){yn.call(this,new Int8Array(t),e,n)}function xn(t,e,n){yn.call(this,new Uint8Array(t),e,n)}function wn(t,e,n){yn.call(this,new Uint8ClampedArray(t),e,n)}function bn(t,e,n){yn.call(this,new Int16Array(t),e,n)}function Mn(t,e,n){yn.call(this,new Uint16Array(t),e,n)}function En(t,e,n){yn.call(this,new Int32Array(t),e,n)}function Sn(t,e,n){yn.call(this,new Uint32Array(t),e,n)}function Tn(t,e,n){yn.call(this,new Float32Array(t),e,n)}function Cn(t,e,n){yn.call(this,new Float64Array(t),e,n)}function Pn(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function An(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(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;n<i;n++){this.vertices[n].applyMatrix4(t)}for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var o=0,a=r.vertexNormals.length;o<a;o++)r.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,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)}}(),fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,i=t.attributes,r=i.position.array,o=void 0!==i.normal?i.normal.array:void 0,a=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,h=void 0!==i.uv2?i.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var u=[],c=[],l=[],f=0,d=0;f<r.length;f+=3,d+=2)e.vertices.push(new Ge(r[f],r[f+1],r[f+2])),void 0!==o&&u.push(new Ge(o[f],o[f+1],o[f+2])),void 0!==a&&e.colors.push(new rn(a[f],a[f+1],a[f+2])),void 0!==s&&c.push(new Fe(s[d],s[d+1])),void 0!==h&&l.push(new Fe(h[d],h[d+1]));function p(t,n,i,r){var f=new mn(t,n,i,void 0!==o?[u[t].clone(),u[n].clone(),u[i].clone()]:[],void 0!==a?[e.colors[t].clone(),e.colors[n].clone(),e.colors[i].clone()]:[],r);e.faces.push(f),void 0!==s&&e.faceVertexUvs[0].push([c[t].clone(),c[n].clone(),c[i].clone()]),void 0!==h&&e.faceVertexUvs[1].push([l[t].clone(),l[n].clone(),l[i].clone()])}var m=t.groups;if(m.length>0)for(f=0;f<m.length;f++)for(var g=m[f],v=g.start,y=(d=v,v+g.count);d<y;d+=3)void 0!==n?p(n[d],n[d+1],n[d+2],g.materialIndex):p(d,d+1,d+2,g.materialIndex);else if(void 0!==n)for(f=0;f<n.length;f+=3)p(n[f],n[f+1],n[f+2]);else for(f=0;f<r.length/3;f+=3)p(f,f+1,f+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},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}}(),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new Be;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new Ge,e=new Ge,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new Ge;if(t){var s,h,u,c=new Ge,l=new Ge;for(i=0,r=this.faces.length;i<r;i++)o=this.faces[i],s=this.vertices[o.a],h=this.vertices[o.b],u=this.vertices[o.c],c.subVectors(u,h),l.subVectors(s,h),c.cross(l),a[o.a].add(c),a[o.b].add(c),a[o.c].add(c)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)a[(o=this.faces[i]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(i=0,r=this.faces.length;i<r;i++){var f=(o=this.faces[i]).vertexNormals;3===f.length?(f[0].copy(a[o.a]),f[1].copy(a[o.b]),f[2].copy(a[o.c])):(f[0]=a[o.a].clone(),f[1]=a[o.b].clone(),f[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var o=new vn;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)h=new Ge,u={a:new Ge,b:new Ge,c:new Ge},a.push(h),s.push(u)}var h,u,c=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],h=c.faceNormals[n],u=c.vertexNormals[n],h.copy(r.normal),u.a.copy(r.vertexNormals[0]),u.b.copy(r.vertexNormals[1]),u.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Je),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ke),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,h=t.faces,u=this.faceVertexUvs[0],c=t.faceVertexUvs[0],l=this.colors,f=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new He).getNormalMatrix(e));for(var d=0,p=a.length;d<p;d++){var m=a[d].clone();void 0!==e&&m.applyMatrix4(e),o.push(m)}for(d=0,p=f.length;d<p;d++)l.push(f[d].clone());for(d=0,p=h.length;d<p;d++){var g,v,y,_=h[d],x=_.vertexNormals,w=_.vertexColors;(g=new mn(_.a+r,_.b+r,_.c+r)).normal.copy(_.normal),void 0!==i&&g.normal.applyMatrix3(i).normalize();for(var b=0,M=x.length;b<M;b++)v=x[b].clone(),void 0!==i&&v.applyMatrix3(i).normalize(),g.vertexNormals.push(v);g.color.copy(_.color);for(b=0,M=w.length;b<M;b++)y=w[b],g.vertexColors.push(y.clone());g.materialIndex=_.materialIndex+n,s.push(g)}for(d=0,p=c.length;d<p;d++){var E=c[d],S=[];if(void 0!==E){for(b=0,M=E.length;b<M;b++)S.push(E[b].clone());u.push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,i,r,o,a,s,h={},u=[],c=[],l=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===h[e=Math.round(t.x*l)+"_"+Math.round(t.y*l)+"_"+Math.round(t.z*l)]?(h[e]=n,u.push(this.vertices[n]),c[n]=u.length-1):c[n]=c[h[e]];var f=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=c[r.a],r.b=c[r.b],r.c=c[r.c],o=[r.a,r.b,r.c];for(var d=0;d<3;d++)if(o[d]===o[(d+1)%3]){f.push(n);break}}for(n=f.length-1;n>=0;n--){var p=f[n];for(this.faces.splice(p,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(p,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new Ge(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,r,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(i=[]),a&&a.length===e&&(r=[]);for(n=0;n<e;n++){var s=t[n]._id;i&&i.push(o[s]),r&&r.push(a[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var i=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];i.push(o.x,o.y,o.z)}var a=[],s=[],h={},u=[],c={},l=[],f={};for(r=0;r<this.faces.length;r++){var d=this.faces[r],p=void 0!==this.faceVertexUvs[0][r],m=d.normal.length()>0,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<<e:t&~(1<<e)}function E(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==h[e]?h[e]:(h[e]=s.length/3,s.push(t.x,t.y,t.z),h[e])}function S(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==c[e]?c[e]:(c[e]=u.length,u.push(t.getHex()),c[e])}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==f[e]?f[e]:(f[e]=l.length/2,l.push(t.x,t.y),f[e])}return t.data={},t.data.vertices=i,t.data.normals=s,u.length>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;e<n;e++)this.vertices.push(s[e].clone());var h=t.colors;for(e=0,n=h.length;e<n;e++)this.colors.push(h[e].clone());var u=t.faces;for(e=0,n=u.length;e<n;e++)this.faces.push(u[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var c=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=c.length;i<r;i++){var l=c[i],f=[];for(o=0,a=l.length;o<a;o++){var d=l[o];f.push(d.clone())}this.faceVertexUvs[e].push(f)}}var p=t.morphTargets;for(e=0,n=p.length;e<n;e++){var m={};if(m.name=p[e].name,void 0!==p[e].vertices)for(m.vertices=[],i=0,r=p[e].vertices.length;i<r;i++)m.vertices.push(p[e].vertices[i].clone());if(void 0!==p[e].normals)for(m.normals=[],i=0,r=p[e].normals.length;i<r;i++)m.normals.push(p[e].normals[i].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],i=0,r=g[e].vertexNormals.length;i<r;i++){var y=g[e].vertexNormals[i],_={};_.a=y.a.clone(),_.b=y.b.clone(),_.c=y.c.clone(),v.vertexNormals.push(_)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],i=0,r=g[e].faceNormals.length;i<r;i++)v.faceNormals.push(g[e].faceNormals[i].clone());this.morphNormals.push(v)}var x=t.skinWeights;for(e=0,n=x.length;e<n;e++)this.skinWeights.push(x[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var b=t.lineDistances;for(e=0,n=b.length;e<n;e++)this.lineDistances.push(b[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(yn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(yn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new rn),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new Fe),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new Ge),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new Ze),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),_n.prototype=Object.create(yn.prototype),_n.prototype.constructor=_n,xn.prototype=Object.create(yn.prototype),xn.prototype.constructor=xn,wn.prototype=Object.create(yn.prototype),wn.prototype.constructor=wn,bn.prototype=Object.create(yn.prototype),bn.prototype.constructor=bn,Mn.prototype=Object.create(yn.prototype),Mn.prototype.constructor=Mn,En.prototype=Object.create(yn.prototype),En.prototype.constructor=En,Sn.prototype=Object.create(yn.prototype),Sn.prototype.constructor=Sn,Tn.prototype=Object.create(yn.prototype),Tn.prototype.constructor=Tn,Cn.prototype=Object.create(yn.prototype),Cn.prototype.constructor=Cn,Object.assign(Pn.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,o=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,s=t.morphTargets,h=s.length;if(h>0){e=[];for(var u=0;u<h;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var c,l=t.morphNormals,f=l.length;if(f>0){c=[];for(u=0;u<f;u++)c[u]={name:l[u].name,data:[]};this.morphTargets.normal=c}var d=t.skinIndices,p=t.skinWeights,m=d.length===i.length,g=p.length===i.length;i.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<n.length;u++){var v=n[u];this.vertices.push(i[v.a],i[v.b],i[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var _=v.normal;this.normals.push(_,_,_)}var x,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var b=v.color;this.colors.push(b,b,b)}if(!0===o)void 0!==(x=r[0][u])?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new Fe,new Fe,new Fe));if(!0===a)void 0!==(x=r[1][u])?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new Fe,new Fe,new Fe));for(var M=0;M<h;M++){var E=s[M].vertices;e[M].data.push(E[v.a],E[v.b],E[v.c])}for(M=0;M<f;M++){var S=l[M].vertexNormals[u];c[M].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),g&&this.skinWeights.push(p[v.a],p[v.b],p[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var Ln=1;function Rn(){Object.defineProperty(this,"id",{value:Ln+=2}),this.uuid=ze.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function On(t,e,n,i,r,o){vn.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new In(t,e,n,i,r,o)),this.mergeVertices()}function In(t,e,n,i,r,o){Rn.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};var a=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1;var s=[],h=[],u=[],c=[],l=0,f=0;function d(t,e,n,i,r,o,d,p,m,g,v){var y,_,x=o/m,w=d/g,b=o/2,M=d/2,E=p/2,S=m+1,T=g+1,C=0,P=0,A=new Ge;for(_=0;_<T;_++){var L=_*w-M;for(y=0;y<S;y++){var R=y*x-b;A[t]=R*i,A[e]=L*r,A[n]=E,h.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=p>0?1:-1,u.push(A.x,A.y,A.z),c.push(y/m),c.push(1-_/g),C+=1}}for(_=0;_<g;_++)for(y=0;y<m;y++){var O=l+y+S*_,I=l+y+S*(_+1),D=l+(y+1)+S*(_+1),k=l+(y+1)+S*_;s.push(O,I,k),s.push(I,D,k),P+=6}a.addGroup(f,P,v),f+=P,l+=C}d("z","y","x",-1,-1,n,e,t,o=Math.floor(o)||1,r,0),d("z","y","x",1,-1,n,e,-t,o,r,1),d("x","z","y",1,1,t,n,e,i,o,2),d("x","z","y",1,-1,t,n,-e,i,o,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(s),this.addAttribute("position",new Tn(h,3)),this.addAttribute("normal",new Tn(u,3)),this.addAttribute("uv",new Tn(c,2))}function Dn(t,e,n,i){vn.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new kn(t,e,n,i)),this.mergeVertices()}function kn(t,e,n,i){Rn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,o,a=(t=t||1)/2,s=(e=e||1)/2,h=Math.floor(n)||1,u=Math.floor(i)||1,c=h+1,l=u+1,f=t/h,d=e/u,p=[],m=[],g=[],v=[];for(o=0;o<l;o++){var y=o*d-s;for(r=0;r<c;r++){var _=r*f-a;m.push(_,-y,0),g.push(0,0,1),v.push(r/h),v.push(1-o/u)}}for(o=0;o<u;o++)for(r=0;r<h;r++){var x=r+c*o,w=r+c*(o+1),b=r+1+c*(o+1),M=r+1+c*o;p.push(x,w,M),p.push(w,b,M)}this.setIndex(p),this.addAttribute("position",new Tn(m,3)),this.addAttribute("normal",new Tn(g,3)),this.addAttribute("uv",new Tn(v,2))}Rn.prototype=Object.assign(Object.create(i.prototype),{constructor:Rn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(An(t)>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;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new Tn(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Pn).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new yn(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){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;u<c;u++){var l=h[u],f=new Tn(3*l.data.length,3);f.name=l.name,s.push(f.copyVector3sArray(l.data))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){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;o<a;o++)e.x=n.getX(o),e.y=n.getY(o),e.z=n.getZ(o),r=Math.max(r,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new yn(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var a,s,h,u=e.normal.array,c=new Ge,l=new Ge,f=new Ge,d=new Ge,p=new Ge;if(t){var m=t.array;for(r=0,o=t.count;r<o;r+=3)a=3*m[r+0],s=3*m[r+1],h=3*m[r+2],c.fromArray(n,a),l.fromArray(n,s),f.fromArray(n,h),d.subVectors(f,l),p.subVectors(c,l),d.cross(p),u[a]+=d.x,u[a+1]+=d.y,u[a+2]+=d.z,u[s]+=d.x,u[s+1]+=d.y,u[s+2]+=d.z,u[h]+=d.x,u[h+1]+=d.y,u[h+2]+=d.z}else for(r=0,o=n.length;r<o;r+=9)c.fromArray(n,r),l.fromArray(n,r+3),f.fromArray(n,r+6),d.subVectors(f,l),p.subVectors(c,l),d.cross(p),u[r]=d.x,u[r+1]=d.y,u[r+2]=d.z,u[r+3]=d.x,u[r+4]=d.y,u[r+5]=d.z,u[r+6]=d.x,u[r+7]=d.y,u[r+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,o=t.attributes[i],a=o.array,s=0,h=o.itemSize*e;s<a.length;s++,h++)r[h]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){var t=new Ge;return function(){for(var e=this.attributes.normal,n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.normalize(),e.setXYZ(n,t.x,t.y,t.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new Rn,e=this.index.array,n=this.attributes;for(var i in n){for(var r=n[i],o=r.array,a=r.itemSize,s=new o.constructor(e.length*a),h=0,u=0,c=0,l=e.length;c<l;c++){h=e[c]*a;for(var f=0;f<a;f++)s[u++]=o[h++]}t.addAttribute(i,new yn(s,a))}var d=this.groups;for(c=0,l=d.length;c<l;c++){var p=d[c];t.addGroup(p.start,p.count,p.materialIndex)}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){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;n<i;n++)h.push(u[n].clone());this.morphAttributes[e]=h}var c=t.groups;for(n=0,i=c.length;n<i;n++){var l=c[n];this.addGroup(l.start,l.count,l.materialIndex)}var f=t.boundingBox;null!==f&&(this.boundingBox=f.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),On.prototype=Object.create(vn.prototype),On.prototype.constructor=On,In.prototype=Object.create(Rn.prototype),In.prototype.constructor=In,Dn.prototype=Object.create(vn.prototype),Dn.prototype.constructor=Dn,kn.prototype=Object.create(Rn.prototype),kn.prototype.constructor=kn;var Nn=0;function zn(){Object.defineProperty(this,"id",{value:Nn++}),this.uuid=ze.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=E,this.side=m,this.flatShading=!1,this.vertexColors=x,this.opacity=1,this.transparent=!1,this.blendSrc=F,this.blendDst=B,this.blendEquation=A,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=X,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function Fn(t){zn.call(this),this.type="MeshBasicMaterial",this.color=new rn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,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.lights=!1,this.setValues(t)}function Bn(t){zn.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function jn(t,e){this.origin=void 0!==t?t:new Ge,this.direction=void 0!==e?e:new Ge}function Gn(t,e,n){this.a=void 0!==t?t:new Ge,this.b=void 0!==e?e:new Ge,this.c=void 0!==n?n:new Ge}function Hn(t,e){fn.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Rn,this.material=void 0!==e?e:new Fn({color:16777215*Math.random()}),this.drawMode=be,this.updateMorphTargets()}function Un(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Vn(t,e,n,i,r,o,a,s,h,u){t=void 0!==t?t:[],e=void 0!==e?e:ht,We.call(this,t,e,n,i,r,o,a,s,h,u),this.flipY=!1}zn.prototype=Object.assign(Object.create(i.prototype),{constructor:zn,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]="overdraw"===e?Number(n):n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===y;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==E&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==m&&(n.side=this.side),this.vertexColors!==x&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(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<i||i!=i)&&(i=o),c>=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<i||i!=i)&&(i=s),i<0?null:this.at(n>=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;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)n=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}},raycast:function(){var t=new Be,e=new jn,n=new Ke,i=new Ge,r=new Ge,o=new Ge,a=new Ge,s=new Ge,h=new Ge,u=new Fe,c=new Fe,l=new Fe,f=new Ge,d=new Ge;function p(t,e,n,i,r,o,a,s){if(null===(e.side===g?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,e.side!==v,s)))return null;d.copy(s),d.applyMatrix4(t.matrixWorld);var h=n.ray.origin.distanceTo(d);return h<n.near||h>n.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;E<T;E++)for(A=_[(P=I[E]).materialIndex],S=Math.max(P.start,D.start),C=Math.min(P.start+P.count,D.start+D.count);S<C;S+=3)w=L.getX(S),b=L.getX(S+1),M=L.getX(S+2),(v=m(this,A,d,e,R,O,w,b,M))&&(v.faceIndex=Math.floor(S/3),g.push(v));else for(E=Math.max(0,D.start),T=Math.min(L.count,D.start+D.count);E<T;E+=3)w=L.getX(E),b=L.getX(E+1),M=L.getX(E+2),(v=m(this,_,d,e,R,O,w,b,M))&&(v.faceIndex=Math.floor(E/3),g.push(v));else if(void 0!==R)if(Array.isArray(_))for(E=0,T=I.length;E<T;E++)for(A=_[(P=I[E]).materialIndex],S=Math.max(P.start,D.start),C=Math.min(P.start+P.count,D.start+D.count);S<C;S+=3)(v=m(this,A,d,e,R,O,w=S,b=S+1,M=S+2))&&(v.faceIndex=Math.floor(S/3),g.push(v));else for(E=Math.max(0,D.start),T=Math.min(R.count,D.start+D.count);E<T;E+=3)(v=m(this,_,d,e,R,O,w=E,b=E+1,M=E+2))&&(v.faceIndex=Math.floor(E/3),g.push(v))}else if(y.isGeometry){var k,N,z,F,B=Array.isArray(_),j=y.vertices,G=y.faces,H=y.faceVertexUvs[0];H.length>0&&(F=H);for(var U=0,V=G.length;U<V;U++){var W=G[U],Z=B?_[W.materialIndex]:_;if(void 0!==Z){if(k=j[W.a],N=j[W.b],z=j[W.c],!0===Z.morphTargets){var q=y.morphTargets,X=this.morphTargetInfluences;i.set(0,0,0),r.set(0,0,0),o.set(0,0,0);for(var Y=0,J=q.length;Y<J;Y++){var K=X[Y];if(0!==K){var Q=q[Y].vertices;i.addScaledVector(a.subVectors(Q[W.a],k),K),r.addScaledVector(s.subVectors(Q[W.b],N),K),o.addScaledVector(h.subVectors(Q[W.c],z),K)}}i.add(k),r.add(N),o.add(z),k=i,N=r,z=o}if(v=p(this,Z,d,e,k,N,z,f)){if(F&&F[U]){var $=F[U];u.copy($[0]),c.copy($[1]),l.copy($[2]),v.uv=Gn.getUV(f,k,N,z,u,c,l,new Fe)}v.face=W,v.faceIndex=U,g.push(v)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Vn.prototype=Object.create(We.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isCubeTexture=!0,Object.defineProperty(Vn.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var Wn=new We,Zn=new Vn;function qn(){this.seq=[],this.map={}}var Xn=[],Yn=[],Jn=new Float32Array(16),Kn=new Float32Array(9),Qn=new Float32Array(4);function $n(t,e,n){var i=t[0];if(i<=0||i>0)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<i;n++)if(t[n]!==e[n])return!1;return!0}function ei(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function ni(t,e){var n=Yn[e];void 0===n&&(n=new Int32Array(e),Yn[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocTextureUnit();return n}function ii(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function ri(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function oi(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(ti(n,e))return;t.uniform2fv(this.addr,e),ei(n,e)}}function ai(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(ti(n,e))return;t.uniform3fv(this.addr,e),ei(n,e)}}function si(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(ti(n,e))return;t.uniform4fv(this.addr,e),ei(n,e)}}function hi(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(ti(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ei(n,e)}else{if(ti(n,i))return;Qn.set(i),t.uniformMatrix2fv(this.addr,!1,Qn),ei(n,i)}}function ui(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(ti(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ei(n,e)}else{if(ti(n,i))return;Kn.set(i),t.uniformMatrix3fv(this.addr,!1,Kn),ei(n,i)}}function ci(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(ti(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ei(n,e)}else{if(ti(n,i))return;Jn.set(i),t.uniformMatrix4fv(this.addr,!1,Jn),ei(n,i)}}function li(t,e,n){var i=this.cache,r=n.allocTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2D(e||Wn,r)}function fi(t,e,n){var i=this.cache,r=n.allocTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||Zn,r)}function di(t,e){var n=this.cache;ti(n,e)||(t.uniform2iv(this.addr,e),ei(n,e))}function pi(t,e){var n=this.cache;ti(n,e)||(t.uniform3iv(this.addr,e),ei(n,e))}function mi(t,e){var n=this.cache;ti(n,e)||(t.uniform4iv(this.addr,e),ei(n,e))}function gi(t,e){var n=this.cache;ti(n,e)||(t.uniform1fv(this.addr,e),ei(n,e))}function vi(t,e){var n=this.cache;ti(n,e)||(t.uniform1iv(this.addr,e),ei(n,e))}function yi(t,e){var n=this.cache,i=$n(e,this.size,2);ti(n,i)||(t.uniform2fv(this.addr,i),this.updateCache(i))}function _i(t,e){var n=this.cache,i=$n(e,this.size,3);ti(n,i)||(t.uniform3fv(this.addr,i),this.updateCache(i))}function xi(t,e){var n=this.cache,i=$n(e,this.size,4);ti(n,i)||(t.uniform4fv(this.addr,i),this.updateCache(i))}function wi(t,e){var n=this.cache,i=$n(e,this.size,4);ti(n,i)||(t.uniformMatrix2fv(this.addr,!1,i),this.updateCache(i))}function bi(t,e){var n=this.cache,i=$n(e,this.size,9);ti(n,i)||(t.uniformMatrix3fv(this.addr,!1,i),this.updateCache(i))}function Mi(t,e){var n=this.cache,i=$n(e,this.size,16);ti(n,i)||(t.uniformMatrix4fv(this.addr,!1,i),this.updateCache(i))}function Ei(t,e,n){var i=this.cache,r=e.length,o=ni(n,r);!1===ti(i,o)&&(t.uniform1iv(this.addr,o),ei(i,o));for(var a=0;a!==r;++a)n.setTexture2D(e[a]||Wn,o[a])}function Si(t,e,n){var i=this.cache,r=e.length,o=ni(n,r);!1===ti(i,o)&&(t.uniform1iv(this.addr,o),ei(i,o));for(var a=0;a!==r;++a)n.setTextureCube(e[a]||Zn,o[a])}function Ti(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return ii;case 35664:return oi;case 35665:return ai;case 35666:return si;case 35674:return hi;case 35675:return ui;case 35676:return ci;case 35678:case 36198:return li;case 35680:return fi;case 5124:case 35670:return ri;case 35667:case 35671:return di;case 35668:case 35672:return pi;case 35669:case 35673:return mi}}(e.type)}function Ci(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return gi;case 35664:return yi;case 35665:return _i;case 35666:return xi;case 35674:return wi;case 35675:return bi;case 35676:return Mi;case 35678:return Ei;case 35680:return Si;case 5124:case 35670:return vi;case 35667:case 35671:return di;case 35668:case 35672:return pi;case 35669:case 35673:return mi}}(e.type)}function Pi(t){this.id=t,qn.call(this)}Ci.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),ei(e,t)},Pi.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var a=i[r];a.setValue(t,e[a.id],n)}};var Ai=/([\w\d_]+)(\])?(\[|\.)?/g;function Li(t,e){t.seq.push(e),t.map[e.id]=e}function Ri(t,e,n){var i=t.name,r=i.length;for(Ai.lastIndex=0;;){var o=Ai.exec(i),a=Ai.lastIndex,s=o[1],h="]"===o[2],u=o[3];if(h&&(s|=0),void 0===u||"["===u&&a+2===r){Li(n,void 0===u?new Ti(s,t,e):new Ci(s,t,e));break}var c=n.map[s];void 0===c&&Li(n,c=new Pi(s)),n=c}}function Oi(t,e,n){qn.call(this),this.renderer=n;for(var i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),r=0;r<i;++r){var o=t.getActiveUniform(e,r);Ri(o,t.getUniformLocation(e,o.name),this)}}function Ii(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),!1===t.getShaderParameter(i,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(i)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(i),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n)),i}Oi.prototype.setValue=function(t,e,n){var i=this.map[e];void 0!==i&&i.setValue(t,n,this.renderer)},Oi.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},Oi.upload=function(t,e,n,i){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}},Oi.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in e&&n.push(o)}return n};var Di=0;function ki(t){switch(t){case Se:return["Linear","( value )"];case Te:return["sRGB","( value )"];case Pe:return["RGBE","( value )"];case Le:return["RGBM","( value, 7.0 )"];case Re:return["RGBM","( value, 16.0 )"];case Oe:return["RGBD","( value, 256.0 )"];case Ce:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function Ni(t,e){var n=ki(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function zi(t){return""!==t}function Fi(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Bi(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function ji(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/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);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]");return r})}function Hi(t,e,n,i,r,o,a){var s=t.context,h=i.defines,u=r.vertexShader,c=r.fragmentShader,l="SHADOWMAP_TYPE_BASIC";o.shadowMapType===d?l="SHADOWMAP_TYPE_PCF":o.shadowMapType===p&&(l="SHADOWMAP_TYPE_PCF_SOFT");var f="ENVMAP_TYPE_CUBE",m="ENVMAP_MODE_REFLECTION",g="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(i.envMap.mapping){case ht:case ut:f="ENVMAP_TYPE_CUBE";break;case dt:case pt:f="ENVMAP_TYPE_CUBE_UV";break;case ct:case lt:f="ENVMAP_TYPE_EQUIREC";break;case ft:f="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case ut:case lt:m="ENVMAP_MODE_REFRACTION"}switch(i.combine){case $:g="ENVMAP_BLENDING_MULTIPLY";break;case tt:g="ENVMAP_BLENDING_MIX";break;case et:g="ENVMAP_BLENDING_ADD"}}var v,y,_=t.gammaFactor>0?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;r<i;r++){var o=t.getActiveAttrib(e,r).name;n[o]=t.getAttribLocation(e,o)}return n}(s,b)),L},this.destroy=function(){s.deleteProgram(b),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=Di++,this.code=n,this.usedTimes=1,this.program=b,this.vertexShader=C,this.fragmentShader=P,this}function Ui(t,e,n){var i=[],r={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function a(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Se,n===Se&&e&&(n=Ce),n}this.getParameters=function(e,i,o,s,h,u,c){var l=r[e.type],f=c.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(n.floatVertexTextures)return 1024;var i=n.maxVertexUniforms,r=Math.floor((i-20)/4),o=Math.min(r,e.length);return o<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+o+"."),0):o}(c):0,d=n.precision;null!==e.precision&&(d=n.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",d,"instead.");var p=t.getRenderTarget();return{shaderID:l,precision:d,supportsVertexTextures:n.vertexTextures,outputEncoding:a(p?p.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:a(e.map,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:a(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===dt||e.envMap.mapping===pt),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:a(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===Ne,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexColors:e.vertexColors,fog:!!s,useFog:e.fog,fogExp:s&&s.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:e.skinning&&f>0,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;a<o.length;a++)i.push(n[o[a]]);return i.push(e.onBeforeCompile.toString()),i.push(t.gammaOutput),i.join()},this.acquireProgram=function(r,o,a,s){for(var h,u=0,c=i.length;u<c;u++){var l=i[u];if(l.code===s){++(h=l).usedTimes;break}}return void 0===h&&(h=new Hi(t,e,s,r,o,a,n),i.push(h)),h},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=i.indexOf(t);i[e]=i[i.length-1],i.pop(),t.destroy()}},this.programs=i}function Vi(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Wi(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Zi(){var t={};return{get:function(e,n){var i=e.id+","+n.id,r=t[i];return void 0===r&&(r=new function(){var t=[],e=0,n=[],i=[];return{opaque:n,transparent:i,init:function(){e=0,n.length=0,i.length=0},push:function(r,o,a,s,h){var u=t[e];void 0===u?(u={id:r.id,object:r,geometry:o,material:a,program:a.program,renderOrder:r.renderOrder,z:s,group:h},t[e]=u):(u.id=r.id,u.object=r,u.geometry=o,u.material=a,u.program=a.program,u.renderOrder=r.renderOrder,u.z=s,u.group=h),(!0===a.transparent?i:n).push(u),e++},sort:function(){n.length>1&&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;v<y;v++){var _=o[v],x=_.color,w=_.intensity,b=_.distance,M=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)h+=x.r*w,u+=x.g*w,c+=x.b*w;else if(_.isDirectionalLight){if((S=t.get(_)).color.copy(_.color).multiplyScalar(_.intensity),S.direction.setFromMatrixPosition(_.matrixWorld),n.setFromMatrixPosition(_.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=_.castShadow,_.castShadow){var E=_.shadow;S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize}e.directionalShadowMap[l]=M,e.directionalShadowMatrix[l]=_.shadow.matrix,e.directional[l]=S,l++}else if(_.isSpotLight)(S=t.get(_)).position.setFromMatrixPosition(_.matrixWorld),S.position.applyMatrix4(g),S.color.copy(x).multiplyScalar(w),S.distance=b,S.direction.setFromMatrixPosition(_.matrixWorld),n.setFromMatrixPosition(_.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(_.angle),S.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),S.decay=0===_.distance?0:_.decay,S.shadow=_.castShadow,_.castShadow&&(E=_.shadow,S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize),e.spotShadowMap[d]=M,e.spotShadowMatrix[d]=_.shadow.matrix,e.spot[d]=S,d++;else if(_.isRectAreaLight)(S=t.get(_)).color.copy(x).multiplyScalar(w),S.position.setFromMatrixPosition(_.matrixWorld),S.position.applyMatrix4(g),r.identity(),i.copy(_.matrixWorld),i.premultiply(g),r.extractRotation(i),S.halfWidth.set(.5*_.width,0,0),S.halfHeight.set(0,.5*_.height,0),S.halfWidth.applyMatrix4(r),S.halfHeight.applyMatrix4(r),e.rectArea[p]=S,p++;else if(_.isPointLight)(S=t.get(_)).position.setFromMatrixPosition(_.matrixWorld),S.position.applyMatrix4(g),S.color.copy(_.color).multiplyScalar(_.intensity),S.distance=_.distance,S.decay=0===_.distance?0:_.decay,S.shadow=_.castShadow,_.castShadow&&(E=_.shadow,S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize,S.shadowCameraNear=E.camera.near,S.shadowCameraFar=E.camera.far),e.pointShadowMap[f]=M,e.pointShadowMatrix[f]=_.shadow.matrix,e.point[f]=S,f++;else if(_.isHemisphereLight){var S;(S=t.get(_)).direction.setFromMatrixPosition(_.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(_.color).multiplyScalar(w),S.groundColor.copy(_.groundColor).multiplyScalar(w),e.hemi[m]=S,m++}}e.ambient[0]=h,e.ambient[1]=u,e.ambient[2]=c,e.directional.length=l,e.spot.length=d,e.rectArea.length=p,e.point.length=f,e.hemi.length=m,e.hash.stateID=e.id,e.hash.directionalLength=l,e.hash.pointLength=f,e.hash.spotLength=d,e.hash.rectAreaLength=p,e.hash.hemiLength=m,e.hash.shadowsLength=a.length},state:e}}function Ji(){var t=new Yi,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(i){t.setup(e,n,i)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function Ki(t){zn.call(this),this.type="MeshDepthMaterial",this.depthPacking=Ie,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function Qi(t){zn.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Ge,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function $i(t,e,n){for(var i=new $e,r=new Be,o=new Fe,a=new Fe(n,n),s=new Ge,h=new Ge,u=1,c=2,l=1+(u|c),f=new Array(l),p=new Array(l),y={},_={0:g,1:m,2:v},x=[new Ge(1,0,0),new Ge(-1,0,0),new Ge(0,0,1),new Ge(0,0,-1),new Ge(0,1,0),new Ge(0,-1,0)],w=[new Ge(0,1,0),new Ge(0,1,0),new Ge(0,1,0),new Ge(0,1,0),new Ge(0,0,1),new Ge(0,0,-1)],b=[new Ze,new Ze,new Ze,new Ze,new Ze,new Ze],M=0;M!==l;++M){var E=0!=(M&u),S=0!=(M&c),T=new Ki({depthPacking:De,morphTargets:E,skinning:S});f[M]=T;var C=new Qi({morphTargets:E,skinning:S});p[M]=C}var P=this;function A(e,n,i,r,o,a){var s=e.geometry,h=null,l=f,d=e.customDepthMaterial;if(i&&(l=p,d=e.customDistanceMaterial),d)h=d;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0: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;l<f;l++){var d=c[l],p=u[d.materialIndex];if(p&&p.visible){var m=A(n,p,a,h,o.near,o.far);t.renderBufferDirect(o,null,s,m,n,d)}}else if(u.visible){m=A(n,u,a,h,o.near,o.far);t.renderBufferDirect(o,null,s,m,n,null)}}for(var g=n.children,v=0,y=g.length;v<y;v++)L(g[v],r,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=d,this.render=function(e,n,u){if(!1!==P.enabled&&(!1!==P.autoUpdate||!1!==P.needsUpdate)&&0!==e.length){var c,l=t.context,f=t.state;f.disable(l.BLEND),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var d=0,p=e.length;d<p;d++){var m=e[d],g=m.shadow,v=m&&m.isPointLight;if(void 0!==g){var y=g.camera;if(o.copy(g.mapSize),o.min(a),v){var _=o.x,M=o.y;b[0].set(2*_,M,_,M),b[1].set(0,M,_,M),b[2].set(3*_,M,_,M),b[3].set(_,M,_,M),b[4].set(3*_,0,_,M),b[5].set(_,0,_,M),o.x*=4,o.y*=2}if(null===g.map){var E={minFilter:yt,magFilter:yt,format:Ft};g.map=new qe(o.x,o.y,E),g.map.texture.name=m.name+".shadowMap",y.updateProjectionMatrix()}g.isSpotLightShadow&&g.update(m);var S=g.map,T=g.matrix;h.setFromMatrixPosition(m.matrixWorld),y.position.copy(h),v?(c=6,T.makeTranslation(-h.x,-h.y,-h.z)):(c=1,s.setFromMatrixPosition(m.target.matrixWorld),y.lookAt(s),y.updateMatrixWorld(),T.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),T.multiply(y.projectionMatrix),T.multiply(y.matrixWorldInverse)),t.setRenderTarget(S),t.clear();for(var C=0;C<c;C++){if(v){s.copy(y.position),s.add(x[C]),y.up.copy(w[C]),y.lookAt(s),y.updateMatrixWorld();var A=b[C];f.viewport(A)}r.multiplyMatrices(y.projectionMatrix,y.matrixWorldInverse),i.setFromMatrix(r),L(n,u,y,v)}}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}P.needsUpdate=!1}}}function tr(t,e,n,i,r,o,a){var s,h={};function u(t,e){if(t.width>e||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<E;M++)w=b[M],n.texImage2D(t.TEXTURE_2D,M,x,w.width,w.height,0,v,_,w.data);i.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(t.TEXTURE_2D,0,x,p.width,p.height,0,v,_,p.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(var M=0,E=b.length;M<E;M++)w=b[M],i.format!==Ft&&i.format!==zt?n.getCompressedTextureFormats().indexOf(v)>-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;M<E;M++)w=b[M],n.texImage2D(t.TEXTURE_2D,M,x,v,_,w);i.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(t.TEXTURE_2D,0,x,v,_,p),e.__maxMipLevel=0;l(i,g)&&f(t.TEXTURE_2D,i,p.width,p.height);e.__version=i.version,i.onUpdate&&i.onUpdate(i)}(g,e,p);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(t.TEXTURE0+p),n.bindTexture(t.TEXTURE_2D,g.__webglTexture)}function y(n,a,s){var h;if(s?(t.texParameteri(n,t.TEXTURE_WRAP_S,o.convert(a.wrapS)),t.texParameteri(n,t.TEXTURE_WRAP_T,o.convert(a.wrapT)),t.texParameteri(n,t.TEXTURE_MAG_FILTER,o.convert(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,o.convert(a.minFilter))):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),a.wrapS===gt&&a.wrapT===gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,p(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,p(a.minFilter)),a.minFilter!==yt&&a.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),h=e.get("EXT_texture_filter_anisotropic")){if(a.type===Lt&&null===e.get("OES_texture_float_linear"))return;if(a.type===Rt&&null===(r.isWebGL2||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||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<P;C++)S=T[C],e.format!==Ft&&e.format!==zt?n.getCompressedTextureFormats().indexOf(b)>-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;n<r;n++){var o=e[n];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("Spatial Controller"))){if(i===t)return o;i++}}}this.enabled=!1,this.getController=function(t){var e=o[t];return void 0===e&&((e=new nr).matrixAutoUpdate=!1,e.visible=!1,o[t]=e),e},this.getDevice=function(){return n},this.setDevice=function(t){void 0!==t&&(n=t),w.setContext(t)},this.setFrameOfReferenceType=function(t){h=t},this.setPoseTarget=function(t){void 0!==t&&(r=t)},this.getCamera=function(t){var e="stage"===h?1.6:0;if(null===n)return t.position.set(0,e,0),t;if(n.depthNear=t.near,n.depthFar=t.far,n.getFrameData(i),"stage"===h){var p=n.stageParameters;p?a.fromArray(p.sittingToStandingTransform):a.makeTranslation(0,e,0)}var m=i.pose,v=null!==r?r:t;if(v.matrix.copy(a),v.matrix.decompose(v.position,v.quaternion,v.scale),null!==m.orientation&&(c.fromArray(m.orientation),v.quaternion.multiply(c)),null!==m.position&&(c.setFromRotationMatrix(a),l.fromArray(m.position),l.applyQuaternion(c),v.position.add(l)),v.updateMatrixWorld(),!1===n.isPresenting)return t;f.near=t.near,d.near=t.near,f.far=t.far,d.far=t.far,g.matrixWorld.copy(t.matrixWorld),g.matrixWorldInverse.copy(t.matrixWorldInverse),f.matrixWorldInverse.fromArray(i.leftViewMatrix),d.matrixWorldInverse.fromArray(i.rightViewMatrix),s.getInverse(a),"stage"===h&&(f.matrixWorldInverse.multiply(s),d.matrixWorldInverse.multiply(s));var y=v.parent;null!==y&&(u.getInverse(y.matrixWorld),f.matrixWorldInverse.multiply(u),d.matrixWorldInverse.multiply(u)),f.matrixWorld.getInverse(f.matrixWorldInverse),d.matrixWorld.getInverse(d.matrixWorldInverse),f.projectionMatrix.fromArray(i.leftProjectionMatrix),d.projectionMatrix.fromArray(i.rightProjectionMatrix),g.projectionMatrix.copy(f.projectionMatrix);var w=n.getLayers();if(w.length){var b=w[0];null!==b.leftBounds&&4===b.leftBounds.length&&f.bounds.fromArray(b.leftBounds),null!==b.rightBounds&&4===b.rightBounds.length&&d.bounds.fromArray(b.rightBounds)}return function(){for(var t=0;t<o.length;t++){var e=o[t],n=x(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&e.position.set(.2,-.6,-.05),null!==i.position&&e.position.fromArray(i.position),null!==i.orientation&&e.quaternion.fromArray(i.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(a),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var r="Daydream Controller"===n.id?0:1;_[t]!==n.buttons[r].pressed&&(_[t]=n.buttons[r].pressed,!0===_[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}(),g},this.getStandingMatrix=function(){return a},this.isPresenting=v;var w=new sn;this.setAnimationLoop=function(t){w.setAnimationLoop(t)},this.submitFrame=function(){v()&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",y)}}function ar(t){console.log("THREE.WebGLRenderer",r);var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,o=void 0===t.depth||t.depth,u=void 0===t.stencil||t.stencil,c=void 0!==t.antialias&&t.antialias,l=void 0===t.premultipliedAlpha||t.premultipliedAlpha,f=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,d=void 0!==t.powerPreference?t.powerPreference:"default",p=null,m=null;this.domElement=e,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=it,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var y,_,x,w,b,L,R,O,I,D,k,N,z,F,B,j,G,H,U=this,V=!1,$=null,tt=null,et=null,nt=-1,rt={geometry:null,program:null,wireframe:!1},ot=null,at=null,st=new Ze,ht=new Ze,ut=null,ct=0,lt=e.width,ft=e.height,dt=1,pt=new Ze(0,0,lt,ft),mt=new Ze(0,0,lt,ft),gt=!1,vt=new $e,yt=new function(){var t=this,e=null,n=0,i=!1,r=!1,o=new Qe,a=new He,s={value:null,needsUpdate:!1};function h(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),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.length<c)&&(u=new Float32Array(c));for(var f=0,d=i;f!==h;++f,d+=4)o.copy(e[f]).applyMatrix4(l,a),o.normal.toArray(u,d),u[d+3]=o.constant}s.value=u,s.needsUpdate=!0}return t.numPlanes=h,u}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var a=0!==t.length||r||0!==n||i;return i=r,e=u(t,o,0),n=t.length,a},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1,h()},this.setState=function(t,o,a,c,l,f){if(!i||null===t||0===t.length||r&&!a)r?u(null):h();else{var d=r?0:n,p=4*d,m=l.clippingState||null;s.value=m,m=u(t,c,p,f);for(var g=0;g!==p;++g)m[g]=e[g];l.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=d}}},_t=!1,xt=!1,wt=new Be,bt=new Ge;function Mt(){return null===tt?dt:1}try{var St={alpha:i,depth:o,stencil:u,antialias:c,premultipliedAlpha:l,preserveDrawingBuffer:f,powerPreference:d};if(e.addEventListener("webglcontextlost",At,!1),e.addEventListener("webglcontextrestored",Ot,!1),null===(y=n||e.getContext("webgl",St)||e.getContext("experimental-webgl",St)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===y.getShaderPrecisionFormat&&(y.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){console.error("THREE.WebGLRenderer: "+t.message)}function Tt(){_=new function(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=i,i}}}(y),(x=new function(t,e,n){var i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&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;a<i;a++)t.texImage2D(n+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);return o}var it={};function rt(n,r){l[n]=1,0===f[n]&&(t.enableVertexAttribArray(n),f[n]=1),d[n]!==r&&((i.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),d[n]=r)}function ot(e){!0!==p[e]&&(t.enable(e),p[e]=!0)}function at(e){!1!==p[e]&&(t.disable(e),p[e]=!1)}function st(e,i,r,o,a,s,h,u){if(e!==M){if(_||(ot(t.BLEND),_=!0),e===P)a=a||i,s=s||r,h=h||o,i===w&&a===R||(t.blendEquationSeparate(n.convert(i),n.convert(a)),w=i,R=a),r===b&&o===L&&s===O&&h===I||(t.blendFuncSeparate(n.convert(r),n.convert(o),n.convert(s),n.convert(h)),b=r,L=o,O=s,I=h),x=e,D=null;else if(e!==x||u!==D){if(w===A&&R===A||(t.blendEquation(t.FUNC_ADD),w=A,R=A),u)switch(e){case E:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case S:t.blendFunc(t.ONE,t.ONE);break;case T:t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA);break;case C:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case E:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case S:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case T:t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR);break;case C:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}b=null,L=null,O=null,I=null,x=e,D=u}}else _&&(at(t.BLEND),_=!1)}function ht(e){k!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),k=e)}function ut(e){e!==a?(ot(t.CULL_FACE),e!==N&&(e===s?t.cullFace(t.BACK):e===h?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):at(t.CULL_FACE),N=e}function ct(e,n,i){e?(ot(t.POLYGON_OFFSET_FILL),F===n&&B===i||(t.polygonOffset(n,i),F=n,B=i)):at(t.POLYGON_OFFSET_FILL)}function lt(e){void 0===e&&(e=t.TEXTURE0+j-1),V!==e&&(t.activeTexture(e),V=e)}return it[t.TEXTURE_2D]=nt(t.TEXTURE_2D,t.TEXTURE_2D,1),it[t.TEXTURE_CUBE_MAP]=nt(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),u.setClear(0),ot(t.DEPTH_TEST),o.setFunc(X),ht(!1),ut(s),ot(t.CULL_FACE),st(M),{buffers:{color:r,depth:o,stencil:u},initAttributes:function(){for(var t=0,e=l.length;t<e;t++)l[t]=0},enableAttribute:function(t){rt(t,0)},enableAttributeAndDivisor:rt,disableUnusedAttributes:function(){for(var e=0,n=f.length;e!==n;++e)f[e]!==l[e]&&(t.disableVertexAttribArray(e),f[e]=0)},enable:ot,disable:at,getCompressedTextureFormats:function(){if(null===m&&(m=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")||e.get("WEBGL_compressed_texture_astc")))for(var n=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),i=0;i<n.length;i++)m.push(n[i]);return m},useProgram:function(e){return y!==e&&(t.useProgram(e),y=e,!0)},setBlending:st,setMaterial:function(e,n){e.side===v?at(t.CULL_FACE):ot(t.CULL_FACE);var i=e.side===g;n&&(i=!i),ht(i),e.blending===E&&!1===e.transparent?st(M):st(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),r.setMask(e.colorWrite),ct(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:ht,setCullFace:ut,setLineWidth:function(e){e!==z&&(G&&t.lineWidth(e),z=e)},setPolygonOffset:ct,setScissorTest:function(e){e?ot(t.SCISSOR_TEST):at(t.SCISSOR_TEST)},activeTexture:lt,bindTexture:function(e,n){null===V&<();var i=$[V];void 0===i&&(i={type:void 0,texture:void 0},$[V]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||it[e]),i.type=e,i.texture=n)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===tt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),tt.copy(e))},viewport:function(e){!1===et.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),et.copy(e))},reset:function(){for(var e=0;e<f.length;e++)1===f[e]&&(t.disableVertexAttribArray(e),f[e]=0);p={},m=null,V=null,$={},y=null,x=null,k=null,N=null,r.reset(),o.reset(),u.reset()}}}(y,_,H,x)).scissor(ht.copy(mt).multiplyScalar(dt)),w.viewport(st.copy(pt).multiplyScalar(dt)),b=new function(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,i,r){switch(r=r||1,e.calls++,i){case t.TRIANGLES:e.triangles+=r*(n/3);break;case t.TRIANGLE_STRIP:case t.TRIANGLE_FAN:e.triangles+=r*(n-2);break;case t.LINES:e.lines+=r*(n/2);break;case t.LINE_STRIP:e.lines+=r*(n-1);break;case t.LINE_LOOP:e.lines+=r*n;break;case t.POINTS:e.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}(y),L=new function(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}},R=new tr(y,_,w,L,x,H,b),O=new hn(y),I=new function(t,e,n){var i={},r={};function o(t){var a=t.target,s=i[a.id];for(var h in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[h]);a.removeEventListener("dispose",o),delete i[a.id];var u=r[s.id];u&&(e.remove(u),delete r[s.id]),n.memory.geometries--}return{get:function(t,e){var r=i[e.id];return r||(e.addEventListener("dispose",o),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Rn).setFromObject(t)),r=e._bufferGeometry),i[e.id]=r,n.memory.geometries++,r)},update:function(n){var i=n.index,r=n.attributes;for(var o in null!==i&&e.update(i,t.ELEMENT_ARRAY_BUFFER),r)e.update(r[o],t.ARRAY_BUFFER);var a=n.morphAttributes;for(var o in a)for(var s=a[o],h=0,u=s.length;h<u;h++)e.update(s[h],t.ARRAY_BUFFER)},getWireframeAttribute:function(n){var i=r[n.id];if(i)return i;var o,a=[],s=n.index,h=n.attributes;if(null!==s)for(var u=0,c=(o=s.array).length;u<c;u+=3){var l=o[u+0],f=o[u+1],d=o[u+2];a.push(l,f,f,d,d,l)}else for(u=0,c=(o=h.position.array).length/3-1;u<c;u+=3)l=u+0,f=u+1,d=u+2,a.push(l,f,f,d,d,l);return i=new(An(a)>65535?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<h;c++)u[c]=[c,0];e[r.id]=u}var l=o.morphTargets&&r.morphAttributes.position,f=o.morphNormals&&r.morphAttributes.normal;for(c=0;c<h;c++)0!==(d=u[c])[1]&&(l&&r.removeAttribute("morphTarget"+c),f&&r.removeAttribute("morphNormal"+c));for(c=0;c<h;c++)(d=u[c])[0]=c,d[1]=s[c];for(u.sort(Un),c=0;c<8;c++){var d;if(d=u[c]){var p=d[0],m=d[1];if(m){l&&r.addAttribute("morphTarget"+c,l[p]),f&&r.addAttribute("morphNormal"+c,f[p]),n[c]=m;continue}}n[c]=0}a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}(y),k=new Ui(U,_,x),N=new Zi,z=new function(){var t={};return{get:function(e,n){var i;return void 0===t[e.id]?(i=new Ji,t[e.id]={},t[e.id][n.id]=i):void 0===t[e.id][n.id]?(i=new Ji,t[e.id][n.id]=i):i=t[e.id][n.id],i},dispose:function(){t={}}}},F=new function(t,e,n,i){var r,o,a,s=new rn(0),h=0;function u(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return s},setClearColor:function(t,e){s.set(t),u(s,h=void 0!==e?e:1)},getClearAlpha:function(){return h},setClearAlpha:function(t){u(s,h=t)},render:function(e,i,c,l){var f=i.background;null===f?u(s,h):f&&f.isColor&&(u(f,1),l=!0),(t.autoClear||l)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&f.isCubeTexture?(void 0===a&&((a=new Hn(new In(1,1,1),new Bn({uniforms:an.cube.uniforms,vertexShader:an.cube.vertexShader,fragmentShader:an.cube.fragmentShader,side:g,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),a.geometry.removeAttribute("uv"),a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(a)),a.material.uniforms.tCube.value=f,e.push(a,a.geometry,a.material,0,null)):f&&f.isTexture&&(void 0===r&&(r=new pn(-1,1,1,-1,0,1),o=new Hn(new kn(2,2),new Fn({depthTest:!1,depthWrite:!1,fog:!1})),n.update(o)),o.material.map=f,t.renderBufferDirect(r,null,o.geometry,o.material,o,null))}}}(U,w,D,l),j=new function(t,e,n,i){var r;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.update(i,r)},this.renderInstances=function(o,a,s){var h;if(i.isWebGL2)h=t;else if(null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[i.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](r,a,s,o.maxInstancedCount),n.update(s,r,o.maxInstancedCount)}}(y,_,b,x),G=new function(t,e,n,i){var r,o,a;this.setMode=function(t){r=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,i){t.drawElements(r,i,o,e*a),n.update(i,r)},this.renderInstances=function(s,h,u){var c;if(i.isWebGL2)c=t;else if(null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[i.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](r,u,o,h*a,s.maxInstancedCount),n.update(u,r,s.maxInstancedCount)}}(y,_,b,x),b.programs=k.programs,U.context=y,U.capabilities=x,U.extensions=_,U.properties=L,U.renderLists=N,U.state=w,U.info=b}Tt();var Ct="xr"in navigator?new function(t){var e=t.context,n=null,i=null,r=null,o="stage",a=null,s=[],h=[];function u(){return null!==i&&null!==r}var c=new ir;c.layers.enable(1),c.viewport=new Ze;var l=new ir;l.layers.enable(2),l.viewport=new Ze;var f=new rr([c,l]);function d(t){var e=s[h.indexOf(t.inputSource)];e&&e.dispatchEvent({type:t.type})}function p(){t.setFramebuffer(null),v.stop()}function m(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}f.layers.enable(1),f.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=s[t];return void 0===e&&((e=new nr).matrixAutoUpdate=!1,e.visible=!1,s[t]=e),e},this.getDevice=function(){return n},this.setDevice=function(t){void 0!==t&&(n=t),t instanceof XRDevice&&e.setCompatibleXRDevice(t)},this.setFrameOfReferenceType=function(t){o=t},this.setSession=function(n){null!==(i=n)&&(i.addEventListener("select",d),i.addEventListener("selectstart",d),i.addEventListener("selectend",d),i.addEventListener("end",p),i.baseLayer=new XRWebGLLayer(i,e),i.requestFrameOfReference(o).then(function(e){r=e,t.setFramebuffer(i.baseLayer.framebuffer),v.setContext(i),v.start()}),h=i.getInputSources(),i.addEventListener("inputsourceschange",function(){h=i.getInputSources(),console.log(h)}))},this.getCamera=function(t){if(u()){var e=t.parent,n=f.cameras;m(f,e);for(var i=0;i<n.length;i++)m(n[i],e);t.matrixWorld.copy(f.matrixWorld);for(var r=t.children,o=(i=0,r.length);i<o;i++)r[i].updateMatrixWorld(!0);return f}return t},this.isPresenting=u;var g=null,v=new sn;v.setAnimationLoop(function(t,e){if(null!==(a=e.getDevicePose(r)))for(var n=i.baseLayer,o=e.views,u=0;u<o.length;u++){var c=o[u],l=n.getViewport(c),d=a.getViewMatrix(c),p=f.cameras[u];p.matrix.fromArray(d).getInverse(p.matrix),p.projectionMatrix.fromArray(c.projectionMatrix),p.viewport.set(l.x,l.y,l.width,l.height),0===u&&(f.matrix.copy(p.matrix),f.projectionMatrix.copy(p.projectionMatrix))}for(u=0;u<s.length;u++){var m=s[u],v=h[u];if(v){var y=e.getInputPose(v,r);if(null!==y){"targetRay"in y?m.matrix.elements=y.targetRay.transformMatrix:"pointerMatrix"in y&&(m.matrix.elements=y.pointerMatrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.visible=!0;continue}}m.visible=!1}g&&g(t)}),this.setAnimationLoop=function(t){g=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new THREE.Matrix4},this.submitFrame=function(){}}(U):new or(U);this.vr=Ct;var Pt=new $i(U,D,x.maxTextureSize);function At(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),V=!0}function Ot(){console.log("THREE.WebGLRenderer: Context Restored."),V=!1,Tt()}function It(t){var e=t.target;e.removeEventListener("dispose",It),function(t){Dt(t),L.remove(t)}(e)}function Dt(t){var e=L.get(t).program;t.program=void 0,void 0!==e&&k.releaseProgram(e)}this.shadowMap=Pt,this.getContext=function(){return y},this.getContextAttributes=function(){return y.getContextAttributes()},this.forceContextLoss=function(){var t=_.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=_.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return dt},this.setPixelRatio=function(t){void 0!==t&&(dt=t,this.setSize(lt,ft,!1))},this.getSize=function(){return{width:lt,height:ft}},this.setSize=function(t,n,i){Ct.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(lt=t,ft=n,e.width=t*dt,e.height=n*dt,!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(){return{width:lt*dt,height:ft*dt}},this.setDrawingBufferSize=function(t,n,i){lt=t,ft=n,dt=i,e.width=t*i,e.height=n*i,this.setViewport(0,0,t,n)},this.getCurrentViewport=function(){return st},this.setViewport=function(t,e,n,i){pt.set(t,ft-e-i,n,i),w.viewport(st.copy(pt).multiplyScalar(dt))},this.setScissor=function(t,e,n,i){mt.set(t,ft-e-i,n,i),w.scissor(ht.copy(mt).multiplyScalar(dt))},this.setScissorTest=function(t){w.setScissorTest(gt=t)},this.getClearColor=function(){return F.getClearColor()},this.setClearColor=function(){F.setClearColor.apply(F,arguments)},this.getClearAlpha=function(){return F.getClearAlpha()},this.setClearAlpha=function(){F.setClearAlpha.apply(F,arguments)},this.clear=function(t,e,n){var i=0;(void 0===t||t)&&(i|=y.COLOR_BUFFER_BIT),(void 0===e||e)&&(i|=y.DEPTH_BUFFER_BIT),(void 0===n||n)&&(i|=y.STENCIL_BUFFER_BIT),y.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,n,i){this.setRenderTarget(t),this.clear(e,n,i)},this.dispose=function(){e.removeEventListener("webglcontextlost",At,!1),e.removeEventListener("webglcontextrestored",Ot,!1),N.dispose(),z.dispose(),L.dispose(),D.dispose(),Ct.dispose(),Nt.stop()},this.renderBufferImmediate=function(t,e){w.initAttributes();var n=L.get(t);t.hasPositions&&!n.position&&(n.position=y.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=y.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=y.createBuffer()),t.hasColors&&!n.color&&(n.color=y.createBuffer());var i=e.getAttributes();t.hasPositions&&(y.bindBuffer(y.ARRAY_BUFFER,n.position),y.bufferData(y.ARRAY_BUFFER,t.positionArray,y.DYNAMIC_DRAW),w.enableAttribute(i.position),y.vertexAttribPointer(i.position,3,y.FLOAT,!1,0,0)),t.hasNormals&&(y.bindBuffer(y.ARRAY_BUFFER,n.normal),y.bufferData(y.ARRAY_BUFFER,t.normalArray,y.DYNAMIC_DRAW),w.enableAttribute(i.normal),y.vertexAttribPointer(i.normal,3,y.FLOAT,!1,0,0)),t.hasUvs&&(y.bindBuffer(y.ARRAY_BUFFER,n.uv),y.bufferData(y.ARRAY_BUFFER,t.uvArray,y.DYNAMIC_DRAW),w.enableAttribute(i.uv),y.vertexAttribPointer(i.uv,2,y.FLOAT,!1,0,0)),t.hasColors&&(y.bindBuffer(y.ARRAY_BUFFER,n.color),y.bufferData(y.ARRAY_BUFFER,t.colorArray,y.DYNAMIC_DRAW),w.enableAttribute(i.color),y.vertexAttribPointer(i.color,3,y.FLOAT,!1,0,0)),w.disableUnusedAttributes(),y.drawArrays(y.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){var a=r.isMesh&&r.normalMatrix.determinant()<0;w.setMaterial(i,a);var s=Gt(t,e,i,r),h=!1;rt.geometry===n.id&&rt.program===s.id&&rt.wireframe===(!0===i.wireframe)||(rt.geometry=n.id,rt.program=s.id,rt.wireframe=!0===i.wireframe,h=!0),r.morphTargetInfluences&&(B.update(r,n,i,s),h=!0);var u,c=n.index,l=n.attributes.position,f=1;!0===i.wireframe&&(c=I.getWireframeAttribute(n),f=2);var d=j;null!==c&&(u=O.get(c),(d=G).setIndex(u)),h&&(!function(t,e,n){if(n&&n.isInstancedBufferGeometry&!x.isWebGL2&&null===_.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");w.initAttributes();var i=n.attributes,r=e.getAttributes(),o=t.defaultAttributeValues;for(var a in r){var s=r[a];if(s>=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<e.material.length;n++)jt(e.material[n],t.fog,e);else jt(e.material,t.fog,e)})};var kt=null;var Nt=new sn;function zt(t,e,n,i){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,h=a.geometry,u=void 0===i?a.material:i,c=a.group;if(n.isArrayCamera){at=n;for(var l=n.cameras,f=0,d=l.length;f<d;f++){var p=l[f];if(s.layers.test(p.layers)){if("viewport"in p)w.viewport(st.copy(p.viewport));else{var g=p.bounds,v=g.x*lt,y=g.y*ft,_=g.z*lt,x=g.w*ft;w.viewport(st.set(v,y,_,x).multiplyScalar(dt))}m.setupLights(p),Bt(s,e,p,h,u,c)}}}else at=null,Bt(s,e,n,h,u,c)}}function Bt(t,e,n,i,r,o){if(t.onBeforeRender(U,e,n,i,r,o),m=z.get(e,at||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){w.setMaterial(r);var a=Gt(n,e.fog,r,t);rt.geometry=null,rt.program=null,rt.wireframe=!1,function(t,e){t.render(function(t){U.renderBufferImmediate(t,e)})}(t,a)}else U.renderBufferDirect(n,e.fog,i,r,t,o);t.onAfterRender(U,e,n,i,r,o),m=z.get(e,at||n)}function jt(t,e,n){var i=L.get(t),r=m.state.lights,o=m.state.shadowsArray,a=i.lightsHash,s=r.state.hash,h=k.getParameters(t,r.state,o,e,yt.numPlanes,yt.numIntersection,n),u=k.getProgramCode(t,h),c=i.program,l=!0;if(void 0===c)t.addEventListener("dispose",It);else if(c.code!==u)Dt(t);else if(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)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,l=!1;else{if(void 0!==h.shaderID)return;l=!1}if(l){if(h.shaderID){var f=an[h.shaderID];i.shader={name:t.type,uniforms:en.clone(f.uniforms),vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}}else i.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(i.shader,U),u=k.getProgramCode(t,h),c=k.acquireProgram(t,i.shader,h,u),i.program=c,t.program=c}var d=c.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var p=0;p<U.maxMorphTargets;p++)d["morphTarget"+p]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(p=0;p<U.maxMorphNormals;p++)d["morphNormal"+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<u;h++){var c=s[h],l=a[c.materialIndex];l&&l.visible&&p.push(e,o,l,bt.z,c)}else a.visible&&p.push(e,o,a,bt.z,null)}var f=e.children;for(var h=0,u=f.length;h<u;h++)t(f[h],n,i)}(t,e,U.sortObjects),!0===U.sortObjects&&p.sort(),_t&&yt.beginShadows();var r=m.state.shadowsArray;Pt.render(r,t,e),m.setupLights(e),_t&&yt.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),F.render(p,t,e,i);var o=p.opaque,a=p.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&zt(o,t,e,s),a.length&&zt(a,t,e,s)}else o.length&&zt(o,t,e),a.length&&zt(a,t,e);n&&R.updateRenderTargetMipmap(n),w.buffers.depth.setTest(!0),w.buffers.depth.setMask(!0),w.buffers.color.setMask(!0),w.setPolygonOffset(!1),t.onAfterRender(U,t,e),Ct.enabled&&Ct.submitFrame(),p=null,m=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var t=ct;return t>=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<i;n++)this.boneInverses.push(new Be)}}function gr(){fn.call(this),this.type="Bone"}function vr(t,e){Hn.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Be,this.bindMatrixInverse=new Be;var n=new mr(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function yr(t){zn.call(this),this.type="LineBasicMaterial",this.color=new rn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function _r(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),fn.call(this),this.type="Line",this.geometry=void 0!==t?t:new Rn,this.material=void 0!==e?e:new yr({color:16777215*Math.random()})}function xr(t,e){_r.call(this,t,e),this.type="LineSegments"}function wr(t,e){_r.call(this,t,e),this.type="LineLoop"}function br(t){zn.call(this),this.type="PointsMaterial",this.color=new rn(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Mr(t,e){fn.call(this),this.type="Points",this.geometry=void 0!==t?t:new Rn,this.material=void 0!==e?e:new br({color:16777215*Math.random()})}function Er(t,e,n,i,r,o,a,s,h){We.call(this,t,e,n,i,r,o,a,s,h),this.generateMipmaps=!1}function Sr(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={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Tr(t,e,n,i,r,o,a,s,h){We.call(this,t,e,n,i,r,o,a,s,h),this.needsUpdate=!0}function Cr(t,e,n,i,r,o,a,s,h,u){if((u=void 0!==u?u:Ht)!==Ht&&u!==Ut)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Ht&&(n=Ct),void 0===n&&u===Ut&&(n=kt),We.call(this,null,i,r,o,a,s,u,n,h),this.image={width:t,height:e},this.magFilter=void 0!==a?a:yt,this.minFilter=void 0!==s?s:yt,this.flipY=!1,this.generateMipmaps=!1}function Pr(t){Rn.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s,h,u,c,l=[],f=[0,0],d={},p=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var g=m[e];for(n=0;n<3;n++)s=g[p[n]],h=g[p[(n+1)%3]],f[0]=Math.min(s,h),f[1]=Math.max(s,h),void 0===d[u=f[0]+","+f[1]]&&(d[u]={index1:f[0],index2:f[1]})}for(u in d)a=d[u],c=t.vertices[a.index1],l.push(c.x,c.y,c.z),c=t.vertices[a.index2],l.push(c.x,c.y,c.z)}else if(t&&t.isBufferGeometry){var v,y,_,x,w,b,M;if(c=new Ge,null!==t.index){for(v=t.attributes.position,y=t.index,0===(_=t.groups).length&&(_=[{start:0,count:y.count,materialIndex:0}]),r=0,o=_.length;r<o;++r)for(e=w=(x=_[r]).start,i=w+x.count;e<i;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),h=y.getX(e+(n+1)%3),f[0]=Math.min(s,h),f[1]=Math.max(s,h),void 0===d[u=f[0]+","+f[1]]&&(d[u]={index1:f[0],index2:f[1]});for(u in d)a=d[u],c.fromBufferAttribute(v,a.index1),l.push(c.x,c.y,c.z),c.fromBufferAttribute(v,a.index2),l.push(c.x,c.y,c.z)}else for(e=0,i=(v=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)b=3*e+n,c.fromBufferAttribute(v,b),l.push(c.x,c.y,c.z),M=3*e+(n+1)%3,c.fromBufferAttribute(v,M),l.push(c.x,c.y,c.z)}this.addAttribute("position",new Tn(l,3))}function Ar(t,e,n){vn.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Lr(t,e,n)),this.mergeVertices()}function Lr(t,e,n){Rn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,o=[],a=[],s=[],h=[],u=new Ge,c=new Ge,l=new Ge,f=new Ge,d=new Ge;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var p=e+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=e;r++){var g=r/e;t(g,m,c),a.push(c.x,c.y,c.z),g-1e-5>=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<n;i++)for(r=0;r<e;r++){var v=i*p+r,y=i*p+r+1,_=(i+1)*p+r+1,x=(i+1)*p+r;o.push(v,y,x),o.push(y,_,x)}this.setIndex(o),this.addAttribute("position",new Tn(a,3)),this.addAttribute("normal",new Tn(s,3)),this.addAttribute("uv",new Tn(h,2))}function Rr(t,e,n,i){vn.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new Or(t,e,n,i)),this.mergeVertices()}function Or(t,e,n,i){Rn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1;var r=[],o=[];function a(t,e,n,i){var r,o,a=Math.pow(2,i),h=[];for(r=0;r<=a;r++){h[r]=[];var u=t.clone().lerp(n,r/a),c=e.clone().lerp(n,r/a),l=a-r;for(o=0;o<=l;o++)h[r][o]=0===o&&r===a?u:u.clone().lerp(c,o/l)}for(r=0;r<a;r++)for(o=0;o<2*(a-r)-1;o++){var f=Math.floor(o/2);o%2==0?(s(h[r][f+1]),s(h[r+1][f]),s(h[r][f])):(s(h[r][f+1]),s(h[r+1][f+1]),s(h[r+1][f]))}}function s(t){r.push(t.x,t.y,t.z)}function h(e,n){var i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function u(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function c(t){return Math.atan2(t.z,-t.x)}function l(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var n=new Ge,i=new Ge,r=new Ge,o=0;o<e.length;o+=3)h(e[o+0],n),h(e[o+1],i),h(e[o+2],r),a(n,i,r,t)}(i=i||0),function(t){for(var e=new Ge,n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){for(var t=new Ge,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var n=c(t)/2/Math.PI+.5,i=l(t)/Math.PI+.5;o.push(n,1-i)}(function(){for(var t=new Ge,e=new Ge,n=new Ge,i=new Ge,a=new Fe,s=new Fe,h=new Fe,l=0,f=0;l<r.length;l+=9,f+=6){t.set(r[l+0],r[l+1],r[l+2]),e.set(r[l+3],r[l+4],r[l+5]),n.set(r[l+6],r[l+7],r[l+8]),a.set(o[f+0],o[f+1]),s.set(o[f+2],o[f+3]),h.set(o[f+4],o[f+5]),i.copy(t).add(e).add(n).divideScalar(3);var d=c(i);u(a,f+0,t,d),u(s,f+2,e,d),u(h,f+4,n,d)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),a=Math.min(e,n,i);r>.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;a<e;a++)g(a);g(!1===r?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=i;s++)c.x=a/e,c.y=s/i,p.push(c.x,c.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=i;a++){var t=(i+1)*(s-1)+(a-1),n=(i+1)*s+(a-1),r=(i+1)*s+a,o=(i+1)*(s-1)+a;m.push(t,n,o),m.push(n,r,o)}}()}(),this.setIndex(m),this.addAttribute("position",new Tn(f,3)),this.addAttribute("normal",new Tn(d,3)),this.addAttribute("uv",new Tn(p,2))}function Ur(t,e,n,i,r,o,a){vn.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Vr(t,e,n,i,r,o)),this.mergeVertices()}function Vr(t,e,n,i,r,o){Rn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;var a,s,h=[],u=[],c=[],l=[],f=new Ge,d=new Ge,p=new Ge,m=new Ge,g=new Ge,v=new Ge,y=new Ge;for(a=0;a<=n;++a){var _=a/n*r*Math.PI*2;for(C(_,r,o,t,p),C(_+.01,r,o,t,m),v.subVectors(m,p),y.addVectors(m,p),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var x=s/i*Math.PI*2,w=-e*Math.cos(x),b=e*Math.sin(x);f.x=p.x+(w*y.x+b*g.x),f.y=p.y+(w*y.y+b*g.y),f.z=p.z+(w*y.z+b*g.z),u.push(f.x,f.y,f.z),d.subVectors(f,p).normalize(),c.push(d.x,d.y,d.z),l.push(a/n),l.push(s/i)}}for(s=1;s<=n;s++)for(a=1;a<=i;a++){var M=(i+1)*(s-1)+(a-1),E=(i+1)*s+(a-1),S=(i+1)*s+a,T=(i+1)*(s-1)+a;h.push(M,E,T),h.push(E,S,T)}function C(t,e,n,i,r){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,h=Math.cos(s);r.x=i*(2+h)*.5*o,r.y=i*(2+h)*a*.5,r.z=i*Math.sin(s)*.5}this.setIndex(h),this.addAttribute("position",new Tn(u,3)),this.addAttribute("normal",new Tn(c,3)),this.addAttribute("uv",new Tn(l,2))}function Wr(t,e,n,i,r){vn.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Zr(t,e,n,i,r)),this.mergeVertices()}function Zr(t,e,n,i,r){Rn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var o,a,s=[],h=[],u=[],c=[],l=new Ge,f=new Ge,d=new Ge;for(o=0;o<=n;o++)for(a=0;a<=i;a++){var p=a/i*r,m=o/n*Math.PI*2;f.x=(t+e*Math.cos(m))*Math.cos(p),f.y=(t+e*Math.cos(m))*Math.sin(p),f.z=e*Math.sin(m),h.push(f.x,f.y,f.z),l.x=t*Math.cos(p),l.y=t*Math.sin(p),d.subVectors(f,l).normalize(),u.push(d.x,d.y,d.z),c.push(a/i),c.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=i;a++){var g=(i+1)*o+a-1,v=(i+1)*(o-1)+a-1,y=(i+1)*(o-1)+a,_=(i+1)*o+a;s.push(g,v,_),s.push(v,y,_)}this.setIndex(s),this.addAttribute("position",new Tn(h,3)),this.addAttribute("normal",new Tn(u,3)),this.addAttribute("uv",new Tn(c,2))}Ki.prototype=Object.create(zn.prototype),Ki.prototype.constructor=Ki,Ki.prototype.isMeshDepthMaterial=!0,Ki.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Qi.prototype=Object.create(zn.prototype),Qi.prototype.constructor=Qi,Qi.prototype.isMeshDistanceMaterial=!0,Qi.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},nr.prototype=Object.assign(Object.create(fn.prototype),{constructor:nr,isGroup:!0}),ir.prototype=Object.assign(Object.create(dn.prototype),{constructor:ir,isPerspectiveCamera:!0,copy:function(t,e){return dn.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*ze.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*ze.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*ze.RAD2DEG*Math.atan(Math.tan(.5*ze.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*ze.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/a,e-=o.offsetY*n/s,i*=o.width/a,n*=o.height/s}var h=this.filmOffset;0!==h&&(r+=t*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=fn.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),rr.prototype=Object.assign(Object.create(ir.prototype),{constructor:rr,isArrayCamera:!0}),sr.prototype.isFogExp2=!0,sr.prototype.clone=function(){return new sr(this.color,this.density)},sr.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},hr.prototype.isFog=!0,hr.prototype.clone=function(){return new hr(this.color,this.near,this.far)},hr.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},ur.prototype=Object.assign(Object.create(fn.prototype),{constructor:ur,copy:function(t,e){return fn.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=fn.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Object.defineProperty(cr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(cr.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(lr.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(lr.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),fr.prototype=Object.create(zn.prototype),fr.prototype.constructor=fr,fr.prototype.isSpriteMaterial=!0,fr.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},dr.prototype=Object.assign(Object.create(fn.prototype),{constructor:dr,isSprite:!0,raycast:function(){var t=new Ge,e=new Ge,n=new Ge,i=new Fe,r=new Fe,o=new Be,a=new Ge,s=new Ge,h=new Ge,u=new Fe,c=new Fe,l=new Fe;function f(t,e,n,a,s,h){i.subVectors(t,n).addScalar(.5).multiply(a),void 0!==s?(r.x=h*i.x-s*i.y,r.y=s*i.x+h*i.y):r.copy(i),t.copy(e),t.x+=r.x,t.y+=r.y,t.applyMatrix4(o)}return function(i,r){e.setFromMatrixScale(this.matrixWorld),o.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),n.setFromMatrixPosition(this.modelViewMatrix);var d,p,m=this.material.rotation;0!==m&&(p=Math.cos(m),d=Math.sin(m));var g=this.center;f(a.set(-.5,-.5,0),n,g,e,d,p),f(s.set(.5,-.5,0),n,g,e,d,p),f(h.set(.5,.5,0),n,g,e,d,p),u.set(0,0),c.set(1,0),l.set(1,1);var v=i.ray.intersectTriangle(a,s,h,!1,t);if(null!==v||(f(s.set(-.5,.5,0),n,g,e,d,p),c.set(0,1),null!==(v=i.ray.intersectTriangle(a,h,s,!1,t)))){var y=i.ray.origin.distanceTo(t);y<i.near||y>i.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;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);n.splice(i,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object},raycast:function(){var t=new Ge;return function(e,n){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(t);this.getObjectForDistance(i).raycast(e,n)}}(),update:function(){var t=new Ge,e=new Ge;return function(n){var i=this.levels;if(i.length>1){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<a&&r>=i[o].distance;o++)i[o-1].object.visible=!1,i[o].object.visible=!0;for(;o<a;o++)i[o].object.visible=!1}}}(),toJSON:function(t){var e=fn.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var o=n[i];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Object.assign(mr.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Be;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new Be,e=new Be;return function(){for(var n=this.bones,i=this.boneInverses,r=this.boneMatrices,o=this.boneTexture,a=0,s=n.length;a<s;a++){var h=n[a]?n[a].matrixWorld:e;t.multiplyMatrices(h,i[a]),t.toArray(r,16*a)}void 0!==o&&(o.needsUpdate=!0)}}(),clone:function(){return new mr(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),gr.prototype=Object.assign(Object.create(fn.prototype),{constructor:gr,isBone:!0}),vr.prototype=Object.assign(Object.create(Hn.prototype),{constructor:vr,isSkinnedMesh:!0,initBones:function(){var t,e,n,i,r=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,i=this.geometry.bones.length;n<i;n++)e=this.geometry.bones[n],t=new gr,r.push(t),t.name=e.name,t.position.fromArray(e.pos),t.quaternion.fromArray(e.rotq),void 0!==e.scl&&t.scale.fromArray(e.scl);for(n=0,i=this.geometry.bones.length;n<i;n++)-1!==(e=this.geometry.bones[n]).parent&&null!==e.parent&&void 0!==r[e.parent]?r[e.parent].add(r[n]):this.add(r[n])}return this.updateMatrixWorld(!0),r},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var t,e;if(this.geometry&&this.geometry.isGeometry)for(e=0;e<this.geometry.skinWeights.length;e++){var n=this.geometry.skinWeights[e];(t=1/n.manhattanLength())!==1/0?n.multiplyScalar(t):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var i=new Ze,r=this.geometry.attributes.skinWeight;for(e=0;e<r.count;e++)i.x=r.getX(e),i.y=r.getY(e),i.z=r.getZ(e),i.w=r.getW(e),(t=1/i.manhattanLength())!==1/0?i.multiplyScalar(t):i.set(1,0,0,0),r.setXYZW(e,i.x,i.y,i.z,i.w)}},updateMatrixWorld:function(t){Hn.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),yr.prototype=Object.create(zn.prototype),yr.prototype.constructor=yr,yr.prototype.isLineBasicMaterial=!0,yr.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},_r.prototype=Object.assign(Object.create(fn.prototype),{constructor:_r,isLine:!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=[0],o=1,a=i.count;o<a;o++)t.fromBufferAttribute(i,o-1),e.fromBufferAttribute(i,o),r[o]=r[o-1],r[o]+=t.distanceTo(e);n.addAttribute("lineDistance",new Tn(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;(r=n.lineDistances)[0]=0;for(o=1,a=s.length;o<a;o++)r[o]=r[o-1],r[o]+=s[o-1].distanceTo(s[o])}return this}}(),raycast:function(){var t=new Be,e=new jn,n=new Ke;return function(i,r){var o=i.linePrecision,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=o,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var h=o/((this.scale.x+this.scale.y+this.scale.z)/3),u=h*h,c=new Ge,l=new Ge,f=new Ge,d=new Ge,p=this&&this.isLineSegments?2:1;if(a.isBufferGeometry){var m=a.index,g=a.attributes.position.array;if(null!==m)for(var v=m.array,y=0,_=v.length-1;y<_;y+=p){var x=v[y],w=v[y+1];if(c.fromArray(g,3*x),l.fromArray(g,3*w),!(e.distanceSqToSegment(c,l,d,f)>u))d.applyMatrix4(this.matrixWorld),(E=i.ray.origin.distanceTo(d))<i.near||E>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.near||E>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;y<M-1;y+=p){var E;if(!(e.distanceSqToSegment(b[y],b[y+1],d,f)>u))d.applyMatrix4(this.matrixWorld),(E=i.ray.origin.distanceTo(d))<i.near||E>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;o<a;o+=2)t.fromBufferAttribute(i,o),e.fromBufferAttribute(i,o+1),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);n.addAttribute("lineDistance",new Tn(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(r=n.lineDistances,o=0,a=s.length;o<a;o+=2)t.copy(s[o]),e.copy(s[o+1]),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e)}return this}}()}),wr.prototype=Object.assign(Object.create(_r.prototype),{constructor:wr,isLineLoop:!0}),br.prototype=Object.create(zn.prototype),br.prototype.constructor=br,br.prototype.isPointsMaterial=!0,br.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},Mr.prototype=Object.assign(Object.create(fn.prototype),{constructor:Mr,isPoints:!0,raycast:function(){var t=new Be,e=new jn,n=new Ke;return function(i,r){var o=this,a=this.geometry,s=this.matrixWorld,h=i.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=h,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var u=h/((this.scale.x+this.scale.y+this.scale.z)/3),c=u*u,l=new Ge,f=new Ge;if(a.isBufferGeometry){var d=a.index,p=a.attributes.position.array;if(null!==d)for(var m=d.array,g=0,v=m.length;g<v;g++){var y=m[g];l.fromArray(p,3*y),w(l,y)}else{g=0;for(var _=p.length/3;g<_;g++)l.fromArray(p,3*g),w(l,g)}}else{var x=a.vertices;for(g=0,_=x.length;g<_;g++)w(x[g],g)}}function w(t,n){var a=e.distanceSqToPoint(t);if(a<c){e.closestPointToPoint(t,f),f.applyMatrix4(s);var h=i.ray.origin.distanceTo(f);if(h<i.near||h>i.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;r<o;r++)a=e[r]*i,s=r<o-1?e[r+1]*i:t.length,(h=Xr(t,a,s,i,!1))===h.next&&(h.steiner=!0),u.push(ro(h));for(u.sort(eo),r=0;r<u.length;r++)no(u[r],n),n=Yr(n,n.next);return n}(t,e,f,n)),t.length>80*n){i=o=t[0],r=a=t[1];for(var p=n;p<l;p+=n)s=t[p],h=t[p+1],s<i&&(i=s),h<r&&(r=h),s>o&&(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;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}(t,e,n,i)>0)for(o=e;o<n;o+=i)a=fo(o,t[o],t[o+1],a);else for(o=n-i;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;e<u&&(s++,i=i.nextZ);e++);for(h=u;s>0||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.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,h=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,u=r.x>o.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.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===a)return n.prev;var h,u=n,c=n.x,l=n.y,f=1/0;i=n.next;for(;i!==u;)r>=i.x&&i.x>=c&&r!==i.x&&oo(o<l?r:a,o,c,l,o<l?a:r,o,i.x,i.y)&&((h=Math.abs(o-i.y)/(r-i.x))<f||h===f&&i.x>n.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<n.x&&(n=e),e=e.next}while(e!==t);return n}function oo(t,e,n,i,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=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;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return go.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];vo(t),yo(n,t);var o=t.length;e.forEach(vo);for(var a=0;a<e.length;a++)i.push(o),o+=e[a].length,yo(n,e[a]);var s=qr(n,i);for(a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function vo(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function yo(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function _o(t,e){vn.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new xo(t,e)),this.mergeVertices()}function xo(t,e){Rn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e};for(var n=this,i=[],r=[],o=0,a=(t=Array.isArray(t)?t:[t]).length;o<a;o++){s(t[o])}function s(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,h=void 0!==e.depth?e.depth:100,u=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:6,l=void 0!==e.bevelSize?e.bevelSize:c-2,f=void 0!==e.bevelSegments?e.bevelSegments:3,d=e.extrudePath,p=void 0!==e.UVGenerator?e.UVGenerator:wo;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=e.amount);var m,g,v,y,_,x,w,b,M=!1;d&&(m=d.getSpacedPoints(s),M=!0,u=!1,g=d.computeFrenetFrames(s,!1),v=new Ge,y=new Ge,_=new Ge),u||(f=0,c=0,l=0);var E=t.extractPoints(a),S=E.shape,T=E.holes;if(!go.isClockWise(S))for(S=S.reverse(),w=0,b=T.length;w<b;w++)x=T[w],go.isClockWise(x)&&(T[w]=x.reverse());var C=go.triangulateShape(S,T),P=S;for(w=0,b=T.length;w<b;w++)x=T[w],S=S.concat(x);function A(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var L,R,O,I,D,k,N=S.length,z=C.length;function F(t,e,n){var i,r,o,a=t.x-e.x,s=t.y-e.y,h=n.x-t.x,u=n.y-t.y,c=a*a+s*s,l=a*u-s*h;if(Math.abs(l)>Number.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<G;j++,H++,U++)H===G&&(H=0),U===G&&(U=0),B[j]=F(P[j],P[H],P[U]);var V,W,Z=[],q=B.concat();for(w=0,b=T.length;w<b;w++){for(x=T[w],V=[],j=0,H=(G=x.length)-1,U=j+1;j<G;j++,H++,U++)H===G&&(H=0),U===G&&(U=0),V[j]=F(x[j],x[H],x[U]);Z.push(V),q=q.concat(V)}for(L=0;L<f;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<G;j++)Y((D=A(P[j],B[j],R)).x,D.y,-I);for(w=0,b=T.length;w<b;w++)for(x=T[w],V=Z[w],j=0,G=x.length;j<G;j++)Y((D=A(x[j],V[j],R)).x,D.y,-I)}for(R=l,j=0;j<N;j++)D=u?A(S[j],q[j],R):S[j],M?(y.copy(g.normals[0]).multiplyScalar(D.x),v.copy(g.binormals[0]).multiplyScalar(D.y),_.copy(m[0]).add(y).add(v),Y(_.x,_.y,_.z)):Y(D.x,D.y,0);for(W=1;W<=s;W++)for(j=0;j<N;j++)D=u?A(S[j],q[j],R):S[j],M?(y.copy(g.normals[W]).multiplyScalar(D.x),v.copy(g.binormals[W]).multiplyScalar(D.y),_.copy(m[W]).add(y).add(v),Y(_.x,_.y,_.z)):Y(D.x,D.y,h/s*W);for(L=f-1;L>=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<G;j++)Y((D=A(P[j],B[j],R)).x,D.y,h+I);for(w=0,b=T.length;w<b;w++)for(x=T[w],V=Z[w],j=0,G=x.length;j<G;j++)D=A(x[j],V[j],R),M?Y(D.x,D.y+m[s-1].y,m[s-1].x+I):Y(D.x,D.y,h+I)}function X(t,e){var n,i;for(j=t.length;--j>=0;){n=j,(i=j-1)<0&&(i=t.length-1);var r=0,o=s+2*f;for(r=0;r<o;r++){var a=N*r,h=N*(r+1);K(e+n+a,e+i+a,e+i+h,e+n+h)}}}function Y(t,e,n){o.push(t),o.push(e),o.push(n)}function J(t,e,r){Q(t),Q(e),Q(r);var o=i.length/3,a=p.generateTopUV(n,i,o-3,o-2,o-1);$(a[0]),$(a[1]),$(a[2])}function K(t,e,r,o){Q(t),Q(e),Q(o),Q(e),Q(r),Q(o);var a=i.length/3,s=p.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);$(s[0]),$(s[1]),$(s[3]),$(s[1]),$(s[2]),$(s[3])}function Q(t){i.push(o[3*t+0]),i.push(o[3*t+1]),i.push(o[3*t+2])}function $(t){r.push(t.x),r.push(t.y)}!function(){var t=i.length/3;if(u){var e=0,r=N*e;for(j=0;j<z;j++)J((k=C[j])[2]+r,k[1]+r,k[0]+r);for(r=N*(e=s+2*f),j=0;j<z;j++)J((k=C[j])[0]+r,k[1]+r,k[2]+r)}else{for(j=0;j<z;j++)J((k=C[j])[2],k[1],k[0]);for(j=0;j<z;j++)J((k=C[j])[0]+N*s,k[1]+N*s,k[2]+N*s)}n.addGroup(t,i.length/3-t,0)}(),function(){var t=i.length/3,e=0;for(X(P,e),e+=P.length,w=0,b=T.length;w<b;w++)X(x=T[w],e),e+=x.length;n.addGroup(t,i.length/3-t,1)}()}this.addAttribute("position",new Tn(i,3)),this.addAttribute("uv",new Tn(r,2)),this.computeVertexNormals()}_o.prototype=Object.create(vn.prototype),_o.prototype.constructor=_o,_o.prototype.toJSON=function(){var t=vn.prototype.toJSON.call(this);return bo(this.parameters.shapes,this.parameters.options,t)},xo.prototype=Object.create(Rn.prototype),xo.prototype.constructor=xo,xo.prototype.toJSON=function(){var t=Rn.prototype.toJSON.call(this);return bo(this.parameters.shapes,this.parameters.options,t)};var wo={generateTopUV:function(t,e,n,i,r){var o=e[3*n],a=e[3*n+1],s=e[3*i],h=e[3*i+1],u=e[3*r],c=e[3*r+1];return[new Fe(o,a),new Fe(s,h),new Fe(u,c)]},generateSideWallUV:function(t,e,n,i,r,o){var a=e[3*n],s=e[3*n+1],h=e[3*n+2],u=e[3*i],c=e[3*i+1],l=e[3*i+2],f=e[3*r],d=e[3*r+1],p=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(s-c)<.01?[new Fe(a,1-h),new Fe(u,1-l),new Fe(f,1-p),new Fe(m,1-v)]:[new Fe(s,1-h),new Fe(c,1-l),new Fe(d,1-p),new Fe(g,1-v)]}};function bo(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var o=t[i];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Mo(t,e){vn.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Eo(t,e)),this.mergeVertices()}function Eo(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new vn;var i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),xo.call(this,i,e),this.type="TextBufferGeometry"}function So(t,e,n,i,r,o,a){vn.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new To(t,e,n,i,r,o,a)),this.mergeVertices()}function To(t,e,n,i,r,o,a){Rn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var s,h,u=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),c=0,l=[],f=new Ge,d=new Ge,p=[],m=[],g=[],v=[];for(h=0;h<=n;h++){var y=[],_=h/n;for(s=0;s<=e;s++){var x=s/e;f.x=-t*Math.cos(i+x*r)*Math.sin(o+_*a),f.y=t*Math.cos(o+_*a),f.z=t*Math.sin(i+x*r)*Math.sin(o+_*a),m.push(f.x,f.y,f.z),d.set(f.x,f.y,f.z).normalize(),g.push(d.x,d.y,d.z),v.push(x,1-_),y.push(c++)}l.push(y)}for(h=0;h<n;h++)for(s=0;s<e;s++){var w=l[h][s+1],b=l[h][s],M=l[h+1][s],E=l[h+1][s+1];(0!==h||o>0)&&p.push(w,b,E),(h!==n-1||u<Math.PI)&&p.push(b,M,E)}this.setIndex(p),this.addAttribute("position",new Tn(m,3)),this.addAttribute("normal",new Tn(g,3)),this.addAttribute("uv",new Tn(v,2))}function Co(t,e,n,i,r,o){vn.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new Po(t,e,n,i,r,o)),this.mergeVertices()}function Po(t,e,n,i,r,o){Rn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,h,u=[],c=[],l=[],f=[],d=t,p=(e-t)/(i=void 0!==i?Math.max(1,i):1),m=new Ge,g=new Fe;for(s=0;s<=i;s++){for(h=0;h<=n;h++)a=r+h/n*o,m.x=d*Math.cos(a),m.y=d*Math.sin(a),c.push(m.x,m.y,m.z),l.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,f.push(g.x,g.y);d+=p}for(s=0;s<i;s++){var v=s*(n+1);for(h=0;h<n;h++){var y=a=h+v,_=a+n+1,x=a+n+2,w=a+1;u.push(y,_,w),u.push(_,x,w)}}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 Ao(t,e,n,i){vn.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new Lo(t,e,n,i)),this.mergeVertices()}function Lo(t,e,n,i){Rn.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=ze.clamp(i,0,2*Math.PI);var r,o,a,s=[],h=[],u=[],c=1/e,l=new Ge,f=new Fe;for(o=0;o<=e;o++){var d=n+o*c*i,p=Math.sin(d),m=Math.cos(d);for(a=0;a<=t.length-1;a++)l.x=t[a].x*p,l.y=t[a].y,l.z=t[a].x*m,h.push(l.x,l.y,l.z),f.x=o/e,f.y=a/(t.length-1),u.push(f.x,f.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var g=r=a+o*t.length,v=r+t.length,y=r+t.length+1,_=r+1;s.push(g,v,_),s.push(v,y,_)}if(this.setIndex(s),this.addAttribute("position",new Tn(h,3)),this.addAttribute("uv",new Tn(u,2)),this.computeVertexNormals(),i===2*Math.PI){var x=this.attributes.normal.array,w=new Ge,b=new Ge,M=new Ge;for(r=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)w.x=x[a+0],w.y=x[a+1],w.z=x[a+2],b.x=x[r+a+0],b.y=x[r+a+1],b.z=x[r+a+2],M.addVectors(w,b).normalize(),x[a+0]=x[r+a+0]=M.x,x[a+1]=x[r+a+1]=M.y,x[a+2]=x[r+a+2]=M.z}}function Ro(t,e){vn.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Oo(t,e)),this.mergeVertices()}function Oo(t,e){Rn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],r=[],o=[],a=0,s=0;if(!1===Array.isArray(t))u(t);else for(var h=0;h<t.length;h++)u(t[h]),this.addGroup(a,s,h),a+=s,s=0;function u(t){var a,h,u,c=i.length/3,l=t.extractPoints(e),f=l.shape,d=l.holes;if(!1===go.isClockWise(f))for(f=f.reverse(),a=0,h=d.length;a<h;a++)u=d[a],!0===go.isClockWise(u)&&(d[a]=u.reverse());var p=go.triangulateShape(f,d);for(a=0,h=d.length;a<h;a++)u=d[a],f=f.concat(u);for(a=0,h=f.length;a<h;a++){var m=f[a];i.push(m.x,m.y,0),r.push(0,0,1),o.push(m.x,m.y)}for(a=0,h=p.length;a<h;a++){var g=p[a],v=g[0]+c,y=g[1]+c,_=g[2]+c;n.push(v,y,_),s+=3}}this.setIndex(n),this.addAttribute("position",new Tn(i,3)),this.addAttribute("normal",new Tn(r,3)),this.addAttribute("uv",new Tn(o,2))}function Io(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function Do(t,e){Rn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,o,a=[],s=Math.cos(ze.DEG2RAD*e),h=[0,0],u={},c=["a","b","c"];t.isBufferGeometry?(o=new vn).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var l=o.vertices,f=o.faces,d=0,p=f.length;d<p;d++)for(var m=f[d],g=0;g<3;g++)n=m[c[g]],i=m[c[(g+1)%3]],h[0]=Math.min(n,i),h[1]=Math.max(n,i),void 0===u[r=h[0]+","+h[1]]?u[r]={index1:h[0],index2:h[1],face1:d,face2:void 0}:u[r].face2=d;for(r in u){var v=u[r];if(void 0===v.face2||f[v.face1].normal.dot(f[v.face2].normal)<=s){var y=l[v.index1];a.push(y.x,y.y,y.z),y=l[v.index2],a.push(y.x,y.y,y.z)}}this.addAttribute("position",new Tn(a,3))}function ko(t,e,n,i,r,o,a,s){vn.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new No(t,e,n,i,r,o,a,s)),this.mergeVertices()}function No(t,e,n,i,r,o,a,s){Rn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s};var h=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var u=[],c=[],l=[],f=[],d=0,p=[],m=n/2,g=0;function v(n){var r,o,p,v=new Fe,y=new Ge,_=0,x=!0===n?t:e,w=!0===n?1:-1;for(o=d,r=1;r<=i;r++)c.push(0,m*w,0),l.push(0,w,0),f.push(.5,.5),d++;for(p=d,r=0;r<=i;r++){var b=r/i*s+a,M=Math.cos(b),E=Math.sin(b);y.x=x*E,y.y=m*w,y.z=x*M,c.push(y.x,y.y,y.z),l.push(0,w,0),v.x=.5*M+.5,v.y=.5*E*w+.5,f.push(v.x,v.y),d++}for(r=0;r<i;r++){var S=o+r,T=p+r;!0===n?u.push(T,T+1,S):u.push(T+1,T,S),_+=3}h.addGroup(g,_,!0===n?1:2),g+=_}!function(){var o,v,y=new Ge,_=new Ge,x=0,w=(e-t)/n;for(v=0;v<=r;v++){var b=[],M=v/r,E=M*(e-t)+t;for(o=0;o<=i;o++){var S=o/i,T=S*s+a,C=Math.sin(T),P=Math.cos(T);_.x=E*C,_.y=-M*n+m,_.z=E*P,c.push(_.x,_.y,_.z),y.set(C,w,P).normalize(),l.push(y.x,y.y,y.z),f.push(S,1-M),b.push(d++)}p.push(b)}for(o=0;o<i;o++)for(v=0;v<r;v++){var A=p[v][o],L=p[v+1][o],R=p[v+1][o+1],O=p[v][o+1];u.push(A,L,O),u.push(L,R,O),x+=6}h.addGroup(g,x,0),g+=x}(),!1===o&&(t>0&&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;d<u.length;d++)f[d]=u.charCodeAt(d);c="blob"===l?new Blob([f.buffer],{type:s}):f.buffer;break;case"document":var p=new DOMParser;c=p.parseFromString(u,s);break;case"json":c=JSON.parse(u);break;default:c=u}window.setTimeout(function(){e&&e(c),r.manager.itemEnd(t)},0)}catch(e){window.setTimeout(function(){i&&i(e),r.manager.itemEnd(t),r.manager.itemError(t)},0)}}else{ea[t]=[],ea[t].push({onLoad:e,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",function(e){var n=this.response;Qo.add(t,n);var i=ea[t];if(delete ea[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var o=0,a=i.length;o<a;o++){(s=i[o]).onLoad&&s.onLoad(n)}r.manager.itemEnd(t)}else{for(o=0,a=i.length;o<a;o++){var s;(s=i[o]).onError&&s.onError(e)}r.manager.itemEnd(t),r.manager.itemError(t)}},!1),m.addEventListener("progress",function(e){for(var n=ea[t],i=0,r=n.length;i<r;i++){var o=n[i];o.onProgress&&o.onProgress(e)}},!1),m.addEventListener("error",function(e){var n=ea[t];delete ea[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemEnd(t),r.manager.itemError(t)},!1),m.addEventListener("abort",function(e){var n=ea[t];delete ea[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemEnd(t),r.manager.itemError(t)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(t),m}ea[t].push({onLoad:e,onProgress:n,onError:i})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(ia.prototype,{load:function(t,e,n,i){var r=this,o=[],a=new Sr;a.image=o;var s=new na(this.manager);function h(h){s.load(t[h],function(t){var n=r._parser(t,!0);o[h]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(a.minFilter=wt),a.format=n.format,a.needsUpdate=!0,e&&e(a))},n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,c=0,l=t.length;c<l;++c)h(c);else s.load(t,function(t){var n=r._parser(t,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){o[s]={mipmaps:[]};for(var h=0;h<n.mipmapCount;h++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+h]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=wt),a.format=n.format,a.needsUpdate=!0,e&&e(a)},n,i);return a},setPath:function(t){return this.path=t,this}}),Object.assign(ra.prototype,{load:function(t,e,n,i){var r=this,o=new Ye,a=new na(this.manager);return a.setResponseType("arraybuffer"),a.load(t,function(t){var n=r._parser(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:gt,o.wrapT=void 0!==n.wrapT?n.wrapT:gt,o.magFilter=void 0!==n.magFilter?n.magFilter:wt,o.minFilter=void 0!==n.minFilter?n.minFilter:Mt,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=wt),o.needsUpdate=!0,e&&e(o,n))},n,i),o}}),Object.assign(oa.prototype,{crossOrigin:"anonymous",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;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",h,!1),Qo.add(t,this),e&&e(this),r.manager.itemEnd(t)}function h(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",h,!1),i&&i(e),r.manager.itemEnd(t),r.manager.itemError(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",h,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(aa.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=new Vn,o=new oa(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],function(t){r.images[n]=t,6===++a&&(r.needsUpdate=!0,e&&e(r))},void 0,i)}for(var h=0;h<t.length;++h)s(h);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(sa.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=new We,o=new oa(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(n){r.image=n;var i=t.search(/\.jpe?g$/i)>0||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)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var u=Math.cos(this.aRotation),c=Math.sin(this.aRotation),l=s-this.aX,f=h-this.aY;s=l*u-f*c+this.aX,h=l*c+f*u+this.aY}return n.set(s,h)},ua.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ua.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},ua.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ca.prototype=Object.create(ua.prototype),ca.prototype.constructor=ca,ca.prototype.isArcCurve=!0;var fa=new Ge,da=new la,pa=new la,ma=new la;function ga(t,e,n,i){ha.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function va(t,e,n,i,r){var o=.5*(i-e),a=.5*(r-n),s=t*t;return(2*n-2*i+o+a)*(t*s)+(-3*n+3*i-2*o-a)*s+o*t+n}function ya(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function _a(t,e,n,i,r){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}function xa(t,e,n,i){ha.call(this),this.type="CubicBezierCurve",this.v0=t||new Fe,this.v1=e||new Fe,this.v2=n||new Fe,this.v3=i||new Fe}function wa(t,e,n,i){ha.call(this),this.type="CubicBezierCurve3",this.v0=t||new Ge,this.v1=e||new Ge,this.v2=n||new Ge,this.v3=i||new Ge}function ba(t,e){ha.call(this),this.type="LineCurve",this.v1=t||new Fe,this.v2=e||new Fe}function Ma(t,e){ha.call(this),this.type="LineCurve3",this.v1=t||new Ge,this.v2=e||new Ge}function Ea(t,e,n){ha.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Fe,this.v1=e||new Fe,this.v2=n||new Fe}function Sa(t,e,n){ha.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Ge,this.v1=e||new Ge,this.v2=n||new Ge}function Ta(t){ha.call(this),this.type="SplineCurve",this.points=t||[]}ga.prototype=Object.create(ha.prototype),ga.prototype.constructor=ga,ga.prototype.isCatmullRomCurve3=!0,ga.prototype.getPoint=function(t,e){var n,i,r,o,a=e||new Ge,s=this.points,h=s.length,u=(h-(this.closed?0:1))*t,c=Math.floor(u),l=u-c;if(this.closed?c+=c>0?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+2<h?o=s[(c+2)%h]:(fa.subVectors(s[h-1],s[h-2]).add(s[h-1]),o=fa),"centripetal"===this.curveType||"chordal"===this.curveType){var f="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(i),f),p=Math.pow(i.distanceToSquared(r),f),m=Math.pow(r.distanceToSquared(o),f);p<1e-4&&(p=1),d<1e-4&&(d=p),m<1e-4&&(m=p),da.initNonuniformCatmullRom(n.x,i.x,r.x,o.x,d,p,m),pa.initNonuniformCatmullRom(n.y,i.y,r.y,o.y,d,p,m),ma.initNonuniformCatmullRom(n.z,i.z,r.z,o.z,d,p,m)}else"catmullrom"===this.curveType&&(da.initCatmullRom(n.x,i.x,r.x,o.x,this.tension),pa.initCatmullRom(n.y,i.y,r.y,o.y,this.tension),ma.initCatmullRom(n.z,i.z,r.z,o.z,this.tension));return a.set(da.calc(l),pa.calc(l),ma.calc(l)),a},ga.prototype.copy=function(t){ha.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},ga.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},ga.prototype.fromJSON=function(t){ha.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Ge).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},xa.prototype=Object.create(ha.prototype),xa.prototype.constructor=xa,xa.prototype.isCubicBezierCurve=!0,xa.prototype.getPoint=function(t,e){var n=e||new Fe,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(_a(t,i.x,r.x,o.x,a.x),_a(t,i.y,r.y,o.y,a.y)),n},xa.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},xa.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},xa.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},wa.prototype=Object.create(ha.prototype),wa.prototype.constructor=wa,wa.prototype.isCubicBezierCurve3=!0,wa.prototype.getPoint=function(t,e){var n=e||new Ge,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(_a(t,i.x,r.x,o.x,a.x),_a(t,i.y,r.y,o.y,a.y),_a(t,i.z,r.z,o.z,a.z)),n},wa.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},wa.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},wa.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},ba.prototype=Object.create(ha.prototype),ba.prototype.constructor=ba,ba.prototype.isLineCurve=!0,ba.prototype.getPoint=function(t,e){var n=e||new Fe;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},ba.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},ba.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},ba.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ba.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ba.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ma.prototype=Object.create(ha.prototype),Ma.prototype.constructor=Ma,Ma.prototype.isLineCurve3=!0,Ma.prototype.getPoint=function(t,e){var n=e||new Ge;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Ma.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ma.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ma.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ma.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ea.prototype=Object.create(ha.prototype),Ea.prototype.constructor=Ea,Ea.prototype.isQuadraticBezierCurve=!0,Ea.prototype.getPoint=function(t,e){var n=e||new Fe,i=this.v0,r=this.v1,o=this.v2;return n.set(ya(t,i.x,r.x,o.x),ya(t,i.y,r.y,o.y)),n},Ea.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ea.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ea.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Sa.prototype=Object.create(ha.prototype),Sa.prototype.constructor=Sa,Sa.prototype.isQuadraticBezierCurve3=!0,Sa.prototype.getPoint=function(t,e){var n=e||new Ge,i=this.v0,r=this.v1,o=this.v2;return n.set(ya(t,i.x,r.x,o.x),ya(t,i.y,r.y,o.y),ya(t,i.z,r.z,o.z)),n},Sa.prototype.copy=function(t){return ha.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Sa.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Sa.prototype.fromJSON=function(t){return ha.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ta.prototype=Object.create(ha.prototype),Ta.prototype.constructor=Ta,Ta.prototype.isSplineCurve=!0,Ta.prototype.getPoint=function(t,e){var n=e||new Fe,i=this.points,r=(i.length-1)*t,o=Math.floor(r),a=r-o,s=i[0===o?o:o-1],h=i[o],u=i[o>i.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<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},Ta.prototype.toJSON=function(){var t=ha.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},Ta.prototype.fromJSON=function(t){ha.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Fe).fromArray(i))}return this};var Ca=Object.freeze({ArcCurve:ca,CatmullRomCurve3:ga,CubicBezierCurve:xa,CubicBezierCurve3:wa,EllipseCurve:ua,LineCurve:ba,LineCurve3:Ma,QuadraticBezierCurve:Ea,QuadraticBezierCurve3:Sa,SplineCurve:Ta});function Pa(){ha.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Aa(t){Pa.call(this),this.type="Path",this.currentPoint=new Fe,t&&this.setFromPoints(t)}function La(t){Aa.call(this,t),this.uuid=ze.generateUUID(),this.type="Shape",this.holes=[]}function Ra(t,e){fn.call(this),this.type="Light",this.color=new rn(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Oa(t,e,n){Ra.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(fn.DefaultUp),this.updateMatrix(),this.groundColor=new rn(e)}function Ia(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Fe(512,512),this.map=null,this.matrix=new Be}function Da(){Ia.call(this,new ir(50,1,.5,500))}function ka(t,e,n,i,r,o){Ra.call(this,t,e),this.type="SpotLight",this.position.copy(fn.DefaultUp),this.updateMatrix(),this.target=new fn,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Da}function Na(t,e,n,i){Ra.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Ia(new ir(90,1,.5,500))}function za(){Ia.call(this,new pn(-5,5,5,-5,.5,500))}function Fa(t,e){Ra.call(this,t,e),this.type="DirectionalLight",this.position.copy(fn.DefaultUp),this.updateMatrix(),this.target=new fn,this.shadow=new za}function Ba(t,e){Ra.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function ja(t,e,n,i){Ra.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}Pa.prototype=Object.assign(Object.create(ha.prototype),{constructor:Pa,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new ba(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=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;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),h=0;h<s.length;h++){var u=s[h];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&n.length>1&&!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;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=ha.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){ha.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new Ca[i.type]).fromJSON(i))}return this}}),Aa.prototype=Object.assign(Object.create(Pa.prototype),{constructor:Aa,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new ba(this.currentPoint.clone(),new Fe(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){var r=new Ea(this.currentPoint.clone(),new Fe(t,e),new Fe(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,r,o){var a=new xa(this.currentPoint.clone(),new Fe(t,e),new Fe(n,i),new Fe(r,o));this.curves.push(a),this.currentPoint.set(r,o)},splineThru:function(t){var e=new Ta([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,i,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,i,r,o)},absarc:function(t,e,n,i,r,o){this.absellipse(t,e,n,n,i,r,o)},ellipse:function(t,e,n,i,r,o,a,s){var h=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(t+h,e+u,n,i,r,o,a,s)},absellipse:function(t,e,n,i,r,o,a,s){var h=new ua(t,e,n,i,r,o,a,s);if(this.curves.length>0){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<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Aa.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=Aa.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){Aa.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new Aa).fromJSON(i))}return this}}),Ra.prototype=Object.assign(Object.create(fn.prototype),{constructor:Ra,isLight:!0,copy:function(t){return fn.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=fn.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Oa.prototype=Object.assign(Object.create(Ra.prototype),{constructor:Oa,isHemisphereLight:!0,copy:function(t){return Ra.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Ia.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Da.prototype=Object.assign(Object.create(Ia.prototype),{constructor:Da,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*ze.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix())}}),ka.prototype=Object.assign(Object.create(Ra.prototype),{constructor:ka,isSpotLight:!0,copy:function(t){return Ra.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Na.prototype=Object.assign(Object.create(Ra.prototype),{constructor:Na,isPointLight:!0,copy:function(t){return Ra.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),za.prototype=Object.assign(Object.create(Ia.prototype),{constructor:za}),Fa.prototype=Object.assign(Object.create(Ra.prototype),{constructor:Fa,isDirectionalLight:!0,copy:function(t){return Ra.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Ba.prototype=Object.assign(Object.create(Ra.prototype),{constructor:Ba,isAmbientLight:!0}),ja.prototype=Object.assign(Object.create(Ra.prototype),{constructor:ja,isRectAreaLight:!0,copy:function(t){return Ra.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Ra.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});var Ga={arraySlice:function(t,e,n){return Ga.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),i=0;i!==e;++i)n[i]=i;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,h=0;h!==e;++h)r[a++]=t[s+h];return r},flattenJSON:function(t,e,n,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[i])&&(e.push(o.time),n.push.apply(n,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[i])&&(e.push(o.time),a.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(a=o[i])&&(e.push(o.time),n.push(a)),o=t[r++]}while(void 0!==o)}}};function Ha(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Ua(t,e,n,i){Ha.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Va(t,e,n,i){Ha.call(this,t,e,n,i)}function Wa(t,e,n,i){Ha.call(this,t,e,n,i)}function Za(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ga.convertArray(e,this.TimeBufferType),this.values=Ga.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function qa(t,e,n){Za.call(this,t,e,n)}function Xa(t,e,n,i){Za.call(this,t,e,n,i)}function Ya(t,e,n,i){Za.call(this,t,e,n,i)}function Ja(t,e,n,i){Ha.call(this,t,e,n,i)}function Ka(t,e,n,i){Za.call(this,t,e,n,i)}function Qa(t,e,n,i){Za.call(this,t,e,n,i)}function $a(t,e,n,i){Za.call(this,t,e,n,i)}function ts(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=ze.generateUUID(),this.duration<0&&this.resetDuration()}function es(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ya;case"vector":case"vector2":case"vector3":case"vector4":return $a;case"color":return Xa;case"quaternion":return Ka;case"bool":case"boolean":return qa;case"string":return Qa}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],i=[];Ga.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}function ns(t){this.manager=void 0!==t?t:ta,this.textures={}}function is(t){this.manager=void 0!==t?t:ta}Object.assign(Ha.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var o;n:{i:if(!(t<i)){for(var a=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===a)break;if(r=i,t<(i=e[++n]))break e}o=e.length;break n}if(t>=r)break t;var s=e[1];t<s&&(n=2,r=s);for(a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===a)break;if(i=r,t>=(r=e[--n-1]))break e}o=n,n=0}for(;n<o;){var h=n+o>>>1;t<e[h]?o=h:n=h+1}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
- //!\ DECLARE ALIAS AFTER assign prototype !
- Object.assign(Ha.prototype,{beforeStart_:Ha.prototype.copySampleValue_,afterEnd_:Ha.prototype.copySampleValue_}),Ua.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Ua,DefaultSettings_:{endingStart:_e,endingEnd:_e},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case xe:r=t,a=2*e-n;break;case we:a=e+i[r=i.length-2]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case xe:o=t,s=2*n-e;break;case we:o=1,s=n+i[1]-i[0];break;default:o=t-1,s=e}var h=.5*(n-e),u=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(s-n),this._offsetPrev=r*u,this._offsetNext=o*u},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,h=s-a,u=this._offsetPrev,c=this._offsetNext,l=this._weightPrev,f=this._weightNext,d=(n-e)/(i-e),p=d*d,m=p*d,g=-l*m+2*l*p-l*d,v=(1+l)*m+(-1.5-2*l)*p+(-.5+l)*d+1,y=(-1-f)*m+(1.5+f)*p+.5*d,_=f*m-f*p,x=0;x!==a;++x)r[x]=g*o[u+x]+v*o[h+x]+y*o[s+x]+_*o[c+x];return r}}),Va.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Va,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,h=s-a,u=(n-e)/(i-e),c=1-u,l=0;l!==a;++l)r[l]=o[h+l]*c+o[s+l]*u;return r}}),Wa.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Wa,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Za,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Ga.convertArray(t.times,Array),values:Ga.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(Za.prototype,{constructor:Za,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ve,InterpolantFactoryMethodDiscrete:function(t){return new Wa(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Va(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ua(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case ge:e=this.InterpolantFactoryMethodDiscrete;break;case ve:e=this.InterpolantFactoryMethodLinear;break;case ye:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ge;case this.InterpolantFactoryMethodLinear:return ve;case this.InterpolantFactoryMethodSmooth:return ye}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,o=i-1;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--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;a<o;++a){var s=!1,h=t[a];if(h!==t[a+1]&&(1!==a||h!==h[0]))if(i)s=!0;else for(var u=a*n,c=u-n,l=u+n,f=0;f!==n;++f){var d=e[u+f];if(d!==e[c+f]||d!==e[l+f]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];var p=a*n,m=r*n;for(f=0;f!==n;++f)e[m+f]=e[p+f]}++r}}if(o>0){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;a<r;a++){var s=[],h=[];s.push((a+r-1)%r,a,(a+1)%r),h.push(0,1,0);var u=Ga.getKeyframeOrder(s);s=Ga.sortedArray(s,1,u),h=Ga.sortedArray(h,1,u),i||0!==s[0]||(s.push(r),h.push(h[0])),o.push(new Ya(".morphTargetInfluences["+e[a].name+"]",s,h).scale(1/n))}return new ts(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var i=t;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],h=s.name.match(r);if(h&&h.length>1){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;h<s.length;h++){var u=s[h].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var c={},l=0;l<u.length;l++)if(u[l].morphTargets)for(var f=0;f<u[l].morphTargets.length;f++)c[u[l].morphTargets[f]]=-1;for(var d in c){var p=[],m=[];for(f=0;f!==u[l].morphTargets.length;++f){var g=u[l];p.push(g.time),m.push(g.morphTarget===d?1:0)}i.push(new Ya(".morphTargetInfluence["+d+"]",p,m))}o=c.length*(a||1)}else{var v=".bones["+e[h].name+"]";n($a,v+".position",u,"pos",i),n(Ka,v+".quaternion",u,"rot",i),n($a,v+".scale",u,"scl",i)}}return 0===i.length?null:new ts(r,o,i)}}),Object.assign(ts.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}}),Object.assign(ns.prototype,{load:function(t,e,n,i){var r=this;new na(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},setTextures:function(t){this.textures=t},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var i=new Ko[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearCoat&&(i.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(i.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var o=t.uniforms[r];switch(i.uniforms[r]={},o.type){case"t":i.uniforms[r].value=n(o.value);break;case"c":i.uniforms[r].value=(new rn).setHex(o.value);break;case"v2":i.uniforms[r].value=(new Fe).fromArray(o.value);break;case"v3":i.uniforms[r].value=(new Ge).fromArray(o.value);break;case"v4":i.uniforms[r].value=(new Ze).fromArray(o.value);break;case"m4":i.uniforms[r].value=(new Be).fromArray(o.value);break;default:i.uniforms[r].value=o.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var a=t.normalScale;!1===Array.isArray(a)&&(a=[a,a]),i.normalScale=(new Fe).fromArray(a)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),i}}),Object.assign(is.prototype,{load:function(t,e,n,i){var r=this;new na(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=new Rn,n=t.data.index;if(void 0!==n){var i=new rs[n.type](n.array);e.setIndex(new yn(i,1))}var r=t.data.attributes;for(var o in r){var a=r[o];i=new rs[a.type](a.array);e.addAttribute(o,new yn(i,a.itemSize,a.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var h=0,u=s.length;h!==u;++h){var c=s[h];e.addGroup(c.start,c.count,c.materialIndex)}var l=t.data.boundingSphere;if(void 0!==l){var f=new Ge;void 0!==l.center&&f.fromArray(l.center),e.boundingSphere=new Ke(f,l.radius)}return e}});var rs={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function os(){}os.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,i=e.length;n<i;n+=2){var r=e[n],o=e[n+1];if(r.test(t))return o}return null}},Object.assign(os.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e,n);return i},createMaterial:function(){var t={NoBlending:M,NormalBlending:E,AdditiveBlending:S,SubtractiveBlending:T,MultiplyBlending:C,CustomBlending:P},e=new rn,n=new sa,i=new ns;return function(r,o,a){var s={};function h(t,e,i,r,h){var u,c=o+t,l=os.Handlers.get(c);null!==l?u=l.load(c):(n.setCrossOrigin(a),u=n.load(c)),void 0!==e&&(u.repeat.fromArray(e),1!==e[0]&&(u.wrapS=mt),1!==e[1]&&(u.wrapT=mt)),void 0!==i&&u.offset.fromArray(i),void 0!==r&&("repeat"===r[0]&&(u.wrapS=mt),"mirror"===r[0]&&(u.wrapS=vt),"repeat"===r[1]&&(u.wrapT=mt),"mirror"===r[1]&&(u.wrapT=vt)),void 0!==h&&(u.anisotropy=h);var f=ze.generateUUID();return s[f]=u,f}var u={uuid:ze.generateUUID(),type:"MeshLambertMaterial"};for(var c in r){var l=r[c];switch(c){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":u.name=l;break;case"blending":u.blending=t[l];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",c,"is no longer supported.");break;case"colorDiffuse":u.color=e.fromArray(l).getHex();break;case"colorSpecular":u.specular=e.fromArray(l).getHex();break;case"colorEmissive":u.emissive=e.fromArray(l).getHex();break;case"specularCoef":u.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(u.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(u.type="MeshPhongMaterial"),"standard"===l.toLowerCase()&&(u.type="MeshStandardMaterial");break;case"mapDiffuse":u.map=h(l,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":u.emissiveMap=h(l,r.mapEmissiveRepeat,r.mapEmissiveOffset,r.mapEmissiveWrap,r.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":u.lightMap=h(l,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":u.aoMap=h(l,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":u.bumpMap=h(l,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":u.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":u.normalMap=h(l,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":u.normalScale=l;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":u.specularMap=h(l,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":u.metalnessMap=h(l,r.mapMetalnessRepeat,r.mapMetalnessOffset,r.mapMetalnessWrap,r.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":u.roughnessMap=h(l,r.mapRoughnessRepeat,r.mapRoughnessOffset,r.mapRoughnessWrap,r.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":u.alphaMap=h(l,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":u.side=g;break;case"doubleSided":u.side=v;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),u.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":u[c]=l;break;case"vertexColors":!0===l&&(u.vertexColors=b),"face"===l&&(u.vertexColors=w);break;default:console.error("THREE.Loader.createMaterial: Unsupported",c,l)}}return"MeshBasicMaterial"===u.type&&delete u.emissive,"MeshPhongMaterial"!==u.type&&delete u.specular,u.opacity<1&&(u.transparent=!0),i.setTextures(s),i.parse(u)}}()});var as={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(escape(e))},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function ss(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:ta,this.withCredentials=!1}function hs(t){this.manager=void 0!==t?t:ta,this.texturePath=""}Object.assign(ss.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:as.extractUrlBase(t),a=new na(this.manager);a.setWithCredentials(this.withCredentials),a.load(t,function(n){var i=JSON.parse(n),a=i.metadata;if(void 0!==a){var s=a.type;if(void 0!==s&&"object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.")}var h=r.parse(i,o);e(h.geometry,h.materials)},n,i)},setCrossOrigin:function(t){return this.crossOrigin=t,this},setTexturePath:function(t){return this.texturePath=t,this},parse:function(){return function(t,e){void 0!==t.data&&(t=t.data),void 0!==t.scale?t.scale=1/t.scale:t.scale=1;var n=new vn;return function(t,e){function n(t,e){return t&1<<e}var i,r,o,a,s,h,u,c,l,f,d,p,m,g,v,y,_,x,w,b,M,E,S,T,C,P=t.faces,A=t.vertices,L=t.normals,R=t.colors,O=t.scale,I=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&I++;for(i=0;i<I;i++)e.faceVertexUvs[i]=[]}for(a=0,s=A.length;a<s;)(x=new Ge).x=A[a++]*O,x.y=A[a++]*O,x.z=A[a++]*O,e.vertices.push(x);for(a=0,s=P.length;a<s;)if(d=n(f=P[a++],0),p=n(f,1),m=n(f,3),g=n(f,4),v=n(f,5),y=n(f,6),_=n(f,7),d){if((b=new mn).a=P[a],b.b=P[a+1],b.c=P[a+3],(M=new mn).a=P[a+1],M.b=P[a+2],M.c=P[a+3],a+=4,p&&(l=P[a++],b.materialIndex=l,M.materialIndex=l),o=e.faces.length,m)for(i=0;i<I;i++)for(T=t.uvs[i],e.faceVertexUvs[i][o]=[],e.faceVertexUvs[i][o+1]=[],r=0;r<4;r++)C=new Fe(T[2*(c=P[a++])],T[2*c+1]),2!==r&&e.faceVertexUvs[i][o].push(C),0!==r&&e.faceVertexUvs[i][o+1].push(C);if(g&&(u=3*P[a++],b.normal.set(L[u++],L[u++],L[u]),M.normal.copy(b.normal)),v)for(i=0;i<4;i++)u=3*P[a++],S=new Ge(L[u++],L[u++],L[u]),2!==i&&b.vertexNormals.push(S),0!==i&&M.vertexNormals.push(S);if(y&&(E=R[h=P[a++]],b.color.setHex(E),M.color.setHex(E)),_)for(i=0;i<4;i++)E=R[h=P[a++]],2!==i&&b.vertexColors.push(new rn(E)),0!==i&&M.vertexColors.push(new rn(E));e.faces.push(b),e.faces.push(M)}else{if((w=new mn).a=P[a++],w.b=P[a++],w.c=P[a++],p&&(l=P[a++],w.materialIndex=l),o=e.faces.length,m)for(i=0;i<I;i++)for(T=t.uvs[i],e.faceVertexUvs[i][o]=[],r=0;r<3;r++)C=new Fe(T[2*(c=P[a++])],T[2*c+1]),e.faceVertexUvs[i][o].push(C);if(g&&(u=3*P[a++],w.normal.set(L[u++],L[u++],L[u])),v)for(i=0;i<3;i++)u=3*P[a++],S=new Ge(L[u++],L[u++],L[u]),w.vertexNormals.push(S);if(y&&(h=P[a++],w.color.setHex(R[h])),_)for(i=0;i<3;i++)h=P[a++],w.vertexColors.push(new rn(R[h]));e.faces.push(w)}}(t,n),function(t,e){var n=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=n){var o=t.skinWeights[i],a=n>1?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;i<r;i+=n){var u=t.skinIndices[i],c=n>1?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;i<r;i++){e.morphTargets[i]={},e.morphTargets[i].name=t.morphTargets[i].name,e.morphTargets[i].vertices=[];for(var o=e.morphTargets[i].vertices,a=t.morphTargets[i].vertices,s=0,h=a.length;s<h;s+=3){var u=new Ge;u.x=a[s]*n,u.y=a[s+1]*n,u.z=a[s+2]*n,o.push(u)}}if(void 0!==t.morphColors&&t.morphColors.length>0){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;i<r;i++)c[i].color.fromArray(l,3*i)}}(t,n),function(t,e){var n=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var o=ts.parseAnimation(i[r],e.bones);o&&n.push(o)}if(e.morphTargets){var a=ts.CreateClipsFromMorphTargetSequences(e.morphTargets,10);n=n.concat(a)}n.length>0&&(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;n<i;n++){var r=(new La).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new ss,r=new is,o=0,a=t.length;o<a;o++){var s,h=t[o];switch(h.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Go[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Go[h.type](h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Go[h.type](h.radius,h.segments,h.thetaStart,h.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Go[h.type](h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Go[h.type](h.radius,h.height,h.radialSegments,h.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Go[h.type](h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Go[h.type](h.radius,h.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Go[h.type](h.innerRadius,h.outerRadius,h.thetaSegments,h.phiSegments,h.thetaStart,h.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Go[h.type](h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Go[h.type](h.radius,h.tube,h.tubularSegments,h.radialSegments,h.p,h.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Go[h.type](h.points,h.segments,h.phiStart,h.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Go[h.type](h.vertices,h.indices,h.radius,h.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var u=[],c=0,l=h.shapes.length;c<l;c++){var f=e[h.shapes[c]];u.push(f)}s=new Go[h.type](u,h.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(u=[],c=0,l=h.shapes.length;c<l;c++){f=e[h.shapes[c]];u.push(f)}var d=h.options.extrudePath;void 0!==d&&(h.options.extrudePath=(new Ca[d.type]).fromJSON(d)),s=new Go[h.type](u,h.options);break;case"BufferGeometry":s=r.parse(h);break;case"Geometry":s=i.parse(h,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+h.type+'"');continue}s.uuid=h.uuid,void 0!==h.name&&(s.name=h.name),!0===s.isBufferGeometry&&void 0!==h.userData&&(s.userData=h.userData),n[h.uuid]=s}return n},parseMaterials:function(t,e){var n={};if(void 0!==t){var i=new ns;i.setTextures(e);for(var r=0,o=t.length;r<o;r++){var a=t[r];if("MultiMaterial"===a.type){for(var s=[],h=0;h<a.materials.length;h++)s.push(i.parse(a.materials[h]));n[a.uuid]=s}else n[a.uuid]=i.parse(a)}}return n},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=ts.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){var n=this,i={};function r(t){return n.manager.itemStart(t),o.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemEnd(t),n.manager.itemError(t)})}if(void 0!==t&&t.length>0){var o=new oa(new $o(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var h=t[a],u=h.url;if(Array.isArray(u)){i[h.uuid]=[];for(var c=0,l=u.length;c<l;c++){var f=u[c],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:n.texturePath+f;i[h.uuid].push(r(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:n.texturePath+h.url;i[h.uuid]=r(d)}}}return i},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(a=Array.isArray(e[s.image])?new Vn(e[s.image]):new We(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,cs)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],ls),a.wrapT=n(s.wrap[1],ls)),void 0!==s.format&&(a.format=s.format),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,fs)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,fs)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),i[s.uuid]=a}return i},parseObject:function(t,e,n){var i;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var o=t[i];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":i=new ur,void 0!==t.background&&Number.isInteger(t.background)&&(i.background=new rn(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?i.fog=new hr(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(i.fog=new sr(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":i=new ir(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(i.focus=t.focus),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.filmGauge&&(i.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(i.filmOffset=t.filmOffset),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"OrthographicCamera":i=new pn(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"AmbientLight":i=new Ba(t.color,t.intensity);break;case"DirectionalLight":i=new Fa(t.color,t.intensity);break;case"PointLight":i=new Na(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":i=new ja(t.color,t.intensity,t.width,t.height);break;case"SpotLight":i=new ka(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":i=new Oa(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=r(t.geometry),s=o(t.material);i=a.bones&&a.bones.length>0?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;u<h.length;u++)i.add(this.parseObject(h[u],e,n));if("LOD"===t.type)for(var c=t.levels,l=0;l<c.length;l++){var f=c[l],d=i.getObjectByProperty("uuid",f.object);void 0!==d&&i.addLevel(d,f.distance)}return i}});var us,cs={UVMapping:st,CubeReflectionMapping:ht,CubeRefractionMapping:ut,EquirectangularReflectionMapping:ct,EquirectangularRefractionMapping:lt,SphericalReflectionMapping:ft,CubeUVReflectionMapping:dt,CubeUVRefractionMapping:pt},ls={RepeatWrapping:mt,ClampToEdgeWrapping:gt,MirroredRepeatWrapping:vt},fs={NearestFilter:yt,NearestMipMapNearestFilter:_t,NearestMipMapLinearFilter:xt,LinearFilter:wt,LinearMipMapNearestFilter:bt,LinearMipMapLinearFilter:Mt};function ds(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:ta,this.options=void 0}function ps(){this.type="ShapePath",this.color=new rn,this.subPaths=[],this.currentPath=null}function ms(t){this.type="Font",this.data=t}function gs(t,e,n,i,r){var o=r.glyphs[t]||r.glyphs["?"];if(o){var a,s,h,u,c,l,f,d,p=new ps;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":a=m[g++]*e+n,s=m[g++]*e+i,p.moveTo(a,s);break;case"l":a=m[g++]*e+n,s=m[g++]*e+i,p.lineTo(a,s);break;case"q":h=m[g++]*e+n,u=m[g++]*e+i,c=m[g++]*e+n,l=m[g++]*e+i,p.quadraticCurveTo(c,l,h,u);break;case"b":h=m[g++]*e+n,u=m[g++]*e+i,c=m[g++]*e+n,l=m[g++]*e+i,f=m[g++]*e+n,d=m[g++]*e+i,p.bezierCurveTo(c,l,f,d,h,u)}}return{offsetX:o.ha*e,path:p}}}function vs(t){this.manager=void 0!==t?t:ta}ds.prototype={constructor:ds,setOptions:function(t){return this.options=t,this},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;fetch(t).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,r.options)}).then(function(n){Qo.add(t,n),e&&e(n),r.manager.itemEnd(t)}).catch(function(e){i&&i(e),r.manager.itemEnd(t),r.manager.itemError(t)})},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(ps.prototype,{moveTo:function(t,e){this.currentPath=new Aa,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i)},bezierCurveTo:function(t,e,n,i,r,o){this.currentPath.bezierCurveTo(t,e,n,i,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],o=new La;o.curves=r.curves,e.push(o)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,o=0;o<n;r=o++){var a=e[r],s=e[o],h=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=e[o],h=-h,s=e[r],u=-u),t.y<a.y||t.y>s.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;v<y;v++)a=r(l=(s=o[v]).getPoints()),(a=t?!a:a)?(!c&&p[g]&&g++,p[g]={s:new La,p:l},p[g].s.curves=s.curves,c&&g++,m[g]=[]):m[g].push({h:s,p:l[0]});if(!p[0])return n(o);if(p.length>1){for(var _=!1,x=[],w=0,b=p.length;w<b;w++)d[w]=[];for(w=0,b=p.length;w<b;w++)for(var M=m[w],E=0;E<M.length;E++){for(var S=M[E],T=!0,C=0;C<p.length;C++)i(S.p,p[C].p)&&(w!==C&&x.push({froms:w,tos:C,hole:E}),T?(T=!1,d[C].push(S)):_=!0);T&&d[w].push(S)}x.length>0&&(_||(m=d))}v=0;for(var P=p.length;v<P;v++){h=p[v].s,u.push(h);for(var A=0,L=(f=m[v]).length;A<L;A++)h.holes.push(f[A].h)}return u}}),Object.assign(ms.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=function(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[],s=0,h=0,u=0;u<i.length;u++){var c=i[u];if("\n"===c)s=0,h-=o;else{var l=gs(c,r,s,h,n);s+=l.offsetX,a.push(l.path)}}return a}(t,e,this.data),r=0,o=i.length;r<o;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Object.assign(vs.prototype,{load:function(t,e,n,i){var r=this,o=new na(this.manager);o.setPath(this.path),o.load(t,function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var i=r.parse(n);e&&e(i)},n,i)},parse:function(t){return new ms(t)},setPath:function(t){return this.path=t,this}});var ys={getContext:function(){return void 0===us&&(us=new(window.AudioContext||window.webkitAudioContext)),us},setContext:function(t){us=t}};function _s(t){this.manager=void 0!==t?t:ta}function xs(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ir,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ir,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function ws(t,e,n){fn.call(this),this.type="CubeCamera";var i=new ir(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new Ge(1,0,0)),this.add(i);var r=new ir(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new Ge(-1,0,0)),this.add(r);var o=new ir(90,1,t,e);o.up.set(0,0,1),o.lookAt(new Ge(0,1,0)),this.add(o);var a=new ir(90,1,t,e);a.up.set(0,0,-1),a.lookAt(new Ge(0,-1,0)),this.add(a);var s=new ir(90,1,t,e);s.up.set(0,-1,0),s.lookAt(new Ge(0,0,1)),this.add(s);var h=new ir(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new Ge(0,0,-1)),this.add(h);var u={format:zt,magFilter:wt,minFilter:wt};this.renderTarget=new Xe(n,n,u),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,i,n),n.activeCubeFace=1,t.render(e,r,n),n.activeCubeFace=2,t.render(e,o,n),n.activeCubeFace=3,t.render(e,a,n),n.activeCubeFace=4,t.render(e,s,n),n.texture.generateMipmaps=u,n.activeCubeFace=5,t.render(e,h,n),t.setRenderTarget(null)},this.clear=function(t,e,n,i){for(var r=this.renderTarget,o=0;o<6;o++)r.activeCubeFace=o,t.setRenderTarget(r),t.clear(e,n,i);t.setRenderTarget(null)}}function bs(){fn.call(this),this.type="AudioListener",this.context=ys.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ms(t){fn.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Es(t){Ms.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Ss(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Ts(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(_s.prototype,{load:function(t,e,n,i){var r=new na(this.manager);r.setResponseType("arraybuffer"),r.load(t,function(t){var n=t.slice(0);ys.getContext().decodeAudioData(n,function(t){e(t)})},n,i)}}),Object.assign(xs.prototype,{update:function(){var t,e,n,i,r,o,a,s,h=new Be,u=new Be;return function(c){if(t!==this||e!==c.focus||n!==c.fov||i!==c.aspect*this.aspect||r!==c.near||o!==c.far||a!==c.zoom||s!==this.eyeSep){t=this,e=c.focus,n=c.fov,i=c.aspect*this.aspect,r=c.near,o=c.far,a=c.zoom;var l,f,d=c.projectionMatrix.clone(),p=(s=this.eyeSep/2)*r/e,m=r*Math.tan(ze.DEG2RAD*n*.5)/a;u.elements[12]=-s,h.elements[12]=s,l=-m*i+p,f=m*i+p,d.elements[0]=2*r/(f-l),d.elements[8]=(f+l)/(f-l),this.cameraL.projectionMatrix.copy(d),l=-m*i-p,f=m*i-p,d.elements[0]=2*r/(f-l),d.elements[8]=(f+l)/(f-l),this.cameraR.projectionMatrix.copy(d)}this.cameraL.matrixWorld.copy(c.matrixWorld).multiply(u),this.cameraR.matrixWorld.copy(c.matrixWorld).multiply(h)}}()}),ws.prototype=Object.create(fn.prototype),ws.prototype.constructor=ws,bs.prototype=Object.assign(Object.create(fn.prototype),{constructor:bs,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(){var t=new Ge,e=new je,n=new Ge,i=new Ge;return function(r){fn.prototype.updateMatrixWorld.call(this,r);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(t,e,n),i.set(0,0,-1).applyQuaternion(e),o.positionX?(o.positionX.setValueAtTime(t.x,this.context.currentTime),o.positionY.setValueAtTime(t.y,this.context.currentTime),o.positionZ.setValueAtTime(t.z,this.context.currentTime),o.forwardX.setValueAtTime(i.x,this.context.currentTime),o.forwardY.setValueAtTime(i.y,this.context.currentTime),o.forwardZ.setValueAtTime(i.z,this.context.currentTime),o.upX.setValueAtTime(a.x,this.context.currentTime),o.upY.setValueAtTime(a.y,this.context.currentTime),o.upZ.setValueAtTime(a.z,this.context.currentTime)):(o.setPosition(t.x,t.y,t.z),o.setOrientation(i.x,i.y,i.z,a.x,a.y,a.z))}}()}),Ms.prototype=Object.assign(Object.create(fn.prototype),{constructor:Ms,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),Es.prototype=Object.assign(Object.create(Ms.prototype),{constructor:Es,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(){var t=new Ge,e=new je,n=new Ge,i=new Ge;return function(r){fn.prototype.updateMatrixWorld.call(this,r);var o=this.panner;this.matrixWorld.decompose(t,e,n),i.set(0,0,1).applyQuaternion(e),o.setPosition(t.x,t.y,t.z),o.setOrientation(i.x,i.y,i.z)}}()}),Object.assign(Ss.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Ts.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==i;++a)n[r+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var a=3*e;this._mixBufferRegion(n,i,a,1-r,e)}for(var s=e,h=e+e;s!==h;++s)if(n[s]!==n[s+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(i>=.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<a;o++)js(r[o],e,n,!0)}function Gs(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Hs(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function Us(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}function Vs(t,e){this.min=void 0!==t?t:new Fe(1/0,1/0),this.max=void 0!==e?e:new Fe(-1/0,-1/0)}function Ws(t,e){this.start=void 0!==t?t:new Ge,this.end=void 0!==e?e:new Ge}function Zs(t){fn.call(this),this.material=t,this.render=function(){}}function qs(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16711680,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var h=new Rn,u=new Tn(2*a*3,3);h.addAttribute("position",u),xr.call(this,h,new yr({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Xs(t,e){fn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new Rn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1;r<32;r++,o++){var a=r/32*Math.PI*2,s=o/32*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new Tn(i,3));var h=new yr({fog:!1});this.cone=new xr(n,h),this.add(this.cone),this.update()}function Ys(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new Rn,i=[],r=[],o=new rn(0,0,1),a=new rn(0,1,0),s=0;s<e.length;s++){var h=e[s];h.parent&&h.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.addAttribute("position",new Tn(i,3)),n.addAttribute("color",new Tn(r,3));var u=new yr({vertexColors:b,depthTest:!1,depthWrite:!1,transparent:!0});xr.call(this,n,u),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Js(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new To(e,4,2),r=new Fn({wireframe:!0,fog:!1});Hn.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Ks(t,e){fn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;var n=new yr({fog:!1}),i=new Rn;i.addAttribute("position",new yn(new Float32Array(15),3)),this.line=new _r(i,n),this.add(this.line),this.update()}function Qs(t,e,n){fn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new Nr(e);i.rotateY(.5*Math.PI),this.material=new Fn({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=b);var r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.addAttribute("color",new yn(o,3)),this.add(new Hn(i,this.material)),this.update()}function $s(t,e,n,i){t=t||10,e=e||10,n=new rn(void 0!==n?n:4473924),i=new rn(void 0!==i?i:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],h=[],u=0,c=0,l=-a;u<=e;u++,l+=o){s.push(-a,0,l,a,0,l),s.push(l,0,-a,l,0,a);var f=u===r?n:i;f.toArray(h,c),c+=3,f.toArray(h,c),c+=3,f.toArray(h,c),c+=3,f.toArray(h,c),c+=3}var d=new Rn;d.addAttribute("position",new Tn(s,3)),d.addAttribute("color",new Tn(h,3));var p=new yr({vertexColors:b});xr.call(this,d,p)}function th(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new rn(void 0!==r?r:4473924),o=new rn(void 0!==o?o:8947848);var a,s,h,u,c,l,f,d=[],p=[];for(u=0;u<=e;u++)h=u/e*(2*Math.PI),a=Math.sin(h)*t,s=Math.cos(h)*t,d.push(0,0,0),d.push(a,0,s),f=1&u?r:o,p.push(f.r,f.g,f.b),p.push(f.r,f.g,f.b);for(u=0;u<=n;u++)for(f=1&u?r:o,l=t-t/n*u,c=0;c<i;c++)h=c/i*(2*Math.PI),a=Math.sin(h)*l,s=Math.cos(h)*l,d.push(a,0,s),p.push(f.r,f.g,f.b),h=(c+1)/i*(2*Math.PI),a=Math.sin(h)*l,s=Math.cos(h)*l,d.push(a,0,s),p.push(f.r,f.g,f.b);var m=new Rn;m.addAttribute("position",new Tn(d,3)),m.addAttribute("color",new Tn(p,3));var g=new yr({vertexColors:b});xr.call(this,m,g)}function eh(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16776960,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var h=new Rn,u=new Tn(2*a*3,3);h.addAttribute("position",u),xr.call(this,h,new yr({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function nh(t,e,n){fn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new Rn;i.addAttribute("position",new Tn([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new yr({fog:!1});this.lightPlane=new _r(i,r),this.add(this.lightPlane),(i=new Rn).addAttribute("position",new Tn([0,0,0,0,0,1],3)),this.targetLine=new _r(i,r),this.add(this.targetLine),this.update()}function ih(t){var e=new Rn,n=new yr({color:16777215,vertexColors:w}),i=[],r=[],o={},a=new rn(16755200),s=new rn(16711680),h=new rn(43775),u=new rn(16777215),c=new rn(3355443);function l(t,e,n){f(t,n),f(e,n)}function f(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}l("n1","n2",a),l("n2","n4",a),l("n4","n3",a),l("n3","n1",a),l("f1","f2",a),l("f2","f4",a),l("f4","f3",a),l("f3","f1",a),l("n1","f1",a),l("n2","f2",a),l("n3","f3",a),l("n4","f4",a),l("p","n1",s),l("p","n2",s),l("p","n3",s),l("p","n4",s),l("u1","u2",h),l("u2","u3",h),l("u3","u1",h),l("c","t",u),l("p","c",c),l("cn1","cn2",c),l("cn3","cn4",c),l("cf1","cf2",c),l("cf3","cf4",c),e.addAttribute("position",new Tn(i,3)),e.addAttribute("color",new Tn(r,3)),xr.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function rh(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Rn;r.setIndex(new yn(n,1)),r.addAttribute("position",new yn(i,3)),xr.call(this,r,new yr({color:e})),this.matrixAutoUpdate=!1,this.update()}function oh(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Rn;r.setIndex(new yn(i,1)),r.addAttribute("position",new Tn([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),xr.call(this,r,new yr({color:n})),this.geometry.computeBoundingSphere()}function ah(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new Rn;r.addAttribute("position",new Tn([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),_r.call(this,r,new yr({color:i}));var o=new Rn;o.addAttribute("position",new Tn([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Hn(o,new Fn({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function sh(t,e,n,i,r,o){fn.call(this),void 0===i&&(i=16776960),void 0===n&&(n=1),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===Cs&&((Cs=new Rn).addAttribute("position",new Tn([0,0,0,0,1,0],3)),(Ps=new No(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new _r(Cs,new yr({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Hn(Ps,new Fn({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function hh(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new Rn;n.addAttribute("position",new Tn(e,3)),n.addAttribute("color",new Tn([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new yr({vertexColors:b});xr.call(this,n,i)}function uh(t,e,n,i,r,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new mn(t,e,n,r,o,a)}Object.assign(As.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Ls,{Composite:As,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Ls.Composite(t,e,n):new Ls(t,e,n)},sanitizeNodeName:function(){var t=new RegExp("[\\[\\]\\.:\\/]","g");return function(e){return e.replace(/\s/g,"_").replace(t,"")}}(),parseTrackName:function(){var t="[^\\[\\]\\.:\\/]",e="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",n=/((?:WC+[\/:])*)/.source.replace("WC",t),i=/(WCOD+)?/.source.replace("WCOD",e),r=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",t),o=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",t),a=new RegExp("^"+n+i+r+o+"$"),s=["material","materials","bones"];return function(t){var e=a.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==s.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}}(),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===e||r.uuid===e)return r;var o=i(r.children);if(o)return o}return null},r=i(t.children);if(r)return r}return null}}),Object.assign(Ls.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=Ls.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[i];if(void 0!==s){var h=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?h=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][h]}else{var c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),
- //!\ DECLARE ALIAS AFTER assign prototype !
- Object.assign(Ls.prototype,{_getValue_unbound:Ls.prototype.getValue,_setValue_unbound:Ls.prototype.setValue}),Object.assign(Rs.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,h=void 0,u=0,c=arguments.length;u!==c;++u){var l=arguments[u],f=l.uuid,d=i[f];if(void 0===d){d=e++,i[f]=d,t.push(l);for(var p=0,m=s;p!==m;++p)a[p].push(new Ls(l,r[p],o[p]))}else if(d<n){h=t[d];var g=--n,v=t[g];i[v.uuid]=d,t[d]=v,i[f]=g,t[g]=l;for(p=0,m=s;p!==m;++p){var y=a[p],_=y[g],x=y[d];y[d]=_,void 0===x&&(x=new Ls(l,r[p],o[p])),y[g]=x}}else t[d]!==h&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],h=s.uuid,u=n[h];if(void 0!==u&&u>=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],u<n){var c=--n,l=t[c],f=t[v=--e];i[l.uuid]=u,t[u]=l,i[f.uuid]=c,t[c]=f,t.pop();for(var d=0,p=o;d!==p;++d){var m=(y=r[d])[c],g=y[v];y[u]=m,y[c]=g,y.pop()}}else{var v;i[(f=t[v=--e]).uuid]=u,t[u]=f,t.pop();for(d=0,p=o;d!==p;++d){var y;(y=r[d])[u]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var o=this._paths,a=this._parsedPaths,s=this._objects,h=s.length,u=this.nCachedObjects_,c=new Array(h);i=r.length,n[t]=i,o.push(t),a.push(e),r.push(c);for(var l=u,f=s.length;l!==f;++l){var d=s[l];c[l]=new Ls(d,t,e)}return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}),Object.assign(Os.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,o=r/i,a=i/r;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,h=o.sampleValues;return s[0]=r,s[1]=r+n,h[0]=t/a,h[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var o=(t-r)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)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&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],s=a.knownActions,h=s[s.length-1],u=t._byClipCacheIndex;h._byClipCacheIndex=u,s[u]=h,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],o=this._bindings;void 0===r&&(r={},i[e]=r),r[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],s=e[e.length-1],h=t._cacheIndex;s._cacheIndex=h,e[h]=s,e.pop(),delete a[r];t:{for(var u in a)break t;delete o[i]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new Va(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?ts.findByName(n,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var h=a.actionByRoot[i];if(void 0!==h)return h;s=a.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var u=new Os(this,r,e);return this._bindAction(u,s),this._addInactiveAction(u,o,i),u},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?ts.findByName(n,t):t,o=r?r.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(i,t,r,o)}var s=this._bindings,h=this._nActiveBindings;for(a=0;a!==h;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var o=r.knownActions,a=0,s=o.length;a!==s;++a){var h=o[a];this._deactivateAction(h);var u=h._cacheIndex,c=e[e.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,c._cacheIndex=u,e[u]=c,e.pop(),this._removeInactiveBindingsForAction(h)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Ds.prototype.clone=function(){return new Ds(void 0===this.value.clone?this.value:this.value.clone())},ks.prototype=Object.assign(Object.create(Rn.prototype),{constructor:ks,isInstancedBufferGeometry:!0,copy:function(t){return Rn.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Ns.prototype=Object.assign(Object.create(cr.prototype),{constructor:Ns,isInstancedInterleavedBuffer:!0,copy:function(t){return cr.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),zs.prototype=Object.assign(Object.create(yn.prototype),{constructor:zs,isInstancedBufferAttribute:!0,copy:function(t){return yn.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Fs.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return js(t,this,i,e),i.sort(Bs),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)js(t[r],this,i,e);return i.sort(Bs),i}}),Object.assign(Gs.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Object.assign(Hs.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(ze.clamp(e/this.radius,-1,1))),this}}),Object.assign(Us.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}}),Object.assign(Vs.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new Fe;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new Fe),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new Fe),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.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.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.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<l;c++)for(var f=h[c],d=0,p=f.vertexNormals.length;d<p;d++){var m=s[f[i[d]]],g=f.vertexNormals[d];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}else if(a&&a.isBufferGeometry){var v=a.attributes.position,y=a.attributes.normal;for(u=0,d=0,p=v.count;d<p;d++)t.set(v.getX(d),v.getY(d),v.getZ(d)).applyMatrix4(r),e.set(y.getX(d),y.getY(d),y.getZ(d)),e.applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}o.needsUpdate=!0}}(),Xs.prototype=Object.create(fn.prototype),Xs.prototype.constructor=Xs,Xs.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Xs.prototype.update=function(){var t=new Ge,e=new Ge;return function(){this.light.updateMatrixWorld();var n=this.light.distance?this.light.distance:1e3,i=n*Math.tan(this.light.angle);this.cone.scale.set(i,i,n),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),Ys.prototype=Object.create(xr.prototype),Ys.prototype.constructor=Ys,Ys.prototype.updateMatrixWorld=function(){var t=new Ge,e=new Be,n=new Be;return function(i){var r=this.bones,o=this.geometry,a=o.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,h=0;s<r.length;s++){var u=r[s];u.parent&&u.parent.isBone&&(e.multiplyMatrices(n,u.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(h,t.x,t.y,t.z),e.multiplyMatrices(n,u.parent.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(h+1,t.x,t.y,t.z),h+=2)}o.getAttribute("position").needsUpdate=!0,fn.prototype.updateMatrixWorld.call(this,i)}}(),Js.prototype=Object.create(Hn.prototype),Js.prototype.constructor=Js,Js.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Js.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},Ks.prototype=Object.create(fn.prototype),Ks.prototype.constructor=Ks,Ks.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Ks.prototype.update=function(){var t=.5*this.light.width,e=.5*this.light.height,n=this.line.geometry.attributes.position,i=n.array;i[0]=t,i[1]=-e,i[2]=0,i[3]=t,i[4]=e,i[5]=0,i[6]=-t,i[7]=e,i[8]=0,i[9]=-t,i[10]=-e,i[11]=0,i[12]=t,i[13]=-e,i[14]=0,n.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},Qs.prototype=Object.create(fn.prototype),Qs.prototype.constructor=Qs,Qs.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Qs.prototype.update=function(){var t=new Ge,e=new rn,n=new rn;return function(){var i=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=i.geometry.getAttribute("color");e.copy(this.light.color),n.copy(this.light.groundColor);for(var o=0,a=r.count;o<a;o++){var s=o<a/2?e:n;r.setXYZ(o,s.r,s.g,s.b)}r.needsUpdate=!0}i.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),$s.prototype=Object.create(xr.prototype),$s.prototype.constructor=$s,th.prototype=Object.create(xr.prototype),th.prototype.constructor=th,eh.prototype=Object.create(xr.prototype),eh.prototype.constructor=eh,eh.prototype.update=function(){var t=new Ge,e=new Ge,n=new He;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,r=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,h=0,u=0,c=s.length;u<c;u++){var l=s[u],f=l.normal;t.copy(a[l.a]).add(a[l.b]).add(a[l.c]).divideScalar(3).applyMatrix4(i),e.copy(f).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),r.setXYZ(h,t.x,t.y,t.z),h+=1,r.setXYZ(h,e.x,e.y,e.z),h+=1}r.needsUpdate=!0}}(),nh.prototype=Object.create(fn.prototype),nh.prototype.constructor=nh,nh.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},nh.prototype.update=function(){var t=new Ge,e=new Ge,n=new Ge;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(e,t),this.lightPlane.lookAt(n),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(n),this.targetLine.scale.z=n.length()}}(),ih.prototype=Object.create(xr.prototype),ih.prototype.constructor=ih,ih.prototype.update=function(){var t,e,n=new Ge,i=new dn;function r(r,o,a,s){n.set(o,a,s).unproject(i);var h=e[r];if(void 0!==h)for(var u=t.getAttribute("position"),c=0,l=h.length;c<l;c++)u.setXYZ(h[c],n.x,n.y,n.z)}return function(){t=this.geometry,e=this.pointMap;i.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),t.getAttribute("position").needsUpdate=!0}}(),rh.prototype=Object.create(xr.prototype),rh.prototype.constructor=rh,rh.prototype.update=function(){var t=new Je;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var n=t.min,i=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=i.x,o[1]=i.y,o[2]=i.z,o[3]=n.x,o[4]=i.y,o[5]=i.z,o[6]=n.x,o[7]=n.y,o[8]=i.z,o[9]=i.x,o[10]=n.y,o[11]=i.z,o[12]=i.x,o[13]=i.y,o[14]=n.z,o[15]=n.x,o[16]=i.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=i.x,o[22]=n.y,o[23]=n.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),rh.prototype.setFromObject=function(t){return this.object=t,this.update(),this},oh.prototype=Object.create(xr.prototype),oh.prototype.constructor=oh,oh.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),fn.prototype.updateMatrixWorld.call(this,t))},ah.prototype=Object.create(_r.prototype),ah.prototype.constructor=ah,ah.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?g:m,this.lookAt(this.plane.normal),fn.prototype.updateMatrixWorld.call(this,t)},sh.prototype=Object.create(fn.prototype),sh.prototype.constructor=sh,sh.prototype.setDirection=function(){var t,e=new Ge;return function(n){n.y>.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;n<i;n++){var r=t[n];e.vertices.push(new Ge(r.x,r.y,r.z||0))}return e}}),Object.assign(Aa.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Rh.prototype=Object.create(ga.prototype),Oh.prototype=Object.create(ga.prototype),Ih.prototype=Object.create(ga.prototype),Object.assign(Ih.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),$s.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ys.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(os.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),as.extractUrlBase(t)}}),Object.assign(Vs.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Je.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Ws.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(ze,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),ze.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),ze.ceilPowerOfTwo(t)}}),Object.assign(He.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Be.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new Ge),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),Qe.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},je.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(jn.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Gn.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Gn,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Gn.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Gn.getNormal(t,e,n,i)}}),Object.assign(La.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new _o(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ro(this,t)}}),Object.assign(Fe.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ge.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ze.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(vn.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(fn.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(fn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(pr.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(mr.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(ha.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),ir.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Ra.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(yn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(Rn.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Rn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(xo.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Ds.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(zn.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new rn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===y}}}),Object.defineProperties(Zo.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Bn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ar.prototype,{animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(ar.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties($i.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(qe.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(or.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Ms.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new _s).load(t,function(t){e.setBuffer(t)}),this},Ss.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},ws.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var jh={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function Gh(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function Hh(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}Ue.crossOrigin=void 0,Ue.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new sa;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},Ue.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new aa;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},Ue.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Ue.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Uh={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function Vh(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}},function(t,e,n){var i=n(25);t.exports=function(t){return Object(i(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";n.r(e),function(t,i,r){n.d(e,"Util",function(){return zt}),n.d(e,"DomUtil",function(){return rn}),n.d(e,"StringUtil",function(){return Pe}),n.d(e,"MapboxUtil",function(){return Ct}),n.d(e,"ui",function(){return no}),n.d(e,"control",function(){return fo}),n.d(e,"renderer",function(){return aa}),n.d(e,"symbolizer",function(){return Ci}),n.d(e,"animation",function(){return ji}),n.d(e,"Browser",function(){return ae}),n.d(e,"Ajax",function(){return on}),n.d(e,"Canvas",function(){return sn}),n.d(e,"Class",function(){return mn}),n.d(e,"Eventable",function(){return fn}),n.d(e,"JSONAble",function(){return vn}),n.d(e,"Handlerable",function(){return yn}),n.d(e,"Handler",function(){return pn}),n.d(e,"DragHandler",function(){return wn}),n.d(e,"MapTool",function(){return Er}),n.d(e,"DrawTool",function(){return Tr}),n.d(e,"AreaTool",function(){return Ur}),n.d(e,"DistanceTool",function(){return Hr}),n.d(e,"SpatialReference",function(){return ni}),n.d(e,"INTERNAL_LAYER_PREFIX",function(){return o}),n.d(e,"GEOMETRY_COLLECTION_TYPES",function(){return a}),n.d(e,"GEOJSON_TYPES",function(){return s}),n.d(e,"RESOURCE_PROPERTIES",function(){return h}),n.d(e,"RESOURCE_SIZE_PROPERTIES",function(){return u}),n.d(e,"NUMERICAL_PROPERTIES",function(){return c}),n.d(e,"COLOR_PROPERTIES",function(){return l}),n.d(e,"projection",function(){return Wn}),n.d(e,"measurer",function(){return Fn}),n.d(e,"Coordinate",function(){return bn}),n.d(e,"CRS",function(){return Mn}),n.d(e,"Extent",function(){return En}),n.d(e,"Point",function(){return ce}),n.d(e,"PointExtent",function(){return Sn}),n.d(e,"Size",function(){return le}),n.d(e,"Transformation",function(){return Tn}),n.d(e,"Map",function(){return ri}),n.d(e,"Layer",function(){return $n}),n.d(e,"TileLayer",function(){return _o}),n.d(e,"GroupTileLayer",function(){return xo}),n.d(e,"WMSTileLayer",function(){return bo}),n.d(e,"CanvasTileLayer",function(){return Mo}),n.d(e,"ImageLayer",function(){return Oo}),n.d(e,"OverlayLayer",function(){return xr}),n.d(e,"VectorLayer",function(){return br}),n.d(e,"CanvasLayer",function(){return Fo}),n.d(e,"ParticleLayer",function(){return Bo}),n.d(e,"TileSystem",function(){return po}),n.d(e,"TileConfig",function(){return go}),n.d(e,"ArcCurve",function(){return hr}),n.d(e,"Circle",function(){return ir}),n.d(e,"ConnectorLine",function(){return yr}),n.d(e,"ArcConnectorLine",function(){return _r}),n.d(e,"CubicBezierCurve",function(){return ur}),n.d(e,"Curve",function(){return sr}),n.d(e,"Ellipse",function(){return rr}),n.d(e,"GeoJSON",function(){return nr}),n.d(e,"Geometry",function(){return Ri}),n.d(e,"GeometryCollection",function(){return Xi}),n.d(e,"Label",function(){return mr}),n.d(e,"LineString",function(){return qi}),n.d(e,"Marker",function(){return Wi}),n.d(e,"MultiLineString",function(){return $i}),n.d(e,"MultiPoint",function(){return Ki}),n.d(e,"MultiPolygon",function(){return tr}),n.d(e,"Polygon",function(){return Ui}),n.d(e,"QuadBezierCurve",function(){return cr}),n.d(e,"Rectangle",function(){return or}),n.d(e,"Sector",function(){return ar}),n.d(e,"TextBox",function(){return pr}),n.d(e,"TextMarker",function(){return dr});
- /*!
- * maptalks v0.41.1
- * LICENSE : BSD-3-Clause
- * (c) 2016-2018 maptalks.org
- */
- var o="_maptalks__internal_layer_",a=["MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],s=["FeatureCollection","Feature","Point","LineString","Polygon"].concat(a),h=["markerFile","polygonPatternFile","linePatternFile","markerFillPatternFile","markerLinePatternFile"],u=[["markerWidth","markerHeight"],[],[null,"lineWidth"],[],[null,"markerLineWidth"]],c={lineWidth:1,lineOpacity:1,lineDx:1,lineDy:1,polygonOpacity:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerOpacity:1,markerFillOpacity:1,markerLineWidth:1,markerLineOpacity:1,textSize:1,textOpacity:1,textHaloRadius:1,textWrapWidth:1,textLineSpacing:1,textDx:1,textDy:1},l=["lineColor","polygonFill","markerFill","markerLineColor","textFill"];function f(){return Date.now()}function d(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function p(t){return null==t}function m(t){return"number"==typeof t&&!isNaN(t)}function g(t){return(0|t)===t}function v(t){return"object"==typeof t&&!!t}function y(t){return!p(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function _(t){return!p(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}var x=Object.prototype.hasOwnProperty;function w(t,e){return x.call(t,e)}var b=Math.PI/180;function M(t){return t*b}function E(t){return t/b}var S,T,C="[object process]"===Object.prototype.toString.call(void 0!==t?t:0)&&!t.versions.electron&&!t.versions.nw&&!t.versions["node-webkit"];function P(t){return t.length>4&&".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<arguments.length;e++){var n=arguments[e];if(n)for(var i=0,r=n.length;i<r;i++)t.push(n[i])}return t.length}function k(t,e){var n=e.indexOf(t);n>-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;a<s;a++)p(i=t[a])?o.push(null):Array.isArray(i)?o.push(N(i,e,n)):(r=n?e.call(n,i):e(i),o.push(r));return o}function z(t,e){return void 0===t?e:t}function F(t){return Math.sign?Math.sign(t):0===(t=+t)||isNaN(t)?Number(t):t>0?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<n.length;o++)r[o]=255&n.charCodeAt(o);return new Blob([i],{type:e})}function Q(t,e,n,i){var r=n-t,o=i-e;return Math.atan2(o,r)}var $="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function tt(t,e){if(!t&&!e)return!0;if(!t||!e)return!1;for(var n in t)if("center"===n){if(!e[n]||!et(t[n][0],e[n][0])||!et(t[n][1],e[n][1]))return!1}else if(t[n]!==e[n])return!1;return!0}function et(t,e,n){return null==n&&(n=1e-6),t>=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 t<e?-1:t>e?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.length;n++){var i=void 0;i=!0===t[n].filter?function(){return!0}:rt(t[n].filter),e.push(mt({},t[n],{filter:i}))}return e}function mt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function gt(t,e){var n;if(bt(t)){var i,r=t.stops&&"object"==typeof t.stops[0][0],o=r||void 0!==t.property,a=r||!o,s=t.type||e||"exponential";if("exponential"===s)i=_t;else if("interval"===s)i=yt;else if("categorical"===s)i=vt;else{if("identity"!==s)throw new Error('Unknown function type "'+s+'"');i=xt}if(r){for(var h={},u=[],c=0;c<t.stops.length;c++){var l=t.stops[c];void 0===h[l[0].zoom]&&(h[l[0].zoom]={zoom:l[0].zoom,type:t.type,property:t.property,stops:[]}),h[l[0].zoom].stops.push([l[0].value,l[1]])}for(var f in h)u.push([h[f].zoom,gt(h[f])]);(n=function(e,n){return _t({stops:u,base:t.base},e)(e,n)}).isFeatureConstant=!1,n.isZoomConstant=!1}else a?((n=function(e){return i(t,e)}).isFeatureConstant=!0,n.isZoomConstant=!1):((n=function(e,n){return i(t,n[t.property])}).isFeatureConstant=!1,n.isZoomConstant=!0)}else(n=function(){return t}).isFeatureConstant=!0,n.isZoomConstant=!0;return n}function vt(t,e){for(var n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.stops[0][1]}function yt(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function _t(t,e){for(var n=void 0!==t.base?t.base:1,i=0;!(i>=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<r.length;s++)a[s]=wt(t,e,n,i,r[s],o[s]);return a}(e,n,i,r,o,a):wt(e,n,i,r,o,a)}(e,n,t.stops[i-1][0],t.stops[i][0],t.stops[i-1][1],t.stops[i][1])}function xt(t,e){return e}function wt(t,e,n,i,r,o){var a,s=i-n,h=t-n;return r*(1-(a=1===e?h/s:(Math.pow(e,h)-1)/(Math.pow(e,s)-1)))+o*a}function bt(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function Mt(t){for(var e in t)if(bt(t[e]))return!0;return!1}function Et(t){return gt(t,"exponential")}function St(t,e){if(!t)return null;var n=!1;if(Array.isArray(t)){for(var i,r=[],o=0;o<t.length;o++)(i=St(t[o],e))?(r.push(i),n=!0):r.push(t[o]);return n?r:t}var a,s={__fn_types_loaded:!0},h=[];for(a in t)t.hasOwnProperty(a)&&h.push(a);for(var u=0,c=h.length;u<c;u++)bt(t[a=h[u]])?(n=!0,s["_"+a]=t[a],function(t){Object.defineProperty(s,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=Et(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})}(a)):s[a]=t[a];return n?s:t}function Tt(t){if(!t||!t.stops)return[];for(var e=[],n=0,i=t.stops.length;n<i;n++)e.push(t.stops[n][1]);return e}var Ct=Object.freeze({createFilter:rt,getFilterFeature:dt,compileStyle:pt,isFunctionDefinition:bt,hasFunctionDefinition:Mt,interpolated:Et,piecewiseConstant:function(t){return gt(t,"interval")},loadFunctionTypes:St,getFunctionTypeResources:Tt});function Pt(t){var e={stroke:{stroke:t.markerLineColor,"stroke-width":t.markerLineWidth,"stroke-opacity":t.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:t.markerFill,"fill-opacity":t.markerFillOpacity}};return 0===e.stroke["stroke-width"]&&(e.stroke["stroke-opacity"]=0),e}function At(t,e,n){if(!t.markerPath)return null;var i=1,r=Pt(t);m(t.markerOpacity)&&(i=t.markerOpacity),m(t.opacity)&&(i*=t.opacity);var o={};if(r){for(var a in r.stroke)r.stroke.hasOwnProperty(a)&&(p(r.stroke[a])||(o[a]=r.stroke[a]));for(var s in r.fill)r.fill.hasOwnProperty(s)&&(p(r.fill[s])||(o[s]=r.fill[s]))}for(var h,u=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath],c=[],l=0;l<u.length;l++)(h=d({},h=y(u[l])?{path:u[l]}:u[l],o)).d=h.path,delete h.path,c.push(h);var f=['<svg version="1.1"','xmlns="http://www.w3.org/2000/svg"'];i<1&&f.push('opacity="'+i+'"'),t.markerPathWidth&&t.markerPathHeight&&f.push('viewBox="0 0 '+t.markerPathWidth+" "+t.markerPathHeight+'"'),f.push('preserveAspectRatio="none"'),e&&f.push('width="'+e+'"'),n&&f.push('height="'+n+'"'),f.push("><defs></defs>");for(var g=0;g<c.length;g++){var v="<path ";for(var _ in c[g])c[g].hasOwnProperty(_)&&(v+=" "+_+'="'+c[g][_]+'"');v+="></path>",f.push(v)}return f.push("</svg>"),"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<c.length;f++)if(bt(i=t[c[f]])&&(i=Tt(i)),i){Array.isArray(i)||(i=[i]);for(var d=0;d<i.length;d++)"url("===i[d].slice(0,4)&&(i[d]=X(i[d])),r=u[f],s.push([i[d],t[r[0]],t[r[1]]])}if("path"===t.markerType&&t.markerPath)if(o=bt(t.markerWidth)?200:t.markerWidth,a=bt(t.markerHeight)?200:t.markerHeight,bt(t.markerPath)){i=Tt(t.markerPath);for(var p=t.markerPath,m=0;m<i.length;m++)t.markerPath=i[m],s.push([At(t),o,a]);t.markerPath=p}else s.push([At(t),o,a])}return s}function Rt(t){if(!t)return null;var e=t;if(C)return e;for(var n,i=h,r=0,o=i.length;r<o;r++)(n=e[i[r]])&&(e[i[r]]=Ot(n));return e}function Ot(t){if(bt(t)){for(var e=t.stops,n=0;n<e.length;n++)e[n][1]=Ot(e[n][1]);return t}return"url("===t.slice(0,4)&&(t=X(t)),!V(t)&&(t.length<="data:".length||"data:"!==t.substring(0,"data:".length))&&(t=function(t,e){var n=t.split("/"),i=e.split("/");if(0===e.slice(0,1))return n.slice(0,3).join("/")+e;n.pop();for(var r=0;r<i.length;r++)"."!==i[r]&&(".."===i[r]?n.pop():n.push(i[r]));return n.join("/")}(location.href,t)),t}function It(t){return t&&t.colorStops}function Dt(t){var e=[t.type];if(t.places&&e.push(t.places.join()),t.colorStops){for(var n=[],i=t.colorStops.length-1;i>=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;r<t.length;r++){var o=d({},t[r]);n(o,e),i.push(o)}}else n(i=d({},t),e);return i}function Nt(t){var e=Array.prototype.slice.call(arguments,1);if(e&&e.length||(e=[{}]),Array.isArray(t)){for(var n,i,r=[],o=0,a=t.length;o<a;o++){n=t[o],i={};for(var s=0,h=e.length;s<h;s++)Array.isArray(e[s])?p(e[s][o])?d(i,n||{}):d(i,n,e[s][o]):d(i,n,e[s]?e[s]:{});r.push(i)}return r}var u=[{},t];return u.push.apply(u,e),d.apply(this,u)}var zt=Object.freeze({now:f,extend:d,isNil:p,isNumber:m,isInteger:g,isObject:v,isString:y,isFunction:_,hasOwn:w,join:function(t,e){return t.join?t.join(e||","):Array.prototype.join.call(t,e||",")},toRadian:M,toDegree:E,IS_NODE:C,get requestAnimFrame(){return S},get cancelAnimFrame(){return T},isSVG:P,loadImage:A,UID:R,GUID:O,parseJSON:I,pushIn:D,removeFromArray:k,forEachCoord:N,getValueOrDefault:z,sign:F,log2:B,interpolate:j,wrap:G,clamp:H,isArrayHasData:U,isURL:V,isCssUrl:q,extractCssUrl:X,btoa:J,b64toBlob:K,computeDegree:Q,emptyImageUrl:$,equalMapView:tt,flash:nt,_defaults:function(t,e){for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(e,r);o&&o.configurable&&void 0===t[r]&&Object.defineProperty(t,r,o)}return t},translateToSVGStyles:Pt,getMarkerPathBase64:At,getExternalResources:Lt,convertResourceUrl:Rt,isGradient:It,getGradientStamp:Dt,getSymbolStamp:function t(e){var n=[];if(Array.isArray(e)){for(var i=0;i<e.length;i++)n.push(t(e[i]));return"[ "+n.join(" , ")+" ]"}for(var r in e)w(e,r)&&(_(e[r])||(It(e[r])?n.push(r+"="+Dt(e[r])):n.push(r+"="+e[r])));return n.join(";")},lowerSymbolOpacity:kt,extendSymbol:Nt}),Ft={};if(!C){var Bt=navigator.userAgent.toLowerCase(),jt=document.documentElement,Gt="ActiveXObject"in window,Ht=-1!==Bt.indexOf("webkit"),Ut=-1!==Bt.indexOf("phantom"),Vt=-1!==Bt.search("android [23]"),Wt=-1!==Bt.indexOf("chrome"),Zt=-1!==Bt.indexOf("gecko")&&!Ht&&!window.opera&&!Gt,qt="undefined"!=typeof orientation||-1!==Bt.indexOf("mobile"),Xt=!window.PointerEvent&&window.MSPointerEvent,Yt=window.PointerEvent&&navigator.pointerEnabled||Xt,Jt=Gt&&"transition"in jt.style,Kt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Vt,Qt="MozPerspective"in jt.style,$t="OTransition"in jt.style,te=(Jt||Kt||Qt)&&!$t&&!Ut,ee=0;Wt&&(ee=Bt.match(/chrome\/([\d.]+)/)[1]);var ne,ie=!Ut&&(Yt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch);try{var re=document.createElement("canvas"),oe=re.getContext("webgl")||re.getContext("experimental-webgl");ne=oe&&oe instanceof WebGLRenderingContext}catch(t){ne=!1}Ft={ie:Gt,ielt9:Gt&&!document.addEventListener,edge:"msLaunchUri"in navigator&&!("documentMode"in document),webkit:Ht,gecko:Zt,android:-1!==Bt.indexOf("android"),android23:Vt,chrome:Wt,chromeVersion:ee,safari:!Wt&&-1!==Bt.indexOf("safari"),phantomjs:Ut,ie3d:Jt,webkit3d:Kt,gecko3d:Qt,opera12:$t,any3d:te,mobile:qt,mobileWebkit:qt&&Ht,mobileWebkit3d:qt&&Kt,mobileOpera:qt&&window.opera,mobileGecko:qt&&Zt,touch:!!ie,msPointer:!!Xt,pointer:!!Yt,retina:(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,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<l;c++){var f=t[c],d=ve(h+f);d>=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;f<d;f++){var p=l[f],m=ve(p,n);if(m>u)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;b<w.length;b++){var M=w[b].width;M>c&&(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<t.length;n++)if(t[n]in e)return t[n];return!1},Le=Ae(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),Re=Ae(["transformOrigin","WebkitTransformOrigin","OTransformOrigin","MozTransformOrigin","msTransformOrigin"]),Oe=Ae(["transition","WebkitTransition","OTransition","MozTransition","msTransition"]),Ie=Ae(["filter","WebkitFilter","OFilter","MozFilter","msFilter"]);function De(t,e){var n=document.createElement(t);return e&&Ye(n,e),n}function ke(t,e,n){var i=De(t);return e&&Ze(i,e),n&&n.appendChild(i),i}function Ne(t){if(!t)return this;if(ae.ielt9||ae.ie9){var e=De("div");e.appendChild(t),e.innerHTML="",e=null}else t.parentNode&&t.parentNode.removeChild(t);return this}function ze(t,e,n,i){if(!(t&&t.addEventListener&&e&&n))return this;for(var r=function(e){e||(e=window.event),n.call(i||t,e)},o=e.split(" "),a=o.length-1;a>=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<u;h++)i(s[h].callback);return delete t["Z__"+a],this}var c=Be(t,a,n);if(c<0)return this;i(a,t["Z__"+a][c].callback),t["Z__"+a].splice(c,1)}}return this}function Be(t,e,n){if(!t||!t["Z__"+e]||!n)return-1;for(var i=t["Z__"+e],r=0,o=i.length;r<o;r++)if(i[r].src===n)return r;return-1}function je(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ge(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this}function He(t){return t.onselectstart=function(){return!1},t.ondragstart=function(){return!1},t.setAttribute("unselectable","on"),this}function Ue(t,e){return t?(ae.any3d?Ke(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px"),e):null}function Ve(t){var e=window.getComputedStyle(t),n=[parseInt(e["padding-left"]),parseInt(e["padding-top"])],i=t.getBoundingClientRect(),r=t.offsetWidth,o=t.offsetHeight,a=r?i.width/r:1,s=o?i.height/o:1;return t.__position=[i.left+n[0],i.top+n[1],a,s],t.__position}function We(t,e){t||(t=window.event);var n=e.__position;return n||(n=Ve(e)),new ce((t.clientX-n[0]-e.clientLeft)/n[2],(t.clientY-n[1]-e.clientTop)/n[3])}function Ze(t,e){var n=t.style.cssText;return function(t,e){var n=t.length-e.length;return n>=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<o;r++)t.classList.add(i[r]);return this}function Ye(t,e){return p(t.className.baseVal)?t.className=e:t.className.baseVal=e,this}function Je(t){return p(t.className.baseVal)?t.className:t.className.baseVal}function Ke(t,e){var n=e||new ce(0,0);return t.style[Le]=ae.any3d?"translate3d("+n.x+"px,"+n.y+"px,0px)":"translate("+n.x+"px,"+n.y+"px)",this}function Qe(t){return/<[a-z\][\s\S]*>/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;d<p&&(a=e[d].text,s=Ee(e[d].size,n.textHorizontalAlignment,n.textVerticalAlignment),sn._textOnLine(t,a,c.add(s.x,d*u),n.textHaloRadius,n.textHaloFill,n.textHaloOpacity),!(l>0&&(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;u<c;u++)if(o=e[u],!s||t.setLineDash)t.lineTo(o.x,o.y),h&&u>0&&(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;s<h;s++)U(e[s])&&(sn._ring(t,e[s],null,0,!0),a=i,s>0&&(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;s<h;s++)U(e[s])&&(o?(sn.paintSmoothLine(t,e[s],n,o,!0),t.closePath()):sn._ring(t,e[s],r,n),c||(a=i,s>0&&(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<u;c++){var l=e[c].x,f=e[c].y,d=void 0,p=void 0,m=void 0,g=void 0,v=void 0,y=void 0;c-1<0?r?(d=e[u-1].x,p=e[u-1].y):(d=e[c+1].x,p=e[c+1].y):(d=e[c-1].x,p=e[c-1].y),c+1<h?(m=e[c+1].x,g=e[c+1].y):(m=e[c+1-h].x,g=e[c+1-h].y),c+2<h?(v=e[c+2].x,y=e[c+2].y):r?(v=e[c+2-h].x,y=e[c+2-h].y):(v=e[c].x,y=e[c].y);var _=w(d,p,l,f,m,g,v,y,i,c===u-1?a:1);if(c===u-1&&a>=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;a<s;a++){i=o[a],(r=this._eventMap[i])||(r=[],this._eventMap[i]=r);var h=r.length;if(h>0)for(var u=0;u<h;u++)if(e===r[u].handler&&r[u].context===n)return this;r.push({handler:e,context:n})}return this},n.addEventListener=function(){return this.on.apply(this,arguments)},n.once=function(t,e,n){if(!y(t)){var i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=this._wrapOnceHandler(r,t[r],n));return this._switch("on",i)}for(var o=t.split(" "),a=0,s=o.length;a<s;a++)this.on(o[a],this._wrapOnceHandler(o[a],e,n));return this},n.off=function(t,e,n){if(!this._eventMap||!t)return this;if(!y(t))return this._switch("off",t,e);if(!e)return this;var i,r,o,a=t.split(" ");n||(n=this);for(var s=0,h=a.length;s<h;s++){if(o="Z__"+(i=a[s].toLowerCase()),!(r=this._eventMap[i]))return this;for(var u=r.length-1;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;o<a;o++)if(e){if(e===i[o].handler&&(p(n)||i[o].context===n))return 1}else r++;return r},n.copyEventListeners=function(t){var e,n=t._eventMap;if(!n)return this;for(var i in n)for(var r=0,o=(e=n[i]).length;r<o;r++)this.on(i,e[r].handler,e[r].context);return this},n.fire=function(){return this._eventParent?this._eventParent.fire.apply(this._eventParent,arguments):this._fire.apply(this,arguments)},n._wrapOnceHandler=function(t,e,n){var i=this,r="Z__"+t,o=!1,a=function s(){o||(delete a[r],o=!0,n?e.apply(n,arguments):e.apply(this,arguments),i.off(t,s,this))};return a[r]=e,a},n._switch=function(t,e,n){for(var i in e)e.hasOwnProperty(i)&&this[t](i,e[i],n);return this},n._clearListeners=function(t){this._eventMap&&y(t)&&(this._eventMap[t.toLowerCase()]&&(this._eventMap[t]=null))},n._clearAllListeners=function(){this._eventMap=null},n._setEventParent=function(t){return this._eventParent=t,this},n._fire=function(t,e){if(!this._eventMap)return this;var n=this._eventMap[t.toLowerCase()];if(!n)return this;e||(e={}),e.type=t,e.target=this;for(var i,r,o=n.slice(0),a=0,s=o.length;a<s;a++)o[a]&&(i=o[a].context,!0,r=d({},e),!1===(i?o[a].handler.call(i,r):o[a].handler(r))&&e.domEvent&&Ge(e.domEvent));return this},e}(t)},dn=function(){function t(t){this.target=t}var e=t.prototype;return e.enable=function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},e.disable=function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},e.enabled=function(){return!!this._enabled},e.remove=function(){this.disable(),delete this.target,delete this.dom},t}(),pn=fn(dn),mn=function(){function t(t){if(!this||!this.setOptions)throw new Error('Class instance is being created without "new" operator.');this.setOptions(t),this.callInitHooks()}var e=t.prototype;return e.callInitHooks=function(){var t=Object.getPrototypeOf(this);return this._visitInitHooks(t),this},e.setOptions=function(t){if(this.hasOwnProperty("options")||(this.options=this.options?Object.create(this.options):{}),!t)return this;for(var e in t)this.options[e]=t[e];return this},e.config=function(t){if(!t){var e={};for(var n in this.options)this.options.hasOwnProperty(n)&&(e[n]=this.options[n]);return e}if(2===arguments.length){var i={};i[t]=arguments[1],t=i}for(var r in t)this.options[r]=t[r],this[r]&&this[r]instanceof pn&&(t[r]?this[r].enable():this[r].disable());return this.onConfig(t),this},e.onConfig=function(){},e._visitInitHooks=function(t){if(!this._initHooksCalled){var e=Object.getPrototypeOf(t);e._visitInitHooks&&e._visitInitHooks.call(this,e),this._initHooksCalled=!0;var n=t._initHooks;if(n&&n!==e._initHooks)for(var i=0;i<n.length;i++)n[i].call(this)}},t.addInitHook=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r="function"==typeof t?t:function(){this[t].apply(this,n)},o=this.prototype,a=Object.getPrototypeOf(o);return o._initHooks&&o._initHooks!==a._initHooks||(o._initHooks=[]),o._initHooks.push(r),this},t.include=function(){for(var t=0;t<arguments.length;t++)d(this.prototype,t<0||arguments.length<=t?void 0:arguments[t]);return this},t.mergeOptions=function(t){var e=this.prototype,n=Object.getPrototypeOf(e);return e.options&&e.options!==n.options||(e.options=e.options?Object.create(e.options):{}),d(e.options,t),this},t}(),gn={},vn=function(t){return function(t){function e(){return t.apply(this,arguments)||this}return se(e,t),e.registerJSONType=function(t){return t?(gn[t]=this,this):this},e.getJSONClass=function(t){return t?gn[t]:null},e.prototype.getJSONType=function(){if(void 0===this._jsonType){var t=Object.getPrototypeOf(this).constructor;for(var e in gn)if(gn[e]===t){this._jsonType=e;break}}if(!this._jsonType)throw new Error("Found an unregistered geometry class!");return this._jsonType},e}(t)};function yn(t){return function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addHandler=function(t,e){if(!e)return this;if(this._handlers||(this._handlers=[]),this[t])return this[t].enable(),this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},n.removeHandler=function(t){if(!t)return this;var e=this[t];if(e){var n=this._handlers.indexOf(e);n>=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;t<e;t++)this._handlers[t].remove();this._handlers=[]},e}(t)}var _n={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},xn={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},wn=function(t){function e(e,n){var i;return void 0===n&&(n={}),(i=t.call(this,null)||this).dom=e,i.options=n,i}se(e,t);var n=e.prototype;return n.enable=function(){return this.dom?(this._onMouseDown=function(t){return this.onMouseDown(t)},en(this.dom,"touchstart mousedown",this._onMouseDown,this),this):this},n.disable=function(){return this.dom?(this._offEvents(),nn(this.dom,"touchstart mousedown",this._onMouseDown),delete this._onMouseDown,this):this},n.onMouseDown=function(t){if((this.options.rightclick||2!==t.button)&&!(t.touches&&t.touches.length>1||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;i<r;i++){var o=t[i];Array.isArray(o)?m(o[0])?n.push(new e(o)):n.push(e.toCoordinates(o)):n.push(new e(o))}return n},e}(ue),Mn=function(){function t(t,e){this.type=t,this.properties=e}return t.createProj4=function(e){return new t("proj4",{proj:e})},t.fromProjectionCode=function(e){return e&&t[e=e.toUpperCase().replace(":","")]||null},t}();Mn.WGS84=Mn.createProj4("+proj=longlat +datum=WGS84 +no_defs"),Mn.EPSG4326=Mn.WGS84,Mn.EPSG3857=Mn.createProj4("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"),Mn.IDENTITY=Mn.createProj4("+proj=identity +no_defs"),Mn.CGCS2000=Mn.createProj4("+proj=longlat +datum=CGCS2000"),Mn.EPSG4490=Mn.CGCS2000,Mn.BD09LL=Mn.createProj4("+proj=longlat +datum=BD09"),Mn.GCJ02=Mn.createProj4("+proj=longlat +datum=GCJ02");var En=function(){function t(t,e,n,i){this._clazz=bn;var r=arguments.length,o=r>0?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)&&n<t.pxmax&&(n=t.pxmax):n=t.pxmax;var i=this.pymin;m(i)?m(t.pymin)&&i>t.pymin&&(i=t.pymin):i=t.pymin;var r=this.pymax;m(r)?m(t.pymax)&&r<t.pymax&&(r=t.pymax):r=t.pymax;var o=this.projection;if(o){var a=o.unproject(new this._clazz(e,i)),s=o.unproject(new this._clazz(n,r));e=a.x,i=a.y,n=s.x,r=s.y}return[e,i,n,r]},e._combine=function(t){if(!t)return this;var e=this.__combine(t);return this.xmin=e[0],this.ymin=e[1],this.xmax=e[2],this.ymax=e[3],this._dirty=!0,this},e.combine=function(t){if(!t)return this;var e=this.__combine(t);return new this.constructor(e[0],e[1],e[2],e[3],this.projection)},e.intersection=function(t){if(!this.intersects(t))return null;var e=new this._clazz(Math.max(this.pxmin,t.pxmin),Math.max(this.pymin,t.pymin)),n=new this._clazz(Math.min(this.pxmax,t.pxmax),Math.min(this.pymax,t.pymax)),i=this.projection;return i&&(e=i.unproject(e),n=i.unproject(n)),new this.constructor(e,n,i)},e.expand=function(t){var e,n;return m(t)?e=n=t:(e=t.width||t.x||t[0]||0,n=t.height||t.y||t[1]||0),new this.constructor(this.xmin-e,this.ymin-n,this.xmax+e,this.ymax+n,this.projection)},e._expand=function(t){var e,n;return m(t)?e=n=t:(e=t.width||t.x||t[0]||0,n=t.height||t.y||t[1]||0),this.xmin-=e,this.ymin-=n,this.xmax+=e,this.ymax+=n,this._dirty=!0,this},e.toJSON=function(){return{xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax}},e.toArray=function(){var t=this.xmin,e=this.ymin,n=this.xmax,i=this.ymax;return[new this._clazz([t,i]),new this._clazz([n,i]),new this._clazz([n,e]),new this._clazz([t,e]),new this._clazz([t,i])]},e.toString=function(){return this.xmin+","+this.ymin+","+this.xmax+","+this.ymax},e.copy=function(){return new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection)},e.convertTo=function(t){if(!this.isValid())return null;var e=new this.constructor,n=new this._clazz(this.xmin,this.ymax);return e._combine(t(n)),n.x=this.xmax,e._combine(t(n)),n.y=this.ymin,e._combine(t(n)),n.x=this.xmin,e._combine(t(n)),e},e._project=function(t){if(t&&t.isValid()){var e=this.projection;if(e){if(t._dirty){var n=[t.getMin(),t.getMax()],i=(n=e.projectCoords(n))[0],r=n[1];t.pxmin=Math.min(i.x,r.x),t.pymin=Math.min(i.y,r.y),t.pxmax=Math.max(i.x,r.x),t.pymax=Math.max(i.y,r.y)}delete t._dirty}else t.pxmin=t.xmin,t.pxmax=t.xmax,t.pymin=t.ymin,t.pymax=t.ymax}},t}(),Sn=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,i,r)||this)._clazz=ce,o}return se(e,t),e}(En),Tn=function(){function t(t){this.matrix=t}var e=t.prototype;return e.transform=function(t,e){return new ce(this.matrix[0]*(t.x-this.matrix[2])/e,this.matrix[1]*(t.y-this.matrix[3])/e)},e.untransform=function(t,e){return new bn(t.x*e/this.matrix[0]+this.matrix[2],t.y*e/this.matrix[1]+this.matrix[3])},t}(),Cn={project:function(){},unproject:function(){},projectCoords:function(t){var e=this;if(!t)return[];if(!Array.isArray(t))return this.project(t);if(0===t.length)return[];if(!this.isSphere())return N(t,this.project,this);if(Array.isArray(t[0]))return t.map(function(t){return e.projectCoords(t)});for(var n,i,r,o,a,s,h=this.getCircum(),u=this.getSphereExtent(),c=u.sx,l=u.sy,f=t[0],d=[this.project(f)],p=1,m=t.length;p<m;p++)o=(r=t[p]).x-f.x,a=r.y-f.y,s=this.project(r),Math.abs(o)>180&&(void 0===n&&(n=r.x<f.x),n&&(s._add(-h.x*F(o)*c,0),r._add(-360*F(o),0))),Math.abs(a)>90&&(void 0===i&&(i=r.y<f.y),i&&(s._add(0,-h.y*F(a)*l),r._add(0,-180*F(a)))),f=r,d.push(s);return d},unprojectCoords:function(t){return t?Array.isArray(t)?N(t,this.unproject,this):this.unproject(t):[]},isSphere:function(){return!!this.sphere},isOutSphere:function(t){return!!this.isSphere()&&!this.getSphereExtent().contains(t)},wrapCoord:function(t){if(!this.isSphere())return t;var e=this.getSphereExtent(),n=new bn(t);return e.contains(n)||(n.x=G(t.x,e.xmin,e.xmax),n.y=G(t.y,e.ymin,e.ymax)),n},getCircum:function(){if(!this.circum&&this.isSphere()){var t=this.getSphereExtent();this.circum={x:t.getWidth(),y:t.getHeight()}}return this.circum},getSphereExtent:function(){if(!this.extent&&this.isSphere()){var t=this.project(new bn(180,90)),e=this.project(new bn(-180,-90));this.extent=new En(e,t,this),this.extent.sx=t.x>e.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;i<r-1;i++)n+=this.measureLenBetween(t[i],t[i+1]);return n}},An=d({measure:"IDENTITY",measureLenBetween:function(t,e){if(!t||!e)return 0;try{return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}catch(t){return 0}},measureArea:function(t){if(!Array.isArray(t))return 0;for(var e=0,n=0,i=t.length;n<i;n++){var r=t[n],o=null;o=n===i-1?t[0]:t[n+1],e+=r.x*o.y-r.y*o.x}return Math.abs(e/2)},locate:function(t,e,n){return t=new bn(t.x,t.y),this._locate(t,e,n)},_locate:function(t,e,n){return t?(e||(e=0),n||(n=0),e||n?(t.x=t.x+e,t.y=t.y+n,t):t):null},rotate:function(t,e,n){return t=new bn(t.x,t.y),this._rotate(t,e,n)},_rotate:function(){var t=new ce(0,0);return function(e,n,i){return t.x=e.x-n.x,t.y=e.y-n.y,t._rotate(i*Math.PI/180),e.x=n.x+t.x,e.y=n.y+t.y,e}}()},Pn),Ln=function(){function t(t){this.radius=t}var e=t.prototype;return e.measureLenBetween=function(t,e){if(!t||!e)return 0;var n=M(t.y),i=M(e.y),r=n-i,o=M(t.x)-M(e.x);return n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(r/2),2)+Math.cos(n)*Math.cos(i)*Math.pow(Math.sin(o/2),2))),n*=this.radius,Math.round(1e5*n)/1e5},e.measureArea=function(t){var e,n=M(this.radius),i=0,r=t,o=r.length;if(o<3)return 0;for(e=0;e<o-1;e++){var a=r[e],s=r[e+1];i+=a.x*n*Math.cos(M(a.y))*s.y*n-s.x*n*Math.cos(M(s.y))*a.y*n}return o=r[e],r=r[0],i+=o.x*n*Math.cos(M(o.y))*r.y*n-r.x*n*Math.cos(M(r.y))*o.y*n,.5*Math.abs(i)},e.locate=function(t,e,n){return t=new bn(t.x,t.y),this._locate(t,e,n)},e._locate=function(t,e,n){if(!t)return null;if(e||(e=0),n||(n=0),!e&&!n)return t;var i,r,o=M(t.y);if(0!==n){var a=Math.abs(n);r=G(180*(o+=2*Math.sin(a/(2*this.radius))*(n>0?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<r;i++)if(n>=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<i;n++)if(r.y>=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(;t<e;)t+=n-e;return t}}),Un=d({},Cn,{code:"IDENTITY",project:function(t){return t.copy()},unproject:function(t){return t.copy()}},An),Vn=Bn,Wn=Object.freeze({EPSG3857:Bn,DEFAULT:Vn,EPSG4326:jn,EPSG4490:Gn,BAIDU:Hn,IDENTITY:Un,Common:Cn}),Zn=function(t){return function(t){function e(){return t.apply(this,arguments)||this}return se(e,t),e.registerRenderer=function(t,e){var n=this.prototype,i=Object.getPrototypeOf(n);return n._rendererClasses&&n._rendererClasses!==i._rendererClasses||(n._rendererClasses=n._rendererClasses?Object.create(n._rendererClasses):{}),n._rendererClasses[t.toLowerCase()]=e,this},e.getRendererClass=function(t){var e=this.prototype;return e._rendererClasses?e._rendererClasses[t.toLowerCase()]:null},e}(t)},qn="undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:{};function Xn(t,e){return t(e={exports:{}},e.exports),e.exports}var Yn=Xn(function(t){!function(e){function n(t){if(t){var e=this;t(function(t){e.resolve(t)},function(t){e.reject(t)})}}function i(t,e){if("function"==typeof t.y)try{var n=t.y.call(s,e);t.p.resolve(n)}catch(e){t.p.reject(e)}else t.p.resolve(e)}function o(t,e){if("function"==typeof t.n)try{var n=t.n.call(s,e);t.p.resolve(n)}catch(e){t.p.reject(e)}else t.p.reject(e)}var a,s,h="fulfilled",u="undefined",c=function(){function t(){for(;n.length-i;){try{n[i]()}catch(t){e.console&&e.console.error(t)}n[i++]=s,i==o&&(n.splice(0,o),i=0)}}var n=[],i=0,o=1024,a=function(){if(typeof MutationObserver!==u){var e=document.createElement("div");return new MutationObserver(t).observe(e,{attributes:!0}),function(){e.setAttribute("a",0)}}return typeof r!==u?function(){r(t)}:function(){setTimeout(t,0)}}();return function(t){n.push(t),n.length-i==1&&a()}}();n.prototype={resolve:function(t){if(this.state===a){if(t===this)return this.reject(new TypeError("Attempt to resolve promise with self"));var e=this;if(t&&("function"==typeof t||"object"==typeof t))try{var n=!0,r=t.then;if("function"==typeof r)return void r.call(t,function(t){n&&(n=!1,e.resolve(t))},function(t){n&&(n=!1,e.reject(t))})}catch(t){return void(n&&this.reject(t))}this.state=h,this.v=t,e.c&&c(function(){for(var n=0,r=e.c.length;r>n;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;a<t.length;a++)e(t[a],a);return t.length||o.resolve(i),o},t.exports&&(t.exports=n),e.define&&e.define.amd&&e.define([],function(){return n}),e.Zousan=n,n.soon=c}(qn)}),Jn="undefined"!=typeof Promise?Promise:Yn,Kn=function(t){function e(e){var n;return(n=t.call(this)||this).layer=e,n._painted=!1,n._drawTime=0,n.setToRedraw(),n}se(e,t);var n=e.prototype;return n.render=function(t){var e=this;if(this.prepareRender(),this.getMap()&&this.layer.isVisible())if(this.resources||(this.resources=new Qn),this.checkResources){var n=this.checkResources();n.length>0?(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.maxZoom<e||!p(this.options.minZoom)&&this.options.minZoom>e)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.length;a++)if(r[a]!==o[a])return!1}return!0};var e=t.prototype;return e._initSpatialRef=function(){var e=this.options.projection;if(!(e=e?t.getProjectionInstance(e):Vn))throw new Error("must provide a valid projection in map's spatial reference.");(e=d({},Cn,e)).measureLength||d(e,zn.DEFAULT),this._projection=e;var n,i=this.options.resolutions;if(!i&&(e.code&&(n=ei[e.code])&&(i=n.resolutions),!i))throw new Error("must provide valid resolutions in map's spatial reference.");this._resolutions=i;var r=this.options.fullExtent;if(!r&&(e.code&&(n=ei[e.code])&&(r=n.fullExtent),!r))throw new Error("must provide a valid fullExtent in map's spatial reference.");if(p(r.left)?(this._fullExtent=new En(r),r.left=r.xmin,r.right=r.xmax,r.top=r.ymax,r.bottom=r.ymin):this._fullExtent=new En(new bn(r.left,r.top),new bn(r.right,r.bottom)),p(r.top)||p(r.bottom)||p(r.left)||p(r.right))throw new Error("must provide valid top/bottom/left/right in fullExtent.");d(this._fullExtent,r),this._projection.fullExtent=r;var o=r.right>=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<this._resolutions.length;t++)if(!p(this._resolutions[t]))return t;return 0},e.getMaxZoom=function(){for(var t=this._resolutions.length-1;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<r-1;o++)if(e[o]){var a=e[o+1]-e[o],s=t-e[o];if(F(a)===F(s)&&Math.abs(a)>=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&&t<this._zoomLevel&&this.setZoom(t),this.options.maxZoom=t,this},n.getMinZoom=function(){return p(this.options.minZoom)?this._spatialReference.getMinZoom():this.options.minZoom},n.setMinZoom=function(t){if(null!==t){var e=this._spatialReference.getMinZoom();t<e&&(t=e),t>this._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;n<i;n++){var r=t[n],o=r.getId();if(p(o))throw new Error("Invalid id for the layer: "+o);if(r.getMap()!==this){if(this._layerCache[o])throw new Error("Duplicate layer id in the map: "+o);this._layerCache[o]=r,r._bindMap(this),e.push(r),this._loaded&&r.load()}}return this._sortLayersByZIndex(),this._fireEvent("addlayer",{layers:t}),this},n.removeLayer=function(t){if(!t)return this;if(!Array.isArray(t))return this.removeLayer([t]);for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];if(r instanceof $n||(r=this.getLayer(r)),r){var o=r.getMap();if(o&&o===this){e.push(r),this._removeLayer(r,this._layers),this._loaded&&r._doRemove();var a=r.getId();this._layerCache&&delete this._layerCache[a]}}}return e.length>0&&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;i<r;i++){var o=t[i];if(y(t[i])&&(o=this.getLayer(o)),!(o instanceof $n&&o.getMap()&&o.getMap()===this))throw new Error("It must be a layer added to this map to order.");o.getZIndex()<n&&(n=o.getZIndex()),e.push(o)}for(var a=0,s=e.length;a<s;a++)e[a].setZIndex(n+a);return this},n.toDataURL=function(t){t||(t={});var e=t.mimeType;e||(e="image/png");var n=t.save,i=this._getRenderer();if(i&&i.toDataURL){var r=t.fileName;r||(r="export");var o=i.toDataURL(e);if(n&&o){var a;if("undefined"!=typeof Blob&&"undefined"!=typeof atob){var s=K(o.replace(/^data:image\/(png|jpeg|jpg);base64,/,""),e);a=URL.createObjectURL(s)}else a=o;var h=document.createElement("a");h.download=r,h.href=a,document.body.appendChild(h),h.click(),document.body.removeChild(h)}return o}return null},n.coordinateToPoint=function(t,e){var n=this.getProjection().project(t);return this._prjToPoint(n,e)},n.coordToPoint=function(t,e){return this.coordinateToPoint(t,e)},n.pointToCoordinate=function(t,e){var n=this._pointToPrj(t,e);return this.getProjection().unproject(n)},n.pointToCoord=function(t,e){return this.pointToCoordinate(t,e)},n.coordinateToViewPoint=function(t){return this._prjToViewPoint(this.getProjection().project(t))},n.coordToViewPoint=function(t){return this.coordinateToViewPoint(t)},n.viewPointToCoordinate=function(t){return this.getProjection().unproject(this._viewPointToPrj(t))},n.viewPointToCoord=function(t){return this.viewPointToCoordinate(t)},n.coordinateToContainerPoint=function(t,e){var n=this.getProjection().project(t);return this._prjToContainerPoint(n,e)},n.coordToContainerPoint=function(t,e){return this.coordinateToContainerPoint(t,e)},n.containerPointToCoordinate=function(t){var e=this._containerPointToPrj(t);return this.getProjection().unproject(e)},n.containerPointToCoord=function(t){return this.containerPointToCoordinate(t)},n.containerPointToViewPoint=function(t){return t.sub(this.getViewPoint())},n.viewPointToContainerPoint=function(t){return t.add(this.getViewPoint())},n.containerToExtent=function(t){var e=new Sn(this._containerPointToPoint(t.getMin()),this._containerPointToPoint(t.getMax()));return this._pointToExtent(e)},n.checkSize=function(){var t=f()-this._initTime<1500&&0===this.width||0===this.height,e=this._getContainerDomSize(),n=this.height,i=this.width;if(e.width===i&&e.height===n)return this;var r=this.getCenter();this._updateMapSize(e);var o=new ce((i-e.width)/2,(n-e.height)/2);this._offsetCenterByPixel(o),this._mapViewCoord=this._getPrjCenter();var a=0===e.width||0===e.height||0===i||0===n;return(t||a)&&(this._noEvent=!0,this.setCenter(r),delete this._noEvent),this._fireEvent("resize"),this},n.distanceToPixel=function(t,e,n){var i=this.getProjection();if(!i)return null;var r=this.getScale()/this.getScale(n),o=this.getCenter(),a=i.locate(o,t,e),s=this.coordToContainerPoint(o),h=this.coordToContainerPoint(a);return h._sub(s)._multi(r)._abs(),new le(h.x,h.y)},n.distanceToPoint=function(t,e,n){var i=this.getProjection();if(!i)return null;var r=this.getCenter(),o=i.locate(r,t,e),a=this.coordToPoint(r,n),s=this.coordToPoint(o,n);return s._sub(a)._abs(),s},n.pixelToDistance=function(t,e){var n=this.getProjection();if(!n)return null;var i=this.getFullExtent(),r=i.top>i.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;e<t.length;e++)t[e].remove();return this._getRenderer()&&this._getRenderer().remove(),this._containerDOM.innerHTML&&(this._containerDOM.innerHTML=""),delete this._panels,delete this._containerDOM,delete this.renderer,this._fireEvent("removeend"),this._clearAllListeners(),this},n.isRemoved=function(){return!this._containerDOM},n.isMoving=function(){return!!this._moving},n.onMoveStart=function(t){this._originCenter=this.getCenter(),this._moving=!0,this._trySetCursor("move"),this._fireEvent("movestart",this._parseEvent(t?t.domEvent:null,"movestart"))},n.onMoving=function(t){this._fireEvent("moving",this._parseEvent(t?t.domEvent:null,"moving"))},n.onMoveEnd=function(t){if(this._moving=!1,this._trySetCursor("default"),this._fireEvent("moveend",t&&t.domEvent?this._parseEvent(t.domEvent,"moveend"):t),!this._verifyExtent(this.getCenter())){var e=this._originCenter;this._verifyExtent(e)||(e=this.getMaxExtent().getCenter()),this.panTo(e)}},n.onDragRotateStart=function(t){this._dragRotating=!0,this._fireEvent("dragrotatestart",this._parseEvent(t?t.domEvent:null,"dragrotatestart"))},n.onDragRotating=function(t){this._fireEvent("dragrotating",this._parseEvent(t?t.domEvent:null,"dragrotating"))},n.onDragRotateEnd=function(t){this._dragRotating=!1,this._fireEvent("dragrotateend",this._parseEvent(t?t.domEvent:null,"dragrotateend"))},n.isDragRotating=function(){return!!this._dragRotating},n.getRenderer=function(){return this._getRenderer()},n._initContainer=function(t){if(y(t)){if(this._containerDOM=document.getElementById(t),!this._containerDOM)throw new Error("Invalid container when creating map: '"+t+"'")}else this._containerDOM=t,C&&(this.CanvasClass=this._containerDOM.constructor);if(this._containerDOM.childNodes&&this._containerDOM.childNodes.length>0&&"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;t<e;t++)this._layers[t]._order=t;this._layers.sort(function(t,e){var n=t.getZIndex()-e.getZIndex();return 0===n?t._order-e._order:n})}},n._fireEvent=function(t,e){this._noEvent||(this.fire("_"+t,e),this.fire(t,e))},n._Load=function(){this._resetMapStatus(),this.options.pitch&&(this.setPitch(this.options.pitch),delete this.options.pitch),this.options.bearing&&(this.setBearing(this.options.bearing),delete this.options.bearing),this._loadAllLayers(),this._getRenderer().onLoad(),this._loaded=!0,this._callOnLoadHooks(),this._initTime=f()},n._initRenderer=function(){var t=this.options.renderer,n=e.getRendererClass(t);this._renderer=new n(this),this._renderer.load()},n._getRenderer=function(){return this._renderer},n._loadAllLayers=function(){this._baseLayer&&this._baseLayer.load(),this._eachLayer(function(t){t&&t.load()},this.getLayers())},n._getLayers=function(t){for(var e=this._baseLayer?[this._baseLayer].concat(this._layers):this._layers,n=[],i=0;i<e.length;i++)t&&!t.call(this,e[i])||n.push(e[i]);return n},n._eachLayer=function(t){if(!(arguments.length<2)){var e=Array.prototype.slice.call(arguments,1);e&&!Array.isArray(e)&&(e=[e]);for(var n=[],i=0,r=e.length;i<r;i++)n=n.concat(e[i]);for(var o=0,a=n.length;o<a;o++)t.call(t,n[o])}},n._onLayerEvent=function(t){t&&"idchange"===t.type&&(delete this._layerCache[t.old],this._layerCache[t.new]=t.target)},n._resetMapStatus=function(){var t=this.getMaxZoom(),e=this.getMinZoom(),n=this._spatialReference.getMaxZoom(),i=this._spatialReference.getMinZoom();(p(t)||-1===t||t>n)&&this.setMaxZoom(n),(p(e)||-1===e||e<i)&&this.setMinZoom(i),(t=this.getMaxZoom())<(e=this.getMinZoom())&&this.setMaxZoom(e),(p(this._zoomLevel)||this._zoomLevel>t)&&(this._zoomLevel=t),this._zoomLevel<e&&(this._zoomLevel=e),delete this._prjCenter;var r=this.getProjection();this._prjCenter=r.project(this._center),this._calcMatrices();var o=this._getRenderer();o&&o.resetContainer()},n._getContainerDomSize=function(){if(!this._containerDOM)return null;var t,e,n=this._containerDOM;if(p(n.width)||p(n.height)){if(p(n.clientWidth)||p(n.clientHeight))throw new Error("can not get size of container");t=parseInt(n.clientWidth,0),e=parseInt(n.clientHeight,0)}else t=n.width,e=n.height,ae.retina&&n.layer&&(t/=2,e/=2);return new le(t,e)},n._updateMapSize=function(t){return this.width=t.width,this.height=t.height,this._getRenderer().updateMapSize(t),this._calcMatrices(),this},n._getPrjCenter=function(){return this._prjCenter},n._setPrjCenter=function(t){this._prjCenter=t,this.isInteracting()&&!this.isMoving()&&(this._mapViewCoord=t),this._calcMatrices()},n._setPrjCoordAtContainerPoint=function(t,e){if(e.x===this.width/2&&e.y===this.height/2)return this;var n=this._containerPointToPoint(e)._sub(this._prjToPoint(this._getPrjCenter())),i=this._pointToPrj(this._prjToPoint(t).sub(n));return this._setPrjCenter(i),this},n._verifyExtent=function(t){if(!t)return!1;var e=this.getMaxExtent();return!e||e.contains(t)},n._offsetCenterByPixel=function(t){var e=new ce(this.width/2-t.x,this.height/2-t.y),n=this._containerPointToPrj(e);return this._setPrjCenter(n),n},n.offsetPlatform=function(t){return t?(this._getRenderer().offsetPlatform(t),this._mapViewCoord=this._getPrjCenter(),this._mapViewPoint=this._mapViewPoint.add(t),this):this._mapViewPoint},n.getViewPoint=function(){var t=this._getViewPointFrameOffset(),e=this.offsetPlatform();return t&&(e=e.add(t)),e},n._getViewPointFrameOffset=function(){if(this.isZooming())return null;var t=this._getPrjCenter();return this._mapViewCoord&&!this._mapViewCoord.equals(t)?this._prjToContainerPoint(this._mapViewCoord).sub(this._prjToContainerPoint(t)):null},n._resetMapViewPoint=function(){this._mapViewPoint=new ce(0,0),this._mapViewCoord=this._getPrjCenter()},n._getResolution=function(t){return p(t)&&(t=this.getZoom()),this._spatialReference.getResolution(t)},n._getResolutions=function(){return this._spatialReference.getResolutions()},n._prjToPoint=function(t,e){return e=p(e)?this.getZoom():e,this._spatialReference.getTransformation().transform(t,this._getResolution(e))},n._pointToPrj=function(t,e){return e=p(e)?this.getZoom():e,this._spatialReference.getTransformation().untransform(t,this._getResolution(e))},n._pointToPoint=function(t,e){return p(e)?t.copy():t.multi(this._getResolution(e)/this._getResolution())},n._pointToPointAtZoom=function(t,e){return p(e)?t.copy():t.multi(this._getResolution()/this._getResolution(e))},n._containerPointToPrj=function(t){return this._pointToPrj(this._containerPointToPoint(t))},n._viewPointToPrj=function(t){return this._containerPointToPrj(this.viewPointToContainerPoint(t))},n._prjToContainerPoint=function(t,e){return this._pointToContainerPoint(this._prjToPoint(t,e),e)},n._prjToViewPoint=function(t){var e=this._prjToContainerPoint(t);return this._containerPointToViewPoint(e)},n._containerPointToViewPoint=function(t){return t?t._sub(this.getViewPoint()):null},n._viewPointToPoint=function(t,e){return this._containerPointToPoint(this.viewPointToContainerPoint(t),e)},n._pointToViewPoint=function(t,e){return this._prjToViewPoint(this._pointToPrj(t,e))},n._callOnLoadHooks=function(){var t=e.prototype;if(t._onLoadHooks)for(var n=0,i=t._onLoadHooks.length;n<i;n++)t._onLoadHooks[n].call(this)},e}(yn(fn(Zn(mn))));ri.mergeOptions(ii);var oi=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addHooks=function(){this.target&&this.target.on("_dblclick",this._onDoubleClick,this)},n.removeHooks=function(){this.target&&this.target.off("_dblclick",this._onDoubleClick,this)},n._onDoubleClick=function(t){var e=this.target;if(e.options.doubleClickZoom){var n=e.getZoom(),i=t.domEvent.shiftKey?Math.ceil(n)-1:Math.floor(n)+1;e._zoomAnimation(i,t.containerPoint)}},e}(pn);ri.mergeOptions({doubleClickZoom:!0}),ri.addOnLoadHook("addHandler","doubleClickZoom",oi);var ai,si=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addHooks=function(){var t=this.target;if(t){var e=t._panels.mapWrapper||t._containerDOM;this._dragHandler=new wn(e,{cancelOn:this._cancelOn.bind(this),rightclick:!0}),this._dragHandler.on("mousedown",this._onMouseDown,this).on("dragstart",this._onDragStart,this).on("dragging",this._onDragging,this).on("dragend",this._onDragEnd,this).enable()}},n.removeHooks=function(){this._dragHandler.off("mousedown",this._onMouseDown,this).off("dragstart",this._onDragStart,this).off("dragging",this._onDragging,this).off("dragend",this._onDragEnd,this),this._dragHandler.remove(),delete this._dragHandler},n._cancelOn=function(t){return!(!this.target.isZooming()&&!this._ignore(t))},n._ignore=function(t){return!!t&&(t.domEvent&&(t=t.domEvent),this.target._ignoreEvent(t))},n._onMouseDown=function(t){delete this.startDragTime,delete this._mode,2===t.domEvent.button||t.domEvent.ctrlKey?(this.target.options.dragRotate||this.target.options.dragPitch)&&(this._mode="rotatePitch"):this.target.options.dragPan&&(this._mode="move"),this.target._stopAnim(this.target._animPlayer),je(t.domEvent)},n._onDragStart=function(t){this.startDragTime=f(),"move"===this._mode?this._moveStart(t):"rotatePitch"===this._mode&&this._rotateStart(t)},n._onDragging=function(t){this.target._isEventOutMap(t.domEvent)||("move"===this._mode?this._moving(t):"rotatePitch"===this._mode&&this._rotating(t))},n._onDragEnd=function(t){"move"===this._mode?this._moveEnd(t):"rotatePitch"===this._mode&&this._rotateEnd(t),delete this.startDragTime,delete this.startBearing},n._start=function(t){this.preX=t.mousePos.x,this.preY=t.mousePos.y,this.startX=this.preX,this.startY=this.preY},n._moveStart=function(t){this._start(t);var e=this.target;e.onMoveStart(t);var n=We(e._getActualEvent(t.domEvent),e.getContainer());this.startPrjCoord=e._containerPointToPrj(n)},n._moving=function(t){if(this.startDragTime){var e=this.target,n=We(e._getActualEvent(t.domEvent),e.getContainer());e._setPrjCoordAtContainerPoint(this.startPrjCoord,n),e.onMoving(t)}},n._moveEnd=function(t){if(this.startDragTime){var e=this.target,n=f()-this.startDragTime,i=t.mousePos.x,r=t.mousePos.y,o=i-this.startX,a=r-this.startY;this._clear(),e.options.panAnimation&&!t.interupted&&e._verifyExtent(e.getCenter())&&n<280&&Math.abs(a)+Math.abs(o)>5?(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<s?"pitch":"rotate"),!("pitch"===this._rotateMode&&0===r&&s<10)){if(this._rotateMode.indexOf("rotate")>=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;s<h-1;s++)(r=ui(t[s],t[s+1],e,s,n,i))&&(o[a]=o[a]||[],o[a].push({point:r[0],index:s}),r[1]===t[s+1]&&s!==h-2||(o[a].push({point:r[1],index:s+1}),a++));return o}function ui(t,e,n,i,r,o){var a,s,h,u=i?ai:fi(t,n),c=fi(e,n);for(ai=c;;){if(!(u|c))return[t,e];if(u&c)return!1;if(o)return[t,e];h=fi(s=li(t,e,a=u||c,n,r),n),a===u?(t=s,u=h):(e=s,c=h)}}function ci(t,e,n){var i,r,o,a,s,h,u,c,l,f=[1,4,2,8];for(r=0,u=t.length;r<u;r++)t[r]._code=fi(t[r],e);for(a=0;a<4;a++){for(c=f[a],i=[],r=0,o=(u=t.length)-1;r<u;o=r++)s=t[r],h=t[o],s._code&c?h._code&c||((l=li(h,s,c,e,n))._code=fi(l,e),i.push(l)):(h._code&c&&((l=li(h,s,c,e,n))._code=fi(l,e),i.push(l)),i.push(s));t=i}return t}function li(t,e,n,i,r){var o,a,s=e.x-t.x,h=e.y-t.y,u=i.getMin(),c=i.getMax();8&n?(o=t.x+s*(c.y-t.y)/h,a=c.y):4&n?(o=t.x+s*(u.y-t.y)/h,a=u.y):2&n?(o=c.x,a=t.y+h*(c.x-t.x)/s):1&n&&(o=u.x,a=t.y+h*(u.x-t.x)/s);var l=new ce(o,a);return r&&l._round(),l}function fi(t,e){var n=0;return t.x<e.getMin().x?n|=1:t.x>e.getMax().x&&(n|=2),t.y<e.getMin().y?n|=4:t.y>e.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<s;a++)for(var h=0,u=r[a].length;h<u;h++)o.push(r[a][h]);return o},n._getRotationAt=function(t){var e=this.getRotation();e||(e=0);var n=this._getRenderPoints()[1];if(!n||!n[t])return e;var i=this.getMap(),r=n[t][0],o=n[t][1];if(i.isTransforming()){var a=i.getGLZoom();r=i._pointToContainerPoint(n[t][0],a),o=i._pointToContainerPoint(n[t][1],a)}return e+Q(r.x,r.y,o.x,o.y)},n._rotate=function(t,e,n){if(n){var i=this.getDxDy(),r=e.sub(i);return t.save(),t.translate(r.x,r.y),t.rotate(n),this.getDxDy()}return null},e}(mi),vi=function(t){function e(n,i,r){var o;(o=t.call(this,n,i,r)||this)._dynamic=Mt(n),o.style=o._defineStyle(o.translate()),o.strokeAndFill=o._defineStyle(e.translateLineAndFill(o.style));var a=o.strokeAndFill.lineWidth;return o.padding=a%2==0?2:1.5,o}se(e,t),e.test=function(t){return!!t&&!(!p(t.markerFile)||p(t.markerType)||"path"===t.markerType)};var n=e.prototype;return n.symbolize=function(t,e){var n=this.style;if(this.painter.isHitTesting()||0!==n.markerWidth&&0!==n.markerHeight&&(0!==n.polygonOpacity||0!==n.lineOpacity)){var i=this._getRenderContainerPoints();U(i)&&(this._prepareContext(t),this.getPainter().isSpriting()||this.geometry.getLayer().getMask()===this.geometry||this._dynamic||!1===this.geometry.getLayer().options.cacheVectorOnCanvas?this._drawMarkers(t,i,e):this._drawMarkersWithCache(t,i,e))}},n.getDxDy=function(){var t=this.style,e=t.markerDx,n=t.markerDy;return new ce(e,n)},n._drawMarkers=function(t,e,n){var i=this.strokeAndFill;It(i.lineColor)||It(i.polygonFill)||this.prepareCanvas(t,i,n);for(var r=e.length-1;r>=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;u<a.length;u++){var c=a[u];p(s)||sn.fillText(t,s,c.add(8,-4),r);for(var l=[],f=0;f<h.length;f++)l.push(h[f].add(c));sn.path(t,l.slice(0,2),1),sn.path(t,l.slice(2,4),1)}}}},e}(gi),_i=function(t){function e(e,n,i){var r;return(r=t.call(this,e,n,i)||this).style=r._defineStyle(r.translate()),r}se(e,t),e.test=function(t){return!!t&&!p(t.markerFile)};var n=e.prototype;return n.symbolize=function(t,e){var n=this.style;if(this.painter.isHitTesting()||0!==n.markerWidth&&0!==n.markerHeight&&0!==n.markerOpacity){var i=this._getRenderContainerPoints();if(U(i)){var r=this._getImage(e);if(r){this._prepareContext(t);var o,a=n.markerWidth,s=n.markerHeight;if(!m(a)||!m(s)){a=r.width,s=r.height,n.markerWidth=a,n.markerHeight=s;var h=[n.markerFile,n.markerWidth,n.markerHeight];e.isResourceLoaded(h)||e.addResource(h,r);var u=this.getPainter();u.isSpriting()||u.removeCache()}"path"!==this.symbol.markerType&&m(n.markerOpacity)&&n.markerOpacity<1&&(o=t.globalAlpha,t.globalAlpha*=n.markerOpacity);for(var c=Ee(new le(a,s),n.markerHorizontalAlignment,n.markerVerticalAlignment),l=0,f=i.length;l<f;l++){var d=i[l],p=this._rotate(t,d,this._getRotationAt(l));p&&(d=p),sn.image(t,r,d.x+c.x,d.y+c.y,a,s),p&&t.restore()}void 0!==o&&(t.globalAlpha=o)}else"undefined"!=typeof console&&console.warn("no img found for "+(this.style.markerFile||this._url[0]))}}},n._getImage=function(t){return t?t.getImage([this.style.markerFile,this.style.markerWidth,this.style.markerHeight]):null},n.getPlacement=function(){return this.symbol.markerPlacement},n.getRotation=function(){var t=this.style.markerRotation;return m(t)?-t*Math.PI/180:null},n.getDxDy=function(){var t=this.style,e=t.markerDx,n=t.markerDy;return new ce(e,n)},n.getFixedExtent=function(t){var e=this.style,n=e.markerFile,i=t?t.getImage(n):null,r=e.markerWidth||(i?i.width:0),o=e.markerHeight||(i?i.height:0),a=this.getDxDy(),s=Ee(new le(r,o),e.markerHorizontalAlignment,e.markerVerticalAlignment),h=new Sn(a.add(0,0),a.add(r,o));h._add(s);var u=this.getRotation();return u&&(h=this._rotateExtent(h,u)),h},n.translate=function(){var t=this.symbol;return{markerFile:t.markerFile,markerOpacity:z(t.markerOpacity,1),markerWidth:z(t.markerWidth,null),markerHeight:z(t.markerHeight,null),markerRotation:z(t.markerRotation,0),markerDx:z(t.markerDx,0),markerDy:z(t.markerDy,0),markerHorizontalAlignment:z(t.markerHorizontalAlignment,"middle"),markerVerticalAlignment:z(t.markerVerticalAlignment,"top")}},e}(gi),xi=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).symbol=e,r.geometry=n,r.painter=i,"Point"===n.type?he(r):(r.style=r._defineStyle(r.translate()),r)}se(e,t),e.test=function(t,e){if(!t)return!1;if(e&&"Point"===e.type)return!1;for(var n in t){var i=n.slice(0,4);if("line"===i||"poly"===i)return!0}return!1};var n=e.prototype;return n.symbolize=function(t,e){var n=this.style;if(0!==n.polygonOpacity||0!==n.lineOpacity||this.painter.isHitTesting()){var i=this._getPaintParams();if(i){this._prepareContext(t);var r=It(n.lineColor),o="Polygon"===this.geometry.getJSONType()||"LineString"===this.geometry.type;!r||!n.lineColor.places&&o||(n.lineGradientExtent=this.getPainter().getContainerExtent()._expand(n.lineWidth)),It(n.polygonFill)&&(n.polygonGradientExtent=this.getPainter().getContainerExtent());var a=i[0];if("Polygon"===this.geometry.getJSONType()&&a.length>0&&Array.isArray(a[0][0])||"LineString"===this.geometry.type&&a.length>0&&Array.isArray(a[0]))for(var s=0;s<a.length;s++){this.prepareCanvas(t,n,e),r&&o&&!n.lineColor.places&&this._createGradient(t,a[s],n.lineColor);var h=[t,a[s]];i.length>1&&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;a<s;a++){var h=n[a],u=this._rotate(t,h,this._getRotationAt(a));u&&(h=u),sn.text(t,o,h,i,this.textDesc),u&&t.restore()}}}},n.getPlacement=function(){return this.symbol.textPlacement},n.getRotation=function(){var t=this.style.textRotation;return m(t)?-t*Math.PI/180:null},n.getDxDy=function(){var t=this.style;return new ce(t.textDx,t.textDy)},n.getFixedExtent=function(){var t=this.getDxDy(),e=this.style,n=this.textDesc.size,i=Ee(n,e.textHorizontalAlignment,e.textVerticalAlignment),r=i.x,o=i.y;if(e.textHaloRadius){var a=e.textHaloRadius;n=n.add(2*a,2*a)}var s=new Sn(t.add(r,o),t.add(r+n.width,o+n.height)),h=this.getRotation();return h&&(s=this._rotateExtent(s,h)),s},n.translate=function(){var t=this.symbol,e={textName:t.textName,textFaceName:z(t.textFaceName,"monospace"),textWeight:z(t.textWeight,"normal"),textStyle:z(t.textStyle,"normal"),textSize:z(t.textSize,10),textFont:z(t.textFont,null),textFill:z(t.textFill,"#000"),textOpacity:z(t.textOpacity,1),textHaloFill:z(t.textHaloFill,"#ffffff"),textHaloRadius:z(t.textHaloRadius,0),textHaloOpacity:z(t.textHaloOpacity,1),textWrapWidth:z(t.textWrapWidth,null),textWrapCharacter:z(t.textWrapCharacter,"\n"),textLineSpacing:z(t.textLineSpacing,0),textDx:z(t.textDx,0),textDy:z(t.textDy,0),textHorizontalAlignment:z(t.textHorizontalAlignment,"middle"),textVerticalAlignment:z(t.textVerticalAlignment,"middle"),textAlign:z(t.textAlign,"center"),textRotation:z(t.textRotation,0),textMaxWidth:z(t.textMaxWidth,0),textMaxHeight:z(t.textMaxHeight,0)};return e.textMaxWidth>0&&(!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&&e<n.size.height&&(n.size.height=e),n},n._storeToCache=function(t){C||(this.geometry[wi]||(this.geometry[wi]={}),this.geometry[wi][this._cacheKey]={desc:t,active:!0})},n._loadFromCache=function(){if(!this.geometry[wi])return null;var t=this.geometry[wi][this._cacheKey];return t?(t.active=!0,t.desc):null},e}(gi);bi.CACHE_KEY=wi;var Mi,Ei=function(t){function e(e,n,i){var r;return(r=t.call(this,e,n,i)||this).style=r._defineStyle(r.translate()),p(r.style.markerWidth)&&(r.style.markerWidth=80),p(r.style.markerHeight)&&(r.style.markerHeight=80),ae.gecko?r._url=[At(e,r.style.markerWidth,r.style.markerHeight),r.style.markerWidth,r.style.markerHeight]:r._url=[At(e),e.markerWidth,e.markerHeight],r}se(e,t),e.test=function(t){return!!t&&!(!p(t.markerFile)||"path"!==t.markerType)};var n=e.prototype;return n._prepareContext=function(){},n._getImage=function(t){if(t&&t.isResourceLoaded(this._url))return t.getImage(this._url);var e=new Image;return e.src=this._url[0],t&&t.addResource(this._url,e),e},e}(_i),Si={lineWidth:1,polygonFill:"#fff",polygonOpacity:.5},Ti=function(t){function e(e,n,i){var r;return(r=t.call(this,e,n,i)||this).style=n.getLayer().options.drawAltitude,r.style&&v(r.style)||(r.style={lineWidth:2}),r.style.lineWidth||(r.style.lineWidth=0),r.dxdy=r._defineStyle({dx:e.textDx||e.markerDx,dy:e.textDy||e.markerDy}),r}se(e,t),e.test=function(t,e){if(!e.getLayer())return!1;var n=e.getJSONType();return"Marker"===n||"LineString"===n};var n=e.prototype;return n.symbolize=function(t){var e=this.geometry.getLayer();if(e.options.drawAltitude){var n=this.geometry.getProperties();if(n&&n[e.options.altitudeProperty]){var i=this._getStyle();if(this._prepareContext(t),"LineString"===this.geometry.type){var r=this._getPaintParams(i.lineDx,i.lineDy);if(!r)return;var o=this.getPainter().getPaintParams(i.lineDx,i.lineDy,!0)[0];this._drawLineAltitude(t,r[0],o)}else{var a=this._getRenderContainerPoints(),s=this._getRenderContainerPoints(!0);if(!a||0===a.length)return;this._drawMarkerAltitude(t,a[0],s[0])}}}},n.getDxDy=function(){var t=this.dxdy;return new ce(t.dx||0,t.dy||0)},n.get2DExtent=function(){return"LineString"===this.geometry.type?xi.prototype.get2DExtent.apply(this):t.prototype.get2DExtent.call(this)},n.getPlacement=function(){return"point"},n._getPaintParams=function(t,e){return this.getPainter().getPaintParams(t||0,e||0)},n._drawMarkerAltitude=function(t,e,n){var i=this._getStyle();this.prepareCanvas(t,i),sn.path(t,[e,n],i.lineOpacity,null,i.lineDasharray)},n._drawLineAltitude=function(t,e,n){var i=this._getStyle();if(e.length>0&&Array.isArray(e[0]))for(var r=0;r<e.length;r++)this._drawLine(t,e[r],n[r]);else this._drawLine(t,e,n);t.setLineDash&&Array.isArray(i.lineDasharray)&&t.setLineDash([])},n._drawLine=function(t,e,n){var i=this._getStyle();this.prepareCanvas(t,i);for(var r=0,o=e.length-1;r<o;r++)sn.polygon(t,[e[r],e[r+1],n[r+1],n[r]],i.lineOpacity,i.polygonOpacity,i.lineDasharray)},n._getStyle=function(){var t=this.geometry.getLayer().options.drawAltitude;return v(t)||(t=Si),t.lineWidth||(t.lineWidth=0,t.lineOpacity=0),t},e}(gi),Ci=Object.freeze({Symbolizer:pi,CanvasSymbolizer:mi,DebugSymbolizer:yi,ImageMarkerSymbolizer:_i,PointSymbolizer:gi,StrokeAndFillSymbolizer:xi,TextMarkerSymbolizer:bi,VectorMarkerSymbolizer:vi,VectorPathMarkerSymbolizer:Ei,DrawAltitudeSymbolizer:Ti}),Pi=[Ti,xi,_i,Ei,vi,bi],Ai=function(t){function e(e){var n;return(n=t.call(this)||this).geometry=e,n.symbolizers=n._createSymbolizers(),n._altAtGLZoom=n._getGeometryAltitude(),n}se(e,t);var n=e.prototype;return n.getMap=function(){return this.geometry.getMap()},n.getLayer=function(){return this.geometry.getLayer()},n._createSymbolizers=function(){var t=this.getSymbol(),e=[],n=Pi,i=t;Array.isArray(t)||(i=[t]);for(var r=i.length-1;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;g<v;g++)m(h[g])||h[g]instanceof le?m(h[g])?l.push(h[g]/c):l.push(h[g].multi(1/c)):l.push(h[g]);return l},n._pointContainerPoints=function(t,e,n,i,r,o){if(!this.getContainerExtent())return null;var a,s=this.getMap(),h=s.getGLZoom(),u=this.containerOffset;function c(t,i){var r=s._pointToContainerPoint(t,h,i)._sub(u);return(e||n)&&r._add(e||0,n||0),r}var l=this.getAltitude();if(Array.isArray(t)){var f,d=this.geometry,p=(f=!r&&d.options.enableClip?this._clip(t,l):{points:t,altitude:l}).points;l=f.altitude,i&&(l=0);var m=l;a=[];for(var g=0,v=p.length;g<v;g++){var y=p[g];if(Array.isArray(y)){for(var _=[],x=0,w=y.length;x<w;x++){var b=y[x];Array.isArray(l)&&(m=l[g]?l[g][x]:0),_.push(c(b,m))}a.push(_)}else Array.isArray(l)&&(m="vertex-last"===o?l[l.length-1-g]:"line"===o?(l[g]+l[g+1])/2:l[g]),a.push(c(y,m))}}else t instanceof ce&&(i&&(l=0),a=s._pointToContainerPoint(t,h,l)._sub(u),(e||n)&&a._add(e,n));return a},n._clip=function(t,e){var n=this.getMap(),i=this.geometry,r=n.getGLZoom(),o=this.getSymbol().lineWidth;m(o)||(o=4);var a=n.getContainerExtent().expand(o).convertTo(function(t){return n._containerPointToPoint(t,r)});if(n.getPitch()>0&&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<t.length;l++){var f=ci(t[l],a);f.length&&u.push(f)}}else u=ci(t,a);else if("LineString"===i.getJSONType()){if(Array.isArray(t[0])){u=[];for(var d=0;d<t.length;d++)D(u,hi(t[d],a,!1,!!c))}else u=hi(t,a,!1,!!c);return this._interpolateSegAlt(u,t,e)}return{points:u,altitude:e}},n._interpolateSegAlt=function(t,e,n){if(!Array.isArray(n)){var i=function(t){return t.point};return{points:t.map(function(t){return Array.isArray(t)?t.map(i):t.point}),altitude:n}}var r=function t(e,n,i){if(!Array.isArray(i))return e;var r=[];for(var o=0,a=e.length;o<a;o++)if(Array.isArray(e[o]))r.push(t(e[o],n,i));else{var s=e[o];if(s.point.equals(n[s.index]))s.altitude=i[s.index],r.push(s);else{var h=void 0,u=void 0;0===s.index?(h=s.index,u=s.index+1):(h=s.index-1,u=s.index);var c=s.point.distanceTo(n[u]),l=c/(c+n[h].distanceTo(s.point)),f=j(i[h],i[u],1-l);s.altitude=f,r.push(s)}}return r}(t,e,n);return n=[],{points:r.map(function(t){if(Array.isArray(t)){var e=[],i=t.map(function(t){return e.push(t.altitude),t.point});return n.push(e),i}return n.push(t.altitude),t.point}),altitude:n}},n.getSymbol=function(){return this.geometry._getInternalSymbol()},n.paint=function(t,e,n){if(this.symbolizers){var i=this.getLayer()._getRenderer();if(i&&i.context&&(!t||t.intersects(this.get2DExtent(i.resources)))){var r=this.getMap(),o=this.getMinAltitude(),a=r.getFrustumAltitude();if(!(o&&a&&a<o)){this.containerOffset=n||r._pointToContainerPoint(i.southWest)._add(0,-r.height),this._beforePaint();for(var s=e||i.context,h=[s,i.resources],u=this.symbolizers.length-1;u>=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;r<o;r+=4)if(i[r]>0)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&&r<i)return null;var o=this._extent2D.convertTo(function(r){return t._pointToContainerPoint(r,e,i/n)}),a=this.getMaxAltitude();if(a!==i){var s=this._extent2D.convertTo(function(i){return t._pointToContainerPoint(i,e,a/n)});o._combine(s)}return o&&o._add(this._fixedExtent),this.geometry.options.smoothness&&o._expand(.15*o.getWidth()),o},n.getFixedExtent=function(){var t=this.getMap().getZoom();return this._extent2D&&this._extent2D._zoom===t||this.get2DExtent(),this._fixedExtent},n.setZIndex=function(t){this._eachSymbolizer(function(e){e.setZIndex(t)})},n.show=function(){this._painted?(this.removeCache(),this._eachSymbolizer(function(t){t.show()})):this.getLayer().isCanvasRender()||this.paint()},n.hide=function(){this._eachSymbolizer(function(t){t.hide()})},n.repaint=function(){this._altAtGLZoom=this._getGeometryAltitude(),this.removeCache();var t=this.getLayer();if(t){var e=t.getRenderer();e&&e.setToRedraw()&&e.setToRedraw()}},n.refreshSymbol=function(){this.removeCache(),this._removeSymbolizers(),this.symbolizers=this._createSymbolizers()},n.remove=function(){this.removeCache(),this._removeSymbolizers()},n._removeSymbolizers=function(){this._eachSymbolizer(function(t){delete t.painter,t.remove()}),delete this.symbolizers},n.removeCache=function(){delete this._renderPoints,delete this._paintParams,delete this._sprite,delete this._extent2D,delete this._fixedExtent,delete this._cachedParams,delete this._unsimpledParams,this.geometry&&delete this.geometry[bi.CACHE_KEY]},n.getAltitude=function(){return this._getAltitudeProperty()!==this._propAlt&&(this._altAtGLZoom=this._getGeometryAltitude()),this._altAtGLZoom?this._altAtGLZoom:0},n.getMinAltitude=function(){return this.minAltitude?this.minAltitude:0},n.getMaxAltitude=function(){return this.maxAltitude?this.maxAltitude:0},n._getGeometryAltitude=function(){var t=this;if(!this.getMap())return 0;var e=this._getAltitudeProperty();if(this._propAlt=e,!e)return this.minAltitude=this.maxAltitude=0,0;var n=this.geometry.getCenter();return Array.isArray(e)?(this.minAltitude=Number.MAX_VALUE,this.maxAltitude=Number.MIN_VALUE,e.map(function(e){var i=t._meterToPoint(n,e);return i<t.minAltitude&&(t.minAltitude=i),i>t.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;i<r&&(!(e=n[i]._getPainter())||!e||!1!==t.call(this,e));i++);},n.paint=function(t){this.geometry&&this._eachPainter(function(e){e.paint(t)})},n.get2DExtent=function(t){var e=new Sn;return this._eachPainter(function(n){e=e.combine(n.get2DExtent(t))}),e},n.getContainerExtent=function(){var t=new Sn;return this._eachPainter(function(e){t=t.combine(e.getContainerExtent())}),t},n.remove=function(){var t=arguments;this._eachPainter(function(e){e.remove.apply(e,t)})},n.setZIndex=function(){var t=arguments;this._eachPainter(function(e){e.setZIndex.apply(e,t)})},n.show=function(){var t=arguments;this._eachPainter(function(e){e.show.apply(e,t)})},n.hide=function(){var t=arguments;this._eachPainter(function(e){e.hide.apply(e,t)})},n.repaint=function(){var t=arguments;this._eachPainter(function(e){e.repaint.apply(e,t)})},n.refreshSymbol=function(){var t=arguments;this._eachPainter(function(e){e.refreshSymbol.apply(e,t)})},n.hasPoint=function(){var t=!1;return this._eachPainter(function(e){return!e.hasPoint()||(t=!0,!1)}),t},n.getMinAltitude=function(){var t=!0,e=0;return this._eachPainter(function(n){var i=n.getMinAltitude();(t||i<e)&&(t=!1,e=i)}),e},n.getMaxAltitude=function(){var t=0;return this._eachPainter(function(e){var n=e.getMaxAltitude();n>t&&(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;e<n;e++)if(p(t[e].opacity)||t[e].opacity>0)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;n<t.length;n++)e.push(Rt(this._checkAndCopySymbol(t[n])));return e}return t?Rt(t=this._checkAndCopySymbol(t)):null},n._checkAndCopySymbol=function(t){var e={};for(var n in t)c[n]&&y(t[n])?e[n]=+t[n]:e[n]=t[n];return e},n._getSymbol=function(){return this._symbol},n._setExternSymbol=function(t){return this._externSymbol=this._prepareSymbol(t),this.onSymbolChanged(),this},n._getInternalSymbol=function(){return this._symbol?this._symbol:this._externSymbol?this._externSymbol:this.options.symbol?this.options.symbol:null},n._getPrjExtent=function(){var t=this._getProjection();return this._verifyProjection(),!this._extent&&t&&(this._extent=this._computePrjExtent(t)),this._extent},n._unbind=function(){var t=this.getLayer();t&&(this._animPlayer&&this._animPlayer.finish(),this._clearHandlers(),this._unbindMenu(),this._unbindInfoWindow(),this.isEditing()&&this.endEdit(),this._removePainter(),this.onRemove&&this.onRemove(),t.onRemoveGeometry&&t.onRemoveGeometry(this),delete this._layer,delete this._internalId,delete this._extent)},n._getInternalId=function(){return this._internalId},n._setInternalId=function(t){this._internalId=t},n._getMeasurer=function(){return this._getProjection()?this._getProjection():ni.getProjectionInstance(this.options.defaultProjection)},n._getProjection=function(){var t=this.getMap();return t?t.getProjection():null},n._verifyProjection=function(){var t=this._getProjection();!this._projCode||t&&this._projCode===t.code||this._clearProjection(),this._projCode=t?t.code:null},n._getExternalResources=function(){return Lt(this._getInternalSymbol())},n._getPainter=function(){return!this._painter&&this.getMap()&&(-1!==a.indexOf(this.type)?this._painter=new Li(this):this._painter=new Ai(this)),this._painter},n._removePainter=function(){this._painter&&this._painter.remove(),delete this._painter},n._paint=function(t){this._painter&&this._painter.paint(t)},n._clearCache=function(){delete this._extent},n._clearProjection=function(){delete this._extent},n._repaint=function(){this._painter&&this._painter.repaint()},n.onHide=function(){this.closeMenu(),this.closeInfoWindow()},n.onShapeChanged=function(){this._clearCache(),this._repaint(),this._fireEvent("shapechange")},n.onPositionChanged=function(){this._clearCache(),this._repaint(),this._fireEvent("positionchange")},n.onSymbolChanged=function(){this._painter&&this._painter.refreshSymbol(),this._fireEvent("symbolchange")},n.onConfig=function(t){var e;t.properties&&(e=t.properties,delete t.properties);var n=!1;for(var i in t)if(t.hasOwnProperty(i)){var r=i.slice(0,5);if("arrow"===r||"smoot"===r){n=!0;break}}e?(this.setProperties(e),this._repaint()):n&&this._repaint()},n._setParent=function(t){t&&(this._parent=t)},n._getParent=function(){return this._parent},n._fireEvent=function(t,e){this.getLayer()&&this.getLayer()._onGeometryEvent&&(e||(e={}),e.type=t,e.target=this,this.getLayer()._onGeometryEvent(e)),this.fire(t,e)},n._toJSON=function(t){return{feature:this.toGeoJSON(t)}},n._exportGraphicOptions=function(t){var e={};return(p(t.options)||t.options)&&(e.options=this.config()),(p(t.symbol)||t.symbol)&&(e.symbol=this.getSymbol()),(p(t.infoWindow)||t.infoWindow)&&this._infoWinOptions&&(e.infoWindow=this._infoWinOptions),e},n._exportGeoJSONGeometry=function(){var t=this.getCoordinates(),e=bn.toNumberArrays(t);return{type:this.getType(),coordinates:e}},n._exportProperties=function(){var t=null,e=this.getProperties();return p(e)||(t=v(e)?d({},e):e),t},e}(vn(fn(yn(mn))));Ri.mergeOptions({id:null,visible:!0,editable:!0,cursor:null,defaultProjection:"EPSG:4326"});var Oi="mousedown mouseup mousemove click dblclick contextmenu touchstart touchmove touchend",Ii=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addHooks=function(){var t=this.target,e=t._panels.allLayers||t._containerDOM;en(e,Oi,this._identifyGeometryEvents,this)},n.removeHooks=function(){var t=this.target,e=t._panels.allLayers||t._containerDOM;nn(e,Oi,this._identifyGeometryEvents,this)},n._identifyGeometryEvents=function(t,e){var n=this.target;if(!n.isInteracting()&&!n._ignoreEvent(t)){var i=n._getLayers(function(t){return!(!t.identify||!t.options.geometryEvents)});if(i.length){var r=null,o=e||t.type;if("mousedown"===o||"touchstart"===o&&1===t.touches.length)this._mouseDownTime=f();else if(("click"===o||"touchend"===o)&&this._mouseDownTime){var a=this._mouseDownTime;if(delete this._mouseDownTime,f()-a>300){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<t.length;r++){var o=Bi._resolveStyles(t[r]);o&&(e.push(o[0]),n.push(o[1]),i.push(o[2]))}return e.length?[e,n,i]:null}function n(t){var e,n=t;Array.isArray(t)||(n=m(t)?[0,t]:t instanceof ce||t instanceof bn?[new(e=t.constructor)(0,0),t]:[t,t]);var i=n[0],r=n[1];return m(i)&&m(r)?i===r?null:[i,r-i,r]:Array.isArray(i)||i instanceof bn||i instanceof ce?(Array.isArray(i)?(i=new bn(i),r=new bn(r)):(i=new(e=i.constructor)(i),r=new e(r)),i.equals(r)?null:[i,r.sub(i),r]):[i,0,r]}function i(t){return!Array.isArray(t)&&t.constructor===Object||!(!Array.isArray(t)||t[0].constructor!==Object)}var r={},o={},a={};for(var s in t)if(t.hasOwnProperty(s)){var h=t[s];if(!h)continue;if(Array.isArray(h)&&(p(h[0])||p(h[1])))continue;var u=void 0;(u=i(h)?e(h):n(h))&&(o[s]=u[0],r[s]=u[1],a[s]=u[2])}return[o,r,a]},framing:function(t,e){e||(e={});var n,i,r,o=e.easing?Ni[e.easing]:Ni.linear;o||(o=Ni.linear),(t=Bi._resolveStyles(t))&&(i=t[0],n=t[1],r=t[2]);return function(t,e){var a,s;if(t<0)a={playState:"idle",delta:0},s=i;else if(t<e){var h=o(t/e);a={playState:"running",delta:h},s=function t(e,n,i){if(!n||!i)return null;var o={};for(var a in i)if(i.hasOwnProperty(a)){if(n[a]===r[a]){o[a]=n[a];continue}var s=n[a],h=i[a];if(m(h))o[a]=s+e*h;else if(Array.isArray(h)){for(var u=[],c=0;c<h.length;c++)u.push(t(e,s[c],h[c]));o[a]=u}else h.constructor===Object?o[a]=t(e,s,h):(s instanceof ce||s instanceof bn)&&(o[a]=s.add(h.multi(e)))}return o}(h,i,n)}else a={playState:"finished",delta:1},s=r;return a.startStyles=i,a.destStyles=r,a.progress=t,a.remainingMs=e-t,new zi(a,s)}},_requestAnimFrame:function(t){this._frameQueue||(this._frameQueue=[]),this._frameQueue.push(t),this._a()},_a:function(){this._animationFrameId||(this._animationFrameId=S(Bi._frameFn))},_run:function(){if(this._frameQueue.length){var t=this._frameQueue;this._frameQueue=[];for(var e=0,n=t.length;e<n;e++)t[e]();this._frameQueue.length?this._animationFrameId=S(Bi._frameFn):delete this._animationFrameId}},animate:function(t,e,n){e||(e={});var i=Bi.framing(t,e);return new Fi(i,e,n)}};Bi._frameFn=Bi._run.bind(Bi),d(Fi.prototype,{_prepare:function(){var t=this.options,e=t.speed||t.duration;y(e)&&((e=Bi.speed[e])||(e=+e)),e||(e=Bi.speed.normal),this.duration=e,this._framer=t.framer||Bi._requestAnimFrame.bind(Bi)},play:function(){if("idle"!==this.playState&&"paused"!==this.playState)return this;"idle"===this.playState&&(this.currentTime=0,this._prepare());var t=f();if(!this.startTime){var e=this.options;this.startTime=e.startTime?e.startTime:t}return this._playStartTime=Math.max(t,this.startTime),"paused"===this.playState&&(this._playStartTime-=this.currentTime),this.playState="running",this._run(),this},pause:function(){return"paused"===this.playState?this:(this.playState="paused",this._run(),this)},cancel:function(){return"idle"===this.playState?this:(this.playState="idle",this.finished=!1,this._run(),this)},finish:function(){return"finished"===this.playState?this:(this.playState="finished",this.finished=!0,this._run(),this)},reverse:function(){},_run:function(){var t=this,e=this._onFrame,n=f(),i=n-this._playStartTime;if(this.options.repeat&&i>=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;u<r;u++){var c=n(e[u],e[i],e[r]);c>h&&(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;a<s;a++)e(i=t[a],r)>n&&(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;r<o-1&&(h=a.computeLength(i[r],i[r+1]),!(this._animLenSoFar+h>s));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.length<s}return p(n)&&(n=i.getZoom()),N(t,function(t){return i._prjToPoint(t,n)})},n._shouldSimplify=function(){var t=this.getLayer(),e=this.getProperties(),n=e&&t.options.enableAltitude&&!p(e[t.options.altitudeProperty]);return t&&t.options.enableSimplify&&!n&&this.options.enableSimplify&&!this._showPlayer},n._setPrjCoordinates=function(t){this._prjCoords=t,this.onShapeChanged()},n._getPrjCoordinates=function(){return this._getProjection()?(this._verifyProjection(),this._prjCoords||(this._prjCoords=this._projectCoords(this._coordinates)),this._prjCoords):null},n._updateCache=function(){this._clearCache(),this._getProjection()&&this._prjCoords&&(this._coordinates=this._unprojectCoords(this._getPrjCoordinates()))},n._clearProjection=function(){this._prjCoords=null,t.prototype._clearProjection.call(this)},n._projectCoords=function(t){var e=this._getProjection();return e?e.projectCoords(t):[]},n._unprojectCoords=function(t){var e=this._getProjection();return e?e.unprojectCoords(t):[]},n._computeCenter=function(){var t=this._coordinates;if(!U(t))return null;for(var e=0,n=0,i=0,r=t.length,o=0;o<r;o++)t[o]&&m(t[o].x)&&m(t[o].y)&&(e+=t[o].x,n+=t[o].y,i++);return new bn(e/i,n/i)},n._computeExtent=function(){var t=this._coordinates;if(!U(t))return null;var e=[t];return this.hasHoles&&this.hasHoles()&&e.push.apply(e,this.getHoles()),this._coords2Extent(e,this._getProjection())},n._computePrjExtent=function(){var t=[this._getPrjCoordinates()];return this.hasHoles&&this.hasHoles()&&t.push.apply(t,this._getPrjHoles()),this._coords2Extent(t)},n._get2DLength=function(){for(var t=this._getPath2DPoints(this._getPrjCoordinates(),!0),e=0,n=1,i=t.length;n<i;n++)e+=t[n].distanceTo(t[n-1]);return e},n._hitTestTolerance=function(){var t,e=this._getInternalSymbol();if(Array.isArray(e)){t=0;for(var n=0;n<e.length;n++)m(e[n].lineWidth)&&e[n].lineWidth>t&&(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;i<r;i++)for(var o=0,a=t[i].length;o<a;o++)n._combine(t[i][o]);return n},e}(Ri);Hi.mergeOptions({smoothness:0,enableClip:!0,enableSimplify:!0,simplifyTolerance:2,symbol:{lineColor:"#000",lineWidth:2,lineOpacity:1,polygonFill:"#fff",polygonOpacity:1,opacity:1}});var Ui=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).type="Polygon",e&&i.setCoordinates(e),i}se(e,t);var n=e.prototype;return n.setCoordinates=function(t){if(!t)return this._coordinates=null,this._holes=null,this._projectRings(),this;var e=bn.toCoordinates(t),n=e.length;if(Array.isArray(e[0])){if(this._coordinates=this._trimRing(e[0]),n>1){for(var i=[],r=1;r<n;r++)e[r]&&i.push(this._trimRing(e[r]));this._holes=i}}else this._coordinates=this._trimRing(e);return this._projectRings(),this},n.getCoordinates=function(){if(!this._coordinates)return[];for(var t=this.getHoles(),e=[this._copyAndCloseRing(this._coordinates)],n=0,i=t.length;n<i;n++)e.push(this._copyAndCloseRing(t[n]));return e},n.getCenterInExtent=function(t){return this._getCenterInExtent(t,this.getShell(),ci)},n.getShell=function(){return this._coordinates||[]},n.getHoles=function(){return this._holes||[]},n.hasHoles=function(){return this.getHoles().length>0},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<r;i++)n+=t.measureLength(e[i]);return n},n._computeGeodesicArea=function(t){var e=this.getCoordinates();if(!U(e))return 0;for(var n=t.measureArea(e[0]),i=1,r=e.length;i<r;i++)n-=t.measureArea(e[i]);return n},n._updateCache=function(){t.prototype._updateCache.call(this),this._prjHoles&&(this._holes=this._unprojectCoords(this._getPrjHoles()))},n._clearCache=function(){return delete this._prjShell,t.prototype._clearCache.call(this)},n._clearProjection=function(){this._prjHoles&&(this._prjHoles=null),this._prjShell&&(this._prjShell=null),t.prototype._clearProjection.call(this)},e}(Hi);function Vi(t){return function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.getCoordinates=function(){return this._coordinates},n.setCoordinates=function(t){var e=t instanceof bn?t:new bn(t);if(e.equals(this._coordinates))return this;if(this._coordinates=e,!this.getMap())return this.onPositionChanged(),this;var n=this._getProjection();return this._setPrjCoordinates(n.project(this._coordinates)),this},n._getCenter2DPoint=function(t){var e=this.getMap();if(!e)return null;var n=p(t)?e.getZoom():e.getGLZoom(),i=this._getPrjCoordinates();return i?e._prjToPoint(i,n):null},n._getPrjCoordinates=function(){var t=this._getProjection();return t?(this._verifyProjection(),this._pcenter||this._coordinates&&(this._pcenter=t.project(this._coordinates)),this._pcenter):null},n._setPrjCoordinates=function(t){this._pcenter=t,this.onPositionChanged()},n._updateCache=function(){this._clearCache();var t=this._getProjection();this._pcenter&&t&&(this._coordinates=t.unproject(this._pcenter))},n._clearProjection=function(){this._pcenter=null,t.prototype._clearProjection.call(this)},n._computeCenter=function(){return this._coordinates?this._coordinates.copy():null},e}(t)}Ui.registerJSONType("Polygon");var Wi=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).type="Point",e&&i.setCoordinates(e),i}se(e,t);var n=e.prototype;return n.getOutline=function(){var t=this._getPainter();if(!t)return null;var n=this.getCoordinates(),i=t.getContainerExtent(),r=this.getMap().coordToContainerPoint(n);return new e(n,{symbol:{markerType:"square",markerWidth:i.getWidth(),markerHeight:i.getHeight(),markerLineWidth:1,markerLineColor:"6b707b",markerFill:"rgba(0, 0, 0, 0)",markerDx:i.xmin-(r.x-i.getWidth()/2),markerDy:i.ymin-(r.y-i.getHeight()/2)}})},n._isVectorMarker=function(){var t=this._getInternalSymbol();return!Array.isArray(t)&&vi.test(t)},n._canEdit=function(){var t=this._getInternalSymbol();return!Array.isArray(t)&&(vi.test(t)||Ei.test(t)||_i.test(t))},n._containsPoint=function(e,n){var i=this.getContainerExtent();return n&&(i=i.expand(n)),!!i.contains(e)&&(!this.options.hitTestForEvent||t.prototype._containsPoint.call(this,e,n))},n._computeExtent=function(){return Zi.call(this,"getCenter")},n._computePrjExtent=function(){return Zi.call(this,"_getPrjCoordinates")},n._computeGeodesicLength=function(){return 0},n._computeGeodesicArea=function(){return 0},n._getSprite=function(t,e){return this._getPainter()?this._getPainter().getSprite(t,e):new Ai(this).getSprite(t,e)},e}(Vi(Ri));function Zi(t){var e=this[t]();return e?new En(e,e,this._getProjection()):null}Wi.mergeOptions({symbol:{markerType:"path",markerPath:[{path:"M8 23l0 0 0 0 0 0 0 0 0 0c-4,-5 -8,-10 -8,-14 0,-5 4,-9 8,-9l0 0 0 0c4,0 8,4 8,9 0,4 -4,9 -8,14z M3,9 a5,5 0,1,0,0,-0.9Z",fill:"#DE3333"}],markerPathWidth:16,markerPathHeight:23,markerWidth:24,markerHeight:34},hitTestForEvent:!1}),Wi.registerJSONType("Marker");var qi=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).type="LineString",e&&i.setCoordinates(e),i}se(e,t);var n=e.prototype;return n.setCoordinates=function(t){return t?(this._coordinates=bn.toCoordinates(t),this.getMap()?this._setPrjCoordinates(this._projectCoords(this._coordinates)):this.onShapeChanged(),this):(this._coordinates=null,this._setPrjCoordinates(null),this)},n.getCoordinates=function(){return this._coordinates||[]},n.getCenterInExtent=function(t){return this._getCenterInExtent(t,this.getCoordinates(),hi)},n._computeGeodesicLength=function(t){return t.measureLength(this.getCoordinates())},n._computeGeodesicArea=function(){return 0},e}(Hi);qi.mergeOptions({arrowStyle:null,arrowPlacement:"vertex-last"}),qi.registerJSONType("LineString");var Xi=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).type="GeometryCollection",i.setGeometries(e),i}se(e,t);var n=e.prototype;return n.setGeometries=function(t){for(var e=this._checkGeometries(t||[]),n=this._getSymbol(),i=this.config(),r=e.length-1;r>=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<r;i++)n[i]&&(e?t.call(e,n[i],i):t(n[i],i));return this},n.filter=function(t,n){if(!t)return new e;var i=[],r=_(t),o=r?t:rt(t);return this.forEach(function(t){var e=r?t:dt(t);(n?o.call(n,e):o(e))&&i.push(t)},this),new e(i)},n.translate=function(t){if(!t)return this;if(this.isEmpty())return this;var e=arguments;return this.forEach(function(t){t&&t.translate&&t.translate.apply(t,e)}),this},n.isEmpty=function(){return!U(this.getGeometries())},n.remove=function(){return this.forEach(function(t){t._unbind()}),Ri.prototype.remove.apply(this,arguments)},n.show=function(){return this.options.visible=!0,this.forEach(function(t){t.show()}),this},n.hide=function(){return this.options.visible=!1,this.forEach(function(t){t.hide()}),this},n.onConfig=function(t){this.forEach(function(e){e.config(t)})},n.getSymbol=function(){var e=t.prototype.getSymbol.call(this);if(!e){var n=[],i=!1;this.forEach(function(t){t.getSymbol()&&!i&&(i=!0),n.push(t.getSymbol())}),i&&(e={children:n})}return e},n.setSymbol=function(t){if(t&&t.children)this._symbol=null,this.forEach(function(e,n){e.setSymbol(t.children[n])});else{var e=this._prepareSymbol(t);this._symbol=e,this.forEach(function(t){t.setSymbol(e)})}return this.onSymbolChanged(),this},n._setExternSymbol=function(t){return t=this._prepareSymbol(t),this._externSymbol=t,this.forEach(function(e){e._setExternSymbol(t)}),this.onSymbolChanged(),this},n._bindLayer=function(){t.prototype._bindLayer.apply(this,arguments),this._bindGeometriesToLayer()},n._bindGeometriesToLayer=function(){var t=this.getLayer();this.forEach(function(e){e._bindLayer(t)})},n._checkGeometries=function(t){if(t&&!Array.isArray(t)){if(t instanceof Ri)return[t];throw new Error("The geometry added to collection is invalid.")}for(var e=0,n=t.length;e<n;e++)if(!this._checkGeo(t[e]))throw new Error("The geometry added to collection is invalid. Index: "+e);return t},n._checkGeo=function(t){return t instanceof Ri},n._updateCache=function(){this._clearCache(),this.isEmpty()||this.forEach(function(t){t&&t._updateCache&&t._updateCache()})},n._removePainter=function(){this._painter&&this._painter.remove(),delete this._painter,this.forEach(function(t){t._removePainter()})},n._computeCenter=function(t){if(!t||this.isEmpty())return null;for(var e=0,n=0,i=0,r=this.getGeometries(),o=0,a=r.length;o<a;o++)if(r[o]){var s=r[o]._computeCenter(t);s&&(e+=s.x,n+=s.y,i++)}return 0===i?null:new bn(e/i,n/i)},n._containsPoint=function(t,e){if(this.isEmpty())return!1;for(var n=this.getGeometries(),i=0,r=n.length;i<r;i++)if(n[i]._containsPoint(t,e))return!0;return!1},n._computeExtent=function(t){return Yi.call(this,t,"_computeExtent")},n._computePrjExtent=function(t){return Yi.call(this,t,"_computePrjExtent")},n._computeGeodesicLength=function(t){if(!t||this.isEmpty())return 0;for(var e=this.getGeometries(),n=0,i=0,r=e.length;i<r;i++)e[i]&&(n+=e[i]._computeGeodesicLength(t));return n},n._computeGeodesicArea=function(t){if(!t||this.isEmpty())return 0;for(var e=this.getGeometries(),n=0,i=0,r=e.length;i<r;i++)e[i]&&(n+=e[i]._computeGeodesicArea(t));return n},n._exportGeoJSONGeometry=function(){var t=[];if(!this.isEmpty())for(var e=this.getGeometries(),n=0,i=e.length;n<i;n++)e[n]&&t.push(e[n]._exportGeoJSONGeometry());return{type:"GeometryCollection",geometries:t}},n._clearProjection=function(){if(!this.isEmpty())for(var t=this.getGeometries(),e=0,n=t.length;e<n;e++)t[e]&&t[e]._clearProjection()},n._getConnectPoints=function(){var t=this.getExtent();return[new bn(t.xmin,t.ymax),new bn(t.xmax,t.ymin),new bn(t.xmin,t.ymin),new bn(t.xmax,t.ymax)]},n._getExternalResources=function(){if(this.isEmpty())return[];for(var t,e,n=this.getGeometries(),i=[],r={},o=0,a=n.length;o<a;o++)if(n[o])for(var s=0,h=(t=Lt(n[o]._getInternalSymbol())).length;s<h;s++)r[e=t[s].join()]||(i.push(t[s]),r[e]=1);return i},n.startEdit=function(t){var e=this;if(this.isEmpty())return this;t||(t={}),t.symbol&&(this._originalSymbol=this.getSymbol(),this.setSymbol(t.symbol)),this._draggbleBeforeEdit=this.options.draggable,this.config("draggable",!1);for(var n=this.getGeometries(),i=0,r=n.length;i<r;i++)n[i].startEdit(t);return this._editing=!0,this.hide(),setTimeout(function(){e.fire("editstart")},1),this},n.endEdit=function(){if(this.isEmpty())return this;for(var t=this.getGeometries(),e=0,n=t.length;e<n;e++)t[e].endEdit();return this._originalSymbol&&(this.setSymbol(this._originalSymbol),delete this._originalSymbol),this._editing=!1,this.show(),this.config("draggable",this._draggbleBeforeEdit),this.fire("editend"),this},n.isEditing=function(){return!!this._editing},e}(Ri);function Yi(t,e){if(this.isEmpty())return null;for(var n=this.getGeometries(),i=null,r=0,o=n.length;r<o;r++){var a=n[r];if(a){var s=a[e](t);s&&(i=s.combine(i))}}return i}Xi.registerJSONType("GeometryCollection");var Ji=function(t){function e(e,n,i,r){var o;return(o=t.call(this,null,r)||this).GeometryType=e,o.type=n,o._initData(i),o}se(e,t);var n=e.prototype;return n.getCoordinates=function(){for(var t=[],e=this.getGeometries(),n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.getShell&&"Polygon"!==r.getJSONType()?[r.getShell()]:r.getCoordinates())}return t},n.setCoordinates=function(t){for(var e=[],n=0,i=(t=t||[]).length;n<i;n++){var r=new this.GeometryType(t[n],this.config());e.push(r)}return this.setGeometries(e),this},n._initData=function(t){(t=t||[]).length&&(t[0]instanceof this.GeometryType?this.setGeometries(t):this.setCoordinates(t))},n._checkGeo=function(t){return t instanceof this.GeometryType},n._exportGeoJSONGeometry=function(){var t=this.getCoordinates(),e=bn.toNumberArrays(t);return{type:this.getType(),coordinates:e}},e}(Xi),Ki=function(t){function e(e,n){return t.call(this,Wi,"MultiPoint",e,n)||this}return se(e,t),e.prototype.findClosest=function(t){if(!t)return null;var e=null,n=1/0;return this.getCoordinates().forEach(function(i){var r=function(t,e){var n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}(i,t);r<n&&(e=i,n=r)}),e},e}(Ji);Ki.registerJSONType("MultiPoint");var Qi=function(t){function e(){return t.apply(this,arguments)||this}return se(e,t),e.prototype.getCenterInExtent=function(t){var e=0,n=0,i=0;return this.getGeometries().forEach(function(r){var o=r.getCenterInExtent(t);o&&(e+=o.x*o.count,n+=o.y*o.count,i+=o.count)}),0===i?null:new bn(e,n)._multi(1/i)},e}(Ji),$i=function(t){function e(e,n){return t.call(this,qi,"MultiLineString",e,n)||this}return se(e,t),e}(Qi);$i.registerJSONType("MultiLineString");var tr=function(t){function e(e,n){return t.call(this,Ui,"MultiPolygon",e,n)||this}return se(e,t),e}(Qi);tr.registerJSONType("MultiPolygon");var er={Marker:Wi,LineString:qi,Polygon:Ui,MultiPoint:Ki,MultiLineString:$i,MultiPolygon:tr},nr={toGeometry:function(t){if(y(t)&&(t=I(t)),Array.isArray(t)){for(var e=[],n=0,i=t.length;n<i;n++){var r=nr._convert(t[n]);Array.isArray(r)?D(e,r):e.push(r)}return e}return nr._convert(t)},_convert:function(t){if(!t||p(t.type))return null;var e=t.type;if("Feature"===e){var n=t.geometry,i=nr._convert(n);return i?(i.setId(t.id),i.setProperties(t.properties),i):null}if("FeatureCollection"===e){var r=t.features;return r?nr.toGeometry(r):null}if(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"].indexOf(e)>=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;h<s;h++)a.push(nr._convert(o[h]));return new Xi(a)}return null}},ir=function(t){function e(e,n,i){var r;return r=t.call(this,null,i)||this,e&&r.setCoordinates(e),r._radius=n,r}se(e,t),e.fromJSON=function(t){var n=t.feature,i=new e(t.coordinates,t.radius,t.options);return i.setProperties(n.properties),i};var n=e.prototype;return n.getRadius=function(){return this._radius},n.setRadius=function(t){return this._radius=t,this.onShapeChanged(),this},n.getShell=function(){for(var t,e,n,i=this._getMeasurer(),r=this.getCoordinates(),o=this.options.numberOfShellPoints,a=this.getRadius(),s=[],h=0,u=o-1;h<u;h++){t=360*h/u*Math.PI/180,e=a*Math.cos(t),n=a*Math.sin(t);var c=i.locate(r,e,n);s.push(c)}return s.push(s[0]),s},n.getHoles=function(){return[]},n.animateShow=function(){return this.show()},n._containsPoint=function(e,n){var i=this.getMap();if(i.getPitch())return t.prototype._containsPoint.call(this,e,n);var r=i._pointToContainerPoint(this._getCenter2DPoint()),o=this.getSize(),a=p(n)?this._hitTestTolerance():n;return di(e,r,r.add(o.width/2,o.height/2),a)},n._computePrjExtent=function(t){var e=this._getMinMax(t);if(!e)return null;var n=this._getPrjCoordinates(),i=e.map(function(e){return t.project(e)}),r=Math.min(Math.abs(i[0].x-n.x),Math.abs(i[1].x-n.x)),o=Math.min(Math.abs(i[2].y-n.y),Math.abs(i[3].y-n.y));return new En(n.sub(r,o),n.add(r,o))},n._computeExtent=function(t){var e=this._getMinMax(t);return e?new En(e[0].x,e[2].y,e[1].x,e[3].y,this._getProjection()):null},n._getMinMax=function(t){if(!t||!this._coordinates||p(this._radius))return null;var e=this._radius;return[t.locate(this._coordinates,-e,0),t.locate(this._coordinates,e,0),t.locate(this._coordinates,0,e),t.locate(this._coordinates,0,-e)]},n._computeGeodesicLength=function(){return p(this._radius)?0:2*Math.PI*this._radius},n._computeGeodesicArea=function(){return p(this._radius)?0:Math.PI*Math.pow(this._radius,2)},n._exportGeoJSONGeometry=function(){return{type:"Polygon",coordinates:bn.toNumberArrays([this.getShell()])}},n._toJSON=function(t){var e=this.getCenter(),n=d({},t);n.geometry=!1;var i=this.toGeoJSON(n);return i.geometry={type:"Polygon"},{feature:i,subType:"Circle",coordinates:[e.x,e.y],radius:this.getRadius()}},e}(Vi(Ui));ir.mergeOptions({numberOfShellPoints:60}),ir.registerJSONType("Circle");var rr=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.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(){for(var t,e,n,i,r=this._getMeasurer(),o=this.getCoordinates(),a=this.options.numberOfShellPoints,s=this.getWidth(),h=this.getHeight(),u=[],c=Math.pow(s/2,2)*Math.pow(h/2,2),l=Math.pow(s/2,2),f=Math.pow(h/2,2),d=0;d<a;d++){e=(t=360*d/a)*Math.PI/180,n=Math.sqrt(c/(l*Math.pow(Math.tan(e),2)+f)),i=Math.sqrt(c/(f*Math.pow(1/Math.tan(e),2)+l)),t>90&&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;h<u;h++){var c=e[h],l=0,f=0;r*(s.x-c.x)>0&&(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;c<o;c++){t=(u*c/(o-1)+h)*Math.PI/180,e=a*Math.cos(t),n=a*Math.sin(t);var l=i.locate(r,e,n);s.push(l)}return s.push(r.copy()),s},n._containsPoint=function(e,n){var i=this.getMap();if(i.isTransforming())return t.prototype._containsPoint.call(this,e,n);var r=i._pointToContainerPoint(this._getCenter2DPoint()),o=p(n)?this._hitTestTolerance():n,a=this.getSize(),s=r,h=e,u=h.x-s.x,c=s.y-h.y,l=Math.atan2(c,u),f=l<0?360*(l+2*Math.PI)/(2*Math.PI):360*l/(2*Math.PI),d=this.startAngle%360,m=this.endAngle%360,g=!1;return g=d>m?!(f>m&&f<d):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;r<o;r++){var a=sn._arcBetween(t,e[r-1],e[r],i),s=[e[r-1].x+e[r].x-a[0],e[r-1].y+e[r].y-a[1]];e[r-1].nextCtrlPoint=s,e[r].prevCtrlPoint=s,sn._stroke(t,n)}},n._quadraticCurve=function(t,e){if(e.length<=2)sn._path(t,e);else{var n,i;for(n=2,i=e.length;n<i;n+=2)t.quadraticCurveTo(e[n-1].x,e[n-1].y,e[n].x,e[n].y);if((n-=1)<i)for(;n<i;n++)t.lineTo(e[n].x,e[n].y)}},n._bezierCurve=function(t,e){if(e.length<=3)sn._path(t,e);else{var n,i;for(n=1,i=e.length;n+2<i;n+=3)t.bezierCurveTo(e[n].x,e[n].y,e[n+1].x,e[n+1].y,e[n+2].x,e[n+2].y);if(n<i)for(;n<i;n++)t.lineTo(e[n].x,e[n].y)}},n._getCurveArrowPoints=function(t,e,n,i,r,o){var a,s=e.length;for(a=o;a<s;a+=o)t.push(this._getArrowShape(e[a-1],e[a],n,i,r));if((a-=o)<s-1)for(a+=1;a<s;a++)t.push(this._getArrowShape(e[a-1],e[a],n,i,r))},e}(qi);sr.mergeOptions({enableSimplify:!1,enableClip:!1});var hr=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"ArcCurve"}},n._paintOn=function(t,e,n){t.beginPath(),this._arc(t,e,n),sn._stroke(t,n),this._paintArrow(t,e,n)},e.fromJSON=function(t){var n=t.feature,i=new e(n.geometry.coordinates,t.options);return i.setProperties(n.properties),i},e}(sr);hr.registerJSONType("ArcCurve"),hr.mergeOptions({arcDegree:90});var ur=function(t){function e(){return t.apply(this,arguments)||this}se(e,t),e.fromJSON=function(t){var n=t.feature,i=new e(n.geometry.coordinates,t.options);return i.setProperties(n.properties),i};var n=e.prototype;return n._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"CubicBezierCurve"}},n._paintOn=function(t,e,n){t.beginPath(),t.moveTo(e[0].x,e[0].y),this._bezierCurve(t,e),sn._stroke(t,n),this._paintArrow(t,e,n)},n._getArrowPoints=function(t,e,n,i,r){return this._getCurveArrowPoints(t,e,n,i,r,3)},e}(sr);ur.registerJSONType("CubicBezierCurve");var cr=function(t){function e(){return t.apply(this,arguments)||this}se(e,t),e.fromJSON=function(t){var n=t.feature,i=new e(n.geometry.coordinates,t.options);return i.setProperties(n.properties),i};var n=e.prototype;return n._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"QuadBezierCurve"}},n._paintOn=function(t,e,n){t.beginPath(),t.moveTo(e[0].x,e[0].y),this._quadraticCurve(t,e,n),sn._stroke(t,n),this._paintArrow(t,e,n)},n._getArrowPoints=function(t,e,n,i,r){return this._getCurveArrowPoints(t,e,n,i,r,2)},e}(sr);cr.registerJSONType("QuadBezierCurve");var lr={textFaceName:"monospace",textSize:12,textLineSpacing:8,textWrapCharacter:"\n",textHorizontalAlignment:"middle",textVerticalAlignment:"middle"},fr={markerType:"square",markerLineColor:"#000",markerLineWidth:2,markerLineOpacity:1,markerFill:"#fff",markerOpacity:1},dr=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.getContent=function(){return this._content},n.setContent=function(t){var e=this._content;return this._content=pe(t),this._refresh(),this._fireEvent("contentchange",{old:e,new:t}),this},n.onAdd=function(){this._refresh()},n.toJSON=function(){var e=t.prototype.toJSON.call(this);return delete e.symbol,e},n.setSymbol=function(e){if(this._refreshing||!e)return t.prototype.setSymbol.call(this,e);var n=this._parseSymbol(e);if(this.setTextStyle){var i=this.getTextStyle()||{};i.symbol=n[0],this.setTextStyle(i)}else this.setTextSymbol&&this.setTextSymbol(n[0]);if(this.setBoxStyle){var r=this.getBoxStyle()||{};r.symbol=n[1],this.setBoxStyle(r)}else this.setBoxSymbol&&this.setBoxSymbol(n[1]);return this},n._parseSymbol=function(t){var e={},n={};for(var i in t)w(t,i)&&(0===i.indexOf("text")?e[i]=t[i]:n[i]=t[i]);return[e,n]},n._getTextSize=function(t){return Ce(this._content,t).size},n._getInternalSymbol=function(){return this._symbol},n._getDefaultTextSymbol=function(){return d({},lr)},n._getDefaultBoxSymbol=function(){return d({},fr)},n._getDefaultPadding=function(){return[12,8]},e}(Wi),pr=function(t){function e(e,n,i,r,o){var a;return void 0===o&&(o={}),(a=t.call(this,n,o)||this)._content=pe(e),a._width=p(i)?100:i,a._height=p(r)?40:r,o.boxSymbol&&a.setBoxSymbol(o.boxSymbol),o.textStyle&&a.setTextStyle(o.textStyle),a._refresh(),a}se(e,t);var n=e.prototype;return n.getWidth=function(){return this._width},n.setWidth=function(t){return this._width=t,this._refresh(),this},n.getHeight=function(){return this._height},n.setHeight=function(t){return this._height=t,this._refresh(),this},n.getBoxSymbol=function(){return d({},this.options.boxSymbol)},n.setBoxSymbol=function(t){return this.options.boxSymbol=t?d({},t):t,this.getSymbol()&&this._refresh(),this},n.getTextStyle=function(){return this.options.textStyle?d({},this.options.textStyle):null},n.setTextStyle=function(t){return this.options.textStyle=t?d({},t):t,this.getSymbol()&&this._refresh(),this},e.fromJSON=function(t){var n=t.feature,i=new e(t.content,n.geometry.coordinates,t.width,t.height,t.options);return i.setProperties(n.properties),i.setId(n.id),t.symbol&&i.setSymbol(t.symbol),i},n._toJSON=function(t){return{feature:this.toGeoJSON(t),width:this.getWidth(),height:this.getHeight(),subType:"TextBox",content:this._content}},n._refresh=function(){var t=this.getTextStyle()||{},e=t.padding||[12,8],n=this._width-2*e[0],i=this._height-2*e[1],r=d({},t.symbol||this._getDefaultTextSymbol(),this.options.boxSymbol||this._getDefaultBoxSymbol(),{textName:this._content,markerWidth:this._width,markerHeight:this._height,textHorizontalAlignment:"middle",textVerticalAlignment:"middle",textMaxWidth:n,textMaxHeight:i});t.wrap&&!r.textWrapWidth&&(r.textWrapWidth=n);var o=t.horizontalAlignment;r.textDx=r.markerDx||0;var a=r.markerWidth/2-e[0];"left"===o?(r.textHorizontalAlignment="right",r.textDx=r.textDx-a):"right"===o&&(r.textHorizontalAlignment="left",r.textDx=r.textDx+a);var s=t.verticalAlignment;r.textDy=r.markerDy||0;var h=r.markerHeight/2-e[1];"top"===s?(r.textVerticalAlignment="bottom",r.textDy-=h):"bottom"===s&&(r.textVerticalAlignment="top",r.textDy+=h),this._refreshing=!0,this.updateSymbol(r),delete this._refreshing},e}(dr);pr.mergeOptions({textStyle:{wrap:!0,padding:[12,8],verticalAlignment:"middle",horizontalAlignment:"middle"},boxSymbol:null}),pr.registerJSONType("TextBox");var mr=function(t){function e(e,n,i){var r;return void 0===i&&(i={}),r=t.call(this,n,i)||this,i.textSymbol&&r.setTextSymbol(i.textSymbol),i.boxStyle&&r.setBoxStyle(i.boxStyle),r._content=pe(e),r._refresh(),r}se(e,t);var n=e.prototype;return n.getBoxStyle=function(){return this.options.boxStyle?d({},this.options.boxStyle):null},n.setBoxStyle=function(t){return this.options.boxStyle=t?d({},t):t,this._refresh(),this},n.getTextSymbol=function(){return d({},this._getDefaultTextSymbol(),this.options.textSymbol)},n.setTextSymbol=function(t){return this.options.textSymbol=t?d({},t):t,this._refresh(),this},e.fromJSON=function(t){var n=t.feature,i=new e(t.content,n.geometry.coordinates,t.options);return i.setProperties(n.properties),i.setId(n.id),t.symbol&&i.setSymbol(t.symbol),i},n._canEdit=function(){return!1},n._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"Label",content:this._content}},n._refresh=function(){var t=d({},this.getTextSymbol(),{textName:this._content}),e=this.getBoxStyle();if(e){d(t,e.symbol);var n=this._getBoxSize(t),i=n[1],r=e.padding||this._getDefaultPadding(),o=n[0];t.markerWidth=o.width,t.markerHeight=o.height;var a=t.textDx||0,s=t.textDy||0,h=Ee(i,t.textHorizontalAlignment,t.textVerticalAlignment)._add(a,s),u=e.horizontalAlignment||"middle";t.markerDx=h.x,"left"===u?t.markerDx+=t.markerWidth/2-r[0]:"right"===u?t.markerDx-=t.markerWidth/2-i.width-r[0]:t.markerDx+=i.width/2;var c=e.verticalAlignment||"middle";t.markerDy=h.y,"top"===c?t.markerDy+=t.markerHeight/2-r[1]:"bottom"===c?t.markerDy-=t.markerHeight/2-i.height-r[1]:t.markerDy+=i.height/2}this._refreshing=!0,this.updateSymbol(t),delete this._refreshing},n._getBoxSize=function(t){t.markerType||(t.markerType="square");var e,n,i=this.getBoxStyle(),r=this._getTextSize(t),o=i.padding||this._getDefaultPadding();return e=r.width+2*o[0],n=r.height+2*o[1],i.minWidth&&(!e||e<i.minWidth)&&(e=i.minWidth),i.minHeight&&(!n||n<i.minHeight)&&(n=i.minHeight),[new le(e,n),r]},e}(dr);mr.mergeOptions({boxStyle:null,textSymbol:null}),mr.registerJSONType("Label");var gr=function(t){return function(t){function e(){return t.apply(this,arguments)||this}se(e,t),e._hasConnectors=function(t){return!p(t.__connectors)&&t.__connectors.length>0},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;s<h;s++)for(var u=i[s],c=0,l=r.length;c<l;c++){var f=r[c],d=t.computeLength(u,f);0===s&&0===c?(e=u,n=f,o=d):d<o&&(e=u,n=f)}U(a)&&a[0].equals(e)&&a[1].equals(n)||this.setCoordinates([e,n])}},n.onAdd=function(){this._registerEvents(),this._updateCoordinates()},n.onRemove=function(){if(this._connSource&&(this._connSource.__connectors&&k(this,this._connSource.__connectors),this._connSource.off("dragging positionchange",this._updateCoordinates,this).off("remove",this.onRemove,this),this._connSource.off("dragstart mousedown mouseover",this._showConnect,this),this._connSource.off("dragend mouseup mouseout",this.hide,this),this._connSource.off("show",this._showConnect,this).off("hide",this.hide,this),delete this._connSource),this._connTarget&&(k(this,this._connTarget.__connectors),this._connTarget.off("dragging positionchange",this._updateCoordinates,this).off("remove",this.onRemove,this),this._connTarget.off("show",this._showConnect,this).off("hide",this.hide,this),delete this._connTarget),!(this._connSource instanceof Ri&&this._connTarget instanceof Ri)){var t=this.getMap();t&&t.off("movestart moving moveend zoomstart zooming zoomend rotate pitch fovchange spatialreferencechange",this._updateCoordinates,this)}},n._showConnect=function(){this._connSource&&this._connTarget&&this._connSource.isVisible()&&this._connTarget.isVisible()&&(this._updateCoordinates(),this.show())},n._registerEvents=function(){if(this._connSource&&this._connTarget){this._connSource.__connectors||(this._connSource.__connectors=[]),this._connTarget.__connectors||(this._connTarget.__connectors=[]),this._connSource.__connectors.push(this),this._connTarget.__connectors.push(this),this._connSource.on("dragging positionchange",this._updateCoordinates,this).on("remove",this.remove,this),this._connTarget.on("dragging positionchange",this._updateCoordinates,this).on("remove",this.remove,this),this._connSource.on("show",this._showConnect,this).on("hide",this.hide,this),this._connTarget.on("show",this._showConnect,this).on("hide",this.hide,this);var t=this.options.showOn;if(this.hide(),"moving"===t?(this._connSource.on("dragstart",this._showConnect,this).on("dragend",this.hide,this),this._connTarget.on("dragstart",this._showConnect,this).on("dragend",this.hide,this)):"click"===t?(this._connSource.on("mousedown",this._showConnect,this).on("mouseup",this.hide,this),this._connTarget.on("mousedown",this._showConnect,this).on("mouseup",this.hide,this)):"mouseover"===t?(this._connSource.on("mouseover",this._showConnect,this).on("mouseout",this.hide,this),this._connTarget.on("mouseover",this._showConnect,this).on("mouseout",this.hide,this)):this._showConnect(),!(this._connSource instanceof Ri&&this._connTarget instanceof Ri)){var e=this.getMap();e&&e.on("movestart moving moveend zoomstart zooming zoomend rotate pitch fovchange spatialreferencechange",this._updateCoordinates,this)}}},e}(t)},vr={showOn:"always"},yr=function(t){function e(e,n,i){var r;return r=t.call(this,null,i)||this,1===arguments.length&&(i=e,e=null,n=null),r._connSource=e,r._connTarget=n,r}return se(e,t),e}(gr(qi));yr.mergeOptions(vr),yr.registerJSONType("ConnectorLine");var _r=function(t){function e(e,n,i){var r;return r=t.call(this,null,i)||this,1===arguments.length&&(i=e,e=null,n=null),r._connSource=e,r._connTarget=n,r}return se(e,t),e}(gr(hr));_r.mergeOptions(vr),_r.registerJSONType("ArcConnectorLine");var xr=function(t){function e(e,n,i){var r;return n&&!(n instanceof Ri)&&!Array.isArray(n)&&s.indexOf(n.type)<0&&(i=n,n=null),(r=t.call(this,e,i)||this)._maxZIndex=0,r._minZIndex=0,r._initCache(),n&&r.addGeometry(n),r}se(e,t);var n=e.prototype;return n.getGeometryById=function(t){return p(t)||""===t?null:this._geoMap[t]?this._geoMap[t]:null},n.getGeometries=function(t,e){if(!t)return this._geoList.slice(0);for(var n,i=[],r=0,o=this._geoList.length;r<o;r++)n=this._geoList[r],(e?t.call(e,n):t(n))&&i.push(n);return i},n.getFirstGeometry=function(){return this._geoList.length?this._geoList[0]:null},n.getLastGeometry=function(){var t=this._geoList.length;return 0===t?null:this._geoList[t-1]},n.getCount=function(){return this._geoList.length},n.getExtent=function(){if(0===this.getCount())return null;var t=new En(this.getProjection());return this.forEach(function(e){t._combine(e.getExtent())}),t},n.forEach=function(t,e){for(var n=this._geoList.slice(0),i=0,r=n.length;i<r;i++)e?t.call(e,n[i],i):t(n[i],i);return this},n.filter=function(){return Xi.prototype.filter.apply(this,arguments)},n.isEmpty=function(){return!this._geoList.length},n.addGeometry=function(t,e){if(!t)return this;if("FeatureCollection"===t.type)return this.addGeometry(nr.toGeometry(t),e);if(!Array.isArray(t)){var n=arguments.length,i=arguments[n-1];return t=Array.prototype.slice.call(arguments,0,n-1),e=i,v(i)&&(t.push(i),e=!1),this.addGeometry(t,e)}if(0===t.length)return this;var r;this._initCache(),!0===e&&(r=new En),this._toSort=this._maxZIndex>0;for(var o=[],a=0,s=t.length;a<s;a++){var h=t[a];if(!h)throw new Error("Invalid geometry to add to layer("+this.getId()+") at index:"+a);if(!(h instanceof Ri)&&(h=Ri.fromJSON(h),Array.isArray(h)))for(var u=0,c=h.length;u<c;u++)this._add(h[u],r,a),o.push(h[u]);Array.isArray(h)||(this._add(h,r,a),o.push(h))}var l=this.getMap();if(l&&(this._getRenderer().onGeometryAdd(o),!0===e&&!p(r.xmin))){var f=l.getFitZoom(r);l.setCenterAndZoom(r.getCenter(),f)}return this.fire("addgeo",{geometries:t}),this},n.getGeoMinZIndex=function(){return this._minZIndex},n.getGeoMaxZIndex=function(){return this._maxZIndex},n._add=function(t,e,n){this._toSort||(this._toSort=0!==t.getZIndex()),this._updateZIndex(t.getZIndex());var i=t.getId();if(!p(i)){if(!p(this._geoMap[i]))throw new Error("Duplicate geometry id in layer("+this.getId()+"):"+i+", at index:"+n);this._geoMap[i]=t}var r=R();t._setInternalId(r),this._geoList.push(t),this.onAddGeometry&&this.onAddGeometry(t),t._bindLayer(this),t.onAdd&&t.onAdd(),e&&e._combine(t.getExtent()),t._fireEvent("add",{layer:this})},n.removeGeometry=function(t){if(!Array.isArray(t))return this.removeGeometry([t]);for(var e=t.length-1;e>=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<e;t++)this._geoList[t].onHide();return $n.prototype.hide.call(this)},n.identify=function(t,e){return void 0===e&&(e={}),this._hitGeos(this._geoList,t,e)},n._hitGeos=function(t,e,n){void 0===n&&(n={});for(var i=n.filter,r=n.tolerance,o=[],a=this.getMap(),s=a.coordToPoint(e),h=a._pointToContainerPoint(s),u=t.length-1;u>=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;n<t;n++)e[n]=arguments[n];this._maxZIndex=Math.max(this._maxZIndex,Math.max.apply(Math,e)),this._minZIndex=Math.min(this._minZIndex,Math.min.apply(Math,e))},n._sortGeometries=function(){var t=this;this._toSort&&(this._maxZIndex=0,this._minZIndex=0,this._geoList.sort(function(e,n){return t._updateZIndex(e.getZIndex(),n.getZIndex()),t._compare(e,n)}),this._toSort=!1)},n._compare=function(t,e){return t.getZIndex()===e.getZIndex()?t._getInternalId()-e._getInternalId():t.getZIndex()-e.getZIndex()},n._findInList=function(t){var e=this._geoList.length;if(0===e)return-1;for(var n,i=0,r=e-1;i<=r;){if(n=Math.floor((i+r)/2),this._geoList[n]===t)return n;this._compare(this._geoList[n],t)>0?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<i;n++)if(!0===this._cookedStyles[n].filter(e))return t._setExternSymbol(this._cookedStyles[n].symbol),!0;return!1},n.identify=function(e,n){void 0===n&&(n={});var i=this.getRenderer();return n.onlyVisible&&i&&i.identify?i.identify(e,n):t.prototype.identify.call(this,e,n)},n.toJSON=function(t){t||(t={});var e={type:this.getJSONType(),id:this.getId(),options:this.config()};if((p(t.style)||t.style)&&this.getStyle()&&(e.style=this.getStyle()),p(t.geometries)||t.geometries){var n;if(t.clipExtent){var i=this.getMap(),r=i?i.getProjection():null;n=new En(t.clipExtent,r)}for(var o=[],a=this.getGeometries(),s=0,h=a.length;s<h;s++){var u=a[s],c=u.getExtent();if(c&&(!n||n.intersects(c))){var l=u.toJSON(t.geometries);o.push(l)}}e.geometries=o}return e},e.fromJSON=function(t){if(!t||"VectorLayer"!==t.type)return null;for(var n=new e(t.id,t.options),i=t.geometries,r=[],o=0;o<i.length;o++){var a=Ri.fromJSON(i[o]);a&&r.push(a)}return n.addGeometry(r),t.style&&n.setStyle(t.style),n},e}(xr);br.mergeOptions(wr),br.registerJSONType("VectorLayer");var Mr="_map_tool",Er=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addTo=function(t){return t?(this._map=t,t[Mr]&&t[Mr].disable(),this.onAdd&&this.onAdd(),this.enable(),t[Mr]=this,this._fireEvent("add"),this):this},n.getMap=function(){return this._map},n.enable=function(){return!this._map||this._enabled?this:(this._enabled=!0,this._switchEvents("off"),this._registerEvents(),this.onEnable&&this.onEnable(),this._fireEvent("enable"),this)},n.disable=function(){return this._enabled&&this._map?(this._enabled=!1,this._switchEvents("off"),this.onDisable&&this.onDisable(),this._fireEvent("disable"),this):this},n.isEnabled=function(){return!!this._enabled},n.remove=function(){return this._map?(this.disable(),this._map&&(delete this._map[Mr],delete this._map),this._fireEvent("remove"),this):this},n._registerEvents=function(){this._switchEvents("on")},n._switchEvents=function(t){var e=this.getEvents();e&&this._map[t](e,this)},n._fireEvent=function(t,e){e||(e={}),this.fire(t,e)},e}(fn(mn)),Sr={},Tr=function(t){function e(e){var n;return(n=t.call(this,e)||this)._checkMode(),n._events={click:n._firstClickHandler,mousemove:n._mouseMoveHandler,dblclick:n._doubleClickHandler,mousedown:n._mouseDownHandler,mouseup:n._mouseUpHandler},n}se(e,t),e.registerMode=function(t,e){Sr[t.toLowerCase()]=e},e.getRegisterMode=function(t){return Sr[t.toLowerCase()]};var n=e.prototype;return n.getMode=function(){return this.options.mode?this.options.mode.toLowerCase():null},n.setMode=function(t){return this._geometry&&(this._geometry.remove(),delete this._geometry),this._clearStage(),this._switchEvents("off"),this.options.mode=t,this._checkMode(),this.isEnabled()&&(this._switchEvents("on"),this._restoreMapCfg(),this._saveMapCfg()),this},n.getSymbol=function(){var t=this.options.symbol;return Nt(t||this.options.symbol)},n.setSymbol=function(t){return t?(this.options.symbol=t,this._geometry&&this._geometry.setSymbol(t),this):this},n.getCurrentGeometry=function(){return this._geometry},n.onAdd=function(){this._checkMode()},n.onEnable=function(){return this._saveMapCfg(),this._drawToolLayer=this._getDrawLayer(),this._clearStage(),this._loadResources(),this},n.onDisable=function(){var t=this.getMap();return this._restoreMapCfg(),this.endDraw(),this._map&&t.removeLayer(this._getDrawLayer()),this},n.undo=function(){var t=this._getRegisterMode(),e=t.action;if(!this._shouldRecordHistory(e)||!this._historyPointer)return this;var n=this._clickCoords.slice(0,--this._historyPointer);return t.update(n,this._geometry),this},n.redo=function(){var t=this._getRegisterMode(),e=t.action;if(!this._shouldRecordHistory(e)||p(this._historyPointer)||this._historyPointer===this._clickCoords.length)return this;var n=this._clickCoords.slice(0,++this._historyPointer);return t.update(n,this._geometry),this},n._shouldRecordHistory=function(t){return Array.isArray(t)&&"click"===t[0]&&"mousemove"===t[1]&&"dblclick"===t[2]},n._checkMode=function(){this._getRegisterMode()},n._saveMapCfg=function(){var t=this.getMap();if(this._mapDoubleClickZoom=t.options.doubleClickZoom,t.config({doubleClickZoom:this.options.doubleClickZoom}),this._getRegisterMode().action.indexOf("mousedown")>-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;n<t.length;n++)e[t[n]]=this._events[t[n]];return e}return null},n._mouseDownHandler=function(t){this._createGeometry(t)},n._mouseUpHandler=function(t){this.endDraw(t)},n._firstClickHandler=function(t){var e=this._getRegisterMode(),n=t.coordinate;this._geometry?(p(this._historyPointer)||(this._clickCoords=this._clickCoords.slice(0,this._historyPointer)),this._clickCoords.push(n),this._historyPointer=this._clickCoords.length,e.clickLimit&&e.clickLimit===this._historyPointer?(e.update([n],this._geometry,t),this.endDraw(t)):e.update(this._clickCoords,this._geometry,t),this._fireEvent("drawvertex",t)):this._createGeometry(t)},n._createGeometry=function(t){var e=this.getMode(),n=this._getRegisterMode(),i=t.coordinate,r=this.getSymbol();this._geometry||(this._clickCoords=[i],this._geometry=n.create(this._clickCoords,t),r&&"point"!==e?this._geometry.setSymbol(r):this.options.hasOwnProperty("symbol")&&this._geometry.setSymbol(this.options.symbol),this._addGeometryToStage(this._geometry),this._fireEvent("drawstart",t)),"point"===e&&this.endDraw(t)},n._mouseMoveHandler=function(t){var e=this.getMap(),n=t.coordinate;if(this._geometry&&e&&!e.isInteracting()){var i=this._getMouseContainerPoint(t);if(this._isValidContainerPoint(i)){var r=this._getRegisterMode();if(this._shouldRecordHistory(r.action)){var o=this._clickCoords.slice(0,this._historyPointer);if(o&&o.length>0&&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;o<a;o++)i[o].x===i[o-1].x&&i[o].y===i[o-1].y||r.push(i[o]);r.length<2||this._geometry&&this._geometry instanceof Ui&&r.length<3||(n.update(r,this._geometry,t),this.endDraw(t))}}}},n._addGeometryToStage=function(t){this._getDrawLayer().addGeometry(t)},n.endDraw=function(t){if(!this._geometry||this._ending)return this;this._ending=!0;var e=this._geometry;return this._clearStage(),t=t||{},this._geometry=e,this._fireEvent("drawend",t),delete this._geometry,this.options.once&&this.disable(),delete this._ending,this},n._clearStage=function(){this._getDrawLayer().clear(),delete this._geometry,delete this._clickCoords},n._getMouseContainerPoint=function(t){return"mousedown"===this._getRegisterMode().action&&Ge(t.domEvent),t.containerPoint},n._isValidContainerPoint=function(t){var e=this._map.getSize(),n=e.width,i=e.height;return!(t.x<0||t.y<0)&&!(t.x>n||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<i;n++){var r=Ri.fromJSON(t[n]);Array.isArray(t)?e=e.concat(r):e.push(r)}return e}return t&&!t.feature?nr.toGeometry(t):(t.subType?(o=Ri.getJSONClass(t.subType).fromJSON(t),p(t.feature.id)||o.setId(t.feature.id)):(o=nr.toGeometry(t.feature),t.options&&o.config(t.options)),t.symbol&&o.setSymbol(t.symbol),t.infoWindow&&o.setInfoWindow(t.infoWindow),o);var o},$n.fromJSON=function(t){if(!t)return null;var e=t.type,n=$n.getJSONClass(e);if(!n||!n.fromJSON)throw new Error("unsupported layer type:"+e);return n.fromJSON(t)},ri.include({JSON_VERSION:"1.0",toJSON:function(t){t||(t={});var e={version:this.JSON_VERSION,extent:this.getExtent().toJSON()};e.options=this.config(),e.options.center=this.getCenter(),e.options.zoom=this.getZoom();var n=this.getBaseLayer();(p(t.baseLayer)||t.baseLayer)&&n&&(e.baseLayer=n.toJSON(t.baseLayer));var i={};t.clipExtent&&(!0===t.clipExtent?i.clipExtent=this.getExtent():i.clipExtent=t.clipExtent);var r=[];if(p(t.layers)||t.layers&&!Array.isArray(t.layers)){for(var o=this.getLayers(),a=0,s=o.length;a<s;a++)if(o[a].toJSON){var h=d({},v(t.layers)?t.layers:{},i);r.push(o[a].toJSON(h))}e.layers=r}else if(U(t.layers)){for(var u=t.layers,c=0;c<u.length;c++){var l=u[c],f=this.getLayer(l.id);if(f.toJSON){var m=d({},l.options,i);r.push(f.toJSON(m))}}e.layers=r}else e.layers=[];return e}}),ri.fromJSON=function(t,e,n){if(!t||!e)return null;n||(n={});var i=new ri(t,e.options);if(p(n.baseLayer)||n.baseLayer){var r=$n.fromJSON(e.baseLayer);r&&i.setBaseLayer(r)}if(p(n.layers)||n.layers){for(var o=[],a=e.layers,s=0;s<a.length;s++){var h=$n.fromJSON(a[s]);o.push(h)}i.addLayer(o)}return i},ri.include({computeLength:function(t,e){if(!this.getProjection())return null;var n=new bn(t),i=new bn(e);return n.equals(i)?0:this.getProjection().measureLength(n,i)},computeGeometryLength:function(t){return t._computeGeodesicLength(this.getProjection())},computeGeometryArea:function(t){return t._computeGeodesicArea(this.getProjection())},identify:function(t,e){if(!t)return this;var n=t.layers;if(!U(n))return this;for(var i=[],r=0,a=n.length;r<a;r++)y(n[r])?i.push(this.getLayer(n[r])):i.push(n[r]);for(var s=new bn(t.coordinate),h=d({},t),u=[],c=i.length-1;c>=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 t<n&&(t=n),t>e&&(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._viewHistoryPointer<this._viewHistory.length-1&&this._viewHistory.splice(this._viewHistoryPointer+1),this._viewHistory.push(t);var i=this.options.viewHistoryCount;i>0&&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;t<this._measureLayers.length;t++)this._measureLayers[t].remove();return delete this._lastMeasure,delete this._lastVertex,this._measureLayers=[],this},n.getMeasureLayers=function(){return this._measureLayers},n.getLastMeasure=function(){return this._lastMeasure?this._lastMeasure:0},n._measure=function(t){var e,n,i=this.getMap();t instanceof Ri?e=i.computeGeometryLength(t):Array.isArray(t)&&(e=i.getProjection().measureLength(t)),this._lastMeasure=e,n="zh-CN"===this.options.language?[" 米"," 公里"," 英尺"," 英里"]:[" m"," km"," feet"," mile"];var r="";return this.options.metric&&(r+=e<1e3?e.toFixed(0)+n[0]:(e/1e3).toFixed(2)+n[1]),this.options.imperial&&(e*=3.2808399,r.length>0&&(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<a;o++)i.push(r[o].resolution);var s=t.fullExtent,h=e.origin,u=[1,-1,h.x,h.y];return delete s.spatialReference,{spatialReference:{resolutions:i,fullExtent:s},tileSystem:u,tileSize:n}}Ur.mergeOptions({mode:"Polygon",symbol:{lineColor:"#000000",lineWidth:2,lineOpacity:1,lineDasharray:"",polygonFill:"#ffffff",polygonOpacity:.5}}),Tr.registerMode("circle",{clickLimit:2,action:["click","mousemove","click"],create:function(t){return new ir(t[0],0)},update:function(t,e){var n=e.getMap().computeLength(e.getCenter(),t[t.length-1]);e.setRadius(n)},generate:function(t){return t}}),Tr.registerMode("freeHandCircle",{action:["mousedown","mousemove","mouseup"],create:function(t){return new ir(t[0],0)},update:function(t,e){var n=e.getMap().computeLength(e.getCenter(),t[t.length-1]);e.setRadius(n)},generate:function(t){return t}}),Tr.registerMode("ellipse",{clickLimit:2,action:["click","mousemove","click"],create:function(t){return new rr(t[0],0,0)},update:function(t,e){var n=e.getMap(),i=e.getCenter(),r=n.computeLength(i,new bn({x:t[t.length-1].x,y:i.y})),o=n.computeLength(i,new bn({x:i.x,y:t[t.length-1].y}));e.setWidth(2*r),e.setHeight(2*o)},generate:function(t){return t}}),Tr.registerMode("freeHandEllipse",{action:["mousedown","mousemove","mouseup"],create:function(t){return new rr(t[0],0,0)},update:function(t,e){var n=e.getMap(),i=e.getCenter(),r=n.computeLength(i,new bn({x:t[t.length-1].x,y:i.y})),o=n.computeLength(i,new bn({x:i.x,y:t[t.length-1].y}));e.setWidth(2*r),e.setHeight(2*o)},generate:function(t){return t}}),Tr.registerMode("rectangle",{clickLimit:2,action:["click","mousemove","click"],create:function(t){var e=new Ui([]);return e._firstClick=t[0],e},update:function(t,e,n){var i=e.getMap(),r=n.containerPoint,o=i.coordToContainerPoint(e._firstClick),a=[[o.x,o.y],[r.x,o.y],[r.x,r.y],[o.x,r.y]];e.setCoordinates(a.map(function(t){return i.containerPointToCoord(new ce(t))}))},generate:function(t){return t}}),Tr.registerMode("freeHandRectangle",{action:["mousedown","mousemove","mouseup"],create:function(t){var e=new Ui([]);return e._firstClick=t[0],e},update:function(t,e){var n=e._firstClick,i=[[n.x,n.y],[t[0].x,n.y],[t[0].x,t[0].y],[n.x,t[0].y]];e.setCoordinates(i)},generate:function(t){return t}}),Tr.registerMode("point",{clickLimit:1,action:["click"],create:function(t){return new Wi(t[0])},generate:function(t){return t}}),Tr.registerMode("polygon",{action:["click","mousemove","dblclick"],create:function(t){return new qi(t)},update:function(t,e){var n=e.getSymbol();e.setCoordinates(t);var i=e.getLayer();if(i){var r=i.getGeometryById("polygon");if(!r&&t.length>=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;n<e.length;n++){var i=fe(e[n]);"fade"===i?t.fade=!0:"scale"===i&&(t.scale=!0)}var r=null;return t.fade&&(r="opacity "+this.options.animationDuration+"ms"),t.scale&&(r=r?r+",":"",r+=Le+" "+this.options.animationDuration+"ms"),t.transition=r,t.ok=null!==r,t},n._getViewPoint=function(){return this.getMap().coordToViewPoint(this._coordinate)._add(this.options.dx,this.options.dy)},n._autoPan=function(){var t=this.getMap(),e=this.getDOM();if(!t.isMoving()){var n=this._pos,i=t.getSize(),r=i.width,o=i.height,a=t.viewPointToContainerPoint(n),s=parseInt(e.clientWidth),h=parseInt(e.clientHeight),u=0,c=0;a.x<0?u=-(a.x-s/2):a.x+s-35>r&&(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='<em class="maptalks-ico"></em>';this.options.title&&(n+="<h2>"+this.options.title+"</h2>"),n+='<a href="javascript:void(0);" class="maptalks-close"></a><div class="maptalks-msgContent"></div>',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='<div class="'+e+'">'+this._content+"</div>",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;s<h;s++){if("-"===(i=o[s])||"_"===i)Xe(r=De("li"),"maptalks-menu-splitter");else{r=De("li");var u=i.item;_(u)&&(u=u({owner:this._owner,index:s})),r.innerHTML=u,r._callback=i.click,en(r,"click",a(s))}n.appendChild(r)}var c=this.options.maxHeight||0;return c>0&&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='<span style="padding:0px 4px">'+n+"</span>"}},e}(io);oo.mergeOptions({position:{bottom:0,left:0},content:'<a href="http://maptalks.org" target="_blank">maptalks</a>'}),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<c;u++){var l=o[u];this._isExcluded(l)&&(s.appendChild(this._renderLayer(o[u],!0)),a.appendChild(s),e.appendChild(a))}}if(r){var f=De("li","group"),d=De("ul"),p=De("label");p.innerHTML=this.options.overlayTitle,f.appendChild(p);for(var m=0;m<r;m++){var g=i[m];this._isExcluded(g)&&d.appendChild(this._renderLayer(g))}f.appendChild(d),e.appendChild(f)}},n._isExcluded=function(t){var e=t.getId(),n=this.options.excludeLayers;return!(n.length&&n.indexOf(e)>=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;o<s;o++){var h=r[o];h[h===t?"show":"hide"]()}else i.isVisible()||i.show();a._fireEvent("setbaselayer")}else t[e.target.checked?"show":"hide"]();n.fire("layerchange",{target:t})},i.appendChild(o),r.innerHTML=t.getId(),i.appendChild(r),i},e}(io);ao.mergeOptions({position:"top-right",baseTitle:"Base Layers",overlayTitle:"Layers",excludeLayers:[],containerClass:"maptalks-layer-switcher"}),ri.mergeOptions({layerSwitcherControl:!1}),ri.addOnLoadHook(function(){this.options.layerSwitcherControl&&(this.layerSwitcherControl=new ao(this.options.layerSwitcherControl),this.addControl(this.layerSwitcherControl))});var so=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(){var t=this.options.size;this.options.maximize||(t=[0,0]);var e=De("div"),n=this.mapContainer=De("div");n.style.width=t[0]+"px",n.style.height=t[1]+"px",n.className=this.options.containerClass;var i=this.button=De("div");return i.className=this.options.buttonClass,e.appendChild(n),e.appendChild(i),e},n.onAdd=function(){this.options.maximize&&this._createOverview(),this.getMap().on("resize moving zooming rotate dragrotating viewchange",this._update,this).on("setbaselayer",this._updateBaseLayer,this).on("spatialreferencechange",this._updateSpatialReference,this),en(this.button,"click",this._onButtonClick,this),this._updateButtonText()},n.onRemove=function(){this.getMap().off("resize moving zooming rotate dragrotating viewchange",this._update,this).off("setbaselayer",this._updateBaseLayer,this).off("spatialreferencechange",this._updateSpatialReference,this),this._overview&&(this._overview.remove(),delete this._overview,delete this._perspective),nn(this.button,"click",this._onButtonClick,this)},n.maxmize=function(){var t=this.options.size,e=this.mapContainer;return e.style.width=t[0]+"px",e.style.height=t[1]+"px",this._createOverview(),this},n.minimize=function(){this._overview&&this._overview.remove(),delete this._overview,delete this._perspective;var t=this.mapContainer;return t.style.width="0px",t.style.height="0px",this},n.getOverviewMap=function(){return this._overview},n._onButtonClick=function(){this._overview?this.minimize():this.maxmize(),this._updateButtonText()},n._updateButtonText=function(){this._overview?this.button.innerHTML="-":this.button.innerHTML="+"},n._createOverview=function(){var t=this.getMap(),e=this.mapContainer,n=t.config();d(n,{center:t.getCenter(),zoom:this._getOverviewZoom(),zoomAnimationDuration:150,pitch:0,bearing:0,scrollWheelZoom:!1,checkSize:!1,doubleClickZoom:!1,touchZoom:!1,control:!1,draggable:!1,maxExtent:null}),this._overview=new ri(e,n),this._updateBaseLayer(),this._perspective=new Ui(this._getPerspectiveCoords(),{draggable:!0,cursor:"move",symbol:this.options.symbol}).on("dragend",this._onDragEnd,this),new br("perspective_layer",this._perspective).addTo(this._overview),this.fire("load")},n._getOverviewZoom=function(){var t=this.getMap(),e=t.getZoom(),n=t.getMinZoom(),i=this.options.level;if(i>0){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;i<r;i++){if(e[i].isVisible()){n=i;break}}var o=t.toJSON(),a=null;e?(a=o.layers[n].options).visible=!0:a=o.options,this._overview.setMinZoom(a.minZoom||null).setMaxZoom(a.maxZoom||null),delete a.minZoom,delete a.maxZoom,delete o.options.canvas,o.options.visible=!0,o.options.renderer="canvas";var s=$n.fromJSON(o);for(var h in t)_(t[h])&&t.hasOwnProperty(h)&&t[h]!==t.constructor.prototype[h]&&(s[h]=t[h]);this._overview.setBaseLayer(s)}else this._overview.setBaseLayer(null)}},e}(io);so.mergeOptions({level:4,position:{right:1,bottom:1},size:[300,200],maximize:!0,symbol:{lineWidth:3,lineColor:"#1bbc9b",polygonFill:"#1bbc9b",polygonOpacity:.4},containerClass:"maptalks-overview",buttonClass:"maptalks-overview-button"}),ri.mergeOptions({overviewControl:!1}),ri.addOnLoadHook(function(){this.options.overviewControl&&(this.overviewControl=new so(this.options.overviewControl),this.addControl(this.overviewControl))});var ho=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(){var t;if(this.options.custom)y(this.options.content)?(t=De("div")).innerHTML=this.options.content:t=this.options.content;else{if(t=De("div","maptalks-panel"),this.options.closeButton){var e=De("a","maptalks-close");e.href="javascript:;",e.onclick=function(){t.style.display="none"},t.appendChild(e)}var n=De("div","maptalks-panel-content");n.innerHTML=this.options.content,t.appendChild(n)}return this.draggable=new wn(t,{cancelOn:this._cancelOn.bind(this),ignoreMouseleave:!0}),this.draggable.on("dragstart",this._onDragStart,this).on("dragging",this._onDragging,this).on("dragend",this._onDragEnd,this),this.options.draggable&&this.draggable.enable(),t},n.update=function(){return this.draggable&&(this.draggable.disable(),delete this.draggable),io.prototype.update.call(this)},n.setContent=function(t){var e=this.options.content;return this.options.content=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.update(),this},n.getContent=function(){return this.options.content},n._cancelOn=function(t){var e=(t.srcElement||t.target).tagName.toLowerCase();return"button"===e||"input"===e||"select"===e||"option"===e||"textarea"===e},n._onDragStart=function(t){this._startPos=t.mousePos,this._startPosition=d({},this.getPosition()),this.fire("dragstart",t)},n._onDragging=function(t){var e=t.mousePos.sub(this._startPos),n=this._startPosition,i=this.getPosition();p(i.top)||(i.top=parseInt(n.top)+e.y),p(i.bottom)||(i.bottom=parseInt(n.bottom)-e.y),p(i.left)||(i.left=parseInt(n.left)+e.x),p(i.right)||(i.right=parseInt(n.right)-e.x),this.setPosition(i),this.fire("dragging",t)},n._onDragEnd=function(t){delete this._startPos,delete this._startPosition,this.fire("dragend",t)},n._getConnectPoints=function(){var t=this.getMap(),e=this.getContainerPoint(),n=this.getDOM(),i=parseInt(n.clientWidth),r=parseInt(n.clientHeight);return[t.containerPointToCoordinate(e.add(i/2,0)),t.containerPointToCoordinate(e.add(i,r/2)),t.containerPointToCoordinate(e.add(i/2,r)),t.containerPointToCoordinate(e.add(0,r/2))]},e}(io);ho.mergeOptions({position:"top-right",draggable:!0,custom:!1,content:"",closeButton:!0});var uo=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(t){return this._map=t,this._scaleContainer=De("div"),this._addScales(),t.on("zoomend",this._update,this),this._map._loaded&&this._update(),this._scaleContainer},n.onRemove=function(){this.getMap().off("zoomend",this._update,this)},n._addScales=function(){var t="border: 2px solid #000000;border-top: none;line-height: 1.1;padding: 2px 5px 1px;color: #000000;font-size: 11px;text-align:center;white-space: nowrap;overflow: hidden;-moz-box-sizing: content-box;box-sizing: content-box;background: #fff; background: rgba(255, 255, 255, 0);";this.options.metric&&(this._mScale=ke("div",t,this._scaleContainer)),this.options.imperial&&(this._iScale=ke("div",t,this._scaleContainer))},n._update=function(){var t=this._map.pixelToDistance(this.options.maxWidth,0);this._updateScales(t)},n._updateScales=function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},n._updateMetric=function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},n._updateImperial=function(t){var e,n,i,r=3.2808399*t;r>5280?(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<s;a++){var h=o[a],u=De("li");if(28!==this.options.height&&(u.style.lineHeight=this.options.height+"px"),u.style.height=this.options.height+"px",u.style.cursor="pointer",Qe(h.item)){u.style.textAlign="center";var c=$e("div",h.item);u.innerHTML='<div style="margin-top:'+(this.options.height-c.height)/2+'px;">'+h.item+"</div>"}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;u<c;u++){var l=_e(s[u].item,"12px");l.width>h&&(h=l.width)}for(var f=0,d=s.length;f<d;f++){var p=s[f],m=De("li");m.innerHTML='<a href="javascript:;">'+p.item+"</a>",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;r<s?(s=r,a=0):o>s&&(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.xmin?(s=l.xmax-(l.xmin-s)%(l.xmax-l.xmin))===l.xmax&&(s=l.xmin):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):h<l.ymin&&(h=l.ymax-(l.ymin-h)%(l.ymax-l.ymin))===l.ymax&&(h=l.ymin)}return{x:s,y:h,idx:u,idy:c}},e._getTileFullIndex=function(t){var e=this.fullExtent,n=this.transformation,i=this._getTileNum(n.transform(new bn(e.left,e.top),1),t),r=this._getTileNum(n.transform(new bn(e.right,e.bottom),1),t);return new En(i,r)},e.getTilePrjNW=function(t,e,n){var i=this.tileSystem,r=this.tileSize,o=i.origin.y+i.scale.y*(e+(1===i.scale.y?1:0))*(n*r.height),a=i.scale.x*(t+(1===i.scale.x?0:1))*n*r.width+i.origin.x;return new bn(a,o)},e.getTilePrjSE=function(t,e,n){var i=this.tileSystem,r=this.tileSize,o=i.origin.y+i.scale.y*(e+(1===i.scale.y?0:1))*(n*r.height),a=i.scale.x*(t+(1===i.scale.x?1:0))*n*r.width+i.origin.x;return new bn(a,o)},e.getTilePrjExtent=function(t,e,n){var i=this.getTilePrjNW(t,e,n),r=this.getTilePrjSE(t,e,n);return new En(i,r)},t}(),vo={urlTemplate:null,subdomains:null,repeatWorld:!0,background:!0,backgroundZoomDiff:6,loadingLimitOnInteracting:3,placeholder:!1,crossOrigin:null,tileSize:[256,256],offset:[0,0],tileSystem:null,fadeAnimation:!C,debug:!1,spatialReference:null,maxCacheSize:256,renderer:ae.webgl?"gl":"canvas",clipByPitch:!0,maxAvailableZoom:null,cascadeTiles:!0,minPitchToCascade:35},yo=/\{ *([\w_]+) *\}/g,_o=function(t){function e(){return t.apply(this,arguments)||this}se(e,t),e.fromJSON=function(t){return t&&"TileLayer"===t.type?new e(t.id,t.options):null};var n=e.prototype;return n.getTileSize=function(){var t=this.options.tileSize;return m(t)&&(t=[t,t]),new le(t)},n.getTiles=function(t){var e=this.getMap(),n=e.getContainerExtent(),i=[],r=0,o=this.getMinZoom(),a=this.options.minPitchToCascade,s=p(t)?this._getTileZoom(e.getZoom()):t;if(!p(t)||!this.options.cascadeTiles||e.getPitch()<=a||!p(o)&&s<=o){var h=this._getTiles(s,n);return h&&(r+=h.tiles.length,i.push(h)),{tileGrids:i,count:r}}var u=Math.floor(e._getVisualHeight(a)),c=new Sn(0,e.height-u,e.width,e.height),l=this._getTiles(s,c,0);r+=l?l.tiles.length:0;var f=new Sn(0,n.ymin,e.width,c.ymin),d=e.getSpatialReference().getZoomDirection(),m=this._getTiles(s-d,f,1);return r+=m?m.tiles.length:0,i.push(l,m),{tileGrids:i,count:r}},n.getTileUrl=function(t,e,n){var i=this.options.urlTemplate,r="";if(this.options.subdomains){var o=this.options.subdomains;if(U(o)){var a=(t+e)%o.length;a<0&&(a=0),r=o[a]}}if(_(i))return i(t,e,n,r);var s={x:t,y:e,z:n,s:r};return i.replace(yo,function(t,e){var n=s[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(s)),n})},n.clear=function(){return this._renderer&&this._renderer.clear(),this.fire("clear"),this},n.toJSON=function(){return{type:this.getJSONType(),id:this.getId(),options:this.config()}},n.getSpatialReference=function(){var t=this.getMap();return!t||this.options.spatialReference&&!ni.equals(this.options.spatialReference,t.options.spatialReference)?(this._sr=this._sr||new ni(this.options.spatialReference),this._sr):t.getSpatialReference()},n._getTileZoom=function(t){var e=this.getMap();g(t)||(t=e.isZooming()?t>e._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)&&t<r||!p(o)&&t>o)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<o;r++){var a=e[r];if(a.options.visible){var s=a.getTiles(t);s&&0!==s.count&&(i+=s.count,D(n,s.tileGrids))}}return{count:i,tileGrids:n}},n.onAdd=function(){var e=this,n=this.getMap();this.layers.forEach(function(t){e.layerMap[t.getId()]=t,t.getChildLayer&&e._groupChildren.push(t),t._bindMap(n),t.on("show hide",e._onLayerShowHide,e)}),t.prototype.onAdd.call(this)},n.onRemove=function(){var e=this;this.layers.forEach(function(t){t._doRemove(),t.off("show hide",e._onLayerShowHide,e)}),delete this.layerMap,delete this._groupChildren,t.prototype.onRemove.call(this)},n.getChildLayer=function(t){var e=this.layerMap[t];if(e)return e;for(var n=0;n<this._groupChildren.length;n++){var i=this._groupChildren[n].getChildLayer(t);if(i)return i}return null},n._onLayerShowHide=function(){var t=this.getRenderer();t&&t.setToRedraw()},n.isVisible=function(){if(!t.prototype.isVisible.call(this))return!1;for(var e=this.layers,n=0,i=e.length;n<i;n++)if(e[n].isVisible())return!0;return!1},n._checkChildren=function(){var t=this,e={};this.layers.forEach(function(n){var i=n.getId();if(e[i])throw new Error("Duplicate child layer id ("+i+") in the GroupTileLayer ("+t.getId()+")");e[i]=1})},e}(_o);xo.registerJSONType("GroupTileLayer");var wo={service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},bo=function(t){function e(e,n){var i;i=t.call(this,e)||this;var r=d({},wo);for(var o in n)o in i.options||(r[o]=n[o]);i.setOptions(n);var a=n.detectRetina&&ae.retina?2:1,s=i.getTileSize();return r.width=s.width*a,r.height=s.height*a,i.wmsParams=r,i._wmsVersion=parseFloat(r.version),i}se(e,t);var n=e.prototype;return n.onAdd=function(){var e=this.options.crs||this.getMap().getProjection().code,n=this._wmsVersion>=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;o<i.length;++o){try{r=t.getContext(i[o],e||n)}catch(t){}if(r)break}return r}(this.canvas2||this.canvas,this.layer.options.glOptions);t.clearColor(0,0,0,0),t.disable(t.DEPTH_TEST),t.enable(t.STENCIL_TEST),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.program=this.createProgram(So,this.layer.options.fragmentShader||To,["u_matrix","u_image","u_opacity"]),this.useProgram(this.program),this.texBuffer=this.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.texBuffer),this.enableVertexAttrib(["a_texCoord",2]),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),t.STATIC_DRAW),this.enableSampler("u_image"),t.activeTexture(t.TEXTURE0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this.posBuffer=this.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.posBuffer),this.enableVertexAttrib(["a_position",3]),this.indicesBuffer=this.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},n.resizeGLCanvas=function(){this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height),this.canvas2&&(this.canvas2.width===this.canvas.width&&this.canvas2.height===this.canvas.height||(this.canvas2.width=this.canvas.width,this.canvas2.height=this.canvas.height))},n.clearGLCanvas=function(){this.gl&&this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.STENCIL_BUFFER_BIT)},n.disposeImage=function(t){t&&(t.texture&&this.saveTexture(t.texture),t.glBuffer&&this.saveImageBuffer(t.glBuffer),delete t.texture,delete t.glBuffer)},n._createTexture=function(t){var e=this.gl,n=this.getTexture()||e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),g(B(t.width))&&g(B(t.width))&&e.generateMipmap(e.TEXTURE_2D),n},n.getTexture=function(){this._textures||(this._textures=[]);var t=this._textures;return t&&t.length>0?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<n.length;o++)r+=n[o][1]||0;for(var a=0,s=0;s<n.length;s++){var h=t.getAttribLocation(e,n[s][0]);if(h<0)throw new Error("Failed to get the storage location of "+n[s][0]);t.vertexAttribPointer(h,n[s][1],t[n[s][2]||"FLOAT"],!1,i*r,i*a),a+=n[s][1]||0,t.enableVertexAttribArray(h)}}else{var u=t.getAttribLocation(e,n[0]);t.vertexAttribPointer(u,n[1],t[n[2]||"FLOAT"],!1,0,0),t.enableVertexAttribArray(u)}}(this.gl,this.gl.program,t)},n.createProgram=function(t,e,n){var i=function(t,e,n){var i=Eo(t,t.VERTEX_SHADER,e),r=Eo(t,t.FRAGMENT_SHADER,n);if(!i||!r)return null;var o=t.createProgram();return o?(t.attachShader(o,i),t.attachShader(o,r),t.linkProgram(o),{program:o,vertexShader:i,fragmentShader:r}):null}(this.gl,t,e),r=i.program,o=i.vertexShader,a=i.fragmentShader;return r.vertexShader=o,r.fragmentShader=a,this._initUniforms(r,n),r},n.useProgram=function(t){var e=this.gl;return e.useProgram(t),e.program=t,this},n.enableSampler=function(t,e){var n=this.gl,i=this._getUniform(n.program,t);return e||(e=0),n.uniform1i(i,e),i},n._initUniforms=function(t,e){for(var n=0;n<e.length;n++){var i=e[n],r=e[n],o=i.indexOf("[");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<t.length;n++){var i=t[n].extent,r=this.resources&&this.resources.getImage(t[n].url);r&&e.intersects(i)&&(this._painted=!0,this._drawImage(r,i,t[n].opacity||1))}},n._drawImage=function(t,e,n){var i=0,r=this.context;n<1&&(i=r.globalAlpha,r.globalAlpha=n);var o=this.getMap(),a=o.coordToPoint(e.getMin()),s=o.coordToPoint(e.getMax()),h=o._pointToContainerPoint(a),u=h.x,c=h.y,l=o.getBearing();l&&(r.save(),r.translate(u,c),l&&r.rotate(-l*Math.PI/180),u=c=0),r.drawImage(t,u,c,s.x-a.x,s.y-a.y),l&&r.restore(),i&&(r.globalAlpha=i)},n.drawOnInteracting=function(){this.draw()},e}(Kn),ko=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.isDrawable=function(){return!0},n._drawImage=function(t,e,n){var i=this.getMap(),r=e.__imagelayerposition;r||(r=e.__imagelayerposition=e.convertTo(function(t){return i.coordToPoint(t,i.getGLZoom())})),this.drawGLImage(t,r.xmin,r.ymin,r.getWidth(),r.getHeight(),n)},n.createContext=function(){this.createGLContext()},n.resizeCanvas=function(e){this.canvas&&(t.prototype.resizeCanvas.call(this,e),this.resizeGLCanvas())},n.clearCanvas=function(){this.canvas&&(t.prototype.clearCanvas.call(this),this.clearGLCanvas())},n.retireImage=function(t){this.disposeImage(t)},n.onRemove=function(){this.removeGLCanvas(),t.prototype.onRemove.call(this)},e}(Lo(Do));Oo.registerRenderer("canvas",Do),Oo.registerRenderer("gl",ko);var No=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.getPrepareParams=function(){return[]},n.getDrawParams=function(){return[]},n.onCanvasCreate=function(){this.canvas&&this.layer.options.doubleBuffer&&(this.buffer=sn.createCanvas(this.canvas.width,this.canvas.height,this.getMap().CanvasClass))},n.needToRedraw=function(){return!!this.layer.options.animation||!(this.getMap().isInteracting()&&!this.layer.drawOnInteracting)&&t.prototype.needToRedraw.call(this)},n.draw=function(){this.prepareCanvas(),this.prepareDrawContext(),this._drawLayer()},n.drawOnInteracting=function(){this._drawLayerOnInteracting()},n.getCanvasImage=function(){var e=t.prototype.getCanvasImage.call(this);if(e&&e.image&&this.layer.options.doubleBuffer){var n=e.image;this.buffer.width===n.width&&this.buffer.height===n.height||(this.buffer.width=n.width,this.buffer.height=n.height);var i=this.buffer.getContext("2d"),r=this.layer.doubleBuffer(i,this.context);(void 0===r||r)&&(sn.image(i,n,0,0),e.image=this.buffer)}return e},n.remove=function(){return delete this._drawContext,t.prototype.remove.call(this)},n.onZoomStart=function(e){this.layer.onZoomStart(e),t.prototype.onZoomStart.call(this,e)},n.onZooming=function(e){this.layer.onZooming(e),t.prototype.onZooming.call(this,e)},n.onZoomEnd=function(e){this.layer.onZoomEnd(e),t.prototype.onZoomEnd.call(this,e)},n.onMoveStart=function(e){this.layer.onMoveStart(e),t.prototype.onMoveStart.call(this,e)},n.onMoving=function(e){this.layer.onMoving(e),t.prototype.onMoving.call(this,e)},n.onMoveEnd=function(e){this.layer.onMoveEnd(e),t.prototype.onMoveEnd.call(this,e)},n.onResize=function(e){this.layer.onResize(e),t.prototype.onResize.call(this,e)},n.prepareDrawContext=function(){if(!this._predrawed){var t=zo(this.getPrepareParams());this._drawContext=this.layer.prepareToDraw.apply(this.layer,[this.context].concat(t)),this._drawContext||(this._drawContext=[]),Array.isArray(this._drawContext)||(this._drawContext=[this._drawContext]),this._predrawed=!0}},n._prepareDrawParams=function(){if(!this.getMap())return null;var t=this.getViewExtent();if(t.maskExtent&&!t.extent.intersects(t.maskExtent))return this.completeRender(),null;var e=[this.context,t],n=zo(this.getDrawParams());return e.push.apply(e,n),e.push.apply(e,this._drawContext),e},n._drawLayer=function(){var t=this._prepareDrawParams();t&&(this.layer.draw.apply(this.layer,t),this.completeRender())},n._drawLayerOnInteracting=function(){if(this.layer.drawOnInteracting){var t=this._prepareDrawParams();t&&(this.layer.drawOnInteracting.apply(this.layer,t),this.completeRender())}},e}(Kn);function zo(t){return t||(t=[]),Array.isArray(t)||(t=[t]),t}var Fo=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.isCanvasRender=function(){return!0},n.prepareToDraw=function(){},n.draw=function(){},n.redraw=function(){return this._getRenderer()&&this._getRenderer().setToRedraw(),this},n.play=function(){return this.config("animation",!0),this},n.pause=function(){return this.config("animation",!1),this},n.isPlaying=function(){return this.options.animation},n.clearCanvas=function(){return this._getRenderer()&&this._getRenderer().clearCanvas(),this},n.requestMapToRender=function(){return this._getRenderer()&&this._getRenderer().requestMapToRender(),this},n.completeRender=function(){return this._getRenderer()&&this._getRenderer().completeRender(),this},n.onCanvasCreate=function(){return this},n.onZoomStart=function(){},n.onZooming=function(){},n.onZoomEnd=function(){},n.onMoveStart=function(){},n.onMoving=function(){},n.onMoveEnd=function(){},n.onResize=function(){},n.doubleBuffer=function(t){return t.clearRect(0,0,t.canvas.width,t.canvas.height),this},e}($n);Fo.mergeOptions({doubleBuffer:!1,animation:!1}),Fo.registerRenderer("canvas",No);var Bo=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.getParticles=function(){},n.draw=function(t,e){var n=this.getParticles(f());if(n&&0!==n.length){var i=this.getMap(),r=e.extent;e.maskExtent&&(r=e.extent.intersection(e.maskExtent)),r=r.convertTo(function(t){return i._pointToContainerPoint(t)});for(var o=2*Math.PI,a=0,s=n.length;a<s;a++){var h=n[a].point;if(r.contains(h)){var u=n[a].color||this.options.lineColor||"#fff",c=n[a].r;t.fillStyle!==u&&(t.fillStyle=u),c<=2?t.fillRect(h.x-c/2,h.y-c/2,c,c):(t.beginPath(),t.arc(h.x,h.y,c/2,0,o),t.fill())}}this._fillCanvas(t)}else{this._getRenderer()&&(this._getRenderer()._shouldClear=!0)}},n._fillCanvas=function(t){var e=t.globalCompositeOperation;t.globalCompositeOperation="destination-out";var n=this.options.trail||30;t.fillStyle="rgba(0, 0, 0, "+1/n+")",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.globalCompositeOperation=e},e}(Fo);Bo.mergeOptions({animation:!0}),Bo.registerRenderer("canvas",function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.draw=function(){this.canvas&&this.layer.options.animation&&!this._shouldClear||(this.prepareCanvas(),this._shouldClear=!1),this.prepareDrawContext(),this._drawLayer()},n.drawOnInteracting=function(){this.draw(),this._shouldClear=!1},n.onSkipDrawOnInteracting=function(){this._shouldClear=!0},e}(No));var jo=o+"_edit_stage_";function Go(t,e){return{markerType:t,markerFill:"#fff",markerLineColor:"#000",markerLineWidth:2,markerWidth:10,markerHeight:10,opacity:e}}var Ho={fixAspectRatio:!1,symbol:null,removeVertexOn:"contextmenu",centerHandleSymbol:Go("ellipse",1),vertexHandleSymbol:Go("square",1),newVertexHandleSymbol:Go("square",.4)},Uo=function(t){function e(e,n){var i;return(i=t.call(this,n)||this)._geometry=e,i._geometry?i:he(i)}se(e,t);var n=e.prototype;return n.getMap=function(){return this._geometry.getMap()},n.prepare=function(){this.getMap()&&(this.options.symbol&&(this._originalSymbol=this._geometry.getSymbol(),this._geometry.setSymbol(this.options.symbol)),this._prepareEditStageLayer())},n._prepareEditStageLayer=function(){var t=this.getMap(),e=R(),n=jo+e,i=jo+e+"_shadow";this._editStageLayer=t.getLayer(n),this._shadowLayer=t.getLayer(i),this._editStageLayer||(this._editStageLayer=new br(n),t.addLayer(this._editStageLayer)),this._shadowLayer||(this._shadowLayer=new br(i),t.addLayer(this._shadowLayer))},n.start=function(){var t=this;if(this._geometry&&this._geometry.getMap()&&!this._geometry.editing){var e=this.getMap();this.editing=!0;var n=this._geometry;this._geometryDraggble=n.options.draggable,n.config("draggable",!1),this.prepare();var i=n.copy();i.setSymbol(n._getInternalSymbol()),i.copyEventListeners(n),n._getParent()&&i.copyEventListeners(n._getParent()),i.setId(null).config({draggable:!1}),this._shadow=i,this._switchGeometryEvents("on"),n.hide(),(n instanceof Wi||n instanceof ir||n instanceof or||n instanceof rr)&&this._createOrRefreshOutline(),this._shadowLayer.bringToFront().addGeometry(i),this._editStageLayer.bringToFront(),this._addListener([e,"zoomstart",function(){t._editStageLayer.hide()}]),this._addListener([e,"zoomend",function(){t._editStageLayer.show()}]),n instanceof Wi?(i.config("draggable",!0),i.on("dragend",this._onMarkerDragEnd,this)):this._createCenterHandle(),n instanceof Wi?this.createMarkerEditor():n instanceof ir?this.createCircleEditor():n instanceof or?this.createEllipseOrRectEditor():n instanceof rr?this.createEllipseOrRectEditor():n instanceof ar||(n instanceof Ui||n instanceof qi)&&this.createPolygonEditor()}},n.stop=function(){delete this._history,delete this._historyPointer,delete this._editOutline,this._switchGeometryEvents("off"),this.getMap()&&(delete this._shadow,this._geometry.config("draggable",this._geometryDraggble),delete this._geometryDraggble,this._geometry.show(),this._editStageLayer.remove(),this._shadowLayer.remove(),this._clearAllListeners(),this._refreshHooks=[],this.options.symbol&&(this._geometry.setSymbol(this._originalSymbol),delete this._originalSymbol),this.editing=!1)},n.isEditing=function(){return!p(this.editing)&&this.editing},n._getGeometryEvents=function(){return{symbolchange:this._onGeoSymbolChange,"positionchange shapechange":this._exeAndReset}},n._switchGeometryEvents=function(t){if(this._geometry){var e=this._getGeometryEvents();for(var n in e)this._geometry[t](n,e[n],this)}},n._onGeoSymbolChange=function(t){this._shadow&&this._shadow.setSymbol(t.target._getInternalSymbol())},n._onMarkerDragEnd=function(){this._update("setCoordinates",this._shadow.getCoordinates().toArray()),this._refresh()},n._createOrRefreshOutline=function(){var t=this._geometry,e=this._editOutline;return e?(e.remove(),this._editOutline=e=t.getOutline(),this._editStageLayer.addGeometry(e)):(e=t.getOutline(),this._editStageLayer.addGeometry(e),this._editOutline=e,this._addRefreshHook(this._createOrRefreshOutline)),e},n._createCenterHandle=function(){var t,e=this,n=this._shadow.getCenter(),i=this.options.centerHandleSymbol,r=this.createHandle(n,{symbol:i,cursor:"move",onDown:function(){var n=kt((t=e._shadow.copy())._getInternalSymbol(),.5);t.setSymbol(n).addTo(e._editStageLayer)},onMove:function(e,n){var i=n.coordOffset;t.translate(i)},onUp:function(){e._update("setCoordinates",bn.toNumberArrays(t.getCoordinates())),t.remove(),e._refresh()}});this._addRefreshHook(function(){var t=e._shadow.getCenter();r.setCoordinates(t)})},n._createHandleInstance=function(t,e){var n=e.symbol;return new Wi(t,{draggable:!0,dragShadow:!1,dragOnAxis:e.axis,cursor:e.cursor,symbol:n})},n.createHandle=function(t,e){e||(e={});var n=this.getMap(),i=this._createHandleInstance(t,e),r=this;function o(t){return e.onDown&&(this._geometry.fire("handledragstart"),e.onDown.call(r,t.viewPoint,t)),!1}function a(t){r._hideContext();var o=n._prjToViewPoint(i._getPrjCoordinates());return e.onMove&&(this._geometry.fire("handledragging"),e.onMove.call(r,o,t)),!1}function s(t){return e.onUp&&(this._geometry.fire("handledragend"),e.onUp.call(r,t)),!1}return i.on("dragstart",o,this),i.on("dragging",a,this),i.on("dragend",s,this),i.on("removestart",function t(){i.config("draggable",!1),i.off("dragstart",o,r),i.off("dragging",a,r),i.off("dragend",s,r),i.off("removestart",t,r),delete i["maptalks--editor-refresh-fn"]},this),e.onRefresh&&(i["maptalks--editor-refresh-fn"]=e.onRefresh),this._editStageLayer.addGeometry(i),i},n._createResizeHandles=function(t,e,n){var i=this,r=["nw-resize","n-resize","ne-resize","w-resize","e-resize","sw-resize","s-resize","se-resize"],o=[null,"y",null,"x","x",null,"y",null],a=this._geometry;t||(t=[]);var s=this,h=[],u={},c=this.getMap(),l=this.options.vertexHandleSymbol,f=function(){for(var f=function(t){return[t.getMin(),new ce((t.xmax+t.xmin)/2,t.ymin),new ce(t.xmax,t.ymin),new ce(t.xmin,(t.ymax+t.ymin)/2),new ce(t.xmax,(t.ymax+t.ymin)/2),new ce(t.xmin,t.ymax),new ce((t.xmax+t.xmin)/2,t.ymax),t.getMax()]}(a._getPainter().get2DExtent()),d=function(d){if(Array.isArray(t)&&t.some(function(t){return t===d}))return"continue";var p=f[d],m=c.pointToCoordinate(p);if(h.length<f.length-t.length){var g=i.createHandle(m,{symbol:l,cursor:r[d],axis:o[d],onMove:function(t){return function(n){s._updating=!0,e(n,t),a.fire("resizing")}}(d),onUp:function(){s._updating=!1,n(),i._refresh()}});g.setId(d),u[d]=h.length,h.push(g)}else h[u[d]].setCoordinates(m)},p=0;p<f.length;p++)d(p)};return f(),this._addRefreshHook(f),h},n.createMarkerEditor=function(){var t=this,e=this._geometry,n=this._shadow,i=this.getMap();if(n._canEdit()){this._history||this._recordHistory(l());var r=n._getInternalSymbol(),o=new ce(0,0);m(r.markerDx)&&(o.x=r.markerDx),m(r.markerDy)&&(o.y=r.markerDy);var a=null;vi.test(r)?"pin"!==r.markerType&&"pie"!==r.markerType&&"bar"!==r.markerType||(a=[5,6,7]):(_i.test(r)||Ei.test(r))&&(a=[5,6,7]);var s,h=[2,1,2,0,0,2,1,2];if(this.options.fixAspectRatio){var u=n.getSize();s=u.width/u.height}var c=this._createResizeHandles(null,function(r,u){if(a&&a.indexOf(u)>=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<h.length&&h.splice(o,1)[0].remove(),i=0===o?h.length-1:o-1,h.splice(i,1)[0].remove(),h.splice(i,0,m.call(n,i)),l(),n._refresh())}function d(i,r){var a,s=c(),u=t._viewPointToPrj(i),l=s[r];l.x=u.x,l.y=u.y,e._updateCache(),e.onShapeChanged(),n._updateCoordFromShadow(!0),a=0===r?h.length-1:r-1,h[r]&&h[r][o](),h[a]&&h[a][o]()}function p(t){var e=u()[t],i=n.createHandle(e,{symbol:n.options.vertexHandleSymbol,cursor:"pointer",axis:null,onMove:function(t){d(t,i[a])},onRefresh:function(){e=u()[i[a]],i.setCoordinates(e)},onUp:function(){n._refresh(),n._updateCoordFromShadow()}});return i[a]=t,i.on(n.options.removeVertexOn,f),i}function m(t){var r,o=u();r=t+1>=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<y;v++)s.push(p.call(this,v)),v<y-1&&h.push(m.call(this,v));e instanceof Ui&&h.push(m.call(this,g.length-1)),this._addRefreshHook(function(){for(var t=h.length-1;t>=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;i<e;i++)n[i-1]=arguments[i];this._exeHistory([t,n]),this._recordHistory.apply(this,[t].concat(n))},n._updateCoordFromShadow=function(t){if(this._shadow){var e=this._shadow.getCoordinates(),n=this._geometry,i=this._updating;this._updating=!0,n.setCoordinates(e),t||this._recordHistory("setCoordinates",bn.toNumberArrays(n.getCoordinates())),this._updating=i}},n._recordHistory=function(t){this._history||(this._history=[],this._historyPointer=0),this._historyPointer<this._history.length-1&&this._history.splice(this._historyPointer+1);for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];this._history.push([t,n]),this._historyPointer=this._history.length-1,this._geometry.fire("editrecord")},n.undo=function(){if(!this._history||0===this._historyPointer)return this;var t=this._history[--this._historyPointer];return this._exeAndReset(t),this},n.redo=function(){if(!this._history||this._historyPointer===this._history.length-1)return null;var t=this._history[++this._historyPointer];return this._exeAndReset(t),this},n._exeAndReset=function(t){if(!this._updating){this._exeHistory(t);var e=this._history,n=this._historyPointer;this.stop(),this._history=e,this._historyPointer=n,this.start()}},n._exeHistory=function(t){var e=this;if(Array.isArray(t)){var n=this._updating;this._updating=!0;var i=this._geometry;Array.isArray(t[0])?t[0].forEach(function(t){var n=t[0],r=t.slice(1);e._shadow[n].apply(e._shadow,r),i[n].apply(i,r)}):(this._shadow[t[0]].apply(this._shadow,t[1]),i[t[0]].apply(i,t[1])),this._updating=n}},e}(fn(mn));Uo.mergeOptions(Ho);var Vo={startEditText:function(){return this.getMap()?(this.hide(),this.endEditText(),this._prepareEditor(),this._fireEvent("edittextstart"),this):this},endEditText:function(){if(this._textEditor){var t=this._textEditor.innerHTML;t=t.replace(/<p>/gi,"").replace(/<\/p>/gi,"<br/>"),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;h<s.length;h++)if(s[h]){var u={};for(var c in s[h])s[h].hasOwnProperty(c)&&(u[c]=[e[h][c],s[h][c]]);a.push(u)}else a.push(null)}else{if(Array.isArray(e))throw new Error("geometry'symbol is a composite symbol, while the symbol in styles isn't.");for(var l in a={},r)r.hasOwnProperty(l)&&(a[l]=[e[l],r[l]])}n.symbol=a}else"translate"===i&&(n.translate=new bn(r))}return n},_fireAnimateEvent:function(t){"finished"===t?(delete this._animationStarted,this._fireEvent("animateend")):"running"===t&&(this._animationStarted?this._fireEvent("animating"):(this._fireEvent("animatestart"),this._animationStarted=!0))}});var Wo=o+"_drag_stage",Zo=ae.touch?"touchstart mousedown":"mousedown",qo=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(Zo,this._startDrag,this)},n.removeHooks=function(){this._endDrag(),this.target.off(Zo,this._startDrag,this),delete this.container},n._prepareDragHandler=function(){this._dragHandler=new wn(this.container),this._dragHandler.on("dragging",this._dragging,this).on("mouseup",this._endDrag,this).enable()},n._prepareShadow=function(){var t=this.target;this._prepareDragStageLayer(),this._shadow&&this._shadow.remove();var e=this._shadow=t.copy();if(this._shadow.setSymbol(t._getInternalSymbol()),t.options.dragShadow){var n=kt(e._getInternalSymbol(),.5);e.setSymbol(n)}e.setId(null),this._prepareShadowConnectors()},n._prepareShadowConnectors=function(){var t=this.target,e=this._shadow,n=this._dragStageLayer._getRenderer().resources,i=[];if(yr._hasConnectors(t))for(var r=yr._getConnectors(t),o=0,a=r.length;o<a;o++){var s=r[o],h=s.config(),u=s._getInternalSymbol();h.symbol=kt(u,.5);var c=void 0;c=s.getConnectSource()===t?new s.constructor(e,s.getConnectTarget(),h):new s.constructor(s.getConnectSource(),e,h),i.push(c),s.getLayer()&&s.getLayer()._getRenderer()&&n.merge(s.getLayer()._getRenderer().resources)}this._shadowConnectors=i,i.push(e),this._dragStageLayer.bringToFront().addGeometry(i)},n._onTargetUpdated=function(){this._shadow&&this._shadow.setSymbol(this.target._getSymbol())},n._prepareDragStageLayer=function(){var t=this.target.getMap(),e=this.target.getLayer();this._dragStageLayer=t.getLayer(Wo),this._dragStageLayer||(this._dragStageLayer=new br(Wo,{enableAltitude:e.options.enableAltitude,altitudeProperty:e.options.altitudeProperty}),t.addLayer(this._dragStageLayer));var n=new Qn;n.merge(e._getRenderer().resources),this._dragStageLayer._getRenderer().resources=n},n._startDrag=function(t){var e=this.target.getMap();if(e&&(!this.target._getParent()&&!this.isDragging())){var n=t.domEvent;n.touches&&n.touches.length>1||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;v<g;v++)for(var y=n[v],_=y.tiles,x=this._generatePlaceHolder(y.zoom),w=0,b=_.length;w<b;w++){var M=_[w],E=M.id,S=this._getCachedTile(E),T=!1;if(this._isLoadingTile(E))T=r=!0,this.tilesLoading[E].current=!0;else if(S)this.getTileOpacity(S.image)<1&&(T=r=!0),a.push(S);else{T=r=!0,m&&i+p[0]>m||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<c;u++)t[u].info.z!==this._tileZoom?h?this.resumeZoomStencilTest():(this.startZoomStencilTest(),h=!0):h&&this.pauseZoomStencilTest(),this._drawTileAndCache(t[u]);this.endZoomStencilTest()}this.onDrawTileEnd(o)},n.writeZoomStencil=function(){},n.startZoomStencilTest=function(){},n.endZoomStencilTest=function(){},n.pauseZoomStencilTest=function(){},n.resumeZoomStencilTest=function(){},n.onDrawTileStart=function(){},n.onDrawTileEnd=function(){},n._drawTileOffset=function(t,e){var n=this._tileOffset;if(n[0]||n[1]){var i=this.getMap(),r=i._getResolution(this._tileZoom)/i._getResolution(t.z);n[0]*=r,n[1]*=r,t.point._sub(n),t.extent2d._sub(n),this.drawTile(t,e),t.point._add(n),t.extent2d._add(n),n[0]/=r,n[1]/=r}else this.drawTile(t,e)},n._drawTileAndCache=function(t){t.current=!0,this.tilesInView[t.info.id]=t,this._drawTileOffset(t.info,t.image),this.tileCache.add(t.info.id,t)},n.drawOnInteracting=function(){this.draw()},n.needToRedraw=function(){var e=this.getMap();return e.getPitch()?t.prototype.needToRedraw.call(this):!(!e.isRotating()&&!e.isZooming())||(e.isMoving()?!!this.layer.options.forceRenderOnMoving:t.prototype.needToRedraw.call(this))},n.hitDetect=function(){return!1},n._getLoadLimit=function(){return this.getMap().isInteracting()?this.layer.options.loadingLimitOnInteracting:0},n.isDrawable=function(){return!this.getMap().getPitch()||(console&&console.warn("TileLayer with canvas renderer can't be pitched, use gl renderer ('renderer' : 'gl') instead."),this.clear(),!1)},n.clear=function(){this._retireTiles(!0),this.tileCache.reset(),this.tilesInView={},this.tilesLoading={},this._parentTiles=[],this._childTiles=[],t.prototype.clear.call(this)},n._isLoadingTile=function(t){return!!this.tilesLoading[t]},n.clipCanvas=function(e){return this.layer.getMask()?t.prototype.clipCanvas.call(this,e):this._clipByPitch(e)},n._clipByPitch=function(t){var e=this.getMap();if(e.getPitch()<=e.options.maxVisualPitch)return!1;if(!this.layer.options.clipByPitch)return!1;var n=e.getContainerExtent(),i=ae.retina?2:1;return t.save(),t.strokeStyle="rgba(0, 0, 0, 0)",t.beginPath(),t.rect(0,Math.ceil(n.ymin)*i,Math.ceil(n.getWidth())*i,Math.ceil(n.getHeight())*i),t.stroke(),t.clip(),!0},n.loadTileQueue=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e],i=this.loadTile(n);void 0===i.loadTime&&(this.tilesLoading[n.id]={image:i,current:!0,info:n})}},n.loadTile=function(t){var e=this.layer.getTileSize(),n=new Image;n.width=e.width,n.height=e.height,n.onload=this.onTileLoad.bind(this,n,t),n.onerror=this.onTileError.bind(this,n,t);var i=this.layer.options.crossOrigin;return p(i)||(n.crossOrigin=i),this.loadTileImage(n,t.url),n},n.loadTileImage=function(t,e){return A(t,[e])},n.abortTileLoading=function(t){t&&(t.onload=Jo,t.onerror=Jo,t.src=$)},n.onTileLoad=function(t,e){if(this.layer){var n=e.id;this.tilesInView&&(t.loadTime=f(),delete this.tilesLoading[n],this._addTileToCache(e,t),this.setToRedraw(),this.layer.fire("tileload",{tile:e,tileImage:t}))}},n.onTileError=function(t,e){this.layer&&(t instanceof Image&&this.abortTileLoading(t),t.loadTime=0,delete this.tilesLoading[e.id],this._addTileToCache(e,t),this.setToRedraw(),this.layer.fire("tileerror",{tile:e}))},n.drawTile=function(t,e){if(e&&this.getMap()){var n=t.point,i=t.z,r=t.id,o=this.getMap(),a=t.size,s=o.getZoom(),h=this.context,u=o._pointToContainerPoint(n,i),c=o.getBearing(),l=c||s!==i,f=this.getTileOpacity(e),d=h.globalAlpha;f<1&&(h.globalAlpha=f,this.setToRedraw()),l||u._round();var p=u.x,m=u.y,g=a[0],v=a[1];if(l){if(g++,v++,h.save(),h.translate(p,m),c&&h.rotate(-c*Math.PI/180),s!==i){var y=o._getResolution(i)/o._getResolution();h.scale(y,y)}p=m=0}if(sn.image(h,e,p,m,g,v),this.layer.options.debug){var _=new ce(p,m),x=this.layer.options.debugOutline,w=r.split("__");h.save(),h.strokeStyle=x,h.fillStyle=x,h.strokeWidth=10,h.font="15px monospace",sn.rectangle(h,_,a,1,0),sn.fillText(h,"x:"+w[2]+", y:"+w[1]+", z:"+w[3],_.add(10,20),x),sn.drawCross(h,_.add(g/2,v/2),2,x),h.restore()}l&&h.restore(),h.globalAlpha!==d&&(h.globalAlpha=d),this.setCanvasUpdated()}},n._findChildTiles=function(t){var e=this._getLayerOfTile(t.layer);if(!e.options.background)return[];for(var n=this.getMap(),i=[],r=t.extent2d.getMin(),o=t.extent2d.getMax(),a=e._project(n._pointToPrj(r,t.z)),s=e._project(n._pointToPrj(o,t.z)),h=1;h<3;h++)this._findChildTilesAt(i,a,s,e,t.z+h);return i},n._findChildTilesAt=function(t,e,n,i,r){for(var o,a,s=i.getId(),h=i.getSpatialReference().getResolution(r),u=i._getTileConfig().getTileIndex(e,h),c=i._getTileConfig().getTileIndex(n,h),l=Math.min(u.idx,c.idx),f=Math.max(u.idx,c.idx),d=Math.min(u.idy,c.idy),p=Math.max(u.idy,c.idy),m=l;m<f;m++)for(var g=d;g<p;g++)o=i._getTileId({idx:m,idy:g},r,s),this.tileCache.has(o)&&(a=this.tileCache.getAndRemove(o),t.push(a),this.tileCache.add(o,a))},n._findParentTile=function(t){var e=this.getMap(),n=this._getLayerOfTile(t.layer);if(!n.options.background)return null;for(var i=n.getSpatialReference(),r=i.getZoomDirection(),o=n.options.backgroundZoomDiff,a=t.extent2d.getCenter(),s=n._project(e._pointToPrj(a,t.z)),h=1;h<=o;h++){var u=t.z-r*h,c=i.getResolution(u),l=n._getTileConfig().getTileIndex(s,c),f=n._getTileId(l,u,t.layer);if(this.tileCache.has(f)){var d=this.tileCache.getAndRemove(f);return this.tileCache.add(f,d),d}}return null},n._getLayerOfTile=function(t){return this.layer.getChildLayer?this.layer.getChildLayer(t):this.layer},n._getCachedTile=function(t){var e=this.tilesInView,n=this.tileCache.getAndRemove(t);if(n){e[t]=n;var i=this.tilesLoading;i&&i[t]&&(i[t].current=!1,this.abortTileLoading(i[t]),delete i[t])}else n=e[t];return n},n._addTileToCache=function(t,e){this.tilesInView[t.id]={image:e,current:!0,info:t}},n.getTileOpacity=function(t){return this.layer.options.fadeAnimation&&t.loadTime?Math.min(1,(f()-t.loadTime)/(1e3/60*10)):1},n.onRemove=function(){this.clear(),delete this.tileCache,delete this._tilePlaceHolder,t.prototype.onRemove.call(this)},n._markTiles=function(){var t=0,e=0;if(this.tilesLoading)for(var n in this.tilesLoading)this.tilesLoading[n].current=!1,t++;if(this.tilesInView)for(var i in this.tilesInView)this.tilesInView[i].current=!1,e++;return[t,e]},n._retireTiles=function(t){for(var e in this.tilesLoading){var n=this.tilesLoading[e];!t&&n.current||(n.image&&this.abortTileLoading(n.image),this.deleteTile(n),delete this.tilesLoading[e])}for(var i in this.tilesInView){var r=this.tilesInView[i];r.current||(delete this.tilesInView[i],this.tileCache.has(i)||this.deleteTile(r))}},n.deleteTile=function(t){t&&t.image&&(t.image.onload=null,t.image.onerror=null)},n._generatePlaceHolder=function(t){var e=this.getMap(),n=this.layer.options.placeholder;if(!n||e.getPitch())return null;var i=this.layer.getTileSize(),r=e._getResolution(t)/e._getResolution(),o=this._tilePlaceHolder=this._tilePlaceHolder||sn.createCanvas(1,1);return o.width=i.width*r,o.height=i.height*r,_(n)?n(o):function(t){var e=t.getContext("2d"),n=t.width,i=t.height,r=n/16,o=i/16;e.beginPath();for(var a=0;a<16;a++)e.moveTo(0,a*o),e.lineTo(n,a*o),e.moveTo(a*r,0),e.lineTo(a*r,i);e.strokeStyle="rgba(180, 180, 180, 0.1)",e.lineWidth=1,e.stroke(),e.beginPath();for(var s=[[0,0],[n,0],[0,i],[n,i],[0,0],[0,i],[n,0],[n,i],[0,i/2],[n,i/2],[n/2,0],[n/2,i]],h=1;h<s.length;h+=2)e.moveTo(s[h-1][0],s[h-1][1]),e.lineTo(s[h][0],s[h][1]);e.lineWidth=4,e.stroke()}(o),o},e}(Kn);function Jo(){return!1}_o.registerRenderer("canvas",Yo);var Ko=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.isDrawable=function(){return!0},n.needToRedraw=function(){var e=this.getMap();return!(!this._gl()||e.getPitch()||!e.isZooming()||e.isMoving()||e.isRotating())||t.prototype.needToRedraw.call(this)},n.drawTile=function(e,n){var i=this.getMap();if(e&&i&&n.src!==$){var r=i.getGLScale(e.z),o=e.size[0]*r,a=e.size[1]*r;if(!1!==e.cache&&this._bindGLBuffer(n,o,a),this._gl()){var s=e.point,h=s.x*r,u=s.y*r,c=this.getTileOpacity(n);this.drawGLImage(n,h,u,o,a,c),c<1?this.setToRedraw():this.setCanvasUpdated()}else t.prototype.drawTile.call(this,e,n)}},n.writeZoomStencil=function(){var t=this.gl;t.stencilFunc(t.ALWAYS,1,255),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE)},n.startZoomStencilTest=function(){var t=this.gl;t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.stencilFunc(t.EQUAL,0,255)},n.endZoomStencilTest=function(){this.pauseZoomStencilTest()},n.pauseZoomStencilTest=function(){var t=this.gl;t.stencilFunc(t.ALWAYS,1,255)},n.resumeZoomStencilTest=function(){var t=this.gl;t.stencilFunc(t.EQUAL,0,255)},n._bindGLBuffer=function(t,e,n){t.glBuffer||(t.glBuffer=this.bufferTileData(0,0,e,n))},n.loadTileImage=function(t,e){t.crossOrigin=this.layer.options.crossOrigin||"",t.src=e},n.onCanvasCreate=function(){this.createCanvas2()},n.createContext=function(){t.prototype.createContext.call(this),this.createGLContext()},n.resizeCanvas=function(e){this.canvas&&(t.prototype.resizeCanvas.call(this,e),this.resizeGLCanvas())},n.clearCanvas=function(){this.canvas&&(t.prototype.clearCanvas.call(this),this.clearGLCanvas())},n.getCanvasImage=function(){if(!this._gl())return t.prototype.getCanvasImage.call(this);var e=t.prototype.getCanvasImage.call(this);return e&&(e.image=this.canvas2),e},n._gl=function(){return this.getMap()&&!!this.getMap().getPitch()||this.layer&&!!this.layer.options.fragmentShader},n.deleteTile=function(e){t.prototype.deleteTile.call(this,e),e&&e.image&&this.disposeImage(e.image)},n.onRemove=function(){this.removeGLCanvas()},e}(Lo(Yo));function Qo(t){var e=this.layer.getTileSize(),n=this.canvas.constructor,i=this.getMap(),r=ae.retina?2:1,o=sn.createCanvas(e.width*r,e.height*r,n);o.layer=this.layer;var a=this,s=new En(i.pointToCoordinate(t.point),i.pointToCoordinate(t.point.add(e.toPoint())),i.getProjection());return this.layer.drawTile(o,{url:t.url,point:t.point,center:i.pointToCoordinate(t.point.add(e.width/2,e.height/2)),extent:s,z:t.z,x:t.x,y:t.y},function(e){e?a.onTileError(o,t):a.onTileLoad(o,t)}),o}_o.registerRenderer("gl",Ko);var $o=function(t){function e(){return t.apply(this,arguments)||this}return se(e,t),e.prototype.loadTile=function(){return Qo.apply(this,arguments)},e}(Yo),ta=function(t){function e(){return t.apply(this,arguments)||this}return se(e,t),e.prototype.loadTile=function(){return Qo.apply(this,arguments)},e}(Ko);Mo.registerRenderer("canvas",$o),Mo.registerRenderer("gl",ta);var ea=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.checkResources=function(){var t=this._geosToCheck;if(this._resourceChecked||t||(t=this.layer._geoList),!U(t))return[];for(var e=[],n={},i=t.length-1;i>=0;i--){var r=t[i]._getExternalResources();if(r.length)if(this.resources)for(var o=0;o<r.length;o++){var a=r[o][0];this.resources.isResourceLoaded(r[o])||n[a]||(e.push(r[o]),n[a]=1)}else e.push.apply(e,r)}return this._resourceChecked=!0,delete this._geosToCheck,e},n.render=function(){return this.layer._sortGeometries(),t.prototype.render.apply(this,arguments)},n._addGeoToCheckRes=function(t){t&&(Array.isArray(t)||(t=[t]),this._geosToCheck||(this._geosToCheck=[]),D(this._geosToCheck,t))},n.onGeometryAdd=function(t){this._addGeoToCheckRes(t),na(this)},n.onGeometryRemove=function(){na(this)},n.onGeometrySymbolChange=function(t){this._addGeoToCheckRes(t.target),na(this)},n.onGeometryShapeChange=function(){na(this)},n.onGeometryPositionChange=function(){na(this)},n.onGeometryZIndexChange=function(){na(this)},n.onGeometryShow=function(){na(this)},n.onGeometryHide=function(){na(this)},n.onGeometryPropertiesChange=function(){na(this)},e}(Kn);function na(t){t.layer.options.drawImmediate&&t.render(),t.setToRedraw()}var ia=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.checkResources=function(){var e=this,n=t.prototype.checkResources.apply(this,arguments),i=this.layer.getStyle();return i&&(Array.isArray(i)||(i=[i]),i.forEach(function(t){for(var i=Lt(t.symbol,!0),r=0,o=i.length;r<o;r++)e.resources.isResourceLoaded(i[r])||n.push(i[r])})),n},n.needToRedraw=function(){var e=this.getMap();return!(!e.isInteracting()||!this.layer.options.enableAltitude)||!(e.isZooming()&&!e.isRotating()&&!e.getPitch()&&!this._hasPoint&&this.layer.constructor===br)&&t.prototype.needToRedraw.call(this)},n.draw=function(){if(this.getMap()){if(!this.layer.isVisible()||this.layer.isEmpty())return this.clearCanvas(),void this.completeRender();this.prepareCanvas(),this.drawGeos(),this.completeRender()}},n.isBlank=function(){return!!this.context&&!this.context.canvas._drawn},n.drawOnInteracting=function(){if(this._geosToDraw){this._updateDisplayExtent();for(var t=0,e=this._geosToDraw.length;t<e;t++)this._geosToDraw[t].isVisible()&&this._geosToDraw[t]._paint(this._displayExtent)}},n.show=function(){this.layer.forEach(function(t){t._repaint()}),t.prototype.show.apply(this,arguments)},n.forEachGeo=function(t,e){this.layer.forEach(t,e)},n.drawGeos=function(){this._updateDisplayExtent(),this.prepareToDraw(),this.forEachGeo(this.checkGeo,this);for(var t=0,e=this._geosToDraw.length;t<e;t++)this._geosToDraw[t]._paint()},n.prepareToDraw=function(){this._hasPoint=!1,this._geosToDraw=[]},n.checkGeo=function(t){if(t&&t.isVisible()&&t.getMap()&&t.getLayer()&&t.getLayer().isCanvasRender()){var e=t._getPainter(),n=e.get2DExtent(this.resources);n&&n.intersects(this._displayExtent)&&(e.hasPoint()&&(this._hasPoint=!0),this._geosToDraw.push(t))}},n.onZoomEnd=function(){delete this.canvasExtent2D,t.prototype.onZoomEnd.apply(this,arguments)},n.onRemove=function(){this.forEachGeo(function(t){t.onHide()}),delete this._geosToDraw},n.onGeometryPropertiesChange=function(e){e&&this.layer._styleGeometry(e.target),t.prototype.onGeometryPropertiesChange.call(this,e)},n._updateDisplayExtent=function(){var t=this.canvasExtent2D;if(this._maskExtent){if(!this._maskExtent.intersects(t))return void this.completeRender();t=t.intersection(this._maskExtent)}this._displayExtent=t},n.identify=function(t,e){void 0===e&&(e={});var n=this._geosToDraw;return n?this.layer._hitGeos(n,t,e):[]},e}(ea);br.registerRenderer("canvas",ia);var ra=function(t){function e(e){var n;return(n=t.call(this)||this).map=e,n._handlerQueue={},n}se(e,t);var n=e.prototype;return n.callInNextFrame=function(t){this._handlerQueue.push(t)},n.executeFrameCallbacks=function(){var t=this._handlerQueue;this._handlerQueue=[];for(var e=0,n=t.length;e<n;e++)t[e]()},n.offsetPlatform=function(t){if(!this.map._panels.front)return this;if(0===t.x&&0===t.y)return this;var e=this.map.offsetPlatform().add(t)._round(),n=this.map._panels;return Ue(n.back,e),Ue(n.front,e),this},n.resetContainer=function(){if(this.map&&(this.map._resetMapViewPoint(),this.map._panels.front)){var t=new ce(0,0);Ue(this.map._panels.back,t),Ue(this.map._panels.front,t)}},n.onZoomEnd=function(){this.resetContainer()},n.onLoad=function(){this._frameLoop()},e}(mn),oa=function(t){function e(e){var n;return(n=t.call(this,e)||this)._containerIsCanvas=!!e._containerDOM.getContext,n._registerEvents(),n._loopTime=0,n}se(e,t);var n=e.prototype;return n.load=function(){this.initContainer()},n.renderFrame=function(t){if(!this.map)return!1;var e=this.map;e._fireEvent("framestart"),this.updateMapDOM();var n=this._getAllLayerToRender();return this.drawLayers(n,t),this.drawLayerCanvas(n),e._fireEvent("frameend"),this._recordView(),this._mapview=this._getMapView(),delete this._spatialRefChanged,this._fireLayerLoadEvents(),this.executeFrameCallbacks(),this._canvasUpdated=!1,!0},n.updateMapDOM=function(){var t=this.map;if(!t.isZooming()){var e=t._getViewPointFrameOffset();e&&t.offsetPlatform(e)}},n.drawLayers=function(t,e){for(var n=this.map,i=n.isInteracting(),r=[],o=[],a=n.options.fpsOnInteracting||0,s=0===a?0:1e3/a,h=this.map.options.layerCanvasLimitOnInteracting,u=t.length,c=n.getBaseLayer(),l=0,f=0;f<u;f++){var d=t[f];if(d.isVisible()){var p=d.isCanvasRender();p&&r.push(d.getId());var m=d._getRenderer();if(m){var g=this._checkLayerRedraw(d);if(p&&m.isCanvasUpdated()&&(g||o.push(d.getId()),this.setLayerCanvasUpdated()),delete m.__shouldZoomTransform,g){if(i&&p){if(h>0&&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<o;s++){if(t[s].isVisible()&&t[s].isCanvasRender())if(t[s]._getRenderer()){var h=this._getLayerImage(t[s]);h&&h.image&&(t[s]===e.getBaseLayer()?n=[t[s],h]:a.push([t[s],h]))}}n&&(this._drawLayerCanvasImage(n[0],n[1]),this._drawFog()),o=a.length;for(var u=i&&r>=0&&o>r?o-r:0;u<o;u++)this._drawLayerCanvasImage(a[u][0],a[u][1]);this._drawCenterCross(),e._fireEvent("renderend",{context:this.context})}},n.setToRedraw=function(){for(var t=this._getAllLayerToRender(),e=0,n=t.length;e<n;e++){var i=t[e].getRenderer();i&&i.canvas&&i.setToRedraw&&i.setToRedraw()}},n.updateMapSize=function(t){if(t&&!this._containerIsCanvas){var e=t.width+"px",n=t.height+"px",i=this.map._panels;i.mapWrapper.style.width=e,i.mapWrapper.style.height=n,this._updateCanvasSize()}},n.getMainPanel=function(){return this.map?this._containerIsCanvas?this.map._containerDOM:this.map._panels?this.map._panels.mapWrapper:null:null},n.toDataURL=function(t){return this.canvas?this.canvas.toDataURL(t):null},n.remove=function(){ae.webgl&&"undefined"!=typeof document&&Fe(document,"visibilitychange",this._onVisibilitychange),this._resizeInterval&&clearInterval(this._resizeInterval),delete this.context,delete this.canvas,delete this.map,delete this._spatialRefChanged,this._cancelFrameLoop()},n.hitDetect=function(t){var e=this.map;if(e&&e.options.hitDetect&&!e.isInteracting()){for(var n=e._getLayers(),i="default",r=e.options.hitDetectLimit||0,o=0,a=n.length-1;a>=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;r<o;r++)i.push(e.coordToPoint(n[r],e.getGLZoom()));return[i,null]}return[[e.coordToPoint(this.getCenter(),e.getGLZoom())],null]}});var ha={_getRenderPoints:function(t){var e,n=this.getMap(),i=n.getGLZoom(),r=null;if("point"===t)(e=this._getPath2DPoints(this._getPrjCoordinates(),!1,i))&&e.length>0&&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;o<a;o++)for(var s=0,h=e[o].length;s<h;s++)0===s?r.push([e[o][s],e[o][s+1]]):r.push([e[o][s-1],e[o][s]]);e=e[0].concat(e[1])}else for(var u=0,c=e.length;u<c;u++)0===u?r.push([e[u],e[u+1]]):r.push([e[u-1],e[u]]);else if("line"===t){e=[],r=[];var l=this._getPath2DPoints(this._getPrjCoordinates(),!1,i);if(l.length>0&&Array.isArray(l[0]))for(var f,d=1,p=l.length;d<p;d++){f=l[d],this instanceof Ui&&f.length>0&&!f[0].equals(f[f.length-1])&&f.push(f[0]);for(var m=1,g=f.length;m<g;m++)e.push(f[m].add(f[m-1])._multi(.5)),r.push([f[m-1],f[m]])}else{this instanceof Ui&&l.length>0&&!l[0].equals(l[l.length-1])&&l.push(l[0]);for(var v=1,y=l.length;v<y;v++)e.push(l[v].add(l[v-1])._multi(.5)),r.push([l[v-1],l[v]])}}else if("vertex-first"===t){var _=this._getPrjCoordinates();e=[n._prjToPoint(_[0],i)],r=[[n._prjToPoint(_[0],i),n._prjToPoint(_[1],i)]]}else if("vertex-last"===t){var x=this._getPrjCoordinates(),w=x.length;e=[n._prjToPoint(x[w-1],i)],r=[[n._prjToPoint(x[w-2],i),n._prjToPoint(x[w-1],i)]]}else{var b=this._getProjection().project(this.getCenter());e=[n._prjToPoint(b,i)]}return[e,r]}};qi.include(ha),Ui.include(ha),Ri.include({_redrawWhenPitch:function(){return!1},_redrawWhenRotate:function(){return!1}});var ua={_redrawWhenPitch:function(){return!0},_redrawWhenRotate:function(){return this instanceof rr||this instanceof ar},_paintAsPath:function(){var t=this.getMap();return this._getPainter().getAltitude()>0||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<a;o++)t.push(this._getArrowShape(e[o],e[o+1],n,i,r))},_paintArrow:function(t,e,n){var i=this._getInternalSymbol().lineWidth;(!m(i)||i<3)&&(i=3);var r=this._getArrows(e,i);if(r.length){t.setLineDash&&t.setLineDash([]);for(var o=r.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<o.length;s++){var h=this._getPath2DPoints(o[s],t,e);Array.isArray(h)&&r?Array.isArray(h[0])?(i[0].push(h[0]),i[1].push(h[1])):i[0].push(h):a.push(h)}return r||D(i=[i],a),[i]},_paintOn:function(t,e,n,i,r){sn.polygon(t,e,n,i,r,this.options.smoothness)}})}.call(this,n(129),n(44),n(130).setImmediate)},function(t,e,n){var i=n(7),r=n(34);t.exports=n(6)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(2),r=n(13),o=n(16),a=n(35)("src"),s=Function.toString,h=(""+s).split("toString");n(20).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(o(n,"name")||r(n,"name",e)),t[e]!==n&&(u&&(o(n,a)||r(n,a,t[e]?""+t[e]:h.join(String(e)))),t===i?t[e]=n:s?t[e]?t[e]=n:r(t,e,n):(delete t[e],r(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(t,e,n){var i=n(0),r=n(3),o=n(25),a=/"/g,s=function(t,e,n,i){var r=String(o(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(i).replace(a,""")+'"'),s+">"+r+"</"+e+">"};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(49),r=n(25);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(50),r=n(34),o=n(17),a=n(24),s=n(16),h=n(95),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(69)("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(11);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(49),o=n(10),a=n(8),s=n(86);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(32),r=n(2),o=n(3),a=n(0),s=n(63),h=n(92),u=n(21),c=n(41),l=n(34),f=n(13),d=n(43),p=n(26),m=n(8),g=n(121),v=n(37),y=n(24),_=n(16),x=n(51),w=n(4),b=n(10),M=n(83),E=n(38),S=n(19),T=n(39).f,C=n(85),P=n(35),A=n(5),L=n(28),R=n(53),O=n(60),I=n(88),D=n(47),k=n(57),N=n(40),z=n(87),F=n(111),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;i<n;)t=this[i],this[i++]=this[--e],this[e]=t;return this},some:function(t){return K(St(this),t,arguments.length>1?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(;o<r;)this[e+o]=i[o++]},zt={entries:function(){return ot.call(St(this))},keys:function(){return rt.call(St(this))},values:function(){return it.call(St(this))}},Ft=function(t,e){return w(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Bt=function(t,e){return Ft(t,e=y(e,!0))?l(2,t[e]):H(t,e)},jt=function(t,e,n){return!(Ft(t,e=y(e,!0))&&w(n)&&_(n,"value"))||_(n,"get")||_(n,"set")||n.configurable||_(n,"writable")&&!n.writable||_(n,"enumerable")&&!n.enumerable?G(t,e,n):(t[e]=n.value,t)};yt||(j.f=Bt,B.f=jt),a(a.S+a.F*!yt,"Object",{getOwnPropertyDescriptor:Bt,defineProperty:jt}),o(function(){ft.call({})})&&(ft=dt=function(){return ut.call(this)});var Gt=d({},Dt);d(Gt,zt),f(Gt,pt,zt.values),d(Gt,{slice:kt,set:Nt,constructor:function(){},toString:ft,toLocaleString:It}),At(Gt,"buffer","b"),At(Gt,"byteOffset","o"),At(Gt,"byteLength","l"),At(Gt,"length","e"),G(Gt,mt,{get:function(){return this[_t]}}),t.exports=function(t,e,n,h){var u=t+((h=!!h)?"Clamped":"")+"Array",l="get"+t,d="set"+t,p=r[u],v=p||{},y=p&&S(p),_=!p||!s.ABV,b={},M=p&&p.prototype,C=function(t,n){G(t,n,{get:function(){return function(t,n){var i=t._d;return i.v[l](n*e+i.o,bt)}(this,n)},set:function(t){return function(t,n,i){var r=t._d;h&&(i=(i=Math.round(i))<0?0:i>255?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)});l<s;)C(t,l++)}),M=p.prototype=E(Gt),f(M,"constructor",p)):o(function(){p(1)})&&o(function(){new p(-1)})&&k(function(t){new p,new p(null),new p(1.5),new p(t)},!0)||(p=n(function(t,n,i,r){var o;return c(t,p,u),w(n)?n instanceof q||"ArrayBuffer"==(o=x(n))||"SharedArrayBuffer"==o?void 0!==r?new v(n,Et(i,e),r):void 0!==i?new v(n,Et(i,e)):new v(n):_t in n?Pt(p,n):Lt.call(p,n):new v(g(n))}),Y(y!==Function.prototype?T(v).concat(T(y)):T(v),function(t){t in p||f(p,t,v[t])}),p.prototype=M,i||(M.constructor=p));var P=M[pt],A=!!P&&("values"==P.name||void 0==P.name),L=zt.values;f(p,gt,!0),f(M,_t,u),f(M,xt,!0),f(M,vt,p),(h?new p(1)[mt]==u:mt in M)||G(M,mt,{get:function(){return u}}),b[u]=p,a(a.G+a.W+a.F*(p!=v),b),a(a.S,u,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*o(function(){v.of.call(p,1)}),u,{from:Lt,of:Rt}),"BYTES_PER_ELEMENT"in M||f(M,"BYTES_PER_ELEMENT",e),a(a.P,u,Dt),N(u),a(a.P+a.F*Mt,u,{set:Nt}),a(a.P+a.F*!A,u,zt),i||M.toString==ft||(M.toString=ft),a(a.P+a.F*o(function(){new p(1).slice()}),u,{slice:kt}),a(a.P+a.F*(o(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!o(function(){M.toLocaleString.call([1,2])})),u,{toLocaleString:It}),D[u]=A?P:L,i||A||f(M,pt,L)}}else t.exports=function(){}},function(t,e,n){var i=n(116),r=n(0),o=n(52)("metadata"),a=o.store||(o.store=new(n(119))),s=function(t,e,n){var r=a.get(t);if(!r){if(!n)return;a.set(t,r=new i)}var o=r.get(e);if(!o){if(!n)return;r.set(e,o=new i)}return o};t.exports={store:a,map:s,has:function(t,e,n){var i=s(e,n,!1);return void 0!==i&&i.has(t)},get:function(t,e,n){var i=s(e,n,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,n,i){s(n,i,!0).set(t,e)},keys:function(t,e){var n=s(t,e,!1),i=[];return n&&n.forEach(function(t,e){i.push(e)}),i},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){r(r.S,"Reflect",t)}}},function(t,e,n){var i=n(35)("meta"),r=n(4),o=n(16),a=n(7).f,s=0,h=Object.isExtensible||function(){return!0},u=!n(3)(function(){return h(Object.preventExtensions({}))}),c=function(t){a(t,i,{value:{i:"O"+ ++s,w:{}}})},l=t.exports={KEY:i,NEED:!1,fastKey:function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,i)){if(!h(t))return"F";if(!e)return"E";c(t)}return t[i].i},getWeak:function(t,e){if(!o(t,i)){if(!h(t))return!0;if(!e)return!1;c(t)}return t[i].w},onFreeze:function(t){return u&&l.NEED&&h(t)&&!o(t,i)&&c(t),t}}},function(t,e){t.exports=!1},function(t,e,n){var i=n(5)("unscopables"),r=Array.prototype;void 0==r[i]&&n(13)(r,i,{}),t.exports=function(t){r[i][t]=!0}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){var i=n(97),r=n(70);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(26),r=Math.max,o=Math.min;t.exports=function(t,e){return(t=i(t))<0?r(t+e,0):o(t,e)}},function(t,e,n){var i=n(1),r=n(98),o=n(70),a=n(69)("IE_PROTO"),s=function(){},h=function(){var t,e=n(67)("iframe"),i=o.length;for(e.style.display="none",n(71).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.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(97),r=n(70).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(109),o=n(83),a=n(1),s=n(8),h=n(85),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){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var i=n(7).f,r=n(16),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(0),r=n(25),o=n(3),a=n(73),s="["+a+"]",h=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),c=function(t,e,n){var r={},s=o(function(){return!!a[t]()||"
"!="
"[t]()}),h=r[t]=s?e(l):a[t];n&&(r[n]=h),i(i.P+i.F*s,"String",r)},l=c.trim=function(t,e){return t=String(r(t)),1&e&&(t=t.replace(h,"")),2&e&&(t=t.replace(u,"")),t};t.exports=c},function(t,e){t.exports={}},function(t,e,n){var i=n(4);t.exports=function(t,e){if(!i(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){var i=n(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var i=n(22),r=n(5)("toStringTag"),o="Arguments"==i(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),r))?n:o?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var i=n(20),r=n(2),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:i.version,mode:n(32)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var i=n(17),r=n(8),o=n(37);t.exports=function(t){return function(e,n,a){var s,h=i(e),u=r(h.length),c=o(a,u);if(t&&n!=n){for(;u>c;)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(11),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(43),s=n(31),h=n(42),u=n(41),c=n(4),l=n(3),f=n(57),d=n(45),p=n(74);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(35),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(32)||!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(11),o=n(21),a=n(42);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(32),a=n(96),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(52)("keys"),r=n(35);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(72).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(32),r=n(0),o=n(14),a=n(13),s=n(47),h=n(80),u=n(45),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(38),r=n(34),o=n(45),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(56),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(47),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(34);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(51),r=n(5)("iterator"),o=n(47);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(230);t.exports=function(t,e){return new(i(t))(e)}},function(t,e,n){"use strict";var i=n(10),r=n(37),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(33),r=n(112),o=n(47),a=n(17);t.exports=n(79)(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(102),h=n(71),u=n(67),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(89).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(11);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(32),a=n(63),s=n(13),h=n(43),u=n(3),c=n(41),l=n(26),f=n(8),d=n(121),p=n(39).f,m=n(7).f,g=n(87),v=n(45),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<<s)-1,u=h>>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<<e|r,s+=e;s>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<<r)-1,a=o>>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;c<e;c++)s[h+c]=u[o?c:e-c-1]}if(a.ABV){if(!u(function(){x(1)})||!u(function(){new x(-1)})||u(function(){return new x,new x(1.5),new x(NaN),"ArrayBuffer"!=x.name})){for(var W,Z=(x=function(t){return c(this,x),new S(d(t))})[y]=S[y],q=p(S),X=0;q.length>X;)(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(341)(!1)).push([t.i,"* {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\nhtml {\r\n --width: 100%;\r\n}\r\n\r\nhtml, body, #map {\r\n width: var(--width);\r\n height: var(--width)\r\n}\r\n\r\n#map {\r\n background: #ccc;\r\n}",""])},function(t,e,n){"use strict";(function(t,i){var r,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,s){"object"===a(e)&&void 0!==i?s(i):void 0===(o="function"==typeof(r=["exports",function(t){var e={exports:{}};s(e)}])?r.call(e,n,e,i):r)||(i.exports=o)}(0,function(e){function n(t){return"function"==typeof t&&/native code/.test(t.toString())}var i;function r(t){Array.isArray(t)||(t=[t]);var e=function(){for(var e=0;e<t.length;e++)t[e].apply(this,arguments)};return e.fns=t,e}function o(){this.stacks={}}i=void 0!==t&&n(t)?t:n("undefined"!=typeof Promise&&Promise)?function(t){Promise.resolve().then(t)}:function(t){setTimeout(t,0)},o.prototype.__bind=function(t,e){var n=r(e);return this.stacks[t]||(this.stacks[t]=r(function(){})),this.stacks[t].fns.push(n),n},o.prototype.on=function(t,e){this.__bind(t,e)},o.prototype.off=function(t){this.stacks[t]&&(this.stacks[t]=r(function(){}))},o.prototype.once=function(t,e){this.__bind(t,e).isOnce=!0},o.prototype.emit=function(t){var e=this.stacks[t],n=Array.prototype.slice.call(arguments,1);e&&i(function(){e.apply(this,n);for(var t=e.fns,i=0;t[i];)t[i].isOnce?t.splice(i,1):i++})},e.exports=o})}).call(this,n(130).setImmediate,n(349)(t))},function(t,e,n){t.exports=!n(6)&&!n(3)(function(){return 7!=Object.defineProperty(n(67)("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(53)(!1),a=n(69)("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(36);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(39).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(36),r=n(54),o=n(50),a=n(10),s=n(49),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(11),r=n(4),o=n(102),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<e;r++)i[r]="a["+r+"]";s[e]=Function("F,a","return new F("+i.join(",")+")")}return s[e](t,n)}(e,i.length,i):o(e,i,t)};return r(e.prototype)&&(h.prototype=e.prototype),h}},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i=n(2).parseInt,r=n(46).trim,o=n(73),a=/^[-+]?0[xX]/;t.exports=8!==i(o+"08")||22!==i(o+"0x16")?function(t,e){var n=r(String(t),3);return i(n,e>>>0||(a.test(n)?16:10))}:i},function(t,e,n){var i=n(2).parseFloat,r=n(46).trim;t.exports=1/i(n(73)+"-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(76),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 r<h?u*function(t){return t+1/o-1/o}(r/h/a)*h*a:(n=(e=(1+a/o)*r)-(e-r))>s||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(11),r=n(10),o=n(49),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(37),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(h<s&&s<h+c&&(l=-1,h+=c-1,s+=c-1);c-- >0;)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(58)})},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(91);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(117),r=n(48);t.exports=n(62)("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(38),o=n(43),a=n(21),s=n(41),h=n(42),u=n(79),c=n(112),l=n(40),f=n(6),d=n(31).fastKey,p=n(48),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(117),r=n(48);t.exports=n(62)("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(31),s=n(100),h=n(120),u=n(4),c=n(3),l=n(48),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(62)("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(43),r=n(31).getWeak,o=n(1),a=n(4),s=n(41),h=n(42),u=n(28),c=n(16),l=n(48),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(39),r=n(54),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(55),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);v<u;){if(v in h){if(p=y?y(h[v],v,n):h[v],m=!1,r(p)&&(m=void 0!==(m=p[s])?!!m:i(p)),m&&l>0)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(75),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(36),r=n(17),o=n(50).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(51),r=n(127);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(42);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){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=[];++l<e;)h&&h[l].run();l=-1,e=u.length}h=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new p(t,e)),1!==u.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(344),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(44))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){var t=[],e=!1,n=!1;return function(){function i(){requestAnimationFrame(function(){for(var r=0;r<t.length;r++)t[r]()&&(t.splice(r,1),r--);threeLayer.renderScene(),0===t.length?e=!1:n||i()})}t.push(function(t,e,n,i){var r=e.length,o=0;return function(){t.visible||(o=i-1);for(var a=0,s=0;a<r;a+=3,s++){var h=s*i+o;e[a+2]=n[h]}return o++,!(!t.isRemove&&o<i&&(t.geometry.attributes.position.needsUpdate=!0,1))}}.apply(void 0,arguments)),e||(e=!0,bus.off("addGeoing"),bus.off("addGeoEnd"),bus.on("addGeoing",function(){n=!0}),bus.on("addGeoEnd",function(){n=!1,i()}),i())}}();e.animation=i,e.init=function(t,e){for(var n=t.length,i=0;i<n;i+=3)t[i+2]=e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={stepTotal:10}},function(t,e,n){t.exports=function(){return new Worker(n.p+"056a09d0cd09012b888c.worker.js")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clearFids=e.addGeo=void 0;var i=o(n(133)),r=o(n(350));function o(t){return t&&t.__esModule?t:{default:t}}var a=new i.default;a.addEventListener("message",function(t){"addGeo"===t.data.incident?(0,r.default)(t):(console.log("shoudao"),bus.emit("addGeoEnd"))}),e.addGeo=function(t){var e=threeLayer.getMap(),n={center:e.getCenter(),maxNativeZoom:e.getMaxNativeZoom()};console.log("get"),bus.emit("addGeoing"),a.postMessage(JSON.stringify({thing:"getGeo",map:n,tiles:t}))},e.clearFids=function(t){a.postMessage(JSON.stringify({thing:"clearFids",fids:t}))}},function(t,e,n){"use strict";(function(t){n(136),n(138),n(340);var e=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(12)),i=n(345),r=h(n(346)),o=h(n(352)),a=n(134),s=h(n(94));function h(t){return t&&t.__esModule?t:{default:t}}t.bus=new s.default,t.map=new e.Map("map",{center:[13.4233277,52.5106093],zoom:16,maxZoom:20,minZoom:15,maxPitch:60,maxVisualPitch:100,doubleClickZoom:!1,attribute:{content:""},forceRenderOnMoving:!0,forceRenderOnZooming:!0,forceRenderOnRotating:!0,baseLayer:new e.TileLayer("tile",{urlTemplate:"http://tile0.f4map.com/tiles/f4_3d/{z}/{x}/{y}.png",subdomains:["a","b","c","d"]})});var u=new e.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}),c=[];u.drawTile=function(t,e){return c.push(e.url)},map.addLayer(u),t.threeLayer=new i.ThreeLayer("t",{forceRenderOnMoving:!0,forceRenderOnZooming:!0,forceRenderOnRotating:!0}),threeLayer.prepareToDraw=o.default,threeLayer.draw=function(){console.log("draw"),(0,a.addGeo)(function(){for(var t=u.getTiles().tileGrids,e=0;e<t.length&&!(t[e].zoom>=15);e++);return t[e].tiles}())},console.log("draw11"),threeLayer.addTo(map),map.on("moving moveend zoomend dragrotating dragrotateend",r.default)}).call(this,n(44))},function(t,e,n){t.exports=n(137)},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(){},t.exports=e.default},function(t,e,n){"use strict";(function(t){if(n(139),n(336),n(337),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;var e="defineProperty";function i(t,n,i){t[n]||Object[e](t,n,{writable:!0,configurable:!0,value:i})}i(String.prototype,"padLeft","".padStart),i(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(t){[][t]&&i(Array,t,Function.call.bind([][t]))})}).call(this,n(44))},function(t,e,n){n(140),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(192),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(208),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(220),n(221),n(223),n(224),n(225),n(226),n(227),n(228),n(229),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(88),n(244),n(245),n(113),n(246),n(247),n(248),n(249),n(250),n(116),n(118),n(119),n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(322),n(323),n(324),n(325),n(326),n(327),n(328),n(329),n(330),n(331),n(332),n(333),n(334),n(335),t.exports=n(20)},function(t,e,n){"use strict";var i=n(2),r=n(16),o=n(6),a=n(0),s=n(14),h=n(31).KEY,u=n(3),c=n(52),l=n(45),f=n(35),d=n(5),p=n(96),m=n(68),g=n(141),v=n(55),y=n(1),_=n(4),x=n(17),w=n(24),b=n(34),M=n(38),E=n(99),S=n(18),T=n(7),C=n(36),P=S.f,A=T.f,L=E.f,R=i.Symbol,O=i.JSON,I=O&&O.stringify,D=d("_hidden"),k=d("toPrimitive"),N={}.propertyIsEnumerable,z=c("symbol-registry"),F=c("symbols"),B=c("op-symbols"),j=Object.prototype,G="function"==typeof R,H=i.QObject,U=!H||!H.prototype||!H.prototype.findChild,V=o&&u(function(){return 7!=M(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=P(j,e);i&&delete j[e],A(t,e,n),i&&t!==j&&A(j,e,i)}:A,W=function(t){var e=F[t]=M(R.prototype);return e._k=t,e},Z=G&&"symbol"==typeof R.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof R},q=function(t,e,n){return t===j&&q(B,e,n),y(t),e=w(e,!0),y(n),r(F,e)?(n.enumerable?(r(t,D)&&t[D][e]&&(t[D][e]=!1),n=M(n,{enumerable:b(0,!1)})):(r(t,D)||A(t,D,b(1,{})),t[D][e]=!0),V(t,e,n)):A(t,e,n)},X=function(t,e){y(t);for(var n,i=g(e=x(e)),r=0,o=i.length;o>r;)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(39).f=E.f=K,n(50).f=Y,n(54).f=Q,o&&!n(32)&&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(36),r=n(54),o=n(50);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(38)})},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(98)})},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(36);n(27)("keys",function(){return function(t){return r(i(t))}})},function(t,e,n){n(27)("getOwnPropertyNames",function(){return n(99).f})},function(t,e,n){var i=n(4),r=n(31).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(31).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(31).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(100)})},function(t,e,n){var i=n(0);i(i.S,"Object",{is:n(157)})},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(72).set})},function(t,e,n){"use strict";var i=n(51),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(101)})},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(103);i(i.G+i.F*(parseInt!=r),{parseInt:r})},function(t,e,n){var i=n(0),r=n(104);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(74),s=n(24),h=n(3),u=n(39).f,c=n(18).f,l=n(7).f,f=n(46).trim,d=i.Number,p=d,m=d.prototype,g="Number"==o(n(38)(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;u<c;u++)if((a=h.charCodeAt(u))<48||a>r)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(105),a=n(75),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<<i),l(1,1),f(2),g=d()}else l(0,n),l(1<<-e,0),g=d()+a.call("0",u);return g=u>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(105),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(106)})},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(106),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(104);i(i.S+i.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},function(t,e,n){var i=n(0),r=n(103);i(i.S+i.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(t,e,n){var i=n(0),r=n(107),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(76);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(77);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(108)})},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;a<s;)h<(n=r(arguments[a++]))?(o=o*(i=h/n)*i+1,h=n):o+=n>0?(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(107)})},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(76)})},function(t,e,n){var i=n(0),r=n(77),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(77),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(37),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<i&&a.push(String(arguments[s]));return a.join("")}})},function(t,e,n){"use strict";n(46)("trim",function(t){return function(){return t(this,3)}})},function(t,e,n){"use strict";var i=n(78)(!0);n(79)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=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(78)(!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(81),a="".endsWith;i(i.P+i.F*n(82)("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(81);i(i.P+i.F*n(82)("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(75)})},function(t,e,n){"use strict";var i=n(0),r=n(8),o=n(81),a="".startsWith;i(i.P+i.F*n(82)("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(219);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(222))},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(55)})},function(t,e,n){"use strict";var i=n(21),r=n(0),o=n(10),a=n(109),s=n(83),h=n(8),u=n(84),c=n(85);r(r.S+r.F*!n(57)(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(84);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(49)!=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(71),o=n(22),a=n(37),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;f<c;f++)l[f]="String"==i?this.charAt(r+f):this[r+f];return l}})},function(t,e,n){"use strict";var i=n(0),r=n(11),o=n(10),a=n(3),s=[].sort,h=[1,2,3];i(i.P+i.F*(a(function(){h.sort(void 0)})||!a(function(){h.sort(null)})||!n(23)(s)),"Array",{sort:function(t){return void 0===t?s.call(o(this)):s.call(o(this),r(t))}})},function(t,e,n){"use strict";var i=n(0),r=n(28)(0),o=n(23)([].forEach,!0);i(i.P+i.F*!o,"Array",{forEach:function(t){return r(this,t,arguments[1])}})},function(t,e,n){var i=n(4),r=n(55),o=n(5)("species");t.exports=function(t){var e;return r(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!r(e.prototype)||(e=void 0),i(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){"use strict";var i=n(0),r=n(28)(1);i(i.P+i.F*!n(23)([].map,!0),"Array",{map:function(t){return r(this,t,arguments[1])}})},function(t,e,n){"use strict";var i=n(0),r=n(28)(2);i(i.P+i.F*!n(23)([].filter,!0),"Array",{filter:function(t){return r(this,t,arguments[1])}})},function(t,e,n){"use strict";var i=n(0),r=n(28)(3);i(i.P+i.F*!n(23)([].some,!0),"Array",{some:function(t){return r(this,t,arguments[1])}})},function(t,e,n){"use strict";var i=n(0),r=n(28)(4);i(i.P+i.F*!n(23)([].every,!0),"Array",{every:function(t){return r(this,t,arguments[1])}})},function(t,e,n){"use strict";var i=n(0),r=n(110);i(i.P+i.F*!n(23)([].reduce,!0),"Array",{reduce:function(t){return r(this,t,arguments.length,arguments[1],!1)}})},function(t,e,n){"use strict";var i=n(0),r=n(110);i(i.P+i.F*!n(23)([].reduceRight,!0),"Array",{reduceRight:function(t){return r(this,t,arguments.length,arguments[1],!0)}})},function(t,e,n){"use strict";var i=n(0),r=n(53)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;i(i.P+i.F*(a||!n(23)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:r(this,t,arguments[1])}})},function(t,e,n){"use strict";var i=n(0),r=n(17),o=n(26),a=n(8),s=[].lastIndexOf,h=!!s&&1/[1].lastIndexOf(1,-0)<0;i(i.P+i.F*(h||!n(23)(s)),"Array",{lastIndexOf:function(t){if(h)return s.apply(this,arguments)||0;var e=r(this),n=a(e.length),i=n-1;for(arguments.length>1&&(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(111)}),n(33)("copyWithin")},function(t,e,n){var i=n(0);i(i.P,"Array",{fill:n(87)}),n(33)("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(33)("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(33)(o)},function(t,e,n){n(40)("Array")},function(t,e,n){var i=n(2),r=n(74),o=n(7).f,a=n(39).f,s=n(56),h=n(58),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(40)("RegExp")},function(t,e,n){"use strict";n(113);var i=n(1),r=n(58),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(59)("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(59)("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(59)("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(59)("split",2,function(t,e,i){"use strict";var r=n(56),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;l<arguments.length-2;l++)void 0===arguments[l]&&(h[l]=void 0)}),h.length>1&&h.index<n.length&&a.apply(f,h.slice(1)),c=h[0].length,p=u,f.length>=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(32),h=n(2),u=n(21),c=n(51),l=n(0),f=n(4),d=n(11),p=n(41),m=n(42),g=n(60),v=n(89).set,y=n(90)(),_=n(91),x=n(114),w=n(61),b=n(115),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(43)(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(45)(C,"Promise"),n(40)("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(57)(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(120),r=n(48);n(62)("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(63),o=n(92),a=n(1),s=n(37),h=n(8),u=n(4),c=n(2).ArrayBuffer,l=n(60),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<r;)c.setUint8(p++,u.getUint8(i++));return o}}),n(40)("ArrayBuffer")},function(t,e,n){var i=n(0);i(i.G+i.W+i.F*!n(63).ABV,{DataView:n(92).DataView})},function(t,e,n){n(29)("Int8",1,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Uint8",1,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Uint8",1,function(t){return function(e,n,i){return t(this,e,n,i)}},!0)},function(t,e,n){n(29)("Int16",2,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Uint16",2,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Int32",4,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Uint32",4,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Float32",4,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){n(29)("Float64",8,function(t){return function(e,n,i){return t(this,e,n,i)}})},function(t,e,n){var i=n(0),r=n(11),o=n(1),a=(n(2).Reflect||{}).apply,s=Function.apply;i(i.S+i.F*!n(3)(function(){a(function(){})}),"Reflect",{apply:function(t,e,n){var i=r(t),h=o(n);return a?a(i,e,h):s.call(i,e,h)}})},function(t,e,n){var i=n(0),r=n(38),o=n(11),a=n(1),s=n(4),h=n(3),u=n(101),c=(n(2).Reflect||{}).construct,l=h(function(){function t(){}return!(c(function(){},[],t)instanceof t)}),f=!h(function(){c(function(){})});i(i.S+i.F*(l||f),"Reflect",{construct:function(t,e){o(t),a(e);var n=arguments.length<3?t:o(arguments[2]);if(f&&!l)return c(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(u.apply(t,i))}var h=n.prototype,d=r(s(h)?h:Object.prototype),p=Function.apply.call(t,d,e);return s(p)?p:d}})},function(t,e,n){var i=n(7),r=n(0),o=n(1),a=n(24);r(r.S+r.F*n(3)(function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=a(e,!0),o(n);try{return i.f(t,e,n),!0}catch(t){return!1}}})},function(t,e,n){var i=n(0),r=n(18).f,o=n(1);i(i.S,"Reflect",{deleteProperty:function(t,e){var n=r(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var i=n(0),r=n(1),o=function(t){this._t=r(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(80)(o,"Object",function(){var t,e=this._k;do{if(this._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(122)})},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(34),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(72);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(53)(!0);i(i.P,"Array",{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(33)("includes")},function(t,e,n){"use strict";var i=n(0),r=n(123),o=n(10),a=n(8),s=n(11),h=n(86);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(33)("flatMap")},function(t,e,n){"use strict";var i=n(0),r=n(123),o=n(10),a=n(8),s=n(26),h=n(86);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(33)("flatten")},function(t,e,n){"use strict";var i=n(0),r=n(78)(!0);i(i.P,"String",{at:function(t){return r(this,t)}})},function(t,e,n){"use strict";var i=n(0),r=n(124),o=n(61);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(124),o=n(61);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(46)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,e,n){"use strict";n(46)("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(56),s=n(58),h=RegExp.prototype,u=function(t,e){this._r=t,this._s=e};n(80)(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(68)("asyncIterator")},function(t,e,n){n(68)("observable")},function(t,e,n){var i=n(0),r=n(122),o=n(17),a=n(18),s=n(84);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(125)(!1);i(i.S,"Object",{values:function(t){return r(t)}})},function(t,e,n){var i=n(0),r=n(125)(!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(11),a=n(7);n(6)&&i(i.P+n(64),"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(11),a=n(7);n(6)&&i(i.P+n(64),"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(64),"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(64),"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(126)("Map")})},function(t,e,n){var i=n(0);i(i.P+i.R,"Set",{toJSON:n(126)("Set")})},function(t,e,n){n(65)("Map")},function(t,e,n){n(65)("Set")},function(t,e,n){n(65)("WeakMap")},function(t,e,n){n(65)("WeakSet")},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){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(128),o=n(108);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(128)})},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(60),s=n(115);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(91),o=n(114);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(118),r=n(127),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(11),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(90)(),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(90)(),s=n(5)("observable"),h=n(11),u=n(1),c=n(41),l=n(43),f=n(13),d=n(42),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);t<e;)n[t]=arguments[t++];return new("function"==typeof this?this:w)(function(t){var e=!1;return a(function(){if(!e){for(var i=0;i<n.length;++i)if(t.next(n[i]),e)return;t.complete()}}),function(){e=!0}})}}),f(w.prototype,s,function(){return this}),i(i.G,{Observable:w}),n(40)("Observable")},function(t,e,n){var i=n(2),r=n(0),o=n(61),a=[].slice,s=/MSIE .\./.test(o),h=function(t){return function(e,n){var i=arguments.length>2,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(89);i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},function(t,e,n){for(var i=n(88),r=n(36),o=n(14),a=n(2),s=n(13),h=n(47),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<p.length;m++){var g,v=p[m],y=d[v],_=a[v],x=_&&_.prototype;if(x&&(x[c]||s(x,c,f),x[l]||s(x,l,v),h[v]=f,y))for(g in i)x[g]||o(x,g,i[g],!0)}},function(t,e,n){(function(e){!function(e){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",h=o.toStringTag||"@@toStringTag",u="object"==typeof t,c=e.regeneratorRuntime;if(c)u&&(t.exports=c);else{(c=e.regeneratorRuntime=u?t.exports:{}).wrap=x;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",m={},g={};g[a]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(R([])));y&&y!==i&&r.call(y,a)&&(g=y);var _=E.prototype=b.prototype=Object.create(g);M.prototype=_.constructor=E,E.constructor=M,E[h]=M.displayName="GeneratorFunction",c.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===M||"GeneratorFunction"===(e.displayName||e.name))},c.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,h in t||(t[h]="GeneratorFunction")),t.prototype=Object.create(_),t},c.awrap=function(t){return{__await:t}},S(T.prototype),T.prototype[s]=function(){return this},c.AsyncIterator=T,c.async=function(t,e,n,i){var r=new T(x(t,e,n,i));return c.isGeneratorFunction(e)?r:r.next().then(function(t){return t.done?t.value:r.next()})},S(_),_[h]="Generator",_[a]=function(){return this},_.toString=function(){return"[object Generator]"},c.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},c.values=R,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,r){return s.type="throw",s.arg=t,e.next=i,r&&(e.method="next",e.arg=n),!!r}for(var o=this.tryEntries.length-1;o>=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<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(h){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=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<t.length;)if(r.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:n,done:!0}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,n(44))},function(t,e,n){n(338),t.exports=n(20).RegExp.escape},function(t,e,n){var i=n(0),r=n(339)(/[\\^$*+?.()|[\]{}]/g,"\\$&");i(i.S,"RegExp",{escape:function(t){return r(t)}})},function(t,e){t.exports=function(t,e){var n=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,n)}}},function(t,e,n){var i=n(93);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0},o=n(342)(i,r);i.locals&&(t.exports=i.locals),t.hot.accept(93,function(){var e=n(93);if("string"==typeof e&&(e=[[t.i,e,""]]),!function(t,e){var n,i=0;for(n in t){if(!e||t[n]!==e[n])return!1;i++}for(n in e)i--;return 0===i}(i.locals,e.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");o(e)}),t.hot.dispose(function(){o()})},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(i),o=i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"});return[n].concat(o).concat([r]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<t.length;r++){var a=t[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var i={},r=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),o=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),a=null,s=0,h=[],u=n(343);function c(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(g(r.parts[a],e))}else{var s=[];for(a=0;a<r.parts.length;a++)s.push(g(r.parts[a],e));i[r.id]={id:r.id,refs:1,parts:s}}}}function l(t,e){for(var n=[],i={},r=0;r<t.length;r++){var o=t[r],a=e.base?o[0]+e.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function f(t,e){var n=o(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=h[h.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),h.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=o(t.insertAt.before,n);n.insertBefore(e,r)}}function d(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=h.indexOf(t);e>=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=e.transform(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<n.length;o++){var a=n[o];(s=i[a.id]).refs--,r.push(s)}t&&c(l(t,e),e);for(o=0;o<r.length;o++){var s;if(0===(s=r[o]).refs){for(var h=0;h<s.parts.length;h++)s.parts[h]();delete i[s.id]}}}};var v=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function y(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=v(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,o=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},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;n<e.length;n++)e[n]=arguments[n+1];var a={callback:t,args:e};return o[r]=a,i(r),r++},h.clearImmediate=u}function u(t){delete o[t]}function c(t){if(a)setTimeout(c,0,t);else{var e=o[t];if(e){a=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(n,i)}}(e)}finally{u(t),a=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(44),n(129))},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(12),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;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(e,r);o&&o.configurable&&void 0===t[r]&&Object.defineProperty(t,r,o)}}(t,e))}var h=Math.PI/180,u=function(t){function e(){return o(this,e),a(this,t.apply(this,arguments))}return s(e,t),e.prototype.draw=function(){this.renderScene()},e.prototype.drawOnInteracting=function(){this.renderScene()},e.prototype.coordinateToVector3=function(t){var e=arguments.length>1&&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,antialias:!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});var i=c(n(347)),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(9)),o=n(131),a=c(n(132)),s=c(n(133)),h=c(n(94)),u=n(134);function c(t){return t&&t.__esModule?t:{default:t}}var l=new s.default,f=(i.default.cache,new r.Frustum),d=new r.Matrix4,p=new h.default;l.addEventListener("message",function(t){p.emit(t.data.incident,t.data.animationArray)});!function(){var t=0}();var m=null;e.default=function(){clearTimeout(m),m=setTimeout(function(){console.log("clear");var t=threeLayer.getCamera();t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),d.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),f.setFromMatrix(d);var e=threeLayer.getScene();e.children.forEach(function(t){"Mesh"===t.type&&(f.intersectsObject(t)||(e.remove(t),t.isRemove=!0,(0,u.clearFids)(t.fids)))})},1e3)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(12)),o=s(n(348)),a=s(n(94));function s(t){return t&&t.__esModule?t:{default:t}}function h(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function i(r,o){try{var a=e[r](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){i("next",t)},function(t){i("throw",t)});t(s)}("next")})}}function u(t){return new Promise(function(e,n){r.Ajax.getJSON(t,function(t,i){!t&&i&&i.features.length?e(i.features):n()})})}var c=new(function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(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}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.urlStatue={},t.cache={},t.loaddingGeos={},t.remoteTask=new o.default({maxParallel:3}),t.loadTask=new o.default({maxParallel:5}),t}return function(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):t.__proto__=e)}(e,a.default),i(e,[{key:"preloadingFeatures",value:function(t){var e=this;this.urlStatue[t]=1,this.remoteTask.push(h(regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,u(t);case 3:return n.abrupt("return",n.sent);case 6:return n.prev=6,n.t0=n.catch(0),delete e.urlStatue[t],n.abrupt("return",null);case 10:case"end":return n.stop()}},n,e,[[0,6]])})),function(n){e.emit(t,n)})}},{key:"checkFeatureState",value:function(t){for(var e in this.loaddingGeos)if(~this.loaddingGeos[e].indexOf(t))return!0}},{key:"inBatches",value:function(){var t=h(regeneratorRuntime.mark(function t(e,n,i){var r,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(1!==this.urlStatue[e]){t.next=7;break}for(r=0,o=n.length;r<o;r++)this.checkFeatureState(n[r].id)&&(n.splice(r,1),r--,o--);return this.loaddingGeos[e]=n.map(function(t){return t.id}),t.next=5,i(n);case 5:this.cache[e]=t.sent,this.urlStatue[e]=2;case 7:case"end":return t.stop()}},t,this)}));return function(e,n,i){return t.apply(this,arguments)}}()},{key:"loaddingFeatures",value:function(){var t=h(regeneratorRuntime.mark(function t(e,n){var i=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this.loadTask.push(h(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i.preloadingFeatures(e),i.off(e),i.once(e,function(t){t&&(document.hidden?i.once("visibilityshow",function(){return i.inBatches(e,t,n)}):i.inBatches(e,t,n))});case 3:case"end":return t.stop()}},t,i)})));case 1:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}()},{key:"loadRegion",value:function(){var t=h(regeneratorRuntime.mark(function t(e,n){var i,r,o,a,s,h;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=!0,r=!1,o=void 0,t.prev=3,a=e[Symbol.iterator]();case 5:if(i=(s=a.next()).done){t.next=13;break}if(h=s.value,!this.urlStatue[h]){t.next=9;break}return t.abrupt("continue",10);case 9:this.loaddingFeatures(h,n);case 10:i=!0,t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),r=!0,o=t.t0;case 19:t.prev=19,t.prev=20,!i&&a.return&&a.return();case 22:if(t.prev=22,!r){t.next=25;break}throw o;case 25:return t.finish(22);case 26:return t.finish(19);case 27:case"end":return t.stop()}},t,this,[[3,15,19,27],[20,,22,26]])}));return function(e,n){return t.apply(this,arguments)}}()},{key:"eliminate",value:function(t){var e=this;Array.isArray(t)||(t=[t]),t.forEach(function(t){delete e.urlStatue[t],delete e.cache[t],delete e.loaddingGeos[t]})}}]),e}());document.addEventListener("visibilitychange",function(){document.hidden||c.emit("visibilityshow")}),e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();var r=function(){function t(e){var n=e.maxParallel;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.maxParallel=n,this.runningTotal=0,this.storage=[],this.resultCb=this.resultCb.bind(this)}return i(t,[{key:"push",value:function(t,e){this.storage.push({mission:t,cb:e}),this.run()}},{key:"resultCb",value:function(){this.runningTotal--,this.run()}},{key:"run",value:function(){var t=this;if(!(0===this.storage.length||this.maxParallel<=this.runningTotal)){this.runningTotal++;var e=this.storage.shift(),n=e.mission,i=e.cb,r=function(t){return Object.prototype.toString.call(t).slice(8,-1)}(n);("Function"===r?Promise.resolve(n()):"Promise"===r?n:"AsyncFunction"===r?n():Promise.resolve(n)).then(function(e){i&&i(e),t.resultCb()}).catch(function(e){i&&i(),t.resultCb()}),this.run()}}}]),t}();e.default=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){var t=function(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function i(r,o){try{var a=e[r](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){i("next",t)},function(t){i("throw",t)});t(s)}("next")})}}(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.data.geoJsonArray.forEach(function(t){var e=t.maxHeight,n=t.animateBuffArrays,i=t.fids,h=t.verticesBuffArrays,u=t.normalsBuffArrays,c=t.type,l=new r.BufferGeometry;l.addAttribute("position",new r.BufferAttribute(h,3)),l.addAttribute("normal",new r.BufferAttribute(u,3));var f=(0,a.default)(l,c);threeLayer.getScene().add(f),f.maxHeight=e,f.fids=i,(0,o.init)(h,e),(0,o.animation)(f,h,n,s.default.stepTotal)});case 2:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}(),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(9)),o=n(131),a=h(n(351)),s=h(n(132));function h(t){return t&&t.__esModule?t:{default:t}}e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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));var r=new i.MeshPhongMaterial({color:16777215,opacity:1});e.default=function(t,e){var n=new i.Mesh(t,r);return n.castShadow=!0,n.receiveShadow=!0,n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){var r=threeLayer.getThreeRenderer(),o=new i.DirectionalLight(16777215,.5);o.position.set(1e4,1e4,1e4),o.castShadow=!0,e.add(o),n.add(new i.PointLight(16777215)),n.updateProjectionMatrix(),map.setPitch(60),r.shadowMapEnabled=!0,r.shadowMapSoft=!0,e.receiveShadow=!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))}]);
|