rk-web-core 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rk-web-core",
3
3
  "description": "iep core utils",
4
- "version": "0.9.1",
4
+ "version": "0.9.2",
5
5
  "author": "",
6
6
  "main": "rk-web-core.js",
7
7
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "vue-router": "^3.5.3",
18
18
  "qiankun": "^2.6.3",
19
19
  "axios": "^0.21.1",
20
- "rk-web-map": "^0.3.0"
20
+ "rk-web-map": "^0.3.1"
21
21
  },
22
22
  "browserslist": [
23
23
  "> 1%",
package/rk-web-core.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("rk-web-core",[],e):"object"==typeof exports?exports["rk-web-core"]=e():t["rk-web-core"]=e()}(window,(function(){return function(t){function e(e){for(var n,r,i=e[0],o=e[1],a=0,s=[];a<i.length;a++)r=i[a],Object.prototype.hasOwnProperty.call(P,r)&&P[r]&&s.push(P[r][0]),P[r]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(F&&F(e);s.length;)s.shift()()}var n=window.webpackHotUpdaterk_web_core;window.webpackHotUpdaterk_web_core=function(t,e){!function(t,e){if(!w[t]||!b[t])return;for(var n in b[t]=!1,e)Object.prototype.hasOwnProperty.call(e,n)&&(g[n]=e[n]);0==--y&&0===_&&C()}(t,e),n&&n(t,e)};var r,i=!0,o="959589b88b35a4cb66e5",a={},s=[],u=[];function c(t){var e=L[t];if(!e)return R;var n=function(n){return e.hot.active?(L[n]?-1===L[n].parents.indexOf(t)&&L[n].parents.push(t):(s=[t],r=n),-1===e.children.indexOf(n)&&e.children.push(n)):(console.warn("[HMR] unexpected require("+n+") from disposed module "+t),s=[]),R(n)},i=function(t){return{configurable:!0,enumerable:!0,get:function(){return R[t]},set:function(e){R[t]=e}}};for(var o in R)Object.prototype.hasOwnProperty.call(R,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(n,o,i(o));return n.e=function(t){return"ready"===f&&d("prepare"),_++,R.e(t).then(e,(function(t){throw e(),t}));function e(){_--,"prepare"===f&&(x[t]||A(t),0===_&&0===y&&C())}},n.t=function(t,e){return 1&e&&(t=n(t)),R.t(t,-2&e)},n}function l(e){var n={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:r!==e,active:!0,accept:function(t,e){if(void 0===t)n._selfAccepted=!0;else if("function"==typeof t)n._selfAccepted=t;else if("object"==typeof t)for(var r=0;r<t.length;r++)n._acceptedDependencies[t[r]]=e||function(){};else n._acceptedDependencies[t]=e||function(){}},decline:function(t){if(void 0===t)n._selfDeclined=!0;else if("object"==typeof t)for(var e=0;e<t.length;e++)n._declinedDependencies[t[e]]=!0;else n._declinedDependencies[t]=!0},dispose:function(t){n._disposeHandlers.push(t)},addDisposeHandler:function(t){n._disposeHandlers.push(t)},removeDisposeHandler:function(t){var e=n._disposeHandlers.indexOf(t);e>=0&&n._disposeHandlers.splice(e,1)},invalidate:function(){switch(this._selfInvalidated=!0,f){case"idle":(g={})[e]=t[e],d("ready");break;case"ready":I(e);break;case"prepare":case"check":case"dispose":case"apply":(v=v||[]).push(e)}},check:S,apply:E,status:function(t){if(!t)return f;h.push(t)},addStatusHandler:function(t){h.push(t)},removeStatusHandler:function(t){var e=h.indexOf(t);e>=0&&h.splice(e,1)},data:a[e]};return r=void 0,n}var h=[],f="idle";function d(t){f=t;for(var e=0;e<h.length;e++)h[e].call(null,t)}var p,g,m,v,y=0,_=0,x={},b={},w={};function M(t){return+t+""===t?+t:t}function S(t){if("idle"!==f)throw new Error("check() is only allowed in idle status");return i=t,d("check"),(e=1e4,e=e||1e4,new Promise((function(t,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,i=R.p+""+o+".hot-update.json";r.open("GET",i,!0),r.timeout=e,r.send(null)}catch(t){return n(t)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+i+" timed out."));else if(404===r.status)t();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+i+" failed."));else{try{var e=JSON.parse(r.responseText)}catch(t){return void n(t)}t(e)}}}))).then((function(t){if(!t)return d(T()?"ready":"idle"),null;b={},x={},w=t.c,m=t.h,d("prepare");var e=new Promise((function(t,e){p={resolve:t,reject:e}}));for(var n in g={},P)A(n);return"prepare"===f&&0===_&&0===y&&C(),e}));var e}function A(t){w[t]?(b[t]=!0,y++,function(t){var e=document.createElement("script");e.charset="utf-8",e.src=R.p+""+t+"."+o+".hot-update.js",e.crossOrigin="anonymous",document.head.appendChild(e)}(t)):x[t]=!0}function C(){d("ready");var t=p;if(p=null,t)if(i)Promise.resolve().then((function(){return E(i)})).then((function(e){t.resolve(e)}),(function(e){t.reject(e)}));else{var e=[];for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&e.push(M(n));t.resolve(e)}}function E(e){if("ready"!==f)throw new Error("apply() is only allowed in ready status");return function e(n){var i,u,c,l,h;function f(t){for(var e=[t],n={},r=e.map((function(t){return{chain:[t],id:t}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((l=L[o])&&(!l.hot._selfAccepted||l.hot._selfInvalidated)){if(l.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(l.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<l.parents.length;s++){var u=l.parents[s],c=L[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]=[]),p(n[u],[o])):(delete n[u],e.push(u),r.push({chain:a.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:t,outdatedModules:e,outdatedDependencies:n}}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];-1===t.indexOf(r)&&t.push(r)}}T();var y={},_=[],x={},b=function(){console.warn("[HMR] unexpected require("+A.moduleId+") to disposed module")};for(var S in g)if(Object.prototype.hasOwnProperty.call(g,S)){var A;h=M(S),A=g[S]?f(h):{type:"disposed",moduleId:S};var C=!1,E=!1,I=!1,O="";switch(A.chain&&(O="\nUpdate propagation: "+A.chain.join(" -> ")),A.type){case"self-declined":n.onDeclined&&n.onDeclined(A),n.ignoreDeclined||(C=new Error("Aborted because of self decline: "+A.moduleId+O));break;case"declined":n.onDeclined&&n.onDeclined(A),n.ignoreDeclined||(C=new Error("Aborted because of declined dependency: "+A.moduleId+" in "+A.parentId+O));break;case"unaccepted":n.onUnaccepted&&n.onUnaccepted(A),n.ignoreUnaccepted||(C=new Error("Aborted because "+h+" is not accepted"+O));break;case"accepted":n.onAccepted&&n.onAccepted(A),E=!0;break;case"disposed":n.onDisposed&&n.onDisposed(A),I=!0;break;default:throw new Error("Unexception type "+A.type)}if(C)return d("abort"),Promise.reject(C);if(E)for(h in x[h]=g[h],p(_,A.outdatedModules),A.outdatedDependencies)Object.prototype.hasOwnProperty.call(A.outdatedDependencies,h)&&(y[h]||(y[h]=[]),p(y[h],A.outdatedDependencies[h]));I&&(p(_,[A.moduleId]),x[h]=b)}var k,B=[];for(u=0;u<_.length;u++)h=_[u],L[h]&&L[h].hot._selfAccepted&&x[h]!==b&&!L[h].hot._selfInvalidated&&B.push({module:h,parents:L[h].parents.slice(),errorHandler:L[h].hot._selfAccepted});d("dispose"),Object.keys(w).forEach((function(t){!1===w[t]&&function(t){delete P[t]}(t)}));var F,D,U=_.slice();for(;U.length>0;)if(h=U.pop(),l=L[h]){var j={},N=l.hot._disposeHandlers;for(c=0;c<N.length;c++)(i=N[c])(j);for(a[h]=j,l.hot.active=!1,delete L[h],delete y[h],c=0;c<l.children.length;c++){var G=L[l.children[c]];G&&((k=G.parents.indexOf(h))>=0&&G.parents.splice(k,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(l=L[h]))for(D=y[h],c=0;c<D.length;c++)F=D[c],(k=l.children.indexOf(F))>=0&&l.children.splice(k,1);d("apply"),void 0!==m&&(o=m,m=void 0);for(h in g=void 0,x)Object.prototype.hasOwnProperty.call(x,h)&&(t[h]=x[h]);var z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(l=L[h])){D=y[h];var H=[];for(u=0;u<D.length;u++)if(F=D[u],i=l.hot._acceptedDependencies[F]){if(-1!==H.indexOf(i))continue;H.push(i)}for(u=0;u<H.length;u++){i=H[u];try{i(D)}catch(t){n.onErrored&&n.onErrored({type:"accept-errored",moduleId:h,dependencyId:D[u],error:t}),n.ignoreErrored||z||(z=t)}}}for(u=0;u<B.length;u++){var V=B[u];h=V.module,s=V.parents,r=h;try{R(h)}catch(t){if("function"==typeof V.errorHandler)try{V.errorHandler(t)}catch(e){n.onErrored&&n.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:e,originalError:t}),n.ignoreErrored||z||(z=e),z||(z=t)}else n.onErrored&&n.onErrored({type:"self-accept-errored",moduleId:h,error:t}),n.ignoreErrored||z||(z=t)}}if(z)return d("fail"),Promise.reject(z);if(v)return e(n).then((function(t){return _.forEach((function(e){t.indexOf(e)<0&&t.push(e)})),t}));return d("idle"),new Promise((function(t){t(_)}))}(e=e||{})}function T(){if(v)return g||(g={}),v.forEach(I),v=void 0,!0}function I(e){Object.prototype.hasOwnProperty.call(g,e)||(g[e]=t[e])}var L={},P={0:0};function R(e){if(L[e])return L[e].exports;var n=L[e]={i:e,l:!1,exports:{},hot:l(e),parents:(u=s,s=[],u),children:[]};return t[e].call(n.exports,n,n.exports,c(e)),n.l=!0,n.exports}R.e=function(t){var e=[],n=P[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise((function(e,r){n=P[t]=[e,r]}));e.push(n[2]=r);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,R.nc&&a.setAttribute("nonce",R.nc),a.src=function(t){return R.p+""+t+"."+o+".js"}(t),0!==a.src.indexOf(window.location.origin+"/")&&(a.crossOrigin="anonymous");var s=new Error;i=function(e){a.onerror=a.onload=null,clearTimeout(u);var n=P[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,n[1](s)}P[t]=void 0}};var u=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(e)},R.m=t,R.c=L,R.d=function(t,e,n){R.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},R.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},R.t=function(t,e){if(1&e&&(t=R(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(R.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)R.d(n,r,function(e){return t[e]}.bind(null,r));return n},R.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return R.d(e,"a",e),e},R.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},R.p="./",R.oe=function(t){throw console.error(t),t},R.h=function(){return o};var O=window.webpackJsonprk_web_core=window.webpackJsonprk_web_core||[],k=O.push.bind(O);O.push=e,O=O.slice();for(var B=0;B<O.length;B++)e(O[B]);var F=k;return c(164)(R.s=164)}([function(t,e,n){t.exports=n(335)},function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return Ct})),n.d(e,"d",(function(){return St})),n.d(e,"e",(function(){return wt})),n.d(e,"f",(function(){return z})),n.d(e,"g",(function(){return it})),n.d(e,"h",(function(){return At})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return jt}));var r=Object.freeze({__proto__:null,get start(){return jt},get ensureJQuerySupport(){return dt},get setBootstrapMaxTime(){return Q},get setMountMaxTime(){return X},get setUnmountMaxTime(){return Y},get setUnloadMaxTime(){return J},get registerApplication(){return At},get unregisterApplication(){return Et},get getMountedApps(){return wt},get getAppStatus(){return St},get unloadApplication(){return Tt},get checkActivityFunctions(){return Ct},get getAppNames(){return Mt},get pathToActiveWhen(){return Pt},get navigateToUrl(){return it},get triggerAppChange(){return Bt},get addErrorHandler(){return l},get removeErrorHandler(){return h},get mountRootParcel(){return z},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return g},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return v},get NOT_MOUNTED(){return y},get MOUNTING(){return _},get UPDATING(){return b},get LOAD_ERROR(){return M},get MOUNTED(){return x},get UNMOUNTING(){return w},get SKIP_BECAUSE_BROKEN(){return S}});function i(t){return(i="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})(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).CustomEvent,s=function(){try{var t=new a("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?a:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},u=[];function c(t,e,n){var r=d(t,e,n);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function l(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function h(t){if("function"!=typeof t)throw Error(f(29,!1));var e=!1;return u=u.filter((function(n){var r=n===t;return e=e||r,!r})),e}function f(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function d(t,e,n){var r,i="".concat(I(e)," '").concat(E(e),"' died in status ").concat(e.status,": ");if(t instanceof Error){try{t.message=i+t.message}catch(t){}r=t}else{console.warn(f(30,!1,e.status,E(e)));try{r=Error(i+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=E(e),e.status=n,r}var p="NOT_LOADED",g="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",v="BOOTSTRAPPING",y="NOT_MOUNTED",_="MOUNTING",x="MOUNTED",b="UPDATING",w="UNMOUNTING",M="LOAD_ERROR",S="SKIP_BECAUSE_BROKEN";function A(t){return t.status===x}function C(t){try{return t.activeWhen(window.location)}catch(e){return c(e,t,S),!1}}function E(t){return t.name}function T(t){return Boolean(t.unmountThisParcel)}function I(t){return T(t)?"parcel":"application"}function L(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function P(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function R(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!P(e,(function(t){return"function"!=typeof t}))));var e}function O(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=I(t),i=E(t);return function(t){return n.reduce((function(n,o,a){return n.then((function(){var n=o(t);return k(n)?n:Promise.reject(f(15,!1,r,i,e,a))}))}),Promise.resolve())}}function k(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function B(t,e){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=v,t.bootstrap?q(t,"bootstrap").then(n).catch((function(n){if(e)throw d(n,t,S);return c(n,t,S),t})):Promise.resolve().then(n))}));function n(){return t.status=y,t}}function F(t,e){return Promise.resolve().then((function(){if(t.status!==x)return t;t.status=w;var n=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(e)throw d(r,t,S);c(r,t,S)}))})).then((function(){return t}));function r(){return q(t,"unmount").then((function(){t.status=y})).catch((function(n){if(e)throw d(n,t,S);c(n,t,S)}))}}))}var D=!1,U=!1;function j(t,e){return Promise.resolve().then((function(){return t.status!==y?t:(D||(window.dispatchEvent(new s("single-spa:before-first-mount")),D=!0),q(t,"mount").then((function(){return t.status=x,U||(window.dispatchEvent(new s("single-spa:first-mount")),U=!0),t})).catch((function(n){return t.status=x,F(t,!0).then(r,r);function r(){if(e)throw d(n,t,S);return c(n,t,S),t}})))}))}var N=0,G={parcels:{}};function z(){return H.apply(G,arguments)}function H(t,e){var n=this;if(!t||"object"!==i(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,i(t.name)));if("object"!==i(e))throw Error(f(4,!1,name,i(e)));if(!e.domElement)throw Error(f(5,!1,name));var r,o=N++,a="function"==typeof t,s=a?t:function(){return Promise.resolve(t)},u={id:o,parcels:{},status:a?g:m,customProps:e,parentName:E(n),unmountThisParcel:function(){return v.then((function(){if(u.status!==x)throw Error(f(6,!1,name,u.status));return F(u,!0)})).then((function(t){return u.parentName&&delete n.parcels[u.id],t})).then((function(t){return l(t),t})).catch((function(t){throw u.status=S,h(t),t}))}};n.parcels[o]=u;var c=s();if(!c||"function"!=typeof c.then)throw Error(f(7,!1));var l,h,p=(c=c.then((function(t){if(!t)throw Error(f(8,!1));var e=t.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!R(t.bootstrap))throw Error(f(9,!1,e));if(!R(t.mount))throw Error(f(10,!1,e));if(!R(t.unmount))throw Error(f(11,!1,e));if(t.update&&!R(t.update))throw Error(f(12,!1,e));var n=O(t,"bootstrap"),i=O(t,"mount"),a=O(t,"unmount");u.status=m,u.name=e,u.bootstrap=n,u.mount=i,u.unmount=a,u.timeouts=K(t.timeouts),t.update&&(u.update=O(t,"update"),r.update=function(t){return u.customProps=t,V(function(t){return Promise.resolve().then((function(){if(t.status!==x)throw Error(f(32,!1,E(t)));return t.status=b,q(t,"update").then((function(){return t.status=x,t})).catch((function(e){throw d(e,t,S)}))}))}(u))})}))).then((function(){return B(u,!0)})),v=p.then((function(){return j(u,!0)})),_=new Promise((function(t,e){l=t,h=e}));return r={mount:function(){return V(Promise.resolve().then((function(){if(u.status!==y)throw Error(f(13,!1,name,u.status));return n.parcels[o]=u,j(u)})))},unmount:function(){return V(u.unmountThisParcel())},getStatus:function(){return u.status},loadPromise:V(c),bootstrapPromise:V(p),mountPromise:V(v),unmountPromise:V(_)}}function V(t){return t.then((function(){return null}))}function W(t){var e=E(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!==i(n)||null===n||Array.isArray(n))&&(n={},console.warn(f(40,!1),e,n));var o=L({},n,{name:e,mountParcel:H.bind(t),singleSpa:r});return T(t)&&(o.unmountSelf=t.unmountThisParcel),o}var Z={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function Q(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(16,!1));Z.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function X(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(17,!1));Z.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Y(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(18,!1));Z.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(19,!1));Z.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function q(t,e){var n=t.timeouts[e],r=n.warningMillis,i=I(t);return new Promise((function(o,a){var s=!1,u=!1;t[e](W(t)).then((function(t){s=!0,o(t)})).catch((function(t){s=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=f(31,!1,e,i,E(t),n.millis);function l(t){if(!s)if(!0===t)u=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!u){var e=t,i=e*r;console.warn(c),i+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))}function K(t){var e={};for(var n in Z)e[n]=L({},Z[n],t&&t[n]||{});return e}function $(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==M?t:(t.status=g,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(W(t));if(!k(r))throw n=!0,Error(f(33,!1,E(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!==i(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!R(e.bootstrap)&&(r=35),R(e.mount)||(r=36),R(e.unmount)||(r=37);var o=I(e);if(r){var a;try{a=JSON.stringify(e)}catch(t){}return console.error(f(r,!1,o,E(t),a),e),c(void 0,t,S),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=L({},t.devtools.overlays,e.devtools.overlays)),t.status=m,t.bootstrap=O(e,"bootstrap"),t.mount=O(e,"mount"),t.unmount=O(e,"unmount"),t.unload=O(e,"unload"),t.timeouts=K(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=S:(r=M,t.loadErrorTime=(new Date).getTime()),c(e,t,r),t})));var e,n}))}var tt,et="undefined"!=typeof window,nt={hashchange:[],popstate:[]},rt=["hashchange","popstate"];function it(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=ht(window.location.href),r=ht(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function ot(t){var e=this;if(t){var n=t[0].type;rt.indexOf(n)>=0&&nt[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}}function at(){Ft([],arguments)}function st(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),i=window.location.href;return tt&&n===i||(Nt()?window.dispatchEvent(ut(window.history.state,e)):Ft([])),r}}function ut(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}if(et){window.addEventListener("hashchange",at),window.addEventListener("popstate",at);var ct=window.addEventListener,lt=window.removeEventListener;window.addEventListener=function(t,e){if(!("function"==typeof e&&rt.indexOf(t)>=0)||P(nt[t],(function(t){return t===e})))return ct.apply(this,arguments);nt[t].push(e)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&rt.indexOf(t)>=0))return lt.apply(this,arguments);nt[t]=nt[t].filter((function(t){return t!==e}))},window.history.pushState=st(window.history.pushState,"pushState"),window.history.replaceState=st(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=it}function ht(t){var e=document.createElement("a");return e.href=t,e}var ft=!1;function dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return pt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return pt.call(this,n,window.removeEventListener,t,e,arguments)},ft=!0}}function pt(t,e,n,r,i){return"string"!=typeof n?t.apply(this,i):(n.split(/\s+/).forEach((function(t){rt.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,i))}var gt={};function mt(t){return Promise.resolve().then((function(){var e=gt[E(t)];if(!e)return t;if(t.status===p)return vt(t,e),t;if("UNLOADING"===t.status)return e.promise.then((function(){return t}));if(t.status!==y&&t.status!==M)return t;var n=t.status===M?Promise.resolve():q(t,"unload");return t.status="UNLOADING",n.then((function(){return vt(t,e),t})).catch((function(n){return function(t,e,n){delete gt[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,c(n,t,S),e.reject(n)}(t,e,n),t}))}))}function vt(t,e){delete gt[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,e.resolve()}function yt(t,e,n,r){gt[E(t)]={app:t,resolve:n,reject:r},Object.defineProperty(gt[E(t)],"promise",{get:e})}function _t(t){return gt[t]}var xt=[];function bt(){var t=[],e=[],n=[],r=[],i=(new Date).getTime();return xt.forEach((function(o){var a=o.status!==S&&C(o);switch(o.status){case M:a&&i-o.loadErrorTime>=200&&n.push(o);break;case p:case g:a&&n.push(o);break;case m:case y:!a&&_t(E(o))?t.push(o):a&&r.push(o);break;case x:a||e.push(o)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}function wt(){return xt.filter(A).map(E)}function Mt(){return xt.map(E)}function St(t){var e=P(xt,(function(e){return E(e)===t}));return e?e.status:null}function At(t,e,n,r){var o=function(t,e,n,r){var o,a={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===i(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(f(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==i(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(f(24,!1));if(!Lt(t.customProps))throw Error(f(22,!1))}(t),a.name=t.name,a.loadApp=t.app,a.activeWhen=t.activeWhen,a.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!e)throw Error(f(23,!1));if("function"!=typeof n)throw Error(f(24,!1));if(!Lt(r))throw Error(f(22,!1))}(t,e,n,r),a.name=t,a.loadApp=e,a.activeWhen=n,a.customProps=r),a.loadApp="function"!=typeof(o=a.loadApp)?function(){return Promise.resolve(o)}:o,a.customProps=function(t){return t||{}}(a.customProps),a.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:Pt(t)})),function(t){return e.some((function(e){return e(t)}))}}(a.activeWhen),a}(t,e,n,r);if(-1!==Mt().indexOf(o.name))throw Error(f(21,!1,o.name));xt.push(L({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),et&&(dt(),Ft())}function Ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return xt.filter((function(e){return e.activeWhen(t)})).map(E)}function Et(t){if(0===xt.filter((function(e){return E(e)===t})).length)throw Error(f(25,!1,t));return Tt(t).then((function(){var e=xt.map(E).indexOf(t);xt.splice(e,1)}))}function Tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var n=P(xt,(function(e){return E(e)===t}));if(!n)throw Error(f(27,!1,t));var r,i=_t(E(n));if(e&&e.waitForUnmount){if(i)return i.promise;var o=new Promise((function(t,e){yt(n,(function(){return o}),t,e)}));return o}return i?(r=i.promise,It(n,i.resolve,i.reject)):r=new Promise((function(t,e){yt(n,(function(){return r}),t,e),It(n,t,e)})),r}function It(t,e,n){F(t).then(mt).then((function(){e(),setTimeout((function(){Ft()}))})).catch(n)}function Lt(t){return!t||"function"==typeof t||"object"===i(t)&&null!==t&&!Array.isArray(t)}function Pt(t,e){var n=function(t,e){var n=0,r=!1,i="^";"/"!==t[0]&&(t="/"+t);for(var o=0;o<t.length;o++){var a=t[o];(!r&&":"===a||r&&"/"===a)&&s(o)}return s(t.length),new RegExp(i,"i");function s(o){var a=t.slice(n,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=r?"[^/]+/?":a,o===t.length)if(r)e&&(i+="$");else{var s=e?"":".*";i="/"===i.charAt(i.length-1)?"".concat(i).concat(s,"$"):"".concat(i,"(/").concat(s,")?(#.*)?$")}r=!r,n=o}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}var Rt=!1,Ot=[],kt=et&&window.location.href;function Bt(){return Ft()}function Ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;if(Rt)return new Promise((function(t,n){Ot.push({resolve:t,reject:n,eventArguments:e})}));var n,r=bt(),i=r.appsToUnload,a=r.appsToUnmount,u=r.appsToLoad,c=r.appsToMount,l=!1,h=kt,f=kt=window.location.href;return Nt()?(Rt=!0,n=i.concat(u,a,c),m()):(n=u,g());function d(){l=!0}function g(){return Promise.resolve().then((function(){var t=u.map($);return Promise.all(t).then(_).then((function(){return[]})).catch((function(t){throw _(),t}))}))}function m(){return Promise.resolve().then((function(){if(window.dispatchEvent(new s(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",b(!0))),window.dispatchEvent(new s("single-spa:before-routing-event",b(!0,{cancelNavigation:d}))),l)return window.dispatchEvent(new s("single-spa:before-mount-routing-event",b(!0))),v(),void it(h);var e=i.map(mt),r=a.map(F).map((function(t){return t.then(mt)})).concat(e),o=Promise.all(r);o.then((function(){window.dispatchEvent(new s("single-spa:before-mount-routing-event",b(!0)))}));var f=u.map((function(t){return $(t).then((function(t){return Dt(t,o)}))})),p=c.filter((function(t){return u.indexOf(t)<0})).map((function(t){return Dt(t,o)}));return o.catch((function(t){throw _(),t})).then((function(){return _(),Promise.all(f.concat(p)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(v)}))}))}function v(){var e=wt();t.forEach((function(t){return t.resolve(e)}));try{var r=0===n.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new s(r,b())),window.dispatchEvent(new s("single-spa:routing-event",b()))}catch(t){setTimeout((function(){throw t}))}if(Rt=!1,Ot.length>0){var i=Ot;Ot=[],Ft(i)}return e}function _(){t.forEach((function(t){ot(t.eventArguments)})),ot(e)}function b(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=arguments.length>1?arguments[1]:void 0,d={},g=(o(t={},x,[]),o(t,y,[]),o(t,p,[]),o(t,S,[]),t);r?(u.concat(c).forEach((function(t,e){v(t,x)})),i.forEach((function(t){v(t,p)})),a.forEach((function(t){v(t,y)}))):n.forEach((function(t){v(t)}));var m={detail:{newAppStatuses:d,appsByNewStatus:g,totalAppChanges:n.length,originalEvent:null==e?void 0:e[0],oldUrl:h,newUrl:f,navigationIsCanceled:l}};return s&&L(m.detail,s),m;function v(t,e){var n=E(t);e=e||St(n),d[n]=e,(g[e]=g[e]||[]).push(n)}}}function Dt(t,e){return C(t)?B(t).then((function(t){return e.then((function(){return C(t)?j(t):t}))})):e.then((function(){return t}))}var Ut=!1;function jt(t){var e;Ut=!0,t&&t.urlRerouteOnly&&(e=t.urlRerouteOnly,tt=e),et&&Ft()}function Nt(){return Ut}et&&setTimeout((function(){Ut||console.warn(f(1,!1))}),5e3);var Gt={getRawAppData:function(){return[].concat(xt)},reroute:Ft,NOT_LOADED:p,toLoadPromise:$,toBootstrapPromise:B,unregisterApplication:Et};et&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Gt)}).call(this,n(20))},function(t,e,n){var r=n(28),i=n(12);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){"use strict";var r=n(123),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===i.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:c,isStream:function(t){return s(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function t(){var e={};function n(n,r){u(e[r])&&u(n)?e[r]=t(e[r],n):u(n)?e[r]=t({},n):o(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)l(arguments[r],n);return e},extend:function(t,e,n){return l(e,(function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),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,n){var r=n(103)("wks"),i=n(104),o=n(5).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(5),i=n(1),o=n(29),a=n(23),s=n(37),u=function(t,e,n){var c,l,h,f=t&u.F,d=t&u.G,p=t&u.S,g=t&u.P,m=t&u.B,v=t&u.W,y=d?i:i[e]||(i[e]={}),_=y.prototype,x=d?r:p?r[e]:(r[e]||{}).prototype;for(c in d&&(n=e),n)(l=!f&&x&&void 0!==x[c])&&s(y,c)||(h=l?x[c]:n[c],y[c]=d&&"function"!=typeof x[c]?n[c]:m&&l?o(h,r):v&&x[c]==h?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):g&&"function"==typeof h?o(Function.call,h):h,g&&((y.virtual||(y.virtual={}))[c]=h,t&u.R&&_&&!_[c]&&a(_,c,h)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){(function(t,r){var i;
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("rk-web-core",[],e):"object"==typeof exports?exports["rk-web-core"]=e():t["rk-web-core"]=e()}(window,(function(){return function(t){function e(e){for(var n,r,i=e[0],o=e[1],a=0,s=[];a<i.length;a++)r=i[a],Object.prototype.hasOwnProperty.call(P,r)&&P[r]&&s.push(P[r][0]),P[r]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(F&&F(e);s.length;)s.shift()()}var n=window.webpackHotUpdaterk_web_core;window.webpackHotUpdaterk_web_core=function(t,e){!function(t,e){if(!w[t]||!b[t])return;for(var n in b[t]=!1,e)Object.prototype.hasOwnProperty.call(e,n)&&(g[n]=e[n]);0==--y&&0===_&&C()}(t,e),n&&n(t,e)};var r,i=!0,o="fa9b9b6f466c2b54b687",a={},s=[],u=[];function c(t){var e=L[t];if(!e)return R;var n=function(n){return e.hot.active?(L[n]?-1===L[n].parents.indexOf(t)&&L[n].parents.push(t):(s=[t],r=n),-1===e.children.indexOf(n)&&e.children.push(n)):(console.warn("[HMR] unexpected require("+n+") from disposed module "+t),s=[]),R(n)},i=function(t){return{configurable:!0,enumerable:!0,get:function(){return R[t]},set:function(e){R[t]=e}}};for(var o in R)Object.prototype.hasOwnProperty.call(R,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(n,o,i(o));return n.e=function(t){return"ready"===f&&d("prepare"),_++,R.e(t).then(e,(function(t){throw e(),t}));function e(){_--,"prepare"===f&&(x[t]||A(t),0===_&&0===y&&C())}},n.t=function(t,e){return 1&e&&(t=n(t)),R.t(t,-2&e)},n}function l(e){var n={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:r!==e,active:!0,accept:function(t,e){if(void 0===t)n._selfAccepted=!0;else if("function"==typeof t)n._selfAccepted=t;else if("object"==typeof t)for(var r=0;r<t.length;r++)n._acceptedDependencies[t[r]]=e||function(){};else n._acceptedDependencies[t]=e||function(){}},decline:function(t){if(void 0===t)n._selfDeclined=!0;else if("object"==typeof t)for(var e=0;e<t.length;e++)n._declinedDependencies[t[e]]=!0;else n._declinedDependencies[t]=!0},dispose:function(t){n._disposeHandlers.push(t)},addDisposeHandler:function(t){n._disposeHandlers.push(t)},removeDisposeHandler:function(t){var e=n._disposeHandlers.indexOf(t);e>=0&&n._disposeHandlers.splice(e,1)},invalidate:function(){switch(this._selfInvalidated=!0,f){case"idle":(g={})[e]=t[e],d("ready");break;case"ready":I(e);break;case"prepare":case"check":case"dispose":case"apply":(v=v||[]).push(e)}},check:S,apply:E,status:function(t){if(!t)return f;h.push(t)},addStatusHandler:function(t){h.push(t)},removeStatusHandler:function(t){var e=h.indexOf(t);e>=0&&h.splice(e,1)},data:a[e]};return r=void 0,n}var h=[],f="idle";function d(t){f=t;for(var e=0;e<h.length;e++)h[e].call(null,t)}var p,g,m,v,y=0,_=0,x={},b={},w={};function M(t){return+t+""===t?+t:t}function S(t){if("idle"!==f)throw new Error("check() is only allowed in idle status");return i=t,d("check"),(e=1e4,e=e||1e4,new Promise((function(t,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,i=R.p+""+o+".hot-update.json";r.open("GET",i,!0),r.timeout=e,r.send(null)}catch(t){return n(t)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+i+" timed out."));else if(404===r.status)t();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+i+" failed."));else{try{var e=JSON.parse(r.responseText)}catch(t){return void n(t)}t(e)}}}))).then((function(t){if(!t)return d(T()?"ready":"idle"),null;b={},x={},w=t.c,m=t.h,d("prepare");var e=new Promise((function(t,e){p={resolve:t,reject:e}}));for(var n in g={},P)A(n);return"prepare"===f&&0===_&&0===y&&C(),e}));var e}function A(t){w[t]?(b[t]=!0,y++,function(t){var e=document.createElement("script");e.charset="utf-8",e.src=R.p+""+t+"."+o+".hot-update.js",e.crossOrigin="anonymous",document.head.appendChild(e)}(t)):x[t]=!0}function C(){d("ready");var t=p;if(p=null,t)if(i)Promise.resolve().then((function(){return E(i)})).then((function(e){t.resolve(e)}),(function(e){t.reject(e)}));else{var e=[];for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&e.push(M(n));t.resolve(e)}}function E(e){if("ready"!==f)throw new Error("apply() is only allowed in ready status");return function e(n){var i,u,c,l,h;function f(t){for(var e=[t],n={},r=e.map((function(t){return{chain:[t],id:t}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((l=L[o])&&(!l.hot._selfAccepted||l.hot._selfInvalidated)){if(l.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(l.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<l.parents.length;s++){var u=l.parents[s],c=L[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]=[]),p(n[u],[o])):(delete n[u],e.push(u),r.push({chain:a.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:t,outdatedModules:e,outdatedDependencies:n}}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];-1===t.indexOf(r)&&t.push(r)}}T();var y={},_=[],x={},b=function(){console.warn("[HMR] unexpected require("+A.moduleId+") to disposed module")};for(var S in g)if(Object.prototype.hasOwnProperty.call(g,S)){var A;h=M(S),A=g[S]?f(h):{type:"disposed",moduleId:S};var C=!1,E=!1,I=!1,O="";switch(A.chain&&(O="\nUpdate propagation: "+A.chain.join(" -> ")),A.type){case"self-declined":n.onDeclined&&n.onDeclined(A),n.ignoreDeclined||(C=new Error("Aborted because of self decline: "+A.moduleId+O));break;case"declined":n.onDeclined&&n.onDeclined(A),n.ignoreDeclined||(C=new Error("Aborted because of declined dependency: "+A.moduleId+" in "+A.parentId+O));break;case"unaccepted":n.onUnaccepted&&n.onUnaccepted(A),n.ignoreUnaccepted||(C=new Error("Aborted because "+h+" is not accepted"+O));break;case"accepted":n.onAccepted&&n.onAccepted(A),E=!0;break;case"disposed":n.onDisposed&&n.onDisposed(A),I=!0;break;default:throw new Error("Unexception type "+A.type)}if(C)return d("abort"),Promise.reject(C);if(E)for(h in x[h]=g[h],p(_,A.outdatedModules),A.outdatedDependencies)Object.prototype.hasOwnProperty.call(A.outdatedDependencies,h)&&(y[h]||(y[h]=[]),p(y[h],A.outdatedDependencies[h]));I&&(p(_,[A.moduleId]),x[h]=b)}var k,B=[];for(u=0;u<_.length;u++)h=_[u],L[h]&&L[h].hot._selfAccepted&&x[h]!==b&&!L[h].hot._selfInvalidated&&B.push({module:h,parents:L[h].parents.slice(),errorHandler:L[h].hot._selfAccepted});d("dispose"),Object.keys(w).forEach((function(t){!1===w[t]&&function(t){delete P[t]}(t)}));var F,D,U=_.slice();for(;U.length>0;)if(h=U.pop(),l=L[h]){var j={},N=l.hot._disposeHandlers;for(c=0;c<N.length;c++)(i=N[c])(j);for(a[h]=j,l.hot.active=!1,delete L[h],delete y[h],c=0;c<l.children.length;c++){var G=L[l.children[c]];G&&((k=G.parents.indexOf(h))>=0&&G.parents.splice(k,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(l=L[h]))for(D=y[h],c=0;c<D.length;c++)F=D[c],(k=l.children.indexOf(F))>=0&&l.children.splice(k,1);d("apply"),void 0!==m&&(o=m,m=void 0);for(h in g=void 0,x)Object.prototype.hasOwnProperty.call(x,h)&&(t[h]=x[h]);var z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(l=L[h])){D=y[h];var H=[];for(u=0;u<D.length;u++)if(F=D[u],i=l.hot._acceptedDependencies[F]){if(-1!==H.indexOf(i))continue;H.push(i)}for(u=0;u<H.length;u++){i=H[u];try{i(D)}catch(t){n.onErrored&&n.onErrored({type:"accept-errored",moduleId:h,dependencyId:D[u],error:t}),n.ignoreErrored||z||(z=t)}}}for(u=0;u<B.length;u++){var V=B[u];h=V.module,s=V.parents,r=h;try{R(h)}catch(t){if("function"==typeof V.errorHandler)try{V.errorHandler(t)}catch(e){n.onErrored&&n.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:e,originalError:t}),n.ignoreErrored||z||(z=e),z||(z=t)}else n.onErrored&&n.onErrored({type:"self-accept-errored",moduleId:h,error:t}),n.ignoreErrored||z||(z=t)}}if(z)return d("fail"),Promise.reject(z);if(v)return e(n).then((function(t){return _.forEach((function(e){t.indexOf(e)<0&&t.push(e)})),t}));return d("idle"),new Promise((function(t){t(_)}))}(e=e||{})}function T(){if(v)return g||(g={}),v.forEach(I),v=void 0,!0}function I(e){Object.prototype.hasOwnProperty.call(g,e)||(g[e]=t[e])}var L={},P={0:0};function R(e){if(L[e])return L[e].exports;var n=L[e]={i:e,l:!1,exports:{},hot:l(e),parents:(u=s,s=[],u),children:[]};return t[e].call(n.exports,n,n.exports,c(e)),n.l=!0,n.exports}R.e=function(t){var e=[],n=P[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise((function(e,r){n=P[t]=[e,r]}));e.push(n[2]=r);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,R.nc&&a.setAttribute("nonce",R.nc),a.src=function(t){return R.p+""+t+"."+o+".js"}(t),0!==a.src.indexOf(window.location.origin+"/")&&(a.crossOrigin="anonymous");var s=new Error;i=function(e){a.onerror=a.onload=null,clearTimeout(u);var n=P[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,n[1](s)}P[t]=void 0}};var u=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(e)},R.m=t,R.c=L,R.d=function(t,e,n){R.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},R.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},R.t=function(t,e){if(1&e&&(t=R(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(R.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)R.d(n,r,function(e){return t[e]}.bind(null,r));return n},R.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return R.d(e,"a",e),e},R.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},R.p="./",R.oe=function(t){throw console.error(t),t},R.h=function(){return o};var O=window.webpackJsonprk_web_core=window.webpackJsonprk_web_core||[],k=O.push.bind(O);O.push=e,O=O.slice();for(var B=0;B<O.length;B++)e(O[B]);var F=k;return c(164)(R.s=164)}([function(t,e,n){t.exports=n(335)},function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return Ct})),n.d(e,"d",(function(){return St})),n.d(e,"e",(function(){return wt})),n.d(e,"f",(function(){return z})),n.d(e,"g",(function(){return it})),n.d(e,"h",(function(){return At})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return jt}));var r=Object.freeze({__proto__:null,get start(){return jt},get ensureJQuerySupport(){return dt},get setBootstrapMaxTime(){return Q},get setMountMaxTime(){return X},get setUnmountMaxTime(){return Y},get setUnloadMaxTime(){return J},get registerApplication(){return At},get unregisterApplication(){return Et},get getMountedApps(){return wt},get getAppStatus(){return St},get unloadApplication(){return Tt},get checkActivityFunctions(){return Ct},get getAppNames(){return Mt},get pathToActiveWhen(){return Pt},get navigateToUrl(){return it},get triggerAppChange(){return Bt},get addErrorHandler(){return l},get removeErrorHandler(){return h},get mountRootParcel(){return z},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return g},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return v},get NOT_MOUNTED(){return y},get MOUNTING(){return _},get UPDATING(){return b},get LOAD_ERROR(){return M},get MOUNTED(){return x},get UNMOUNTING(){return w},get SKIP_BECAUSE_BROKEN(){return S}});function i(t){return(i="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})(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).CustomEvent,s=function(){try{var t=new a("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?a:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},u=[];function c(t,e,n){var r=d(t,e,n);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function l(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function h(t){if("function"!=typeof t)throw Error(f(29,!1));var e=!1;return u=u.filter((function(n){var r=n===t;return e=e||r,!r})),e}function f(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function d(t,e,n){var r,i="".concat(I(e)," '").concat(E(e),"' died in status ").concat(e.status,": ");if(t instanceof Error){try{t.message=i+t.message}catch(t){}r=t}else{console.warn(f(30,!1,e.status,E(e)));try{r=Error(i+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=E(e),e.status=n,r}var p="NOT_LOADED",g="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",v="BOOTSTRAPPING",y="NOT_MOUNTED",_="MOUNTING",x="MOUNTED",b="UPDATING",w="UNMOUNTING",M="LOAD_ERROR",S="SKIP_BECAUSE_BROKEN";function A(t){return t.status===x}function C(t){try{return t.activeWhen(window.location)}catch(e){return c(e,t,S),!1}}function E(t){return t.name}function T(t){return Boolean(t.unmountThisParcel)}function I(t){return T(t)?"parcel":"application"}function L(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function P(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function R(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!P(e,(function(t){return"function"!=typeof t}))));var e}function O(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=I(t),i=E(t);return function(t){return n.reduce((function(n,o,a){return n.then((function(){var n=o(t);return k(n)?n:Promise.reject(f(15,!1,r,i,e,a))}))}),Promise.resolve())}}function k(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function B(t,e){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=v,t.bootstrap?q(t,"bootstrap").then(n).catch((function(n){if(e)throw d(n,t,S);return c(n,t,S),t})):Promise.resolve().then(n))}));function n(){return t.status=y,t}}function F(t,e){return Promise.resolve().then((function(){if(t.status!==x)return t;t.status=w;var n=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(e)throw d(r,t,S);c(r,t,S)}))})).then((function(){return t}));function r(){return q(t,"unmount").then((function(){t.status=y})).catch((function(n){if(e)throw d(n,t,S);c(n,t,S)}))}}))}var D=!1,U=!1;function j(t,e){return Promise.resolve().then((function(){return t.status!==y?t:(D||(window.dispatchEvent(new s("single-spa:before-first-mount")),D=!0),q(t,"mount").then((function(){return t.status=x,U||(window.dispatchEvent(new s("single-spa:first-mount")),U=!0),t})).catch((function(n){return t.status=x,F(t,!0).then(r,r);function r(){if(e)throw d(n,t,S);return c(n,t,S),t}})))}))}var N=0,G={parcels:{}};function z(){return H.apply(G,arguments)}function H(t,e){var n=this;if(!t||"object"!==i(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,i(t.name)));if("object"!==i(e))throw Error(f(4,!1,name,i(e)));if(!e.domElement)throw Error(f(5,!1,name));var r,o=N++,a="function"==typeof t,s=a?t:function(){return Promise.resolve(t)},u={id:o,parcels:{},status:a?g:m,customProps:e,parentName:E(n),unmountThisParcel:function(){return v.then((function(){if(u.status!==x)throw Error(f(6,!1,name,u.status));return F(u,!0)})).then((function(t){return u.parentName&&delete n.parcels[u.id],t})).then((function(t){return l(t),t})).catch((function(t){throw u.status=S,h(t),t}))}};n.parcels[o]=u;var c=s();if(!c||"function"!=typeof c.then)throw Error(f(7,!1));var l,h,p=(c=c.then((function(t){if(!t)throw Error(f(8,!1));var e=t.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!R(t.bootstrap))throw Error(f(9,!1,e));if(!R(t.mount))throw Error(f(10,!1,e));if(!R(t.unmount))throw Error(f(11,!1,e));if(t.update&&!R(t.update))throw Error(f(12,!1,e));var n=O(t,"bootstrap"),i=O(t,"mount"),a=O(t,"unmount");u.status=m,u.name=e,u.bootstrap=n,u.mount=i,u.unmount=a,u.timeouts=K(t.timeouts),t.update&&(u.update=O(t,"update"),r.update=function(t){return u.customProps=t,V(function(t){return Promise.resolve().then((function(){if(t.status!==x)throw Error(f(32,!1,E(t)));return t.status=b,q(t,"update").then((function(){return t.status=x,t})).catch((function(e){throw d(e,t,S)}))}))}(u))})}))).then((function(){return B(u,!0)})),v=p.then((function(){return j(u,!0)})),_=new Promise((function(t,e){l=t,h=e}));return r={mount:function(){return V(Promise.resolve().then((function(){if(u.status!==y)throw Error(f(13,!1,name,u.status));return n.parcels[o]=u,j(u)})))},unmount:function(){return V(u.unmountThisParcel())},getStatus:function(){return u.status},loadPromise:V(c),bootstrapPromise:V(p),mountPromise:V(v),unmountPromise:V(_)}}function V(t){return t.then((function(){return null}))}function W(t){var e=E(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!==i(n)||null===n||Array.isArray(n))&&(n={},console.warn(f(40,!1),e,n));var o=L({},n,{name:e,mountParcel:H.bind(t),singleSpa:r});return T(t)&&(o.unmountSelf=t.unmountThisParcel),o}var Z={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function Q(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(16,!1));Z.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function X(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(17,!1));Z.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Y(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(18,!1));Z.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(f(19,!1));Z.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function q(t,e){var n=t.timeouts[e],r=n.warningMillis,i=I(t);return new Promise((function(o,a){var s=!1,u=!1;t[e](W(t)).then((function(t){s=!0,o(t)})).catch((function(t){s=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=f(31,!1,e,i,E(t),n.millis);function l(t){if(!s)if(!0===t)u=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!u){var e=t,i=e*r;console.warn(c),i+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))}function K(t){var e={};for(var n in Z)e[n]=L({},Z[n],t&&t[n]||{});return e}function $(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==M?t:(t.status=g,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(W(t));if(!k(r))throw n=!0,Error(f(33,!1,E(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!==i(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!R(e.bootstrap)&&(r=35),R(e.mount)||(r=36),R(e.unmount)||(r=37);var o=I(e);if(r){var a;try{a=JSON.stringify(e)}catch(t){}return console.error(f(r,!1,o,E(t),a),e),c(void 0,t,S),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=L({},t.devtools.overlays,e.devtools.overlays)),t.status=m,t.bootstrap=O(e,"bootstrap"),t.mount=O(e,"mount"),t.unmount=O(e,"unmount"),t.unload=O(e,"unload"),t.timeouts=K(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=S:(r=M,t.loadErrorTime=(new Date).getTime()),c(e,t,r),t})));var e,n}))}var tt,et="undefined"!=typeof window,nt={hashchange:[],popstate:[]},rt=["hashchange","popstate"];function it(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=ht(window.location.href),r=ht(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function ot(t){var e=this;if(t){var n=t[0].type;rt.indexOf(n)>=0&&nt[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}}function at(){Ft([],arguments)}function st(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),i=window.location.href;return tt&&n===i||(Nt()?window.dispatchEvent(ut(window.history.state,e)):Ft([])),r}}function ut(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}if(et){window.addEventListener("hashchange",at),window.addEventListener("popstate",at);var ct=window.addEventListener,lt=window.removeEventListener;window.addEventListener=function(t,e){if(!("function"==typeof e&&rt.indexOf(t)>=0)||P(nt[t],(function(t){return t===e})))return ct.apply(this,arguments);nt[t].push(e)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&rt.indexOf(t)>=0))return lt.apply(this,arguments);nt[t]=nt[t].filter((function(t){return t!==e}))},window.history.pushState=st(window.history.pushState,"pushState"),window.history.replaceState=st(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=it}function ht(t){var e=document.createElement("a");return e.href=t,e}var ft=!1;function dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return pt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return pt.call(this,n,window.removeEventListener,t,e,arguments)},ft=!0}}function pt(t,e,n,r,i){return"string"!=typeof n?t.apply(this,i):(n.split(/\s+/).forEach((function(t){rt.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,i))}var gt={};function mt(t){return Promise.resolve().then((function(){var e=gt[E(t)];if(!e)return t;if(t.status===p)return vt(t,e),t;if("UNLOADING"===t.status)return e.promise.then((function(){return t}));if(t.status!==y&&t.status!==M)return t;var n=t.status===M?Promise.resolve():q(t,"unload");return t.status="UNLOADING",n.then((function(){return vt(t,e),t})).catch((function(n){return function(t,e,n){delete gt[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,c(n,t,S),e.reject(n)}(t,e,n),t}))}))}function vt(t,e){delete gt[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,e.resolve()}function yt(t,e,n,r){gt[E(t)]={app:t,resolve:n,reject:r},Object.defineProperty(gt[E(t)],"promise",{get:e})}function _t(t){return gt[t]}var xt=[];function bt(){var t=[],e=[],n=[],r=[],i=(new Date).getTime();return xt.forEach((function(o){var a=o.status!==S&&C(o);switch(o.status){case M:a&&i-o.loadErrorTime>=200&&n.push(o);break;case p:case g:a&&n.push(o);break;case m:case y:!a&&_t(E(o))?t.push(o):a&&r.push(o);break;case x:a||e.push(o)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}function wt(){return xt.filter(A).map(E)}function Mt(){return xt.map(E)}function St(t){var e=P(xt,(function(e){return E(e)===t}));return e?e.status:null}function At(t,e,n,r){var o=function(t,e,n,r){var o,a={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===i(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(f(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==i(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(f(24,!1));if(!Lt(t.customProps))throw Error(f(22,!1))}(t),a.name=t.name,a.loadApp=t.app,a.activeWhen=t.activeWhen,a.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!e)throw Error(f(23,!1));if("function"!=typeof n)throw Error(f(24,!1));if(!Lt(r))throw Error(f(22,!1))}(t,e,n,r),a.name=t,a.loadApp=e,a.activeWhen=n,a.customProps=r),a.loadApp="function"!=typeof(o=a.loadApp)?function(){return Promise.resolve(o)}:o,a.customProps=function(t){return t||{}}(a.customProps),a.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:Pt(t)})),function(t){return e.some((function(e){return e(t)}))}}(a.activeWhen),a}(t,e,n,r);if(-1!==Mt().indexOf(o.name))throw Error(f(21,!1,o.name));xt.push(L({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),et&&(dt(),Ft())}function Ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return xt.filter((function(e){return e.activeWhen(t)})).map(E)}function Et(t){if(0===xt.filter((function(e){return E(e)===t})).length)throw Error(f(25,!1,t));return Tt(t).then((function(){var e=xt.map(E).indexOf(t);xt.splice(e,1)}))}function Tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var n=P(xt,(function(e){return E(e)===t}));if(!n)throw Error(f(27,!1,t));var r,i=_t(E(n));if(e&&e.waitForUnmount){if(i)return i.promise;var o=new Promise((function(t,e){yt(n,(function(){return o}),t,e)}));return o}return i?(r=i.promise,It(n,i.resolve,i.reject)):r=new Promise((function(t,e){yt(n,(function(){return r}),t,e),It(n,t,e)})),r}function It(t,e,n){F(t).then(mt).then((function(){e(),setTimeout((function(){Ft()}))})).catch(n)}function Lt(t){return!t||"function"==typeof t||"object"===i(t)&&null!==t&&!Array.isArray(t)}function Pt(t,e){var n=function(t,e){var n=0,r=!1,i="^";"/"!==t[0]&&(t="/"+t);for(var o=0;o<t.length;o++){var a=t[o];(!r&&":"===a||r&&"/"===a)&&s(o)}return s(t.length),new RegExp(i,"i");function s(o){var a=t.slice(n,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=r?"[^/]+/?":a,o===t.length)if(r)e&&(i+="$");else{var s=e?"":".*";i="/"===i.charAt(i.length-1)?"".concat(i).concat(s,"$"):"".concat(i,"(/").concat(s,")?(#.*)?$")}r=!r,n=o}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}var Rt=!1,Ot=[],kt=et&&window.location.href;function Bt(){return Ft()}function Ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;if(Rt)return new Promise((function(t,n){Ot.push({resolve:t,reject:n,eventArguments:e})}));var n,r=bt(),i=r.appsToUnload,a=r.appsToUnmount,u=r.appsToLoad,c=r.appsToMount,l=!1,h=kt,f=kt=window.location.href;return Nt()?(Rt=!0,n=i.concat(u,a,c),m()):(n=u,g());function d(){l=!0}function g(){return Promise.resolve().then((function(){var t=u.map($);return Promise.all(t).then(_).then((function(){return[]})).catch((function(t){throw _(),t}))}))}function m(){return Promise.resolve().then((function(){if(window.dispatchEvent(new s(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",b(!0))),window.dispatchEvent(new s("single-spa:before-routing-event",b(!0,{cancelNavigation:d}))),l)return window.dispatchEvent(new s("single-spa:before-mount-routing-event",b(!0))),v(),void it(h);var e=i.map(mt),r=a.map(F).map((function(t){return t.then(mt)})).concat(e),o=Promise.all(r);o.then((function(){window.dispatchEvent(new s("single-spa:before-mount-routing-event",b(!0)))}));var f=u.map((function(t){return $(t).then((function(t){return Dt(t,o)}))})),p=c.filter((function(t){return u.indexOf(t)<0})).map((function(t){return Dt(t,o)}));return o.catch((function(t){throw _(),t})).then((function(){return _(),Promise.all(f.concat(p)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(v)}))}))}function v(){var e=wt();t.forEach((function(t){return t.resolve(e)}));try{var r=0===n.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new s(r,b())),window.dispatchEvent(new s("single-spa:routing-event",b()))}catch(t){setTimeout((function(){throw t}))}if(Rt=!1,Ot.length>0){var i=Ot;Ot=[],Ft(i)}return e}function _(){t.forEach((function(t){ot(t.eventArguments)})),ot(e)}function b(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=arguments.length>1?arguments[1]:void 0,d={},g=(o(t={},x,[]),o(t,y,[]),o(t,p,[]),o(t,S,[]),t);r?(u.concat(c).forEach((function(t,e){v(t,x)})),i.forEach((function(t){v(t,p)})),a.forEach((function(t){v(t,y)}))):n.forEach((function(t){v(t)}));var m={detail:{newAppStatuses:d,appsByNewStatus:g,totalAppChanges:n.length,originalEvent:null==e?void 0:e[0],oldUrl:h,newUrl:f,navigationIsCanceled:l}};return s&&L(m.detail,s),m;function v(t,e){var n=E(t);e=e||St(n),d[n]=e,(g[e]=g[e]||[]).push(n)}}}function Dt(t,e){return C(t)?B(t).then((function(t){return e.then((function(){return C(t)?j(t):t}))})):e.then((function(){return t}))}var Ut=!1;function jt(t){var e;Ut=!0,t&&t.urlRerouteOnly&&(e=t.urlRerouteOnly,tt=e),et&&Ft()}function Nt(){return Ut}et&&setTimeout((function(){Ut||console.warn(f(1,!1))}),5e3);var Gt={getRawAppData:function(){return[].concat(xt)},reroute:Ft,NOT_LOADED:p,toLoadPromise:$,toBootstrapPromise:B,unregisterApplication:Et};et&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Gt)}).call(this,n(20))},function(t,e,n){var r=n(28),i=n(12);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){"use strict";var r=n(123),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===i.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:c,isStream:function(t){return s(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function t(){var e={};function n(n,r){u(e[r])&&u(n)?e[r]=t(e[r],n):u(n)?e[r]=t({},n):o(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)l(arguments[r],n);return e},extend:function(t,e,n){return l(e,(function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),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,n){var r=n(103)("wks"),i=n(104),o=n(5).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(5),i=n(1),o=n(29),a=n(23),s=n(37),u=function(t,e,n){var c,l,h,f=t&u.F,d=t&u.G,p=t&u.S,g=t&u.P,m=t&u.B,v=t&u.W,y=d?i:i[e]||(i[e]={}),_=y.prototype,x=d?r:p?r[e]:(r[e]||{}).prototype;for(c in d&&(n=e),n)(l=!f&&x&&void 0!==x[c])&&s(y,c)||(h=l?x[c]:n[c],y[c]=d&&"function"!=typeof x[c]?n[c]:m&&l?o(h,r):v&&x[c]==h?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):g&&"function"==typeof h?o(Function.call,h):h,g&&((y.virtual||(y.virtual={}))[c]=h,t&u.R&&_&&!_[c]&&a(_,c,h)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){(function(t,r){var i;
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>
@@ -100,7 +100,7 @@ and limitations under the License.
100
100
  * License: BSD-3
101
101
  * https://github.com/huiyan-fe/mapv
102
102
  *
103
- */function Qn(t,e,n){var r=Xn(n),i=function(t){return t.min||0}(n),o=r-i,a=n.range||null,s=0,u=1024;a&&2===a.length&&(s=(a[0]-i)/o*1024),a&&2===a.length&&(u=(a[1]-i)/o*1024);for(var c,l=n.maxOpacity||.8,h=n.minOpacity||0,f=3,d=t.length;f<d;f+=4)c=4*t[f],t[f]/256>l&&(t[f]=256*l),t[f]/256<h&&(t[f]=256*h),c&&c>=s&&c<=u?(t[f-3]=e[c],t[f-2]=e[c+1],t[f-1]=e[c+2]):t[f]=0}function Xn(t){return t.max||100}function Yn(t,e,n){var r=Xn(n),i=function(t){var e=t/2,n=t+e,r=1e4,i=Rn(2*n,2*n),o=i.getContext("2d");return o.shadowBlur=e,o.shadowColor="black",o.shadowOffsetX=o.shadowOffsetY=r,o.beginPath(),o.arc(n-r,n-r,t,0,2*Math.PI,!0),o.closePath(),o.fill(),i}(n._size||n.size||13),o=i.width/2,a=i.height/2,s=e,u={};for(var c in s.forEach((function(t){var e=void 0===t.count?1:t.count,n=Math.min(1,e/r).toFixed(2);u[n]=u[n]||[],u[n].push(t)})),u)if(!isNaN(c)){var l=u[c];t.beginPath(),n.withoutAlpha||(t.globalAlpha=c),l.forEach((function(e){var n=e.coordinate,s=void 0===e.count?1:e.count;t.globalAlpha=s/r,t.drawImage(i,n[0]-o,n[1]-a)}))}}var Jn={draw:function(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var r=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+r+")";var i=Rn(t.canvas.width,t.canvas.height),o=i.getContext("2d");o.scale(devicePixelRatio,devicePixelRatio),n=n||{},t.save();var a=new Zn({gradient:n.gradient});if(Yn(o,e,n),!n.absolute){var s=o.getImageData(0,0,t.canvas.width,t.canvas.height);Qn(s.data,a.getImageData(),n),t.putImageData(s,0,0),t.restore()}a=null,i=null}},drawGray:Yn,colorize:Qn};const qn={altitude:0,interactive:!1,min:0,max:100,size:13,gradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},gridScale:.5};var Kn=class extends ht{constructor(t,e,n,r){Array.isArray(t)||(t=[t]);let i=1/0,o=1/0,a=-1/0,s=-1/0;const u=[];for(let e=0,n=t.length;e<n;e++){const{coordinate:n,lnglat:c,xy:l}=t[e],h=n||c||l;if(!h){console.warn("not find coordinate");continue}const f=r.coordinateToVector3(h);u.push(f);const{x:d,y:p}=f;i=Math.min(i,d),o=Math.min(o,p),a=Math.max(a,d),s=Math.max(s,p)}e=h.Util.extend({},qn,e,{layer:r,points:t});let{gridScale:c,altitude:f}=e;const d=Math.abs(a-i),p=Math.abs(s-o),g=Math.max(d*c,p*c);g>2048&&(console.warn(`gridScale: ${c} it's too big. I hope it's a smaller value,canvas max size is 2048* 2048`),c=2048/(g/c));const m=Math.ceil(d*c),v=Math.ceil(p*c),y=m/d,_=v/p,x=[];for(let e=0,n=u.length;e<n;e++){const n=u[e];n.x-=i,n.y-=o,n.x*=y,n.y*=_,n.y=v-n.y,x.push({coordinate:[n.x,n.y],count:t[e].count})}let b=Rn(m,v),w=b.getContext("2d");Jn.drawGray(w,x,e);const M=w.getImageData(0,0,w.canvas.width,w.canvas.height);let S=-1/0;const A=new Float32Array(M.data.length/4),C=new Float32Array(M.data.length/4);for(let t=3,e=M.data.length,n=0;t<e;t+=4){const e=M.data[t];S=Math.max(S,e),C[n]=e,e<=0&&(A[n]=1),n++}const E=new Zn({gradient:e.gradient});Jn.colorize(M.data,E.getImageData(),e),b=null,w=null;const T=Dn(d,p,m-1,v-1),I=T.getIndex().array,L=T.attributes.position.array,P=new Float32Array(L.length),R=new Uint32Array(6*L.length),O=new l.Color;let k=0;for(let t=0,e=L.length,n=0,r=I.length,i=0,o=M.data.length,a=0;t<Math.max(e,r,o);t+=3){if(t<e){const e=C[a];e>0&&(L[t+2]=e/S)}if(n<r){const t=I[n],e=I[n+1],r=I[n+2];A[t]&&A[e]&&A[r]||(R[k]=t,R[k+1]=e,R[k+2]=r,k+=3)}if(i<o){const t=`rgb(${M.data[i]},${M.data[i+1]},${M.data[i+2]})`;O.setStyle(t),P[n]=O.r,P[n+1]=O.g,P[n+2]=O.b}n+=3,i+=4,a++}const B=new Uint32Array(k);for(let t=0;t<k;t++)B[t]=R[t];T.setIndex(new l.BufferAttribute(B,1)),J(T,"color",new l.BufferAttribute(P,3,!0)),n.vertexColors=q(),super(),this._initOptions(e),this._createMesh(T,n);const F=r.distanceToVector3(f,f).x;this.getObject3d().position.copy(new l.Vector3((i+a)/2,(o+s)/2,F)),this.type="HeatMap"}};const $n=new l.Color;let tr=1;var er=class{constructor(t){this.object3ds=[],this.layer=t,this.camera=t.getCamera(),this.renderer=t.getThreeRenderer(),this.pickingTexture=new l.WebGLRenderTarget(1,1),this.pickingScene=new l.Scene}getColor(){return $n.setHex(tr),tr++,$n}add(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=t,this.pickingScene.add(t))}return this}remove(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=null,this.pickingScene.remove(t))}return this}isEmpty(){if(0===this.pickingScene.children.length)return!0;for(let t=0,e=this.pickingScene.children.length;t<e;t++){const e=this.pickingScene.children[t];if(e){const t=e.__parent;if(t&&!0===t.getOptions().interactive)return!1}}return!0}pick(t){if(!t)return;if(this.isEmpty())return;const{camera:e,renderer:n,pickingTexture:r,pickingScene:i,object3ds:o,layer:a}=this,s=this.pickingScene.children.length;for(let t=0;t<s;t++){const e=this.pickingScene.children[t];e&&e.__parent&&(e.__parent.picked=!1)}const{width:u,height:c}=a._getRenderer().canvas,l=r.width,h=r.height;u===l&&c===h||r.setSize(u,c),n.setRenderTarget(r),n.clear(),n.render(i,e);const f=new Uint8Array(4),{x:d,y:p}=t,g=window.devicePixelRatio,m=d*g,v=r.height-p*g;n.readRenderTargetPixels(r,Math.round(m),Math.round(v),1,1,f);const y=f[0]<<16|f[1]<<8|f[2],_=o[y];if(_)_.__parent&&(o[y].__parent.picked=!0);else for(let t=0;t<s;t++){const e=this.pickingScene.children[t];if(e&&e.__parent){const t=e.__parent;if(t._colorMap&&null!=t._colorMap[y]){t.picked=!0,t.index=t._colorMap[y];break}}}n.setRenderTarget(null)}};const nr={bottomHeight:0,altitude:0};var rr=class extends ht{constructor(t,e,n,r){e=h.Util.extend({},nr,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{lineStrings:i,center:o}=Ae(t),a=[],s={};for(let t=0,n=i.length;t<n;t++){const n=we(i[t],r,o).positionsV;Pt(n,e.bottomHeight,r,s),Ce(a,n)}const u=new at;u.setPositions(a),this._setMaterialRes(r,n),this._createLine2(u,n);const{altitude:c}=e,l=r.distanceToVector3(c,c).x,f=r.coordinateToVector3(o,l);this.getObject3d().position.copy(f),this._setPickObject3d(a,n.linewidth),this._init(),this.type="FatLine"}_init(){const t=this.getLayer().getPick();this.on("add",()=>{t.add(this.pickObject3d)}),this.on("remove",()=>{t.remove(this.pickObject3d)})}_setMaterialRes(t,e){const n=t.getMap().getSize(),r=n.width,i=n.height;e.resolution.set(r,i)}_setPickObject3d(t,e){const n=new at;n.setPositions(t);const r=this.getLayer().getPick().getColor(),i=[];for(let e=0,n=t.length/3;e<n;e++)i.push(r.r,r.g,r.b);n.setColors(i);const o=new rt({color:"#fff",linewidth:e,vertexColors:q()});this._setMaterialRes(this.getLayer(),o);const a=r.getHex(),s=new st(n,o);s.position.copy(this.getObject3d().position),s._colorIndex=a,this.setPickObject3d(s)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof l.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}};const ir={altitude:0,colors:null};class or extends(qe(ht)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const i=[],o=[],a=t.length;for(let e=0;e<a;e++){const n=Ae(t[e]);i.push(n.center),o.push(n.lineStrings)}const s=Lt(i);e=h.Util.extend({},ir,e,{layer:r,lineStrings:t,coordinate:s});const u=[],c={};let l=0,f=[],d=[],p=0,g=[];for(let t=0;t<a;t++){const e=o[t];let n=0;for(let t=0,i=e.length;t<i;t++){const i=me(e[t])?e[t].properties:e[t].getProperties()||{},{positionsV:o}=we(e[t],r,s);Pt(o,i.bottomHeight,r,c),n+=2*o.length-2,Ce(g,o)}const i=n;f[t]=[l,l+i],l+=i,d[t]={position:{count:n,start:p,end:p+3*n},instanceStart:{count:n,start:p,end:p+3*n},instanceEnd:{count:n,start:p,end:p+3*n},hide:!1},p+=3*n}super(),this._initOptions(e);const m=new at;m.setPositions(g),this._setMaterialRes(r,n),this._createLine2(m,n);const{altitude:v}=e,y=r.distanceToVector3(v,v).x,_=r.coordinateToVector3(s,y);this.getObject3d().position.copy(_),this._faceMap=f,this._baseObjects=u,this._datas=t,this._geometriesAttributes=d,this.faceIndex=null,this.index=null,this._geometryCache=new at,this._geometryCache.setPositions(g),this._colorMap={},this.isHide=!1,this._initBaseObjectsEvent(u),this._setPickObject3d(g,n.linewidth),this._init(),this.type="FatLines"}_setMaterialRes(t,e){const n=t.getMap().getSize(),r=n.width,i=n.height;e.resolution.set(r,i)}_setPickObject3d(t,e){const n=this._geometryCache||new at;n.setPositions(t);const r=this.getLayer().getPick(),{_geometriesAttributes:i}=this,o=Rt(i);let a=0;for(let t=0,e=i.length;t<e;t++){const e=r.getColor(),n=e.getHex();this._colorMap[n]=t;const{count:s}=i[t].position;this._datas[t].colorIndex=n;for(let t=0;t<s;t++)o[a]=e.r,o[a+1]=e.g,o[a+2]=e.b,a+=3}n.setColors(o);const s=new rt({color:"#fff",linewidth:e,vertexColors:q()});this._setMaterialRes(this.getLayer(),s);const u=r.getColor().getHex(),c=new st(n,s);c.position.copy(this.getObject3d().position),c._colorIndex=u,this.setPickObject3d(c)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof l.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=h.Util.extend({},this.getOptions(),{index:t},me(e)?e.properties:e.getProperties());this._baseObjects[t]=new rr(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_updateAttribute(t,e){const{indexs:n}=this._getHideGeometryIndex(e),r=this._geometryCache.attributes[e].array,i=r.length;for(let e=0;e<i;e++)t.array[e]=r[e];for(let r=0;r<n.length;r++){const i=n[r],{start:o,end:a}=this._geometriesAttributes[i][e];for(let e=o;e<a;e++)t.array[e]=-1e5}return this}_showGeometry(t,e){let n;if(t&&(n=t.getOptions().index),null!=n){const t=this._geometriesAttributes[n],{hide:r}=t;if(r===e)return this;t.hide=e;const i=this.getObject3d().geometry;this._updateAttribute(i.attributes.instanceStart,"instanceStart"),this._updateAttribute(i.attributes.instanceEnd,"instanceEnd"),i.attributes.instanceStart.data.needsUpdate=!0,i.attributes.instanceEnd.data.needsUpdate=!0,this.isHide=e}return this}}var ar=or;const sr={radius:10,height:100,altitude:0,topColor:"",bottomColor:"#2d2f61"};var ur=class extends ht{constructor(t,e,n,r){e=h.Util.extend({},sr,e,{layer:r,coordinate:t}),super(),this._initOptions(e);const{height:i,radius:o,topColor:a,bottomColor:s,altitude:u}=e,c=r.distanceToVector3(i,i).x,l=r.distanceToVector3(o,o).x,f=Ct().clone();f.scale(2*l,2*l,c),a&&(St(f,s,a,"z",c/2),n.vertexColors=q()),this._createMesh(f,n);const d=r.distanceToVector3(u,u).x,p=r.coordinateToVector3(t,d);this.getObject3d().position.copy(p),this.type="Box"}};const cr={radius:10,height:100,altitude:0,topColor:null,bottomColor:"#2d2f61"};class lr extends(qe(ht)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const i=t.length,o=Lt(t),a=r.coordinateToVector3(o),s=[],u=[],c=[],l=[];let f=0,d=0,p=0,g=0;const m={};for(let e=0;e<i;e++){const i=h.Util.extend({index:e},cr,t[e]),{radius:o,altitude:v,topColor:y,bottomColor:_,height:x,coordinate:b}=i,w=It(o,r,m),M=It(x,r,m),S=It(v,r,m),A=Ct().clone();A.scale(2*w,2*w,M),y&&(St(A,_,y,"z",M/2),n.vertexColors=q());const C=r.coordinateToVector3(b).sub(a),E=A.attributes.position.array;for(let t=0,e=E.length;t<e;t+=3)E[t+2]+=S,E[t]+=C.x,E[t+1]+=C.y,E[t+2]+=C.z;s.push(A);const T=new ur(b,i,n,r);u.push(T);const I=A.index.count/3;l[e]=[f+1,f+I],f+=I;const L=A.attributes.position.count,P=A.attributes.normal.count,R=A.attributes.uv.count;c[e]={position:{count:L,start:d,end:d+3*L},normal:{count:P,start:p,end:p+3*P},uv:{count:R,start:g,end:g+2*R},hide:!1},d+=3*L,p+=3*P,g+=2*R}super(),e=h.Util.extend({},{altitude:0,layer:r,points:t},e),this._initOptions(e);const v=At(s);this._createMesh(v,n);const y=e.altitude,_=r.distanceToVector3(y,y).x,x=a.clone();x.z=_,this.getObject3d().position.copy(x),this._faceMap=l,this._baseObjects=u,this._datas=t,this._geometriesAttributes=c,this.faceIndex=null,this._geometryCache=v.clone(),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(u),this._setPickObject3d(),this._init(),this.type="Boxs"}identify(t){return this.picked}}var hr=lr;const fr=Math.PI/180,dr=[[4e3,220],[2e3,100],[1e3,30],[500,15],[100,5],[50,2],[10,1],[5,.7],[2,.1],[1,.05],[.5,.02]],pr=["mousemove","click","mousedown","mouseup","dblclick","contextmenu","touchstart","touchmove","touchend"],gr=new h.Coordinate(0,0),mr=new h.Point(0,0);class vr extends h.CanvasLayer{constructor(t,e){super(t,e),this._animationBaseObjectMap={},this._needsUpdate=!0,this._mousemoveTimeOut=0,this._baseObjects=[],this._delayMeshes=[],this.type="ThreeLayer"}isRendering(){const t=this.getMap();return!!t&&(t.isInteracting()||t.isAnimating())}prepareToDraw(...t){}draw(){this.renderScene()}drawOnInteracting(){this.renderScene()}coordinateToVector3(t,e=0){const n=this.getMap();if(!n)return null;const r=Array.isArray(t);r&&(gr.x=t[0],gr.y=t[1]),r||t instanceof h.Coordinate||(t=new h.Coordinate(t));const i=_r(n),o=xr(n,r?gr:t,i,mr);return new l.Vector3(o.x,o.y,e)}distanceToVector3(t,e,n){if(0===t&&0===e||!h.Util.isNumber(t)||!h.Util.isNumber(e))return new l.Vector3(0,0,0);const r=this.getMap(),i=_r(r);let o=n||r.getCenter();o instanceof h.Coordinate||(o=new h.Coordinate(o));const a=r.locate(o,t,e),s=xr(r,o,i),u=xr(r,a,i),c=Math.abs(u.x-s.x)*h.Util.sign(t),f=Math.abs(u.y-s.y)*h.Util.sign(e);return new l.Vector3(c,f,0)}toShape(t){if(!t)return null;if(t instanceof h.MultiPolygon)return t.getGeometries().map(t=>this.toShape(t));const e=t.getCenter(),n=this.coordinateToVector3(e),r=t.getShell().map(t=>{const e=this.coordinateToVector3(t).sub(n);return new l.Vector2(e.x,e.y)}),i=new l.Shape(r),o=t.getHoles();return o&&o.length>0&&(i.holes=o.map(t=>{const e=t.map(t=>{const e=this.coordinateToVector3(t).sub(n);return new l.Vector2(e.x,e.y)});return new l.Shape(e)})),i}toExtrudeMesh(t,e,n,r){if(!t)return null;if(t instanceof h.MultiPolygon)return t.getGeometries().map(t=>this.toExtrudeMesh(t,e,n,r));const i=t.getCoordinates();i.forEach(t=>{for(let e=t.length-1;e>=1;e--)t[e].equals(t[e-1])&&t.splice(e,1)}),t.setCoordinates(i);const o=this.toShape(t),a=this.coordinateToVector3(t.getCenter());r=h.Util.isNumber(r)?r:e,r=this.distanceToVector3(r,r).x;const s=this.distanceToVector3(e,e).x,u={bevelEnabled:!1,bevelSize:1};u[parseInt(l.REVISION)>=93?"depth":"amount"]=r;const c=new l.ExtrudeGeometry(o,u);let f=c;l.BufferGeometry.prototype.fromGeometry&&(f=new l.BufferGeometry,f.fromGeometry(c));const d=new l.Mesh(f,n);return d.position.set(a.x,a.y,s-r),d}toExtrudePolygon(t,e,n){return new je(t,e,n,this)}toBar(t,e,n){return new Tt(t,e,n,this)}toLine(t,e,n){return new Te(t,e,n,this)}toExtrudeLine(t,e,n){return new De(t,e,n,this)}toModel(t,e){return new Ge(t,e,this)}toExtrudeLineTrail(t,e,n){return new Xe(t,e,n,this)}toExtrudePolygons(t,e,n){return new on(t,e,n,this)}toPoint(t,e,n){return new cn(t,e,n,this)}toPoints(t,e,n){return new vn(t,e,n,this)}toBars(t,e,n){return new xn(t,e,n,this)}toExtrudeLines(t,e,n){return new Mn(t,e,n,this)}toLines(t,e,n){return new Cn(t,e,n,this)}toThreeVectorTileLayer(t,e,n){return new Fn(t,e,n,this)}toTerrain(t,e,n){return new zn(t,e,n,this)}toTerrainVectorTileLayer(t,e,n){return new Vn(t,e,n,this)}toHeatMap(t,e,n){return new Kn(t,e,n,this)}toFatLine(t,e,n){return new rr(t,e,n,this)}toFatLines(t,e,n){return new ar(t,e,n,this)}toBox(t,e,n){return new ur(t,e,n,this)}toBoxs(t,e,n){return new hr(t,e,n,this)}getBaseObjects(){return this.getMeshes().filter(t=>t instanceof ht)}getMeshes(){const t=this.getScene();if(!t)return[];const e=[];for(let n=0,r=t.children.length;n<r;n++){const r=t.children[n];r instanceof l.Object3D&&!(r instanceof l.Camera)&&e.push(r.__parent||r)}return e}clear(){return this.clearMesh()}clearMesh(){const t=this.getScene();if(!t)return this;for(let e=t.children.length-1;e>=0;e--){const n=t.children[e];if(n instanceof l.Object3D&&!(n instanceof l.Camera)){t.remove(n);const e=n.__parent;e&&e instanceof ht&&(e.isAdd=!1,e._fire("remove",{target:e}),delete this._animationBaseObjectMap[n.uuid])}}return this}lookAt(t){const e=this._getRenderer();return e&&e.context.lookAt(t),this}getCamera(){const t=this._getRenderer();return t?t.camera:null}getScene(){const t=this._getRenderer();return t?t.scene:null}renderScene(){const t=this._getRenderer();return t&&(t.clearCanvas(),t.renderScene()),this}loop(t=!1){const e=this._delayMeshes;if(!e.length)return;const n=this.getMap();if(!n||n.isAnimating()||n.isInteracting())return;const r=this.options.loopRenderCount||50,i=e.slice(0,r);i&&this.addMesh(i,t),e.splice(0,r)}renderPickScene(){const t=this._getRenderer();if(t){const e=t.pick;e&&e.pick(this._containerPoint)}return this}getThreeRenderer(){const t=this._getRenderer();return t?t.context:null}getPick(){const t=this._getRenderer();return t?t.pick:null}delayAddMesh(t){if(!t)return this;Array.isArray(t)||(t=[t]);for(let e=0,n=t.length;e<n;e++)this._delayMeshes.push(t[e]);return this}addMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();return t.forEach(t=>{t instanceof ht?(n.add(t.getObject3d()),t.isAdd||(t.isAdd=!0,t._fire("add",{target:t})),t._animation&&h.Util.isFunction(t._animation)&&(this._animationBaseObjectMap[t.getObject3d().uuid]=t)):t instanceof l.Object3D&&n.add(t)}),this._zoomend(),e&&this.renderScene(),this}removeMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();return t.forEach(t=>{if(t instanceof ht){n.remove(t.getObject3d()),t.isAdd&&(t.isAdd=!1,t._fire("remove",{target:t})),t._animation&&h.Util.isFunction(t._animation)&&delete this._animationBaseObjectMap[t.getObject3d().uuid];const e=this._delayMeshes;if(e.length)for(let n=0,r=e.length;n<r;n++)if(e[n]===t){e.splice(n,1);break}}else t instanceof l.Object3D&&n.remove(t)}),e&&this.renderScene(),this}_initRaycaster(){return this._raycaster||(this._raycaster=new l.Raycaster,this._mouse=new l.Vector2),this}identify(t,e){if(!t)return console.error("coordinate is null,it should be Coordinate"),[];if(Array.isArray(t)&&(t=new h.Coordinate(t)),!(t instanceof h.Coordinate))return console.error("coordinate type is error,it should be Coordinate"),[];const n=this.getMap().coordToContainerPoint(t);this._containerPoint=n;const{x:r,y:i}=n;this._initRaycaster();const o=this._raycaster,a=this._mouse,s=this.getCamera(),u=this.getScene(),c=this.getMap().getSize();if(!u)return[];const f=c.width,d=c.height;a.x=r/f*2-1,a.y=-i/d*2+1,o.setFromCamera(a,s),function(t,e){Y>113?t.params.Line.threshold=e:t.linePrecision=e}(o,this._getLinePrecision(this.getMap().getResolution()));const p=[],g=[];u.children.forEach(t=>{const e=t.__parent;if(e&&e.getOptions){const n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&h.Util.isFunction(n.identify)?g.push(n):p.push(t))}else(t instanceof l.Mesh||t instanceof l.Group)&&p.push(t)});let m=[];const v=o.intersectObjects(p,!0);v&&Array.isArray(v)&&v.length&&(m=v.map(t=>{let e=t.object;e=this._recursionMesh(e)||{};const n=e.__parent||e;return n.faceIndex=t.faceIndex,n.index=t.index,n})),this.renderPickScene(),g.length&&g.forEach(e=>{e.identify(t)&&m.push(e)});const y=m.length;for(let t=0;t<y;t++)if(m[t])for(let e=t+1;e<y;e++)m[t]===m[e]&&m.splice(e,1);const _=(e=h.Util.extend({},e)).count;return h.Util.isNumber(_)&&_>0?m.slice(0,_):m}_recursionMesh(t){for(;t&&t.parent!==this.getScene();)t=t.parent;return t}_getLinePrecision(t=10){for(let e=0,n=dr.length;e<n;e++){const[n,r]=dr[e];if(t>n)return r}return.01}_identifyBaseObjectEvents(t){if(!this.options.geometryEvents)return this;const e=this.map||this.getMap();if(e.isInteracting()||!e.options.geometryEvents)return this;const{type:n,coordinate:r}=t,i=h.Util.now();if(this._mousemoveTimeOut&&"mousemove"===n&&i-this._mousemoveTimeOut<64)return this;this._mousemoveTimeOut=i,e.resetCursor("default");const o=this.options.identifyCountOnEvent;let a=Math.max(0,h.Util.isNumber(o)?o:0);0===a&&(a=1/0);const s=this.identify(r,{count:a}),u=this.getScene();if(0===s.length&&u)for(let e=0,n=u.children.length;e<n;e++){const n=(u.children[e]||{}).__parent;n&&n.fire("empty",Object.assign({},t,{target:n}))}if("mousemove"===n){s.length&&e.setCursor("pointer");const i=[];this._baseObjects&&this._baseObjects.forEach(t=>{let e=!0;s.forEach(n=>{t===n&&(e=!1)}),e&&i.push(t)}),i.forEach(e=>{e&&e instanceof ht&&(e.getSelectMesh?e.isHide||(e._mouseover=!1,e.fire("mouseout",Object.assign({},t,{target:e,type:"mouseout",selectMesh:null})),e.closeToolTip()):(e._mouseover=!1,e.fire("mouseout",Object.assign({},t,{target:e,type:"mouseout"})),e.closeToolTip()))}),s.forEach(e=>{if(e instanceof ht){e._mouseover||(e.fire("mouseover",Object.assign({},t,{target:e,type:"mouseover",selectMesh:e.getSelectMesh?e.getSelectMesh():null})),e._mouseover=!0),e.fire(n,Object.assign({},t,{target:e,selectMesh:e.getSelectMesh?e.getSelectMesh():null}));const i=e.getToolTip();i&&!i._owner&&i.addTo(e),e.openToolTip(r)}}),this._baseObjects=s}else s.forEach(e=>{if(e instanceof ht&&(e.fire(n,Object.assign({},t,{target:e,selectMesh:e.getSelectMesh?e.getSelectMesh():null})),"click"===n)){const t=e.getInfoWindow();t&&!t._owner&&t.addTo(e),e.openInfoWindow(r)}});return this}_zoomend(){const t=this.getScene();if(!t)return;const e=this.getMap().getZoom();t.children.forEach(t=>{const n=t.__parent;if(n&&n.getOptions){const t=n;t.zoomChange&&h.Util.isFunction(t.zoomChange)&&t.zoomChange(e);const r=t.getMinZoom(),i=t.getMaxZoom();e<r||e>i?(t.isVisible()&&(t.getObject3d().visible=!1),t._zoomVisible=!1):r<=e&&e<=i&&(t._visible&&(t.getObject3d().visible=!0),t._zoomVisible=!0)}})}onAdd(){super.onAdd();const t=this.map||this.getMap();return t?(pr.forEach(e=>{t.on(e,this._identifyBaseObjectEvents,this)}),this._needsUpdate=!0,this._animationBaseObjectMap||(this._animationBaseObjectMap={}),t.on("zooming zoomend",this._zoomend,this),this):this}onRemove(){super.onRemove();const t=this.map||this.getMap();return t?(pr.forEach(e=>{t.off(e,this._identifyBaseObjectEvents,this)}),t.off("zooming zoomend",this._zoomend,this),this):this}_callbackBaseObjectAnimation(){const t=this;if(t._animationBaseObjectMap)for(const e in t._animationBaseObjectMap)t._animationBaseObjectMap[e]._animation();return this}_getFovRatio(){const t=this.getMap().getFov();return Math.tan(t/2*fr)}}vr.mergeOptions({renderer:"gl",doubleBuffer:!1,glOptions:null,geometryEvents:!0,identifyCountOnEvent:0,forceRenderOnZooming:!0,loopRenderCount:50});class yr extends h.renderer.CanvasLayerRenderer{constructor(){super(...arguments),this._renderTime=0}getPrepareParams(){return[this.scene,this.camera]}getDrawParams(){return[this.scene,this.camera]}_drawLayer(){super._drawLayer.apply(this,arguments)}hitDetect(){return!1}createCanvas(){super.createCanvas(),this.createContext()}createContext(){if(this.canvas.gl&&this.canvas.gl.wrap)this.gl=this.canvas.gl.wrap();else{const t=this.layer.options.glOptions||{alpha:!0,depth:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1};t.preserveDrawingBuffer=!0,this.gl=this.gl||this._createGLContext(this.canvas,t)}this._initThreeRenderer(),this.layer.onCanvasCreate(this.context,this.scene,this.camera)}_initThreeRenderer(){this.matrix4=new l.Matrix4;const t=new l.WebGLRenderer({context:this.gl,alpha:!0});t.autoClear=!1,t.setClearColor(new l.Color(1,1,1),0),t.setSize(this.canvas.width,this.canvas.height),t.clear(),this.context=t;const e=this.scene=new l.Scene,n=this.layer.getMap(),r=n.getFov()*Math.PI/180,i=this.camera=new l.PerspectiveCamera(r,n.width/n.height,n.cameraNear,n.cameraFar);i.matrixAutoUpdate=!1,this._syncCamera(),e.add(i),this.pick=new er(this.layer)}onCanvasCreate(){super.onCanvasCreate()}resizeCanvas(t){if(!this.canvas)return;let e,n=this.getMap();e=t||n.getSize();const r=n.getDevicePixelRatio?n.getDevicePixelRatio():h.Browser.retina?2:1,i=this.canvas;i.height=r*e.height,i.width=r*e.width,this.layer._canvas&&i.style&&(i.style.width=e.width+"px",i.style.height=e.height+"px"),this.context.setSize(i.width,i.height)}clearCanvas(){this.canvas&&this.context.clear()}prepareCanvas(){return this.canvas?this.clearCanvas():this.createCanvas(),this.layer.fire("renderstart",{context:this.context}),null}renderScene(){const t=h.Util.now();t-this._renderTime>=16&&(this.layer._callbackBaseObjectAnimation(),this._renderTime=t),this._syncCamera(),this.context.render(this.scene,this.camera),this.completeRender()}remove(){delete this._drawContext,super.remove()}_syncCamera(){const t=this.getMap(),e=this.camera;e.matrix.elements=t.cameraWorldMatrix,e.projectionMatrix.elements=t.projMatrix,this.matrix4.invert?e.projectionMatrixInverse.elements=this.matrix4.copy(e.projectionMatrix).invert().elements:e.projectionMatrixInverse.elements=this.matrix4.getInverse(e.projectionMatrix).elements}_createGLContext(t,e){const n=["webgl2","webgl","experimental-webgl"];let r=null;for(let i=0;i<n.length;++i){try{r=t.getContext(n[i],e)}catch(t){}if(r)break}return r}}function _r(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function xr(t,e,n,r){return t.coordToPointAtRes?t.coordToPointAtRes(e,n,r):t.coordinateToPoint(e,n,r)}vr.registerRenderer("gl",yr),h.registerWorkerAdapter&&h.registerWorkerAdapter("__maptalks.three__",'function(e){"use strict";var d=n,t=n;function n(e,t,n){n=n||2;var r,i,o,a,v,h=t&&t.length,l=h?t[0]*n:e.length,u=p(e,0,l,n,!0),x=[];if(!u||u.next===u.prev)return x;if(h&&(u=function(e,t,n,r){var i,o,a,v,h=[];for(i=0,o=t.length;i<o;i++)a=t[i]*r,v=i<o-1?t[i+1]*r:e.length,(v=p(e,a,v,r,!1))===v.next&&(v.steiner=!0),h.push(function(e){var t=e,n=e;for(;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next,t!==e;);return n}(v));for(h.sort(m),i=0;i<h.length;i++)!function(e,t){(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var v=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(v<=i&&a<v){if((a=v)===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}}while(r=r.next,r!==t);if(!n)return null;if(i===a)return n;var h,l=n,u=n.x,x=n.y,f=1/0;r=n;for(;i>=r.x&&r.x>=u&&i!==r.x&&M(o<x?i:a,o,u,x,o<x?a:i,o,r.x,r.y)&&(h=Math.abs(o-r.y)/(i-r.x),Z(r,e)&&(h<f||h===f&&(r.x>n.x||r.x===n.x&&function(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}(n,r)))&&(n=r,f=h)),r=r.next,r!==l;);return n}(e,t))&&(e=S(t,e),g(t,t.next),g(e,e.next))}(h[i],n),n=g(n,n.next);return n}(e,t,u,n)),e.length>80*n){for(var f=r=e[0],s=i=e[1],c=n;c<l;c+=n)(o=e[c])<f&&(f=o),(a=e[c+1])<s&&(s=a),r<o&&(r=o),i<a&&(i=a);v=0!==(v=Math.max(r-f,i-s))?1/v:0}return y(u,x,n,f,s,v),x}function p(e,t,n,r,i){var o,a;if(i===0<z(e,t,n,r))for(o=t;o<n;o+=r)a=v(o,e[o],e[o+1],a);else for(o=n-r;t<=o;o-=r)a=v(o,e[o],e[o+1],a);return a&&u(a,a.next)&&(f(a),a=a.next),a}function g(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!u(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(f(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){for(var i=e;null===i.z&&(i.z=b(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,v,h,l=1;do{for(n=e,o=e=null,a=0;n;){for(a++,r=n,t=v=0;t<l&&(v++,r=r.nextZ);t++);for(h=l;0<v||0<h&&r;)0!==v&&(0===h||!r||n.z<=r.z)?(n=(i=n).nextZ,v--):(r=(i=r).nextZ,h--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}}while(o.nextZ=null,l*=2,1<a)}(i)}(e,r,i,o);for(var v,h,l=e;e.prev!==e.next;)if(v=e.prev,h=e.next,o?function(e,t,n,r){var i=e.prev,o=e,a=e.next;if(0<=w(i,o,a))return!1;var v=(i.x<o.x?i.x<a.x?i:a:o.x<a.x?o:a).x,h=(i.y<o.y?i.y<a.y?i:a:o.y<a.y?o:a).y,l=(i.x>o.x?i.x>a.x?i:a:o.x>a.x?o:a).x,u=(i.y>o.y?i.y>a.y?i:a:o.y>a.y?o:a).y,x=b(v,h,t,n,r),f=b(l,u,t,n,r),s=e.prevZ,c=e.nextZ;for(;s&&s.z>=x&&c&&c.z<=f;){if(s!==e.prev&&s!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;if(s=s.prevZ,c!==e.prev&&c!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&0<=w(c.prev,c,c.next))return!1;c=c.nextZ}for(;s&&s.z>=x;){if(s!==e.prev&&s!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;s=s.prevZ}for(;c&&c.z<=f;){if(c!==e.prev&&c!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&0<=w(c.prev,c,c.next))return!1;c=c.nextZ}return!0}(e,r,i,o):function(e){var t=e.prev,n=e,r=e.next;if(0<=w(t,n,r))return!1;var i=e.next.next;for(;i!==e.prev;){if(M(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=w(i.prev,i,i.next))return!1;i=i.next}return!0}(e))t.push(v.i/n),t.push(e.i/n),t.push(h.i/n),f(e),e=h.next,l=h.next;else if((e=h)===l){a?1===a?y(e=function(e,t,n){var r=e;do{var i=r.prev,o=r.next.next}while(!u(i,o)&&x(i,r,r.next,o)&&Z(i,o)&&Z(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),f(r),f(r.next),r=e=o),r=r.next,r!==e);return g(r)}(g(e),t,n),t,n,r,i,o,2):2===a&&function(e,t,n,r,i,o){var a=e;do{for(var v=a.next.next;v!==a.prev;){if(a.i!==v.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&x(n,n.next,e,t))return!0}while(n=n.next,n!==e);return!1}(e,t)&&(Z(e,t)&&Z(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||u(e,t)&&0<w(e.prev,e,e.next)&&0<w(t.prev,t,t.next))}(a,v)){var h=S(a,v);return a=g(a,a.next),h=g(h,h.next),y(a,t,n,r,i,o),y(h,t,n,r,i,o)}v=v.next}}while((a=a.next)!==e)}(e,t,n,r,i,o):y(g(e),t,n,r,i,o,1);break}}}function m(e,t){return e.x-t.x}function b(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function M(e,t,n,r,i,o,a,v){return 0<=(i-a)*(t-v)-(e-a)*(o-v)&&0<=(e-a)*(r-v)-(n-a)*(t-v)&&0<=(n-a)*(o-v)-(i-a)*(r-v)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function u(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,n,r){var i=l(w(e,t,n)),o=l(w(e,t,r)),a=l(w(n,r,e)),v=l(w(n,r,t));return i!==o&&a!==v||(0===i&&h(e,n,t)||(0===o&&h(e,r,t)||(0===a&&h(n,e,r)||!(0!==v||!h(n,t,r)))))}function h(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function l(e){return 0<e?1:e<0?-1:0}function Z(e,t){return w(e.prev,e,e.next)<0?0<=w(e,t,e.next)&&0<=w(e,e.prev,t):w(e,t,e.prev)<0||w(e,e.next,t)<0}function S(e,t){var n=new a(e.i,e.x,e.y),r=new a(t.i,t.x,t.y),i=e.next,o=t.prev;return(e.next=t).prev=e,(n.next=i).prev=n,(r.next=n).prev=r,(o.next=r).prev=o,r}function v(e,t,n,r){n=new a(e,t,n);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function f(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function a(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}function r(e,t){var n=e.length-1,r=[e[0]];return function e(t,n,r,i,o){for(var a,v,h,l,u,x,f,s=i,c=n+1;c<r;c++){var p=(v=t[c],h=t[n],l=t[r],p=f=x=u=void 0,u=h[0],x=h[1],f=l[0]-u,p=l[1]-x,0===f&&0===p||(1<(h=((v[0]-u)*f+(v[1]-x)*p)/(f*f+p*p))?(u=l[0],x=l[1]):0<h&&(u+=f*h,x+=p*h)),(f=v[0]-u)*f+(p=v[1]-x)*p);s<p&&(a=c,s=p)}i<s&&(1<a-n&&e(t,n,a,i,o),o.push(t[a]),1<r-a&&e(t,a,r,i,o))}(e,0,n,t,r),r.push(e[n]),r}function A(e,t,n){if(e.length<=2)return e;t=void 0!==t?t*t:1;return e=r(e=n?e:function(e,t){for(var n,r,i,o,a=e[0],v=[a],h=1,l=e.length;h<l;h++)n=e[h],i=a,o=void 0,o=(r=n)[0]-i[0],i=r[1]-i[1],t<o*o+i*i&&(v.push(n),a=n);return a!==n&&v.push(n),v}(e,t),t)}function R(e,t){var n=t[0],r=t[1],t=Math.sqrt(n*n+r*r);return e[0]=n/t,e[1]=r/t,e}function s(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function F(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}n.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(z(e,0,o,n));if(i)for(var v=0,h=t.length;v<h;v++){var l=t[v]*n,u=v<h-1?t[v+1]*n:e.length;a-=Math.abs(z(e,l,u,n))}for(var x=0,v=0;v<r.length;v+=3){var f=r[v]*n,s=r[v+1]*n,c=r[v+2]*n;x+=Math.abs((e[f]-e[c])*(e[1+s]-e[1+f])-(e[f]-e[s])*(e[1+c]-e[1+f]))}return 0===a&&0===x?0:Math.abs((x-a)/a)},n.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[i][o][a]);0<i&&(r+=e[i-1].length,n.holes.push(r))}return n},d.default=t;var c=[];function ee(e,t,n,r){var i,o,a=(o=n,(i=t)[0]*o[0]+i[1]*o[1]+i[2]*o[2]),v=Math.acos(a)*r;return s(c,n,t,-a),r=(o=i=c)[0],n=o[1],a=o[2],o=Math.sqrt(r*r+n*n+a*a),i[0]=r/o,i[1]=n/o,i[2]=a/o,a=e,o=t,t=Math.cos(v),a[0]=o[0]*t,a[1]=o[1]*t,a[2]=o[2]*t,s(e,e,c,Math.sin(v)),e}function q(e,t,n){if(n-t<3)return 0;for(var r=0,i=2*(n-1),o=2*t;o<2*n;){var a=e[i],v=e[i+1],h=e[o],l=e[o+1],i=o;o+=2,r+=a*l-h*v}return r}var B=[],U=[],L=[];function O(e,t,n,r,i,o,a,v){var h=null!=a,l=i,u=null;h&&(u=new Uint32Array(r-n));for(var x=n;x<r;x++){var f=x===r-1?n:x+1,s=x===n?r-1:x-1,c=e[2*s],p=e[2*s+1],g=e[2*x],d=e[2*x+1],s=e[2*f],f=e[2*f+1];B[0]=g-c,B[1]=d-p,U[0]=s-g,U[1]=f-d,R(B,B),R(U,U),h&&(u[x]=l),v||x!==n?v||x!==r-1?(c=U,p=B,(s=L)[0]=c[0]+p[0],s[1]=c[1]+p[1],f=L[1],L[1]=-L[0],L[0]=f,R(L,L),s=U,p=(c=L)[0]*s[0]+c[1]*s[1],f=Math.sqrt(1-p*p),c=o*Math.min(10,1/f),h&&a<1/f&&o*p<0?(s=g+L[0]*o,p=d+L[1]*o,f=Math.acos(f)/2,f=Math.tan(f)*Math.abs(o),t[2*l]=s+L[1]*f,t[2*l+1]=p-L[0]*f,t[2*++l]=s-L[1]*f,t[2*l+1]=p+L[0]*f):(t[2*l]=g+L[0]*c,t[2*l+1]=d+L[1]*c)):(L[0]=B[1],L[1]=-B[0],R(L,L),t[2*l]=g+L[0]*o,t[2*l+1]=d+L[1]*o):(L[0]=U[1],L[1]=-U[0],R(L,L),t[2*l]=g+L[0]*o,t[2*l+1]=d+L[1]*o),l++}return u}function P(e,t,n,r,i){var o=null!=r?[]:new Float32Array(e.length);if(O(e,o,0,t&&t.length?t[0]:e.length/2,0,n,r,i),t)for(var a=0;a<t.length;a++){var v=t[a];O(e,o,v,t[a+1]||e.length/2,null!=r?o.length/2:v,n,r,i)}return o}function V(e,t,n,r){for(var i=0;i<Math.floor((r-n)/2);i++)for(var o=0;o<t;o++){var a=(i+n)*t+o,v=(r-i-1)*t+o,h=e[a];e[a]=e[v],e[v]=h}return e}function W(e){e.depth=e.depth||1,e.bevelSize=e.bevelSize||0,e.bevelSegments=null==e.bevelSegments?2:e.bevelSegments,e.smoothSide=e.smoothSide||!1,e.smoothBevel=e.smoothBevel||!1,e.simplify=e.simplify||0,"number"==typeof e.depth&&(e.bevelSize=Math.min(0<e.bevelSegments?e.bevelSize:0,e.depth/2)),0<e.bevelSize||(e.bevelSegments=0),e.bevelSegments=Math.round(e.bevelSegments);var t,n,r,i,o=e.boundingRect;e.translate=e.translate||[0,0],e.scale=e.scale||[1,1],e.fitRect&&(t=null==e.fitRect.x?o.x||0:e.fitRect.x,n=null==e.fitRect.y?o.y||0:e.fitRect.y,r=e.fitRect.width,i=e.fitRect.height,null==r?null!=i?r=i/o.height*o.width:(r=o.width,i=o.height):null==i&&(i=r/o.width*o.height),e.scale=[r/o.width,i/o.height],e.translate=[(t-o.x)*e.scale[0],(n-o.y)*e.scale[1]])}function j(e,t){function n(e,t,n,r){e[0]=t,e[1]=n,e[2]=r}for(var r,i,o,a,v,h,l,u=[],x=[],f=[],s=[],c=[],p=[],g=e.length,d=new Float32Array(t.length),y=0;y<g;){var m=3*e[y++],b=3*e[y++],M=3*e[y++];n(u,t[m],t[1+m],t[2+m]),n(x,t[b],t[1+b],t[2+b]),n(f,t[M],t[1+M],t[2+M]),F(s,u,x),F(c,x,f),r=p,o=c,l=h=v=a=void 0,a=(i=s)[0],v=i[1],h=i[2],l=o[0],i=o[1],o=o[2],r[0]=v*o-h*i,r[1]=h*l-a*o,r[2]=a*i-v*l;for(var w=0;w<3;w++)d[m+w]=d[m+w]+p[w],d[b+w]=d[b+w]+p[w],d[M+w]=d[M+w]+p[w]}for(var Z,S,z,A,R,q=0;q<d.length;)n(p,d[q],d[q+1],d[q+2]),R=A=z=void 0,z=(S=Z=p)[0],A=S[1],R=S[2],S=Math.sqrt(z*z+A*A+R*R),Z[0]=z/S,Z[1]=A/S,Z[2]=R/S,d[q++]=p[0],d[q++]=p[1],d[q++]=p[2];return d}var te=[[0,0],[1,0],[1,1],[0,0],[1,1],[0,1]];function H(e,t,n,r,i,o){var a=t.vertices,v=t.topVertices,h=t.depth,t=t.rect,l=r-n,u=o.smoothSide?1:2,x=l*u,f=o.smoothBevel?1:2,s=Math.min(h/2,o.bevelSize),c=o.bevelSegments,p=i.vertex,g=Math.max(t.width,t.height,h);if(0<s)for(var d=[0,0,1],y=[],m=[0,0,-1],b=[],M=0,w=new Float32Array(l),Z=0;Z<2;Z++)for(var S=0===Z?h-s:s,z=0;z<=c*f;z++){for(var A=0,R=void 0,q=void 0,F=0;F<l;F++){for(var B=0;B<u;B++){var U=2*((F+B)%l+n);y[0]=a[U]-v[U],y[1]=a[1+U]-v[1+U],y[2]=0;var L=Math.sqrt(y[0]*y[0]+y[1]*y[1]);y[0]/=L,y[1]/=L;var O=(Math.floor(z/f)+z%f)/c;0===Z?ee(b,d,y,O):ee(b,y,m,O);var P=0===Z?O:1-O,V=s*Math.sin(P*Math.PI/2),W=L*Math.cos(P*Math.PI/2),O=s*L/Math.sqrt(V*V+W*W),P=b[0]*O+v[U],L=b[1]*O+v[1+U],V=b[2]*O+S;e.position[3*i.vertex]=P,e.position[3*i.vertex+1]=L,e.position[3*i.vertex+2]=V,(0<F||0<B)&&(A+=Math.sqrt((R-P)*(R-P)+(q-L)*(q-L))),(0<z||0<Z)&&(W=3*(i.vertex-x),U=e.position[W],O=e.position[1+W],W=e.position[2+W],w[F]+=Math.sqrt((U-P)*(U-P)+(O-L)*(O-L)+(W-V)*(W-V))),e.uv[2*i.vertex]=A/g,e.uv[2*i.vertex+1]=w[F]/g,R=P,q=L,i.vertex++}if(1<f&&z%f||1==f&&1<=z)for(var j=0;j<6;j++){var H=(te[j][0]+F*u)%x,k=te[j][1]+M;e.indices[i.index++]=(k-1)*x+H+p}}M++}else for(var I=0;I<2;I++)for(var _=0===I?h-s:s,D=0,E=void 0,C=void 0,G=0;G<l;G++)for(var J=0;J<u;J++){var K=2*((G+J)%l+n),N=a[K],K=a[1+K];e.position[3*i.vertex]=N,e.position[3*i.vertex+1]=K,e.position[3*i.vertex+2]=_,(0<G||0<J)&&(D+=Math.sqrt((E-N)*(E-N)+(C-K)*(C-K))),e.uv[2*i.vertex]=D/g,e.uv[2*i.vertex+1]=_/g,E=N,C=K,i.vertex++}for(var Q=0<s?c*f+1:1,T=0;T<l;T++)for(var X=0;X<6;X++){var Y=(te[X][0]+T*u)%x,$=te[X][1]+Q;e.indices[i.index++]=($-1)*x+Y+p}}function k(e,t){for(var n=0,r=0,i=0;i<e.length;i++){var o=e[i],a=o.indices,v=o.vertices,h=o.holes,o=o.depth,l=v.length/2,u=0<Math.min(o/2,t.bevelSize)?t.bevelSegments:0;n+=a.length*(t.excludeBottom?1:2),r+=l*(t.excludeBottom?1:2);for(var x=2+2*u,f=0,s=0,c=0;c<(h?h.length:0)+1;c++){n+=6*((s=0===c?h&&h.length?h[0]:l:(f=h[c-1],h[c]||l))-f)*(x-1);var p=(s-f)*(t.smoothSide?1:2);r+=p*x+(t.smoothBevel?0:u*p*2)}}for(var g={position:new Float32Array(3*r),indices:new(65535<r?Uint32Array:Uint16Array)(n),uv:new Float32Array(2*r)},d={vertex:0,index:0},y=0;y<e.length;y++)!function(e,t,n,r){var i=e.indices,o=e.vertices,a=e.topVertices,v=e.rect,h=e.depth;if(!(o.length<=4)){for(var l=n.vertex,u=i.length,x=0;x<u;x++)t.indices[n.index++]=l+i[x];for(var f=Math.max(v.width,v.height),s=0;s<(r.excludeBottom?1:2);s++)for(var c=0;c<a.length;c+=2){var p=a[c],g=a[c+1];t.position[3*n.vertex]=p,t.position[3*n.vertex+1]=g,t.position[3*n.vertex+2]=(1-s)*h,t.uv[2*n.vertex]=(p-v.x)/f,t.uv[2*n.vertex+1]=(g-v.y)/f,n.vertex++}if(!r.excludeBottom)for(var d=o.length/2,y=0;y<u;y+=3)for(var m=0;m<3;m++)t.indices[n.index++]=l+d+i[y+2-m]}}(e[y],g,d,t);for(var m=0;m<e.length;m++){var b,M=e[m],w=M.holes,Z=M.vertices.length/2,S=w&&w.length?w[0]:Z;if(H(g,e[m],0,S,d,t),w)for(var z=0;z<w.length;z++)b=w[z],S=w[z+1]||Z,H(g,e[m],b,S,d,t)}for(var A=0;A<g.uv.length;A++){var R=g.uv[A];0<R&&Math.round(R)===R?g.uv[A]=1:g.uv[A]=R%1}return g.normal=j(g.indices,g.position),g.boundingRect=e[0]&&e[0].rect,g}function I(e,t){t=Object.assign({},t);for(var n=[1/0,1/0],r=[-1/0,-1/0],i=0;i<e.length;i++)D(e[i][0],n,r);t.boundingRect=t.boundingRect||{x:n[0],y:n[1],width:r[0]-n[0],height:r[1]-n[1]},W(t);for(var o=[],a=t.translate||[0,0],v=t.scale||[1,1],h=t.boundingRect,l={x:h.x*v[0]+a[0],y:h.y*v[1]+a[1],width:h.width*v[0],height:h.height*v[1]},u=Math.min(h.width,h.height)/1e5,x=0;x<e.length;x++){var f=function(e,t){for(var n=[],r=0;r<e.length;r++){for(var i=e[r],o=[],a=i.length,v=i[a-1][0],h=i[a-1][1],l=0,u=0;u<a;u++){var x=i[u][0],f=i[u][1],s=x-v,c=f-h;t<(l+=Math.sqrt(s*s+c*c))&&(o.push(i[u]),l=0),v=x,h=f}3<=o.length&&n.push(o)}return 0<n.length?n:null}(e[x],u);if(f){var s=t.simplify/Math.max(v[0],v[1]);if(f=0<s?function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];3<=(i=A(i,t,!0)).length&&n.push(i)}return 0<n.length?n:null}(f,s):f){for(var c=d.flatten(f),p=c.vertices,s=c.holes,f=c.dimensions,g=0;g<p.length;)p[g]=p[g++]*v[0]+a[0],p[g]=p[g++]*v[1]+a[1];if(!function(e,t){var n=e.length/2,r=0,i=t&&t.length?t[0]:n;0<q(e,r,i)&&V(e,2,r,i);for(var o=1;o<(t?t.length:0)+1;o++)q(e,r=t[o-1],i=t[o]||n)<0&&V(e,2,r,i)}(p,s),2!==f)throw new Error("Only 2D polygon points are supported");c=0<t.bevelSize?P(p,s,t.bevelSize,null,!0):p,f=d(c,s,f=void 0===(f=f)?2:f);o.push({indices:f,vertices:p,topVertices:c,holes:s,rect:l,depth:"function"==typeof t.depth?t.depth(x):t.depth})}}}return k(o,t)}function _(e,t){t=Object.assign({},t);for(var n=[1/0,1/0],r=[-1/0,-1/0],i=0;i<e.length;i++)D(e[i],n,r);t.boundingRect=t.boundingRect||{x:n[0],y:n[1],width:r[0]-n[0],height:r[1]-n[1]},W(t);var o=t.scale||[1,1];null==t.lineWidth&&(t.lineWidth=1),null==t.miterLimit&&(t.miterLimit=2);for(var a=[],v=0;v<e.length;v++){var h=e[v],l=t.simplify/Math.max(o[0],o[1]);0<l&&(h=A(h,l,!0)),a.push(function(e,t,n){for(var r=n.lineWidth,i=e.length,o=new Float32Array(2*i),a=n.translate||[0,0],v=n.scale||[1,1],h=0,l=0;h<i;h++)o[l++]=e[h][0]*v[0]+a[0],o[l++]=e[h][1]*v[1]+a[1];q(o,0,i)<0&&V(o,2,0,i);var u=[],x=[],f=n.miterLimit,s=O(o,x,0,i,0,-r/2,f,!1);V(o,2,0,i);for(var c=O(o,u,0,i,0,-r/2,f,!1),r=(u.length+x.length)/2,p=new Float32Array(2*r),g=0,d=x.length/2,y=0;y<x.length;y++)p[g++]=x[y];for(var m=0;m<u.length;m++)p[g++]=u[m];for(var b=new(65535<r?Uint32Array:Uint16Array)(3*(2*(i-1)+(r-2*i))),M=0,w=0;w<i-1;w++){var Z=w+1;b[M++]=d-1-s[w],b[M++]=d-1-s[w]-1,b[M++]=c[w]+1+d,b[M++]=d-1-s[w],b[M++]=c[w]+1+d,b[M++]=c[w]+d,c[Z]-c[w]==2?(b[M++]=c[w]+2+d,b[M++]=c[w]+1+d,b[M++]=d-s[Z]-1):s[Z]-s[w]==2&&(b[M++]=c[Z]+d,b[M++]=d-1-(s[w]+1),b[M++]=d-1-(s[w]+2))}return f=0<n.bevelSize?P(p,[],n.bevelSize,null,!0):p,r=n.boundingRect,{vertices:p,indices:b,topVertices:f,rect:{x:r.x*v[0]+a[0],y:r.y*v[1]+a[1],width:r.width*v[0],height:r.height*v[1]},depth:"function"==typeof n.depth?n.depth(t):n.depth,holes:[]}}(h,v,t))}return k(a,t)}function D(e,t,n){for(var r=0;r<e.length;r++)t[0]=Math.min(e[r][0],t[0]),t[1]=Math.min(e[r][1],t[1]),n[0]=Math.max(e[r][0],n[0]),n[1]=Math.max(e[r][1],n[1])}function E(e){for(var t=new Float32Array(e),n=[],r=0,i=t.length;r<i;r+=2){var o=t[r],a=t[r+1];n.push([o,a])}return n}function C(e,t){void 0===t&&(t=!1);for(var n,r,i,o,a=e.length,v=[],h=[],l=[],u=0,x=0,f=0,s=0,c=0;c<a;c++){var p=t?(p=e[c],r=i=n=o=i=r=n=void 0,n=p.data,r=p.height,i=p.width,o=p.bottomHeight,p=_(n,{lineWidth:i,depth:r}),n=p.position,i=p.normal,r=p.uv,p=p.indices,G(n,o),{position:n,normal:i,uv:r,indices:p}):(d=e[c],b=m=y=b=g=m=y=void 0,y=d.data,m=d.height,g=d.bottomHeight,b=I(y,{depth:m}),d=b.position,y=b.normal,m=b.uv,b=b.indices,G(d,g),{position:d,normal:y,uv:m,indices:b}),g=e[c].bottomHeight||0,d=p.position,y=p.normal,m=p.uv,b=p.indices;h.push(p);b=b.length/3;l[c]=[u+1,u+b],u+=b;d=d.length/3,y=y.length/3,m=m.length/2;v[c]={position:{middleZ:g+(e[c].height||0)/2,count:d,start:x,end:x+3*d},normal:{count:y,start:f,end:f+3*y},uv:{count:m,start:s,end:s+2*m},hide:!1},x+=3*d,f+=3*y,s+=2*m}var M=function(e){for(var t={},n={},r=0;r<e.length;++r){var i,o=e[r];for(i in o)void 0===t[i]&&(t[i]=[],n[i]=0),t[i].push(o[i]),n[i]+=o[i].length}var a,v={},h=0,l=[];for(a in t)if("indices"===a)for(var u=t[a],x=0,f=u.length;x<f;x++){for(var s=u[x],c=0,p=s.length;c<p;c++)l.push(s[c]+h);h+=t.position[x].length/3}else{var g=function(e,t){for(var n=new Float32Array(t),r=0,i=0;i<e.length;++i)n.set(e[i],r),r+=e[i].length;return n}(t[a],n[a]);if(!g)return null;v[a]=g}return v.indices=new Uint32Array(l),v}(h),w=M.position,Z=M.normal,S=M.uv,M=M.indices;return{position:w.buffer,normal:Z.buffer,uv:S.buffer,indices:M.buffer,faceMap:l,geometriesAttributes:v}}function G(e,t){if(void 0!==t&&"number"==typeof t&&0!==t)for(var n=0,r=e.length;n<r;n+=3)e[n+2]+=t}e.initialize=function(){},e.onmessage=function(e,t){var n=e.data,e=n.type,r=n.datas;if("Polygon"===e){!function(e){for(var t=e.length,n=0;n<t;n++)for(var r=e[n].data,i=0,o=r.length;i<o;i++)for(var a=r[i],v=0,h=a.length;v<h;v++)e[n].data[i][v]=E(a[v])}(r);n=C(r);t(null,n,[n.position,n.normal,n.uv,n.indices])}else if("LineString"===e){for(var i=0,o=r.length;i<o;i++)for(var a=0,v=r[i].data.length;a<v;a++)r[i].data[a]=E(r[i].data[a]);e=C(r,!0);t(null,e,[e.position,e.normal,e.uv,e.indices])}},Object.defineProperty(e,"__esModule",{value:!0})}');var br={altitude:0},wr=new l.Vector3,Mr={positionsConvert:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=[],i=0,o=t.length;i<o;i+=3){var a=t[i],s=t[i+1],u=t[i+2];e>0&&(u+=n.distanceToVector3(e,e).x),r.push(new l.Vector3(a,s,u))}return r},vectors2Pixel:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;t[0]instanceof l.Vector3||(t=Mr.positionsConvert(t,r,i));var o=t.map((function(t){return Mr.vector2Pixel(t,e,n)}));return o},vector2Pixel:function(t,e,n){var r=t.project(n),i=e.width/2,o=e.height/2;return{x:Math.round(r.x*i+i),y:Math.round(-r.y*o+o)}}};function Sr(t,e,n){return t[e]||(t[e]=n.distanceToVector3(e,e).x),t[e]}function Ar(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}var Cr=function(t){P(n,t);var e=F(n);function n(t,i,o,a,s){var u;r(this,n),Array.isArray(t)||(t=[t]);var c=1/0,f=1/0,d=-1/0,p=-1/0;if((i=h.Util.extend({},br,i,{layer:s,points:t})).bound)c=i.bound.minX,f=i.bound.minY,d=i.bound.maxX,p=i.bound.maxY;else for(var g=0,m=t.length;g<m;g++){var v=t[g].coordinate,y=void 0,_=void 0;Array.isArray(v)?(y=v[0],_=v[1]):v instanceof h.Coordinate&&(y=v.x,_=v.y),c=Math.min(c,y),f=Math.min(f,_),d=Math.max(d,y),p=Math.max(p,_)}for(var x=s.coordinateToVector3([(c+d)/2,(f+p)/2]),b=X.initGrids(c,f,d,p),w=b.grids,M=b.averageX,S=b.averageY,A=b.ROWS,C=(b.COLS,w.length,new Float32Array(3*t.length)),E=[],T=new Float32Array(3*t.length),I=new Float32Array(3*t.length),L=[],P=[],R=new Float32Array(t.length),O=new Float32Array(t.length),k=new Float32Array(t.length),B=new Float32Array(t.length),F=new Float32Array(t.length),D=new Float32Array(t.length),U=new Float32Array(t.length),j={},N={},G=new l.Vector3(0,0,0),z=0,H=t.length;z<H;z++){var V=t[z],W=V.coordinate,Z=V.height,Q=V.color,Y=V.fcolor1,J=V.rotation,q=V.imgflag,K=V.visibility,$=V.opavalue,tt=V.colorflag,et=V.fcolorflag,nt=V.imgnum,rt=3*z,it=Q instanceof l.Color?Q:new l.Color(Q);T[rt]=it.r,T[rt+1]=it.g,T[rt+2]=it.b,it=Q instanceof l.Color?Q:new l.Color(Y),I[rt]=it.r,I[rt+1]=it.g,I[rt+2]=it.b,R[z]=J,O[z]=q,k[z]=K,B[z]=$,F[z]=tt,D[z]=et,U[z]=nt;var ot=Sr(j,Z,s),at=s.coordinateToVector3(W,ot);G.x=at.x,G.y=at.y,G.z=at.z,G.sub(x),C[rt]=G.x,C[rt+1]=G.y,C[rt+2]=G.z,E.push(at),P[z]={position:{count:1,start:3*z,end:3*z+3},hide:!1};var st=Ar((W[1]-f)/S,4),ut=Ar((W[0]-c)/M,4);st-=1,ut-=1,st=Math.max(0,st),ut=Math.max(0,ut),st=Math.ceil(st);var ct=(ut=Math.ceil(ut))*A+st;w[ct]&&(w[ct].positions.push(at),w[ct].indexs.push(z)),N[z]=!(K<.5)}var lt=new l.BufferGeometry;lt.setAttribute("position",new l.Float32BufferAttribute(C,3,!0)),lt.setAttribute("color",new l.Float32BufferAttribute(T,3,!0)),lt.setAttribute("rotation",new l.Float32BufferAttribute(R,1,!0)),lt.setAttribute("fcolor1",new l.Float32BufferAttribute(I,3,!0)),lt.setAttribute("imgflag",new l.Float32BufferAttribute(O,1,!0)),lt.setAttribute("visibility",new l.Float32BufferAttribute(k,1,!0)),lt.setAttribute("opavalue",new l.Float32BufferAttribute(B,1,!0)),lt.setAttribute("colorflag",new l.Float32BufferAttribute(F,1,!0)),lt.setAttribute("fcolorflag",new l.Float32BufferAttribute(D,1,!0)),lt.setAttribute("imgnum",new l.Float32BufferAttribute(U,1,!0)),i.positions=E,(u=e.call(this))._initOptions(i),u._createPoints(lt,o);var ht=i.altitude,ft=s.distanceToVector3(ht,ht).x,dt=x.clone();return dt.z=ft,u.getObject3d().position.copy(dt),u._centerPt=x,u._averageX=M,u._averageY=S,u._ROWS=A,u._minX=c,u._minY=f,u._baseObjects=L,u._datas=t,u.faceIndex=null,u._geometriesAttributes=P,u.isHide=!1,u._initBaseObjectsEvent(L),u._grids=w,u._indexs_hide=N,u._bindMapEvents(),u._markTypeFunc=a,u.parent=null,u.type="Points",u}return o(n,[{key:"_bindMapEvents",value:function(){var t=this,e=this.getMap(),n="zoomstart zooming zoomend movestart moving moveend pitch rotate";this.on("add",(function(){t._updateGrids(),e.on(n,t._updateGrids,t)})),this.on("remove",(function(){e.off(n,t._updateGrids,t)}))}},{key:"updatepoints",value:function(t){Array.isArray(t)||(t=[t]);for(var e=this._grids.length,n=0;n<e;n++)this._grids[n].positions=[],this._grids[n].indexs=[];for(var r={},i=new Float32Array(3*t.length),o=new l.Vector3(0,0,0),a=0,s=t.length;a<s;a++){var u=t[a],c=u.coordinate,h=3*a,f=Sr(r,u.height,this.getLayer()),d=this.getLayer().coordinateToVector3(c,f);o.x=d.x,o.y=d.y,o.z=d.z,o.sub(this._centerPt),i[h]=o.x,i[h+1]=o.y,i[h+2]=o.z;var p=Ar((c[1]-this._minY)/this._averageY,4),g=Ar((c[0]-this._minX)/this._averageX,4);p-=1,g-=1,p=Math.max(0,p),g=Math.max(0,g),p=Math.ceil(p);var m=(g=Math.ceil(g))*this._ROWS+p;this._grids[m]&&(this._grids[m].positions.push(d),this._grids[m].indexs.push(a))}for(var v=this.getObject3d().geometry.attributes.position.array,y=0;y<i.length;y++)v[3*y+0]=i[3*y+0],v[3*y+1]=i[3*y+1],v[3*y+2]=i[3*y+2];this.getObject3d().geometry.attributes.position.needsUpdate=!0,this._updateGrids()}},{key:"_updateGrids",value:function(){var t=this.getMap();this._grids.forEach((function(e){e.indexs.length&&e.updateBBoxPixel(t)}))}},{key:"getSelectMesh",value:function(){var t=this.faceIndex;if(null!=t){if(!this._baseObjects[t]){var e=this._datas[t],n=e.coordinate,r=e.height,i=e.color;this._baseObjects[t]=this.getLayer().toPoint(n,{height:r,index:t,color:i},this.getObject3d().material),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}},{key:"identify",value:function(t){var e=this.getLayer(),n=this.getMap().getSize(),r=this.getLayer().getCamera(),i=this.getOptions().altitude,o=this.getMap(),a=e.distanceToVector3(i,i).x,s=this._markTypeFunc(this),u=o.coordToContainerPoint(t),c=[];if(this._grids&&this._grids.forEach((function(t){t.indexs.length&&t.isRecCross(u,s)&&c.push(t)})),c.length<1)return!1;for(var l=0,h=c.length;l<h;l++)for(var f=0,d=c[l].positions.length;f<d;f++){var p=c[l].positions[f];wr.x=p.x,wr.y=p.y,wr.z=p.z+a;var g=Mr.vector2Pixel(wr,n,r);if(Math.sqrt(Math.pow(u.x-g.x,2)+Math.pow(u.y-g.y,2))<=s/2){if(this.faceIndex=c[l].indexs[f],!this._indexs_hide[this.faceIndex])continue;return!0}}return!1}}]),n}(qe(ht)),Er=(n("0f55"),n("8745"),n("d3f4")),Tr=n.n(Er),Ir=function(){function t(e,n,i){var o=this;r(this,t);var a=n.altitude,s=n.isLabel,u=n.labelMinZoom,c=n.labelMaxZoom,f=n.labelLayerName,d=n.labelVisible,p=n.canvasSize,g=n.markSize,m=n.pointMinZoom,v=n.pointOrder,y=n.isToolTip,_=n.isPointNum,x=n.sizeType,b=n.iconFile;if(0!=e.length){var w=new l.PointsMaterial({sizeAttenuation:!1,transparent:!0,depthTest:!1});s&&f&&(this.layerLabel=new h.VectorLayer(f,{minZoom:u||15,geometryEvents:!1,hitDetect:!1,visible:d||!1}).addTo(i.map),this.all_labels=[]);var M=[];if(this.typeValues={},this.initTypeValue=-.9,this._initChildVar(n,i),e.slice(0,1/0).map((function(t){if(1*t.longitude>70&&1*t.longitude<138&&1*t.latitude>0&&1*t.latitude<56){var e=o._getImgType(t.businessType,t.imgSrc,t);if(o._bindDataItem(M,t,e),o.layerLabel){var r=new h.Marker([parseFloat(t.longitude),parseFloat(t.latitude)],{properties:{name:t.name,type:t.businessType,code:t.code,status:1},symbol:{textFaceName:n.nameFaceName||"microsoft yahei",textName:"{name}",textSize:n.nameFontSize||12,textFill:n.nameFontColor||"#cbd3ff",textDx:n.nameDy||0,textDy:n.nameDx||30}});1==t.visibility&&o.layerLabel.addGeometry(r),o.all_labels.push(r)}}})),this.textures=null,this.threeLayer=i,this.map=i.map,this.canvasSize=p||48,this.markSize=g||40,this.m=w,this.dataItems=M,this.point=null,this.shader=null,this.minZoom=m||8,this.markType=0===x?0:1,this.order=v||0,this.isToolTip=y||!1,this.customTooltip=n.customTooltip||!1,this.clickFunc=n.clickFunc||null,this.clickInfoFlag=void 0!==n.clickInfoFlag&&n.clickInfoFlag,this.iconFile=b||null,this.isPointNum=_||!1,this.iconFile&&(this.Infolayer=this.map.getLayer("infoLayer"),this.Infolayer||(this.Infolayer=new h.VectorLayer("infoLayer",{geometryEvents:!1,hitDetect:!1}).addTo(i.map)),this.iconCode=null),this.clickInfoFlag){var S={custom:!0,dy:n.infoDy||-48,content:"",animation:!1,autoOpenOn:null};this.infoWindow=new h.ui.InfoWindow(S).addTo(this.map)}this.layerPointNumLabel=new h.VectorLayer(h.Util.GUID(),{hitDetect:!1,zIndex:1001}).addTo(i.map),this.selectItems=[],this.funcsNew={},this.fitZoom=null,this.isCtrol=!0,this.rbush=new Tr.a,this.GLOBALSCALE=32768,this.XMAX=178,this.YMAX=85,this.MAXZOOM=31,this.SCALES=[];for(var A=0;A<this.MAXZOOM;A++)this.SCALES.push(129202.08021/Math.pow(2,A));this.clusterItemsCache={},this.clusterMinZoom=9,this.clusterMaxZoom=18,this.altitude=a,this.labelMaxZoom=c}else console.error("需要绘制的点位数量为0")}return o(t,[{key:"_initChildVar",value:function(t,e){throw new Error(e,"需要在派生类中实现")}},{key:"_bindMapEvents",value:function(){this.map.on("zooming zoomend",this._setSizeOn,this),this.point&&this.point.on("click empty mousemove mouseout",this._setPointEvent,this)}},{key:"_setSizeOn",value:function(){var t=this._getRate();for(var e in this.shader&&(this.shader.uniforms.size1.value=this.markSize*t),this.funcsNew)this.funcsNew[e]()}},{key:"_addIcon",value:function(t){this.Infolayer.clear(),new h.Marker([t.coordinate[0],t.coordinate[1]],{symbol:{markerFile:this.iconFile,markerWidth:48,markerHeight:48,markerDx:0,markerDy:0,markerOpacity:1}}).addTo(this.Infolayer),this.iconCode=t.code}},{key:"addContent",value:function(){var t=s(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.clickInfoFlag){t.next=5;break}return t.next=3,this.clickFunc(this.infoWindow,e);case 3:t.next=7;break;case 5:return t.next=7,this.clickFunc(e);case 7:this.iconFile&&this._addIcon(e),this.clickInfoFlag&&this.infoWindow.show({x:e.coordinate[0],y:e.coordinate[1]});case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_setPointEvent",value:function(t){var e,n=t.selectMesh;if(n&&(e=n.data),"mousemove"===t.type&&e){var r=e.value;this.isToolTip&&(this.point.getToolTip()._content="".concat(r)),this.customTooltip&&this.clickFunc&&this.addContent(e)}"mouseout"===t.type&&this.customTooltip&&this.clickFunc&&this.infoWindow.hide(),"click"===t.type&&e&&this.clickFunc&&!this.customTooltip&&this.addContent(e)}},{key:"_bindDataItem",value:function(t,e,n){throw new Error(t,e,n,"需要在派生类中实现")}},{key:"_getImgType",value:function(t,e,n){throw new Error(t,e,"需要在派生类中实现")}},{key:"_deleteFunsKey",value:function(t){if(t){for(var e in this.funcsNew)if(t&&t===e){delete this.funcsNew[e];break}}else for(var n in this.funcsNew)delete this.funcsNew[n]}},{key:"dispose",value:function(){for(var t in this.isToolTip&&this.point&&this.point.removeToolTip(),this.clearIcon(),this.Infolayer&&(this.map.removeLayer(this.Infolayer),delete this.Infolayer),this.rbush&&(this.rbush.clear(),delete this.rbush),this.layerLabel&&(this.map.removeLayer(this.layerLabel),delete this.layerLabel,this.all_labels=[]),this.layerPointNumLabel&&this.map&&(this.map.removeLayer(this.layerPointNumLabel),delete this.layerPointNumLabel),this._closeEvent(),this._deleteFunsKey(),this.typeValues)delete this.typeValues[t];if(this.typeValues={},this.point){if(this.threeLayer.removeMesh(this.point),this.point.object3d.geometry&&this.point.object3d.geometry.dispose(),this.point.object3d.material&&this.point.object3d.material.dispose(),this.point._indexs_hide){for(var e in this.point._indexs_hide)delete this.point._indexs_hide[e];delete this.point._indexs_hide}this.point._datas=[],this.point._geometriesAttributes=[],this.point._grids=[],delete this.point.object3d,this.point.toolTip&&delete this.point.toolTip,this.point.options.points=[],this.point.options.positions=[],delete this.point}this.infoWindow&&(this.infoWindow.remove(),delete this.infoWindow),this.clickFunc&&delete this.clickFunc,this.textures&&this.textures.length>0&&(this.textures.forEach((function(t){t.dispose()})),delete this.textures),this.dataItems=[],this.threeLayer=null,this.map=null,delete this.shader,this.m&&(this.m.dispose(),delete this.m),this.selectItems=[]}},{key:"findItemByCode",value:function(t){for(var e=0;e<this.dataItems.length;e++)if(this.dataItems[e].code===t)return e}},{key:"changePointMinZoom",value:function(t){this.point&&(this.point.options.minZoom=t)}},{key:"_closeEvent",value:function(){this.point&&this.map.off("zooming zoomend",this._setSizeOn,this),this.point&&this.point.off("click empty mousemove mouseout",this._setPointEvent,this)}},{key:"clearIcon",value:function(){this.Infolayer&&this.Infolayer.clear(),this.infoWindow&&this.infoWindow.hide(),this.iconCode=null}},{key:"_loadTexture",value:function(){var t=s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("需要在派生类中实现");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"pointShowHide",value:function(t,e,n,r,i){this.point&&(this.layerPointNumLabel&&this.layerPointNumLabel.clear(),this.layerLabel&&this.layerLabel.clear(),this.bzlayerNum&&this.bzlayerNum.clear(),this._deleteFunsKey(),this.selectItems=[],this.point.show(),this._pointShowHide(t,e,n,r,i))}},{key:"_pointShowHide",value:function(t,e,n,r,i){throw new Error(t,e,n,r,i,"需要在派生类中实现")}},{key:"_changePtVisible",value:function(t){var e=this;this.layerLabel&&this.layerLabel.clear();var n=this.point.object3d.geometry.attributes.visibility.array;if(0===t.length)for(var r=0;r<this.dataItems.length;r++)1===this.dataItems[r].visibility?(n[r]=1,this.point._indexs_hide[r]=!0,this.layerLabel.addGeometry(this.all_labels[r])):(n[r]=.1,this.point._indexs_hide[r]=!1);else{this.dataItems.forEach((function(t){t.visibility=.1})),t.forEach((function(t){e.dataItems[t].visibility=1}));for(var i=0;i<this.dataItems.length;i++)1===this.dataItems[i].visibility?(n[i]=1,this.point._indexs_hide[i]=!0,this.layerLabel&&this.layerLabel.addGeometry(this.all_labels[i])):(n[i]=.1,this.point._indexs_hide[i]=!1)}this.point.object3d.geometry.attributes.visibility.needsUpdate=!0}},{key:"pointShowHideByCode",value:function(t,e){this.layerPointNumLabel&&this.layerPointNumLabel.clear(),this._deleteFunsKey(),this.selectItems=[],this.point.show();for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<this.dataItems.length;a++){var s=this.dataItems[a];t.includes(s.code)?(n=Math.min(n,this.dataItems[a].coordinate[0]),r=Math.min(r,this.dataItems[a].coordinate[1]),i=Math.max(i,this.dataItems[a].coordinate[0]),o=Math.max(o,this.dataItems[a].coordinate[1]),s.visibility=1):s.visibility=.1}this._changePtVisible([]),e&&this.map.fitExtent(new h.Extent(n,r,i,o),0)}},{key:"_itemHide",value:function(t,e,n,r,i,o){var a,s=n||!0,u=r||!0;e&&"MultiPolygon"===e.getType()&&(a=e.toGeoJSON());var c=this.point.object3d.geometry.attributes.visibility.array;if(t.length>0){for(var l=0;l<this.dataItems.length;l++){var h=this.dataItems[l],f=!0;if(1===h.status?f=!0===s:0===h.status&&(f=!0===u),e&&(f&=!!("MultiPolygon"===e.getType()?V.containsCoordinate2(this.dataItems[l].coordinate,a):V.containsCoordinate1(this.dataItems[l].coordinate,e))),i&&i.rangeArr.length>0){var d=1*this.dataItems[l].pvalue;f&=!!V.isInLevels(i,d)}h.imgflag==o&&(f?(c[l]=1,this.point._indexs_hide[l]=!0,this.selectItems.push(l),this.layerLabel&&this.layerLabel.addGeometry(this.all_labels[l]),this.bzlayerNum&&this.bzlayerNum.addGeometry(this.bz_all_nums[l])):(c[l]=.1,this.point._indexs_hide[l]=!1))}this.point.object3d.geometry.attributes.visibility.needsUpdate=!0}else{for(var p=0;p<this.dataItems.length;p++)this.dataItems[p].imgflag==o&&(c[p]=.1,this.point._indexs_hide[p]=!1);this.point.object3d.geometry.attributes.visibility.needsUpdate=!0}}},{key:"_getRate",value:function(){var t=this.map.getZoom()-8;return.2*(t=t>4?4:t)+.2}},{key:"_getMarkSize",value:function(t){var e=t.parent;return e.markSize*e._getRate()}},{key:"addPoint",value:function(){var t=s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("需要在派生类中实现");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"pointShowHideShowNumSingle",value:function(t,e,n){var r=this,i=n||12;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey(),this.selectItems=[],this._pointShowHide(t,e);var o=1/0,a=1/0,s=-1/0,u=-1/0;this.selectItems.forEach((function(t){o=Math.min(o,r.dataItems[t].coordinate[0]),a=Math.min(a,r.dataItems[t].coordinate[1]),s=Math.max(s,r.dataItems[t].coordinate[0]),u=Math.max(u,r.dataItems[t].coordinate[1])}));var c=[(o+s)/2,(a+u)/2];this._addClusterLabel(c,this.selectItems.length,{}).on("click",(function(){r.layerPointNumLabel.hide(),r.map.fitExtent(new h.Extent(o,a,s,u),0),setTimeout((function(){r.point.show()}),500)})),this.point.hide(),this.funcsNew.a=function(){r.map.getZoom()<i?(r.point.hide(),r.layerPointNumLabel.show()):(r.point.show(),r.layerPointNumLabel.hide())}}},{key:"_clearClusterCache",value:function(){for(var t in this.clusterItemsCache)delete this.clusterItemsCache[t];this.clusterItemsCache={}}},{key:"pointShowHideShowNumbyCodeMultiple",value:function(t,e){var n=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey();for(var r=[],i=[],o=0;o<e.length;o++)r.push({code:o,geo:e[o],geojson:e[o].toGeoJSON(),ptnum:0,val:t,ptids:[]});this.dataItems.forEach((function(t){t.visibility=.1})),r.forEach((function(e){for(var r=0;r<n.dataItems.length;r++){var o=n.dataItems[r];t.includes(o.code)&&V.containsCoordinate2(n.dataItems[r].coordinate,e.geojson)&&(e.ptnum+=1,e.ptids.push(r),i.push(r),o.visibility=1)}})),r.forEach((function(t){n._addClusterLabel(t.geo.getCenter(),t.ptnum,t).on("click",(function(t){n.selectItems=[];var e=t.target.properties.item;e.ptnum>0&&(setTimeout((function(){n.point.show()}),500),n._changePtVisible(e.ptids),n._zoomSelect1(e.ptids,e.geo,i))}))})),this._changePtVisible(i),this.map.getZoom()<9.4?this.point.hide():(this.point.show(),this.layerPointNumLabel.hide()),this.funcsNew.b=function(){n.isCtrol&&(n.map.getZoom()<9.4?(n.point.hide(),n.layerPointNumLabel.show()):(n.point.show(),n.layerPointNumLabel.hide()))}}},{key:"pointShowHideShowNumMultiple",value:function(t,e){var n=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey();for(var r=[],i=[],o=0;o<e.length;o++)r.push({code:o,geo:e[o],geojson:e[o].toGeoJSON(),ptnum:0,val:t,ptids:[]});this.dataItems.forEach((function(t){t.visibility=.1})),r.forEach((function(e){for(var r=function(r){var o=n.dataItems[r];t.filter((function(t){return t===o.type})).length>0&&V.containsCoordinate2(n.dataItems[r].coordinate,e.geojson)&&(e.ptnum+=1,e.ptids.push(r),i.push(r),o.visibility=1)},o=0;o<n.dataItems.length;o++)r(o)})),r.forEach((function(t){n._addClusterLabel(t.geo.getCenter(),t.ptnum,t).on("click",(function(t){n.selectItems=[];var e=t.target.properties.item;e.ptnum>0&&(setTimeout((function(){n.point.show()}),500),n._changePtVisible(e.ptids),n._zoomSelect1(e.ptids,e.geo,i))}))})),this._changePtVisible(i),this.map.getZoom()<9.4?this.point.hide():(this.point.show(),this.layerPointNumLabel.hide()),this.funcsNew.b=function(){n.isCtrol&&(n.map.getZoom()<9.4?(n.point.hide(),n.layerPointNumLabel.show()):(n.point.show(),n.layerPointNumLabel.hide()))}}},{key:"_zoomSelect1",value:function(t,e,n){var r=this,i=1/0,o=1/0,a=-1/0,s=-1/0;t.forEach((function(t){i=Math.min(i,r.dataItems[t].coordinate[0]),o=Math.min(o,r.dataItems[t].coordinate[1]),a=Math.max(a,r.dataItems[t].coordinate[0]),s=Math.max(s,r.dataItems[t].coordinate[1])})),this.layerPointNumLabel.hide(),this.map.fitExtent(new h.Extent(i,o,a,s),0),this.isCtrol=!1,setTimeout((function(){r.funcsNew.a=function(){r.fitZoom||(r.fitZoom=r.map.getZoom()),r.map.getZoom()<r.fitZoom-.5&&(r.point.hide(),r.layerPointNumLabel.show(),r._deleteFunsKey("a"),r.fitZoom=null,r.isCtrol=!0,r._changePtVisible(n))}}),500)}},{key:"_addClusterLabelSmall",value:function(t,e,n,r,i){var o=r||"#50fcfc",a=i||"#000",s=new h.Marker(t,{properties:{item:n},symbol:[{type:"1",markerType:"ellipse",markerFill:o,markerFillOpacity:1,markerLineWidth:0,markerLineOpacity:1,markerWidth:{stops:[[9,32],[12,52]]},markerHeight:{stops:[[9,32],[12,52]]}}]});return this.layerPointNumLabel.addGeometry(s),new h.Marker(t,{properties:{name:e},symbol:{textFaceName:"sans-serif",textName:"{name}",textSize:{stops:[[9,12],[12,18],[15,24]]},textFill:a}}).addTo(this.layerPointNumLabel),s}},{key:"_addClusterLabel",value:function(t,e,n,r,i){var o=r||"#50fcfc",a=i||"#000",s=new h.Marker(t,{properties:{item:n},symbol:[{type:"1",markerType:"ellipse",markerFill:o,markerFillOpacity:1,markerLineWidth:0,markerLineOpacity:1,markerWidth:{stops:[[9,32],[12,52],[15,82]]},markerHeight:{stops:[[9,32],[12,52],[15,82]]}},{type:"2",markerType:"ellipse",markerFill:o,markerFillOpacity:"0.4",markerLineWidth:0,markerLineOpacity:1,markerWidth:{stops:[[9,54],[12,74],[15,104]]},markerHeight:{stops:[[9,54],[12,74],[15,104]]}}]});return this.layerPointNumLabel.addGeometry(s),new h.Marker(t,{properties:{name:e},symbol:{textFaceName:"sans-serif",textName:"{name}",textSize:{stops:[[9,12],[12,18],[15,24]]},textFill:a}}).addTo(this.layerPointNumLabel),s}},{key:"getClosestZoom",value:function(t){for(var e=0;e<this.MAXZOOM-1;e++){var n=this.SCALES[e],r=this.SCALES[e+1];if(n===t)return e;if(r===t)return e+1;if(t<n&&r<t)return Math.abs(t-n)<=Math.abs(t-r)?e:e+1}}},{key:"calColNum",value:function(t,e,n){var r=this;this.rbush.clear();for(var i=[],o=[],a=0;a<this.dataItems.length;a++)if(e&&e.length>0&&e.includes(a)){var s=this.getRect(this.dataItems[a],a);this.rbush.insert(s)}for(var u=0;u<this.dataItems.length;u++)if(e.includes(u))if(t>=18){var c=[u];o.push(c)}else i.includes(u)||function(){var t=r.getRect(r.dataItems[u]),e=r.rbush.search(t),n=[];if(e.forEach((function(t){n.push(t.idx)})),o.length>0){for(var a=[],s=0;s<o.length;s++)o[s].filter((function(t){return n.includes(t)})).length>0&&a.push(s);if(0===a.length)o.push(n.sort((function(t,e){return t-e})));else if(1===a.length){var c=o[a[0]].concat(n.filter((function(t){return!o[a[0]].includes(t)})));o[a[0]]=c.sort((function(t,e){return t-e}))}else{for(var l=[],h=[],f=0;f<o.length;f++)a.includes(f)?h.push(o[f]):l.push(o[f]);var d=h.flat(),p=d.concat(n.filter((function(t){return!d.includes(t)})));o=[],l.forEach((function(t){o.push(t)})),o.push(p)}}else o.push(n);i=o.flat()}();n.push(o)}},{key:"testCluster",value:function(t){var e=this;this.layerPointNumLabel.clear(),t.forEach((function(t){if(t.length>1){var n=1/0,r=1/0,i=-1/0,o=-1/0;t.forEach((function(t){n=Math.min(n,e.dataItems[t].coordinate[0]),r=Math.min(r,e.dataItems[t].coordinate[1]),i=Math.max(i,e.dataItems[t].coordinate[0]),o=Math.max(o,e.dataItems[t].coordinate[1]),e.dataItems[t].visibility=.1}));var a=[(n+i)/2,(r+o)/2];e._addClusterLabelSmall(a,t.length,{})}else e.dataItems[t[0]].visibility=1})),this._changePtVisible([])}},{key:"testMinClusterZoom",value:function(t){var e=this;this.layerPointNumLabel.clear(),t.forEach((function(t){e._addClusterLabel(t.geo.getCenter(),t.ptnum,t)})),this.dataItems.forEach((function(t){t.visibility=.1})),this._changePtVisible([])}},{key:"getRect",value:function(t,e){var n=this.threeLayer.coordinateToVector3(t.coordinate,0),r=this.getPixel(n),i=r.x,o=r.y,a=this._getRate(),s=this.markSize*a;return{minX:i-s/2,minY:o-s/2,maxX:i+s/2,maxY:o+s/2,idx:e}}},{key:"getPixel",value:function(t){var e=this.map.getSize(),n=this.threeLayer.getCamera();return V.vector2Pixel(t,e,n)}}]),t}(),Lr={factor:{aqi:{unit:"",name:"AQI",colorMap:{"00e400":[0,50],ffff00:[50,100],ff7e00:[100,150],ff0000:[150,200],"99004c":[200,300],"7e0023":[300,500],"6e6e6e":[500]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},pm25:{unit:"μg/m³",name:"PM2.5",colorMap:{"00e400":[0,35],ffff00:[35,75],ff7e00:[75,115],ff0000:[115,150],"99004c":[150,250],"7e0023":[250,500],"7e0022":[500]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},pm10:{unit:"μg/m³",name:"PM10",colorMap:{"00e400":[0,50],ffff00:[50,150],ff7e00:[150,250],ff0000:[250,350],"99004c":[350,420],"7e0023":[420,600],"7e0022":[600]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},so2:{unit:"μg/m³",name:"SO₂",colorMap:{"00e400":[0,50],ffff00:[50,150],ff7e00:[150,475],ff0000:[475,800],"99004c":[800,1600],"7e0023":[1600,2620],"6e6e6e":[2620]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},no2:{unit:"μg/m³",name:"NO₂",colorMap:{"00e400":[0,40],ffff00:[40,80],ff7e00:[80,180],ff0000:[180,280],"99004c":[280,565],"7e0023":[565,940],"6e6e6e":[940]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},co:{unit:"mg/m³",name:"CO",colorMap:{"00e400":[0,2],ffff00:[2,4],ff7e00:[4,14],ff0000:[14,24],"99004c":[24,36],"7e0023":[36,60],"6e6e6e":[60]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},o3:{unit:"μg/m³",name:"O₃",colorMap:{"00e400":[0,100],ffff00:[100,160],ff7e00:[160,215],ff0000:[215,265],"99004c":[265,800],"7e0023":[800,1200],"6e6e6e":[1200]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},ci:{unit:"μg/m³",name:"CI",colorMap:{"00e400":[0,1.3],ffff00:[1.3,4],ff7e00:[4,8],ff0000:[8,12],"99004c":[12,20],"7e0023":[20]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},tsp:{unit:"μg/m³",name:"TSP",colorMap:{"00e400":[0,120],ffff00:[120,300],ff7e00:[300,400],ff0000:[400,500],"99004c":[500,625],"7e0023":[625,3e3],"6e6e6e":[3e3]},degreeMap:{"00e400":"",ffff00:"",ff7e00:"",ff0000:"","99004c":"","7e0023":""}},voc:{unit:"mg/m³",name:"VOC",colorMap:{"00e400":[0,.19],ffff00:[.19,.59],ff7e00:[.59,1.79],ff0000:[1.79,2.29],"99004c":[2.29,3],"7e0023":[3]},degreeMap:{"00e400":"",ffff00:"",ff7e00:"",ff0000:"","99004c":"","7e0023":""}},temperature:{unit:"℃",name:"温度",colorMap:{"8274cc":[-40,-30],acb3e2:[-30,-20],"95d0d8":[-20,-10],"61afff":[-10,0],"87b922":[0,10],e5aa06:[10,20],e45914:[20,30],"8a2b0a":[30]},degreeMap:{"8274cc":"",acb3e2:"","95d0d8":"","61afff":"","87b922":"",e5aa06:"",e45914:"","8a2b0a":""}},humidity:{unit:"%",name:"湿度",colorMap:{c4be20:[0,20],c4be21:[20,40],"4fcb46":[40,60],"45afde":[60,80],"6661f1":[80]},degreeMap:{c4be20:"",c4be21:"","4fcb46":"","45afde":"","6661f1":""}},pressure:{unit:"Pa",name:"气压",colorMap:{"6493FF":[1,1e17]},degreeMap:{"6493FF":""}}},colorForValue:{"00e400":"优",ffff00:"良",ff7e00:"轻度",ff0000:"中度","99004c":"重度","7e0023":"严重","6e6e6e":"无"},colorForFont:{"#00e400":"#000","#ffff00":"#000","#ff7e00":"#fff","#ff0000":"#fff","#99004c":"#fff","#7e0023":"#fff","#6e6e6e":"#fff"},wind:{"东北⻛":[22.5,67.5],"东⻛":[67.5,112.5],"东南⻛":[112.5,157.5],"南⻛":[157.5,202.5],"⻄南⻛":[202.5,247.5],"⻄⻛":[247.5,292.5],"⻄北⻛":[292.5,337.5]},windLevel:{"0级":[0,.2],"1级":[.2,1.5],"2级":[1.5,3.3],"3级":[3.3,5.4],"4级":[5.4,7.9],"5级":[7.9,10.7],"6级":[10.7,13.8],"7级":[13.8,17.1],"8级":[17.1,20.7],"9级":[20.7,24.4],"10级":[24.4,28.4],"11级":[28.4,32.6]},windLevelZh:{"零级(⽆⻛)":[0,.2],"⼀级(软⻛)":[.2,1.5],"⼆级(轻⻛)":[1.5,3.3],"三级(微⻛)":[3.3,5.4],"四级(和⻛)":[5.4,7.9],"五级(劲⻛)":[7.9,10.7],"六级(强⻛)":[10.7,13.8],"七级(疾⻛)":[13.8,17.1],"⼋级(⼤⻛)":[17.1,20.7],"九级(烈⻛)":[20.7,24.4],"⼗级(狂⻛)":[24.4,28.4],"⼗⼀级(暴⻛)":[28.4,32.6]}},Pr=function(t,e){return Lr.colorForFont[function(t,e){if(!e)return"#8a97a0";var n=(Lr.factor[e]||Lr.factor[e.toLowerCase()]||{}).colorMap;if(!n)return"#8a97a0";for(var r in t=+t,n){if(1===n[r].length&&n[r][0]<t)return"#"+r;if(n[r][0]<t&&t<=n[r][1])return"#"+r}return"#8a97a0"}(t,e.toLowerCase())]},Rr=function(t){P(n,t);var e=F(n);function n(t,i,o){var a;return r(this,n),(a=e.call(this,t,i,o)).InforItems=[],a.curZoom=9,a.clusterMinZoom=9,a.name=i.labelLayerName,a.zoomPara=.05,a.canvasSize=i.canvasSize||40,a._bound=i.bound,a}return o(n,[{key:"_initChildVar",value:function(t,e){!0===t.addValueLabel&&(this.bzlayerNum=new h.VectorLayer(h.Util.GUID(),{minZoom:t.valueMinZoom||11,geometryEvents:!1,hitDetect:!1,visible:!1}).addTo(e.map),this.bz_all_nums=[],this.valueFaceName=t.valueFaceName||"microsoft yahei",this.valueFontSize=t.valueFontSize||12,this.valueDy=t.valueDy||0,this.valueDx=t.valueDx||0),this.paraName=t.paraName||"pm25",this.typeImgNum=-1}},{key:"_bindDataItem",value:function(t,e,n){var r=parseFloat(e.value)||0,i=parseFloat(e.opavalue)?parseFloat(e.opavalue):1,o=0;e.imgSrc&&(o=e.imgSrc.length);var a=.9,s="#fff";e.imgColor&&e.imgColor.length>=1&&(a=1.9,s=e.imgColor[0]);var u=.9,c="#fff";e.imgColor&&e.imgColor.length>=2&&(u=1.9,c=e.imgColor[1]);var l=(parseFloat(e.windDirection)||0)+.01,f=parseFloat(l*(Math.PI/180));if(t.push({coordinate:[parseFloat(e.longitude),parseFloat(e.latitude)],height:0,color:s,colorflag:a,fcolorflag:u,fcolor1:c,imgnum:o,value:e.name,imgflag:n,rotation:f,visibility:1==e.visibility?1:.1,code:e.code,opavalue:i,pvalue:e.value||0,data:e.data}),this.bzlayerNum){var d=e.valueFontColr||Pr(r,this.paraName),p=new h.Marker([parseFloat(e.longitude),parseFloat(e.latitude)],{properties:{name:r,type:e.businessType,pvalue:r},symbol:{textFaceName:this.valueFaceName,textName:"{name}",textSize:this.valueFontSize,textFill:d,textDx:this.valueDx,textDy:this.valueDy}});1==e.visibility&&this.bzlayerNum.addGeometry(p),this.bz_all_nums.push(p)}}},{key:"_getRate",value:function(){if(1===this.markType)return I(E(n.prototype),"_getRate",this).call(this);var t=this.map.getZoom()-3;return.1*(t=t>9?9:t)+.1}},{key:"_getImgType",value:function(t,e,n){return void 0===this.typeValues[t]&&(0===Object.keys(this.typeValues).length?this.initTypeValue=.9:this.initTypeValue+=this.typeImgNum,this.typeImgNum=e.length,this.typeValues[t]={v:this.initTypeValue,img:e,inImgWidth:parseInt(n.inImgWidth)||16}),this.typeValues[t].v}},{key:"_pointShowHide",value:function(t,e,n,r,i){var o=this;this.layerLabel&&this.layerLabel.clear();var a=function(a){var s=t.filter((function(t){return t===a}));o._itemHide(s,e,n,r,i,o.typeValues[a].v)};for(var s in this.typeValues)a(s)}},{key:"pointFindByCode",value:function(t,e,n){var r=this.dataItems.filter((function(e){return e.code===t}));r.length>0&&(e&&this.map.fitExtent(new h.Extent(r[0].coordinate[0]-this.zoomPara,r[0].coordinate[1]-this.zoomPara,r[0].coordinate[0]+this.zoomPara,r[0].coordinate[1]+this.zoomPara),0),n&&this.iconFile&&this._addIcon(r[0]))}},{key:"_loadTexture",value:function(){var t=s(regeneratorRuntime.mark((function t(){var e,n,r,i,o,a,s,u,c,l,h,f,d,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=[],t.t0=regeneratorRuntime.keys(this.typeValues);case 2:if((t.t1=t.t0()).done){t.next=32;break}if(n=t.t1.value,!this.typeValues[n].img||!Array.isArray(this.typeValues[n].img)){t.next=30;break}r=0;case 6:if(!(r<this.typeValues[n].img.length)){t.next=30;break}if(i=this.typeValues[n].img[r],o=i,!i.includes(".svg")){t.next=16;break}return t.next=12,fetch(i);case 12:return a=t.sent,t.next=15,a.text();case 15:o=t.sent;case 16:return s=new DOMParser,u=s.parseFromString(o,"image/svg+xml"),c=1*(u.documentElement.getAttribute("width")||1),l=1*(u.documentElement.getAttribute("height")||1),h=l/c,f=parseInt(this.canvasSize/h),d=parseInt(f*h),t.next=25,V.addImageProcess(o);case 25:p=t.sent,0===r?e.push({type:"img",src:p,w:this.canvasSize,h:this.canvasSize,iw:f,ih:d}):(f=parseInt(this.typeValues[n].inImgWidth/h),d=parseInt(f*h),e.push({type:"img1",src:p,w:this.canvasSize,h:this.canvasSize,iw:f,ih:d}));case 27:r++,t.next=6;break;case 30:t.next=2;break;case 32:return t.abrupt("return",V.generateTexture(e));case 33:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"addPoint",value:function(){var t=s(regeneratorRuntime.mark((function t(){var e,n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.dataItems){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this._loadTexture();case 4:return e=t.sent,this.textures||(this.textures=[]),this.textures.push(e.texture),n=this._getRate(),this.m.onBeforeCompile=function(t){r=o._createShaderPol(t,e.texture,e.xys,e.textureSize,o.markSize*n),o.shader=r},i=new Cr(this.dataItems,{minZoom:this.minZoom,bound:this._bound},this.m,this._getMarkSize,this.threeLayer),this.isToolTip&&i.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),i.object3d.renderOrder=this.order,this.point=i,this.point.parent=this,this.threeLayer.addMesh(this.point),this._bindMapEvents(),t.abrupt("return",i);case 17:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"addInfo",value:function(t){if(t.length!==this.InforItems.length)for(var e=0;e<this.dataItems.length;e++)if(t.includes(e)){var n=this.dataItems[e],r=n.data.infoWindowData;if(n.data.law_num&&n.data.punish_num&&(r=[{key:"案件数",value:n.data.law_num},{key:"处罚金额",value:"".concat(n.data.punish_num,"万元")}]),!r||!r.length)continue;var i={single:!1,custom:!0,dy:-16,autoOpenOn:null,animation:!1,autoPanDuration:!1,autoPan:!1,content:'<div style="background: rgba(0,0,0,0.42); border-radius: 6px; font-size: 12px; color: #ffffff; padding: 6px;display: flex;\n flex-direction: column;\n align-items: center; width: 128px">\n <span>'.concat(r[0].key,":").concat(r[0].value,"</span>\n <span>").concat(r[1].key,":").concat(r[1].value,"</span>\n </div>")},o=new h.ui.InfoWindow(i);this.InforItems.push(o),o.addTo(this.map).show({x:n.coordinate[0],y:n.coordinate[1]})}}},{key:"hideInfoWindows",value:function(){this.InforItems.length>0&&(this.InforItems.forEach((function(t){t.remove()})),this.InforItems=[])}},{key:"pointShowStatisticsByeCodeMultiple",value:function(t,e,n,r,i){var o=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this.hideInfoWindows(),this._deleteFunsKey();for(var a=[],s=[],u=0;u<e.length;u++)a.push({code:u,geo:e[u],geojson:e[u].toGeoJSON(),ptnum:0,val:t,sum:0,ptids:[]});a.forEach((function(e){for(var r=0;r<o.dataItems.length;r++){var i=o.dataItems[r];t.includes(i.code)&&V.containsCoordinate2(o.dataItems[r].coordinate,e.geojson)&&(e.ptnum+=1,e.ptids.push(r),s.push(r),o.dataItems[r].data[n]?(e.sum+=parseFloat(o.dataItems[r].data[n])||0,e.sum=Math.floor(100*e.sum)/100):e.sum+=0)}})),this._clearClusterCache();var c=this.clusterMinZoom;this.clusterItemsCache[c]=a,this.testMinClusterZoom1(this.clusterItemsCache[c],r,i),this.funcsNew.c=function(){var t=o.getClosestZoom(o.map.pixelToDistance(1,0));if(!(t<9||t>18)&&o.curZoom!==t)if(o.curZoom=t,o.clusterItemsCache[t])if(t===o.clusterMinZoom)o.hideInfoWindows(),o.testMinClusterZoom1(o.clusterItemsCache[t],r,i);else{var e=o.clusterItemsCache[t];o.testCluster1(e,r,i,n)}else{var s=[];a.forEach((function(e){o.calColNum(t,e.ptids,s)})),o.clusterItemsCache[t]=s.flat(),o.testCluster1(o.clusterItemsCache[t],r,i,n)}}}},{key:"testMinClusterZoom1",value:function(t,e,n){var r=this;this.layerPointNumLabel.clear(),t.forEach((function(t){r._addClusterLabel(t.geo.getCenter(),t.sum,t,e,n)})),this.dataItems.forEach((function(t){t.visibility=.1})),this._changePtVisible([])}},{key:"testCluster1",value:function(t,e,n,r){var i=this;this.layerPointNumLabel.clear();var o=[];t.forEach((function(t){if(t.length>1){var a=1/0,s=1/0,u=-1/0,c=-1/0,l=0;t.forEach((function(t){a=Math.min(a,i.dataItems[t].coordinate[0]),s=Math.min(s,i.dataItems[t].coordinate[1]),u=Math.max(u,i.dataItems[t].coordinate[0]),c=Math.max(c,i.dataItems[t].coordinate[1]),i.dataItems[t].visibility=.1,i.dataItems[t].data[r]?(l+=parseFloat(i.dataItems[t].data[r])||0,l=Math.floor(100*l)/100):l+=0}));var h=[(a+u)/2,(s+c)/2];i._addClusterLabelSmall(h,l,{},e,n)}else i.dataItems[t[0]].visibility=1,o.push(t[0])})),this._changePtVisible([]),this.hideInfoWindows(),this.addInfo(o)}},{key:"pointShowStatisticsByeTypeMultiple",value:function(t,e,n){var r=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey();for(var i=[],o=0;o<e.length;o++)i.push({code:o,geo:e[o],geojson:e[o].toGeoJSON(),sum:0,val:t,ptnum:0});i.forEach((function(e){for(var i=function(i){var o=r.dataItems[i];t.filter((function(t){return t.includes(o.type)})).length>0&&V.containsCoordinate2(r.dataItems[i].coordinate,e.geojson)&&(e.ptnum+=1,r.dataItems[i].data[n]?e.sum+=parseFloat(r.dataItems[i].data[n])||0:e.sum+=0)},o=0;o<r.dataItems.length;o++)i(o)})),i.forEach((function(e){r._addClusterLabel(e.geo.getCenter(),e.sum,e).on("click",(function(e){r.selectItems=[];var n=e.target.properties.item;n.ptnum>0&&(setTimeout((function(){r.point.show()}),500),r._pointShowHide(n.val,n.geo),r._zoomSelect(t,n.geo))}))})),this._pointShowHide(t),this.map.getZoom()<9.4?this.point.hide():(this.point.show(),this.layerPointNumLabel.hide()),this.funcsNew.b=function(){r.isCtrol&&(r.map.getZoom()<9.4?(r.point.hide(),r.layerPointNumLabel.show()):(r.point.show(),r.layerPointNumLabel.hide()))}}},{key:"showValue",value:function(t,e){if(this.shader){if(void 0===e){var n=!0===t?0:1;this.shader.uniforms.flag.value=n}this.bzlayerNum&&(this.bzlayerNum.options.visible=t)}}},{key:"showName",value:function(t){this.layerLabel&&(this.layerLabel.options.visible=t)}},{key:"changePositionValue",value:function(t,e){var n=this;if(this.point){this.paraName=e||this.paraName;var r=this.point.object3d.geometry.attributes.color.array,i=this.point.object3d.geometry.attributes.rotation.array,o=this.point.object3d.geometry.attributes.opavalue.array;t.slice(0,1/0).map((function(t){var e=parseFloat(t.value)||0,r=parseFloat(t.opavalue)?parseFloat(t.opavalue):1,i="#fff";t.imgColor&&t.imgColor.length>=1&&(i=t.imgColor[0]);var o=(parseFloat(t.windDirection)||0)+.01,a=parseFloat(o*(Math.PI/180)),s=n.findItemByCode(t.code);void 0!==s&&(n.dataItems[s].coordinate=[parseFloat(t.longitude),parseFloat(t.latitude)],n.dataItems[s].color=i,n.dataItems[s].rotation=a,n.dataItems[s].pvalue=e,n.dataItems[s].opavalue=r,n.all_labels[s].setCoordinates([parseFloat(t.longitude),parseFloat(t.latitude)]),n.iconCode&&n.iconCode===t.code)&&n.Infolayer.getGeometries().forEach((function(e){e.setCoordinates([parseFloat(t.longitude),parseFloat(t.latitude)])}))}));try{this.point.updatepoints(this.dataItems);for(var a=0;a<this.dataItems.length;a++){var s=new l.Color(this.dataItems[a].color);r[3*a+0]=s.r,r[3*a+1]=s.g,r[3*a+2]=s.b,i[a]=this.dataItems[a].rotation,o[a]=this.dataItems[a].opavalue}this.point.object3d.geometry.attributes.color.needsUpdate=!0,this.point.object3d.geometry.attributes.rotation.needsUpdate=!0,this.point.object3d.geometry.attributes.opavalue.needsUpdate=!0}catch(t){throw t}}}},{key:"changeParaValue",value:function(t,e){var n=this;if(this.point){this.paraName=e||this.paraName;var r=this.point.object3d.geometry.attributes.color.array,i=this.point.object3d.geometry.attributes.fcolor1.array,o=this.point.object3d.geometry.attributes.opavalue.array;t.slice(0,1/0).map((function(t){var e=parseFloat(t.value)||0,r=parseFloat(t.opavalue)?parseFloat(t.opavalue):1,i="#fff";t.imgColor&&t.imgColor.length>=1&&(i=t.imgColor[0]);var o="#fff";t.imgColor&&t.imgColor.length>=2&&(o=t.imgColor[1]);var a=(parseFloat(t.windDirection)||0)+.01,s=(parseFloat(a*(Math.PI/180)),n.findItemByCode(t.code));if(void 0!==s&&(n.dataItems[s].color=i,n.dataItems[s].fcolor1=o,n.dataItems[s].pvalue=e,n.dataItems[s].opavalue=r,n.bzlayerNum)){var u=Pr(e,n.paraName);n.bz_all_nums[s].getProperties().name=e,n.bz_all_nums[s].updateSymbol({textName:"{name}",textFill:u})}}));for(var a=0;a<this.dataItems.length;a++){var s=new l.Color(this.dataItems[a].color);r[3*a+0]=s.r,r[3*a+1]=s.g,r[3*a+2]=s.b;var u=new l.Color(this.dataItems[a].fcolor1);i[3*a+0]=u.r,i[3*a+1]=u.g,i[3*a+2]=u.b,o[a]=this.dataItems[a].opavalue}this.point.object3d.geometry.attributes.color.needsUpdate=!0,this.point.object3d.geometry.attributes.fcolor1.needsUpdate=!0,this.point.object3d.geometry.attributes.opavalue.needsUpdate=!0}}},{key:"dispose",value:function(){this.InforItems.length>0&&this.hideInfoWindows(),this.bzlayerNum&&(this.map.removeLayer(this.bzlayerNum),this.bz_all_nums=[]),this.bound&&delete this.bound,I(E(n.prototype),"dispose",this).call(this)}},{key:"_createShaderPol",value:function(t,e,n,r,i){return t.uniforms.imgdatas={value:n},t.uniforms.texture1={value:e},t.uniforms.textureSize={value:r},t.uniforms.size1={value:i},t.uniforms.flag={value:1},t.vertexShader="uniform float size1;\n attribute float imgflag;\n attribute float rotation;\n attribute vec3 color;\n attribute vec3 fcolor1;\n varying float vimgflag;\n attribute float visibility;\n varying float vVisible;\n varying float vRotation;\n varying vec3 vColor;\n varying vec3 vFcolor;\n attribute float opavalue;\n varying float vOpavalue;\n attribute float colorflag;\n varying float vColorflag;\n attribute float fcolorflag;\n varying float vFcolorflag;\n attribute float imgnum;\n varying float vImgnum;\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <project_vertex>","\n #include <project_vertex>\n vimgflag = imgflag;\n vVisible = visibility;\n vRotation = rotation;\n vColor = color;\n vOpavalue = opavalue;\n vColorflag = colorflag;\n vFcolorflag = fcolorflag;\n vFcolor = fcolor1;\n vImgnum = imgnum;\n ").replace("gl_PointSize = size;","\n gl_PointSize = size1;\n "),t.fragmentShader="struct imgdata {\n float u;\n float v;\n float w;\n float h;\n };\n uniform imgdata imgdatas[".concat(n.length,"];\n uniform sampler2D texture1;\n uniform float textureSize;\n varying float vimgflag;\n varying float vVisible;\n varying float vRotation;\n varying vec3 vColor;\n varying float vOpavalue;\n varying float vColorflag;\n varying float vFcolorflag;\n varying float vImgnum;\n varying vec3 vFcolor;\n uniform int flag;\n ")+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("gl_FragColor = vec4( outgoingLight, diffuseColor.a );","\n highp int index = int(vimgflag);\n float width = gl_PointCoord.x / textureSize * imgdatas[index].w;\n float height = gl_PointCoord.y / textureSize * imgdatas[index].h;\n float x = imgdatas[index].u;\n float y = 1.0 - imgdatas[index].v;\n vec2 uv = vec2(x + width, y - height);\n\n float xx = x + 0.5 / textureSize * imgdatas[index].w;\n float yy = y - 0.5 / textureSize * imgdatas[index].h;\n float angle = 1.0;\n float s = sin(vRotation);\n float c = cos(vRotation);\n mat2 rotationMatrix = mat2( c, s,\n -s, c);\n vec2 pivot = vec2( xx, yy);\n uv = rotationMatrix * (uv - pivot) + pivot;\n\n vec4 rotatedTexture = texture2D( texture1, uv);\n vec4 texColor;\n if (vColorflag > 1.0) {\n texColor = vec4(vColor, vOpavalue) * rotatedTexture;\n } else {\n texColor = rotatedTexture;\n }\n\n if (vImgnum > 1.0 && flag == 1) {\n index += 1;\n width = gl_PointCoord.x / textureSize * imgdatas[index].w;\n height = gl_PointCoord.y / textureSize * imgdatas[index].h;\n x = imgdatas[index].u;\n y = 1.0 - imgdatas[index].v;\n vec4 img = texture2D( texture1, vec2(x + width, y - height) );\n vec4 Ca;\n img.a *= img.r;\n if(vFcolorflag > 1.0){\n Ca = vec4(vFcolor, 1.0) * img;\n }\n else{\n Ca = img;\n }\n //Ca.a *= Ca.r;\n\n\n // 第三种\n /*texColor.xyz *= texColor.a; //premultiply source \n gl_FragColor = mix(texColor, Ca, Ca.a);\n gl_FragColor.rgb /= gl_FragColor.a;*/\n \n vec3 rgb = mix(texColor.xyz * texColor.a, Ca.xyz, Ca.a);\n float a = Ca.a + texColor.a * (1. - Ca.a);\n vec4 dst = vec4(rgb / a, a);\n gl_FragColor = dst;\n\n /*vec3 rgb = mix(texColor.xyz * texColor.a, Ca.rgb, Ca.a);\n float a = Ca.a + texColor.a * (1. - Ca.a);\n vec4 dst = vec4(rgb, a);\n gl_FragColor = dst;*/\n \n // 第一种\n /*vec4 out_Color;\n outgoingLight *= texColor.xyz;\n gl_FragColor = vec4( outgoingLight, texColor.a * diffuseColor.a );\n gl_FragColor = mix(gl_FragColor, Ca, Ca.a);\n gl_FragColor.rgb /= gl_FragColor.a;*/\n \n } else {\n outgoingLight *= texColor.xyz;\n gl_FragColor = vec4( outgoingLight, texColor.a * diffuseColor.a );\n }\n\n if (vVisible < 0.5) discard;\n "),t}}]),n}(Ir),Or=(n("8195"),{interactive:!1,altitude:0,imageWidth:512,imageHeight:512,texture:null}),kr=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n);var u=i=h.Util.extend({},Or,i),c=u.altitude;u.imageHeight,u.imageWidth,t instanceof h.Extent||(t=new h.Extent(t));var f=t,d=f.xmin,p=f.ymin,g=f.xmax,m=f.ymax,v=1/0,y=1/0,_=-1/0,x=-1/0;[[d,p],[d,m],[g,m],[g,p]].forEach((function(t){var e=a.coordinateToVector3(t),n=e.x,r=e.y;v=Math.min(n,v),y=Math.min(r,y),_=Math.max(n,_),x=Math.max(r,x)}));var b=Math.abs(_-v),w=Math.abs(x-y),M=new l.PlaneBufferGeometry(b,w);(s=e.call(this))._initOptions(i),s._createMesh(M,o);var S=a.distanceToVector3(c,c).x,A=a.coordinateToVector3(t.getCenter(),S);return s.getObject3d().position.copy(A),s.parent=null,s.type="Image",s}return o(n)}(ht),Br=function(){function t(e,n,i,o,a){var s=this;r(this,t),this.threelayer=a,this.textureLoader=new l.TextureLoader;var u=e.split(","),c=n.split(","),f=parseFloat(u[0]),d=parseFloat(u[1]),p=parseFloat(c[0]),g=parseFloat(c[1]),m=o.maxZoom||11,v=o.renderOrder||0,y=o.opacity||1,_=o.maxZoom||3,x=new h.Extent(f,d,p,g);this.textureLoader.load(i,(function(t){var e=new l.MeshBasicMaterial({map:t,transparent:!0,opacity:y}),n=new kr(x,{imageWidth:512,imageHeight:512,maxZoom:m,minZoom:_},e,s.threelayer);n.object3d.renderOrder=v,s.imgMesh=n,s.imgMesh.parent=s,s.m=e,s.texture=t,s.threelayer.addMesh(s.imgMesh)}))}return o(t,[{key:"updateImage",value:function(t){var e=this;this.textureLoader.load(t,(function(t){e.texture&&e.texture.dispose(),delete e.texture,t.magFilter=l.NearestFilter,t.minFilter=l.NearestFilter,e.imgMesh.object3d.material.map=t,e.imgMesh.object3d.material.map.needsUpdate=!0,e.texture=t}))}},{key:"clearImage",value:function(){this.imgMesh&&this.threelayer.removeMesh(this.imgMesh)}},{key:"dispose",value:function(){this.threelayer.removeMesh(this.imgMesh),this.imgMesh.object3d.geometry&&this.imgMesh.object3d.geometry.dispose(),this.imgMesh.object3d.material&&(this.imgMesh.object3d.material.dispose(),delete this.m),this.texture&&(this.texture&&this.texture.dispose(),delete this.texture),this.threelayer=null,this.textureLoader&&delete this.textureLoader}}]),t}(),Fr=(n("0132"),n("2b0f"),n("5d56")),Dr={0:.05,1:.05,2:.05,3:.003,4:.003,5:.003,6:.003,7:.003,8:.002,9:.001,10:5e-4,11:3e-4,12:15e-5,13:1e-4,14:5e-5,15:25e-6,16:1e-5,16.99:1e-5,17:5e-6,18:2e-6,19:1e-6,20:5e-7,21:2e-7,22:1e-7},Ur=Object(u.map)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var n=22.5,r=n*e;return{bearing:r,range:[r-n/2,r+n/2],label:t}})),jr=function(t,e,n){return t>=e&&t<n},Nr=function(){function t(e,n,i){var o=this;r(this,t),this.map=i,this.windLayer=this.map.getLayer("windLayer"),this.windLayer?this.windLayer.setData(e):(this.windLayer=new Fr.a("windLayer",e,{windOptions:{colorScale:["rgba(68,162,255,1)","rgba(110,223,255,1)","rgba(142,228,187,1)","rgba(179,253,163,1)","rgba(213,247,176,1)","rgba(255,252,213,1)","rgba(255,238,159,1)","rgba(252,217,125,1)","rgba(255,182,100,1)","rgba(252,150,75,1)","rgba(250,112,52,1)","rgba(245,64,32,1)","rgba(237,45,28,1)","rgba(220,24,32,1)","rgba(180,0,35,1)"],velocityScale:function(){var t=o.map.getZoom();return Dr[parseInt(t)]||1/40},frameRate:16,maxAge:60,globalAlpha:.9,paths:3782}}),this.map.addLayer(this.windLayer)),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}return o(t,[{key:"_bindMapEvents",value:function(){this.map.on("mousemove",this._onWind,this)}},{key:"_closeEvent",value:function(){this.map.off("mousemove",this._onWind,this)}},{key:"_onWind",value:function(t){var e,n=this.windLayer.field.interpolatedValueAt(t.coordinate.x,t.coordinate.y);if(n){var r=this.vectorToDegrees(n.u,n.v,"bearingCCW"),i=this.vectorToSpeed(n.u,n.v,"m/s");this.toolTip._content="".concat(null===(e=function(t){return Object(u.find)(Ur,(function(e){return jr(t,e.range[0],e.range[1])||jr(t-360,e.range[0],e.range[1])}))}(r))||void 0===e?void 0:e.label).concat(this.windLevel(i),"级;速度").concat(i.toFixed(2),"m/s;高度10米")}}},{key:"windLevel",value:function(t){return t<=0?0:t<=.3?1:t<=1.6?2:t<=3.4?3:t<=5.5?4:t<=8?5:t<=10.8?6:t<=13.9?7:t<=17.2?8:t<=20.8?9:t<=24.5?10:t<=28.5?11:12}},{key:"setToolTip",value:function(t,e){this.removeToolTip(),this.toolTip=new h.ui.ToolTip(t,e),this.toolTip.addTo(this.map)}},{key:"removeToolTip",value:function(){var t;this.toolTip&&(null===(t=this.toolTip)||void 0===t||t.remove(),this.toolTip=null)}},{key:"vectorToDegrees",value:function(t,e,n){n.endsWith("CCW")&&(e=e>0?e=-e:Math.abs(e));var r=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i=180*Math.atan2(t/r,e/r)/Math.PI+180;return"bearingCW"!==n&&"meteoCCW"!==n||(i+=180)>=360&&(i-=360),i}},{key:"vectorToSpeed",value:function(t,e,n){var r=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return"k/h"===n?3.6*r:"kt"===n?r/.514:r}},{key:"closeWind",value:function(){this._closeEvent(),this.removeToolTip(),this.map.removeLayer(this.windLayer),delete this.windLayer,this.windLayer=null}}]),t}(),Gr=function(){function t(e,n,i,o){r(this,t),this.map=o.map,this.tlayer=o,this.drawTool=new h.DrawTool({mode:e,symbol:{lineColor:"#E40D56",lineWidth:2,lineDasharray:[5,5],polygonFill:"#E40D56",polygonOpacity:.2}}).addTo(this.map).enable(),this.toolLayer=this.map.getLayer("toolLayer"),this.toolLayer||(this.toolLayer=new h.VectorLayer("toolLayer",{geometryEvents:!1,hitDetect:!1}).addTo(this.map)),this._drawEnd=n,this._bindEvent(),this.geometry=null,this.mode=e,this.type="drawTool",V.setPointEventStatus(o,!1)}return o(t,[{key:"_bindEvent",value:function(){this.drawTool.on("drawend",this.drawEnd,this)}},{key:"_closeEvent",value:function(){this.drawTool.off("drawend",this.drawEnd,this)}},{key:"drawEnd",value:function(t){this.toolLayer&&this.toolLayer.addGeometry(t.geometry),this._drawEnd&&("Circle"===this.mode?this._drawEnd(t.geometry.getCoordinates(),t.geometry.getRadius()):this._drawEnd(t.geometry.getCoordinates())),this.geometry=t.geometry}},{key:"disableTool",value:function(){this.drawTool.disable(),V.setPointEventStatus(this.tlayer,!0)}},{key:"clearGeometry",value:function(){this.toolLayer&&this.toolLayer.clear()}},{key:"setMode",value:function(t,e){V.setPointEventStatus(this.tlayer,!1),this._drawEnd&&delete this._drawEnd,this._drawEnd=e,this.drawTool.setMode(t).enable(),this.mode=t}},{key:"startEdit",value:function(){this.disableTool(),this.geometry&&this.geometry.startEdit()}},{key:"endEdit",value:function(t){this.geometry&&(this.geometry.endEdit(),t&&("Circle"===this.mode?t(this.geometry.getCoordinates(),this.geometry.getRadius()):t(this.geometry.getCoordinates())))}},{key:"dispose",value:function(){this._closeEvent(),this._drawEnd&&delete this._drawEnd,this.geometry&&delete this.geometry,this.map.removeLayer(this.toolLayer),delete this.toolLayer,delete this.drawTool}}]),t}(),zr=function(){function t(e,n){r(this,t),this.tlayer=n,this.map=n.map,this.distanceTool=new h.DistanceTool({symbol:{lineColor:"#34495e",lineWidth:2},vertexSymbol:{markerType:"ellipse",markerFill:"#1bbc9b",markerLineColor:"#000",markerLineWidth:3,markerWidth:10,markerHeight:10},labelOptions:{textSymbol:{textFaceName:"monospace",textFill:"#fff",textLineSpacing:1,textHorizontalAlignment:"right",textDx:15,markerLineColor:"#b4b3b3",markerFill:"#000"},boxStyle:{padding:[6,2],symbol:{markerType:"square",markerFill:"#000",markerFillOpacity:.9,markerLineColor:"#b4b3b3"}}},clearButtonSymbol:[{markerType:"square",markerFill:"#000",markerLineColor:"#b4b3b3",markerLineWidth:2,markerWidth:15,markerHeight:15,markerDx:20},{markerType:"x",markerWidth:10,markerHeight:10,markerLineColor:"#fff",markerDx:20}],language:"zh-CN"}).addTo(this.map),V.setPointEventStatus(n,!1)}return o(t,[{key:"dispose",value:function(){this.distanceTool&&(this.distanceTool.clear(),delete this.distanceTool),this.tlayer=null,this.map=null}},{key:"disable",value:function(){this.distanceTool.disable(),V.setPointEventStatus(this.tlayer,!0)}},{key:"enable",value:function(){V.setPointEventStatus(this.tlayer,!1),this.distanceTool.enable()}},{key:"clear",value:function(){this.distanceTool.clear()}}]),t}(),Hr=n("8b15"),Vr={fontSize:20,altitude:0,color:"#fff",text:"hello",weight:0,zoomFilter:!1},Wr={positionsConvert:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=[],i=0,o=t.length;i<o;i+=3){var a=t[i],s=t[i+1],u=t[i+2];e>0&&(u+=n.distanceToVector3(e,e).x),r.push(new l.Vector3(a,s,u))}return r},vectors2Pixel:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;t[0]instanceof l.Vector3||(t=Wr.positionsConvert(t,r,i));var o=t.map((function(t){return Wr.vector2Pixel(t,e,n)}));return o},vector2Pixel:function(t,e,n){var r=t.project(n),i=e.width/2,o=e.height/2;return{x:Math.round(r.x*i+i),y:Math.round(-r.y*o+o)}}},Zr=function(t){P(n,t);var e=F(n);function n(t,i,o){var a;r(this,n),i=h.Util.extend({},Vr,i,{layer:o,position:t}),(a=e.call(this))._initOptions(i);var s=i,u=(s.altitude,s.fontSize),c=s.color,f=s.text,d=s.rotation,p=d*(Math.PI/180);a._createGroup();var g=new Hr.SpriteText2D(f,{align:Hr.textAlign.center,font:"".concat(2*u,"px Arial"),fillStyle:c,antialias:!1});g.children[0].material.sizeAttenuation=!1,g.children[0].material.rotation=p;var m=.001/3;return g.scale.set(m,m,m),a.getObject3d().add(g),a.getObject3d().name=d,a.getObject3d().position.copy(t),a.textRect={width:a.calTextWidth(f,u)+3*u,height:u+3*u},a._vector=new l.Vector3,a._pixel={x:0,y:0},a}return o(n,[{key:"getTextRect",value:function(){this.getPixel();var t=this._pixel,e=t.x,n=t.y,r=this.textRect,i=r.width,o=r.height;return{minX:e-i/2,minY:n-o/2,maxX:e+i/2,maxY:n+o/2}}},{key:"calTextWidth",value:function(t,e){var n=(t.match(/[\u4e00-\u9fa5]/g)||"").length;return n*e+.5*(t.length-n)*e}},{key:"getPixel",value:function(){var t=this.getMap().getSize(),e=this.getLayer().getCamera(),n=this.getObject3d().position;this._vector.x=n.x,this._vector.y=n.y,this._vector.z=n.z,this._pixel=Wr.vector2Pixel(this._vector,t,e)}},{key:"identify",value:function(t){var e=this.getTextRect(),n=e.minX,r=e.minY,i=e.maxX,o=e.maxY,a=this.getMap().coordToContainerPoint(t);return a.x>=n&&a.x<=i&&a.y>=r&&a.y<=o}}]),n}(ht),Qr={radius:100,altitude:0},Xr=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},Qr,i,{layer:a,coordinate:t}),(s=e.call(this))._initOptions(i);var u=i,c=u.altitude,f=u.radius,d=a.distanceToVector3(f,f).x,p=new l.CircleBufferGeometry(d,128,0,90*Math.PI/180);s._createMesh(p,o);var g=a.distanceToVector3(c,c).x,m=a.coordinateToVector3(t,g);return s.getObject3d().position.copy(m),s}return o(n)}(ht),Yr=function(){function t(e,n,i,o,a){var s=this;r(this,t),this.threelayer=a,this.map=a.map,this.all_cirles=[],this.rItems={},this.all_texts={},this.all_sectors={},this.textSprites=[],this.rbush=new Tr.a,this.material=new l.MeshBasicMaterial({color:"#233F75",transparent:!0,opacity:.5,depthTest:!1}),this.vector_circle_layer=this.map.getLayer("vector_circle"),this.vector_circle_layer||(this.vector_circle_layer=new h.VectorLayer("vector_circle",{geometryEvents:!1,hitDetect:!1}).addTo(a.map)),this.sector=null;for(var u=this.threelayer.coordinateToVector3([e,n],0),c=(new l.Matrix4).makeTranslation(u.x,u.y,u.z),f=1e3;f<=1e4;f+=1e3){this.createLine([e,n],f);var d=this.threelayer.distanceToVector3(f,f).x;this.rItems[f]=d,this.all_texts[f]=[]}for(var p=this.vector_circle_layer.getGeometries(),g=0;g<p.length;g++)this.all_cirles.push(p[g]);for(var m=3;m<=360;){for(var v in this.rItems){var y=this.createLabel("".concat(v/1e3,"km"),m,this.rItems[v],c,5,a);this.all_texts[v].push(y)}m+=24}var _=this.createParty(e,n,3e3);this.all_sectors[3e3]=_;var x=this.createParty(e,n,5e3);this.all_sectors[5e3]=x;var b=this.createParty(e,n,1e4);this.all_sectors[1e4]=b,this.vector_circle_layer.clear();for(var w=i/1e3,M=void 0,S=0;S<w;S++){var A=this.all_texts[1e3*(S+1)];A&&A.forEach((function(t){s.textSprites.push(t)})),this.vector_circle_layer.addGeometry(this.all_cirles[S]),S===w-1&&(M=this.all_cirles[S])}if(this.vector_circle_layer.options.visible=!0,this.threelayer.addMesh(this.textSprites),o.rotation){var C=this.all_sectors[i],E=this.calDirection(o.rotation);C.object3d.rotation.z=E*Math.PI/180,this.threelayer.addMesh(C),this.sector=C}this.collides(),this._bindEvent(),o.callback&&o.callback(M)}return o(t,[{key:"update",value:function(t,e,n,r){var i=this;this._closeEvent();var o=this.threelayer.coordinateToVector3([t,e],0),a=(new l.Matrix4).makeTranslation(o.x,o.y,o.z);this.all_cirles.forEach((function(n){n.setCoordinates([t,e])}));for(var s=3,u=0;s<=360;){for(var c in this.rItems){var h=this.getPsVec(s,this.rItems[c],a);this.all_texts[c][u].object3d.position.copy(h)}s+=24,u+=1}for(var f in this.all_sectors)this.all_sectors[f].object3d.position.copy(o);this.threelayer.removeMesh(this.textSprites),this.textSprites=[],this.vector_circle_layer.clear(),this.threelayer.removeMesh(this.sector);for(var d=n/1e3,p=void 0,g=0;g<d;g++){var m=this.all_texts[1e3*(g+1)];m&&m.forEach((function(t){i.textSprites.push(t)})),this.vector_circle_layer.addGeometry(this.all_cirles[g]),g===d-1&&(p=this.all_cirles[g])}if(this.vector_circle_layer.show(),this.threelayer.addMesh(this.textSprites),r.rotation){var v=this.all_sectors[n],y=this.calDirection(r.rotation);v.object3d.rotation.z=y*Math.PI/180,this.threelayer.addMesh(v),this.sector=v}this.collides(),this._bindEvent(),r.callback&&r.callback(p)}},{key:"_bindEvent",value:function(){this.map.on("zooming zoomend moveend animateend",this.circleTextOn,this),this.map.on("rotate",this.circleTextRotationOn,this)}},{key:"_closeEvent",value:function(){this.map.off("zooming zoomend moveend animateend",this.circleTextOn,this),this.map.off("rotate",this.circleTextRotationOn,this)}},{key:"circleTextOn",value:function(){this.textSprites.sort((function(t,e){return e.getOptions().weight-t.getOptions().weight})),this.collides()}},{key:"circleTextRotationOn",value:function(){for(var t=0;t<this.textSprites.length;t++)this.textSprites[t].object3d.children[0].material.rotation=(parseFloat(this.textSprites[t].object3d.name)+this.map.getBearing())*(Math.PI/180);this.textSprites.sort((function(t,e){return e.getOptions().weight-t.getOptions().weight})),this.collides()}},{key:"dispose",value:function(){for(var t in this._closeEvent(),this.all_cirles=[],this.rItems)delete this.rItems[t];for(var e in this.threelayer.removeMesh(this.textSprites),this.rbush.clear(),delete this.rbush,this.textSprites=[],this.all_texts)this.all_texts[e].forEach((function(t){t.object3d.children[0].sprite&&t.object3d.children[0].sprite.geometry&&t.object3d.children[0].sprite.geometry.dispose(),t.object3d.children[0].material&&t.object3d.children[0].material.dispose(),t.object3d.children[0].texture&&t.object3d.children[0].texture.dispose()})),delete this.all_texts[e];for(var n in this.sector=null,this.all_sectors){var r=this.all_sectors[n];r.object3d.geometry&&r.object3d.geometry.dispose(),delete this.all_sectors[n]}this.material&&this.material.dispose(),this.map.removeLayer(this.vector_circle_layer)}},{key:"createLine",value:function(t,e){1e3===e?new h.Circle(t,e,{symbol:{lineColor:"#1bbc9b",lineWidth:1,lineOpacity:1,polygonFill:"#1bbc9b",polygonOpacity:0}}).addTo(this.vector_circle_layer):new h.Circle(t,e,{symbol:{lineColor:"#1bbc9b",lineWidth:1,lineDasharray:[5,5,5],lineOpacity:1,polygonFill:"#1bbc9b",polygonOpacity:0}}).addTo(this.vector_circle_layer)}},{key:"createParty",value:function(t,e,n){return new Xr([t,e],{radius:n,interactive:!1},this.material,this.threelayer)}},{key:"createLabel",value:function(t,e,n,r,i,o){var a=this.getArrowPs(e,1),s=this.getPsVec(e,n,r),u=new Zr(s,{text:t,color:"white",fontSize:18,weight:i,interactive:!1,rotation:a.rotation,minZoom:11},o);return u.object3d.renderOrder=3,u}},{key:"collides",value:function(){this.rbush.clear();for(var t=0,e=this.textSprites.length;t<e;t++){var n=this.textSprites[t],r=n.getTextRect();this.rbush.collides(r)?n.hide():(n.show(),this.rbush.insert(r))}}},{key:"getPsVec",value:function(t,e,n){var r=t*(Math.PI/180),i=new l.Vector3(Math.sin(r)*e,Math.cos(r)*e,0);return i=i.applyMatrix4(n)}},{key:"calDirection",value:function(t){return t<=22.5&&t>337.5?45:t<=67.5&&t>22.5?0:t<=112.5&&t>67.5?315:t<=157.5&&t>112.5?270:t<=202.5&&t>157.5?225:t<=247.5&&t>202.5?180:t<=292.5&&t>247.5?135:t<=337.5&&t>292.5?90:0}},{key:"getArrowPs",value:function(t,e){var n=0;return t<=90?n=-t:t>90&&t<=180||t>180&&t<=270?n=180-t:t>270&&t<360&&(n=360-t),{rotation:n}}}]),t}(),Jr={altitude:0,height:0},qr=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),t=h.Util.extend({},Jr,t,{layer:a}),s=e.call(this);var u=t;return u.width,u.height,u.altitude,s._initOptions(t),s._createMesh(i,o),s}return o(n)}(ht),Kr={computeTangents:function(t){t.computeTangents(),console.warn("THREE.BufferGeometryUtils: .computeTangents() has been removed. Use BufferGeometry.computeTangents() instead.")},mergeBufferGeometries:function(t,e){for(var n=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),o={},a={},s=t[0].morphTargetsRelative,u=new l.BufferGeometry,c=0,h=0;h<t.length;++h){var f=t[h],d=0;if(n!==(null!==f.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var p in f.attributes){if(!r.has(p))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+p+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[p]&&(o[p]=[]),o[p].push(f.attributes[p]),d++}if(d!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(s!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var p in f.morphAttributes){if(!i.has(p))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[p]&&(a[p]=[]),a[p].push(f.morphAttributes[p])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(f.userData),e){var g;if(n)g=f.index.count;else{if(void 0===f.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;g=f.attributes.position.count}u.addGroup(c,g,h),c+=g}}if(n){var m=0,v=[];for(h=0;h<t.length;++h){for(var y=t[h].index,_=0;_<y.count;++_)v.push(y.getX(_)+m);m+=t[h].attributes.position.count}u.setIndex(v)}for(var p in o){var x=this.mergeBufferAttributes(o[p]);if(!x)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+p+" attribute."),null;u.setAttribute(p,x)}for(var p in a){var b=a[p][0].length;if(0===b)break;for(u.morphAttributes=u.morphAttributes||{},u.morphAttributes[p]=[],h=0;h<b;++h){var w=[];for(_=0;_<a[p].length;++_)w.push(a[p][_][h]);var M=this.mergeBufferAttributes(w);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+p+" morphAttribute."),null;u.morphAttributes[p].push(M)}}return u},mergeBufferAttributes:function(t){for(var e,n,r,i=0,o=0;o<t.length;++o){var a=t[o];if(a.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=a.array.length}var s=new e(i),u=0;for(o=0;o<t.length;++o)s.set(t[o].array,u),u+=t[o].array.length;return new l.BufferAttribute(s,n,r)},interleaveAttributes:function(t){for(var e,n=0,r=0,i=0,o=t.length;i<o;++i){var a=t[i];if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=a.array.length,r+=a.itemSize}var s=new l.InterleavedBuffer(new e(n),r),u=0,c=[],h=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],d=0;for(o=t.length;d<o;d++){var p=(a=t[d]).itemSize,g=a.count,m=new l.InterleavedBufferAttribute(s,p,u,a.normalized);c.push(m),u+=p;for(var v=0;v<g;v++)for(var y=0;y<p;y++)m[f[y]](v,a[h[y]](v))}return c},estimateBytesUsed:function(t){var e=0;for(var n in t.attributes){var r=t.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=t.getIndex();return e+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);for(var n={},r=t.getIndex(),i=t.getAttribute("position"),o=r?r.count:i.count,a=0,s=Object.keys(t.attributes),u={},c={},h=[],f=["getX","getY","getZ","getW"],d=0,p=s.length;d<p;d++){var g=s[d];u[g]=[];var m=t.morphAttributes[g];m&&(c[g]=new Array(m.length).fill().map(()=>[]))}var v=Math.log10(1/e),y=Math.pow(10,v);for(d=0;d<o;d++){var _=r?r.getX(d):d,x="",b=0;for(p=s.length;b<p;b++){g=s[b];for(var w=t.getAttribute(g),M=w.itemSize,S=0;S<M;S++)x+=~~(w[f[S]](_)*y)+","}if(x in n)h.push(n[x]);else{for(b=0,p=s.length;b<p;b++){g=s[b],w=t.getAttribute(g),m=t.morphAttributes[g],M=w.itemSize;var A=u[g],C=c[g];for(S=0;S<M;S++){var E=f[S];if(A.push(w[E](_)),m)for(var T=0,I=m.length;T<I;T++)C[T].push(m[T][E](_))}}n[x]=a,h.push(a),a++}}const L=t.clone();for(d=0,p=s.length;d<p;d++){g=s[d];var P=t.getAttribute(g),R=new P.array.constructor(u[g]);if(w=new l.BufferAttribute(R,P.itemSize,P.normalized),L.setAttribute(g,w),g in c)for(b=0;b<c[g].length;b++){var O=t.morphAttributes[g][b],k=(R=new O.array.constructor(c[g][b]),new l.BufferAttribute(R,O.itemSize,O.normalized));L.morphAttributes[g][b]=k}}return L.setIndex(h),L},toTrianglesDrawMode:function(t,e){if(e===l.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===l.TriangleFanDrawMode||e===l.TriangleStripDrawMode){var n=t.getIndex();if(null===n){var r=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<i.count;o++)r.push(o);t.setIndex(r),n=t.getIndex()}var a=n.count-2,s=[];if(e===l.TriangleFanDrawMode)for(o=1;o<=a;o++)s.push(n.getX(0)),s.push(n.getX(o)),s.push(n.getX(o+1));else for(o=0;o<a;o++)o%2==0?(s.push(n.getX(o)),s.push(n.getX(o+1)),s.push(n.getX(o+2))):(s.push(n.getX(o+2)),s.push(n.getX(o+1)),s.push(n.getX(o)));s.length/3!==a&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(s),u.clearGroups(),u}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t},computeMorphedAttributes:function(t){if(!0!==t.geometry.isBufferGeometry)return console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry."),null;var e=new l.Vector3,n=new l.Vector3,r=new l.Vector3,i=new l.Vector3,o=new l.Vector3,a=new l.Vector3,s=new l.Vector3,u=new l.Vector3,c=new l.Vector3;function h(t,l,h,f,d,p,g,m,v){e.fromBufferAttribute(h,p),n.fromBufferAttribute(h,g),r.fromBufferAttribute(h,m);var y=t.morphTargetInfluences;if(l.morphTargets&&f&&y){s.set(0,0,0),u.set(0,0,0),c.set(0,0,0);for(var _=0,x=f.length;_<x;_++){var b=y[_],w=f[_];0!==b&&(i.fromBufferAttribute(w,p),o.fromBufferAttribute(w,g),a.fromBufferAttribute(w,m),d?(s.addScaledVector(i,b),u.addScaledVector(o,b),c.addScaledVector(a,b)):(s.addScaledVector(i.sub(e),b),u.addScaledVector(o.sub(n),b),c.addScaledVector(a.sub(r),b)))}e.add(s),n.add(u),r.add(c)}t.isSkinnedMesh&&(t.boneTransform(p,e),t.boneTransform(g,n),t.boneTransform(m,r)),v[3*p+0]=e.x,v[3*p+1]=e.y,v[3*p+2]=e.z,v[3*g+0]=n.x,v[3*g+1]=n.y,v[3*g+2]=n.z,v[3*m+0]=r.x,v[3*m+1]=r.y,v[3*m+2]=r.z}var f,d,p,g,m,v,y,_,x,b=t.geometry,w=t.material,M=b.index,S=b.attributes.position,A=b.morphAttributes.position,C=b.morphTargetsRelative,E=b.attributes.normal,T=b.morphAttributes.position,I=b.groups,L=b.drawRange,P=new Float32Array(S.count*S.itemSize),R=new Float32Array(E.count*E.itemSize);if(null!==M)if(Array.isArray(w))for(g=0,v=I.length;g<v;g++)for(x=w[(_=I[g]).materialIndex],m=Math.max(_.start,L.start),y=Math.min(_.start+_.count,L.start+L.count);m<y;m+=3)h(t,x,S,A,C,f=M.getX(m),d=M.getX(m+1),p=M.getX(m+2),P),h(t,x,E,T,C,f,d,p,R);else for(g=Math.max(0,L.start),v=Math.min(M.count,L.start+L.count);g<v;g+=3)h(t,w,S,A,C,f=M.getX(g),d=M.getX(g+1),p=M.getX(g+2),P),h(t,w,E,T,C,f,d,p,R);else if(void 0!==S)if(Array.isArray(w))for(g=0,v=I.length;g<v;g++)for(x=w[(_=I[g]).materialIndex],m=Math.max(_.start,L.start),y=Math.min(_.start+_.count,L.start+L.count);m<y;m+=3)h(t,x,S,A,C,f=m,d=m+1,p=m+2,P),h(t,x,E,T,C,f,d,p,R);else for(g=Math.max(0,L.start),v=Math.min(S.count,L.start+L.count);g<v;g+=3)h(t,w,S,A,C,f=g,d=g+1,p=g+2,P),h(t,w,E,T,C,f,d,p,R);return{positionAttribute:S,normalAttribute:E,morphedPositionAttribute:new l.Float32BufferAttribute(P,3),morphedNormalAttribute:new l.Float32BufferAttribute(R,3)}}},$r=n("faa4"),ti=function(){function t(e,n,i){var o=this;r(this,t);var a=n.width||64,s=e.length>100?100:e.length,u=new l.PlaneBufferGeometry(a,a);this.texture=this._createBackGround(a),this.radius=a/3;var c,h=new l.MeshStandardMaterial({map:this.texture}),f=[];this.impacts=[],this.tweens=[],e.slice(0,s).map((function(t){var e=u.clone(),n=i.coordinateToVector3(t,0),r=(new l.Matrix4).makeTranslation(n.x,n.y,n.z);e.applyMatrix4(r),f.push(e),o.impacts.push({impactPosition:new l.Vector3(0,0,0).applyMatrix4(r),impactMaxRadius:o.radius,impactRatio:1})})),h.onBeforeCompile=function(t){t.uniforms.impacts={value:o.impacts},t.uniforms.impactRadius={value:a/2},t.vertexShader="varying vec3 vPosition;\n"+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <worldpos_vertex>","#include <worldpos_vertex>\n vPosition = transformed.xyz;"),t.fragmentShader="struct impact {\n vec3 impactPosition;\n float impactMaxRadius;\n float impactRatio;\n };\n uniform impact impacts[".concat(s,"];\n uniform float impactRadius;\n varying vec3 vPosition;\n ")+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("#include <dithering_fragment>","#include <dithering_fragment>\n float finalStep = 0.0;\n for (int i = 0; i < ".concat(s,";i++){\n \n float dist = distance(vPosition, impacts[i].impactPosition);\n //float curRadius = impacts[i].impactMaxRadius * impacts[i].impactRatio;\n float curRadius = impactRadius * impacts[i].impactRatio;\n float sstep = smoothstep(0., curRadius, dist) - smoothstep(curRadius - ( 0.25 * impacts[i].impactRatio ), curRadius, dist);\n sstep *= 1. - impacts[i].impactRatio;\n finalStep += sstep;\n\n }\n finalStep = 1. - clamp(finalStep, 0., 1.);\n\n //vec3 col = mix(vec3(1., 0.5, 0.0625), vec3(1.,0.125, 0.0625), finalStep);\n vec3 col = mix(vec3(1.,0., 0.), vec3(1.,0., 0.), finalStep);\n gl_FragColor = vec4( mix( col, gl_FragColor.rgb, finalStep), diffuseColor.a );")),c=t,o.materialShader=t};var d=Kr.mergeBufferGeometries(f),p=new qr({interactive:!1},d,h,i);i.addMesh(p),this.map=i.map,this.curscale=this.map.getScale();for(var g=this,m=function(t){o.tweens.push({runTween:function(){new $r.a({value:0}).to({value:1},l.Math.randInt(2500,5e3)).delay(l.Math.randInt(500,2e3)).onUpdate((function(e){c&&c.uniforms.impacts.value[t]&&(c.uniforms.impacts.value[t].impactRatio=e.value)})).onComplete((function(){var e;null===(e=g.tweens[t])||void 0===e||e.runTween()})).start()}})},v=0;v<s;v++)m(v);this.tweens.forEach((function(t){t.runTween()})),this.width=a,this.shockMeshs=p,this.threelayer=i,this.points=e,this._geom=u,this._bindMapEvents()}return o(t,[{key:"_bindMapEvents",value:function(){this.map&&this.map.on("zooming zoomend",this._setSizeOn,this)}},{key:"_closeEvent",value:function(){this.map&&this.map.off("zooming zoomend",this._setSizeOn,this)}},{key:"_setSizeOn",value:function(){if(this.materialShader){var t=this.map.getScale()/this.curscale;t=(t=t>1?1:t)<.5?.5:t,this.materialShader.uniforms.impactRadius.value=this.radius*t}}},{key:"_createBackGround",value:function(t){var e=document.createElement("canvas");e.width=e.height=t;var n=e.getContext("2d");n.globalCompositeOperation,n.globalAlpha=0,n.fillRect(0,0,e.width,e.height);var r=new l.Texture(e);return r.needsUpdate=!0,r}},{key:"hide",value:function(){this.shockMeshs&&this.threelayer.removeMesh(this.shockMeshs)}},{key:"show",value:function(){this.shockMeshs&&this.threelayer.addMesh(this.shockMeshs)}},{key:"dispose",value:function(){if(this.shockMeshs&&(this.threelayer.removeMesh(this.shockMeshs),this.shockMeshs.object3d.geometry&&this.shockMeshs.object3d.geometry.dispose(),delete this.shockMeshs,this.texture&&this.texture.dispose(),this.material&&(this.material.dispose(),delete this.material)),this.tweens.length>0){for(var t=0;t<this.tweens.length;t++)delete this.tweens[t];this.tweens=[]}if(this.impacts.length>0){for(var e=0;e<this.impacts.length;e++)delete this.impacts[e];this.impacts=[]}this._geom&&(this._geom.dispose(),delete this._geom),this._closeEvent(),this.points=[],this.materialShader&&delete this.materialShader,this.map=null}}]),t}();l.UniformsLib.line={linewidth:{value:1},resolution:{value:new l.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},l.ShaderLib.line={uniforms:l.UniformsUtils.merge([l.UniformsLib.common,l.UniformsLib.fog,l.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\tfloat a = vUv.x;\n\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\tfloat len2 = a * a + b * b;\n\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t}\n\n\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};var ei=function(t){l.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:l.UniformsUtils.clone(l.ShaderLib.line.uniforms),vertexShader:l.ShaderLib.line.vertexShader,fragmentShader:l.ShaderLib.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)};(ei.prototype=Object.create(l.ShaderMaterial.prototype)).constructor=ei,ei.prototype.isLineMaterial=!0;var ni=function(){l.InstancedBufferGeometry.call(this),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new l.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new l.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))};ni.prototype=Object.assign(Object.create(l.InstancedBufferGeometry.prototype),{constructor:ni,isLineSegmentsGeometry:!0,applyMatrix4:function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},setPositions:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new l.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new l.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new l.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new l.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new l.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new l.InterleavedBufferAttribute(n,3,3)),this},fromWireframeGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromEdgesGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromMesh:function(t){return this.fromWireframeGeometry(new l.WireframeGeometry(t.geometry)),this},fromLineSegments:function(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")},computeBoundingBox:function(){var t=new l.Box3;return function(){null===this.boundingBox&&(this.boundingBox=new l.Box3);var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==e&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(e),t.setFromBufferAttribute(n),this.boundingBox.union(t))}}(),computeBoundingSphere:function(){var t=new l.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new l.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==e&&void 0!==n){var r=this.boundingSphere.center;this.boundingBox.getCenter(r);for(var i=0,o=0,a=e.count;o<a;o++)t.fromBufferAttribute(e,o),i=Math.max(i,r.distanceToSquared(t)),t.fromBufferAttribute(n,o),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}}(),toJSON:function(){},applyMatrix:function(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}});var ri=function(){ni.call(this),this.type="LineGeometry"};ri.prototype=Object.assign(Object.create(ni.prototype),{constructor:ri,isLineGeometry:!0,setPositions:function(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return ni.prototype.setPositions.call(this,n),this},setColors:function(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return ni.prototype.setColors.call(this,n),this},fromLine:function(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")},copy:function(){return this}});var ii={altitude:0,height:0},oi=function(t){P(n,t);var e=F(n);function n(t,i,o){var a;r(this,n),t=h.Util.extend({},ii,t,{layer:o}),a=e.call(this);var s=t,u=s.width,c=s.height;s.altitude,a._initOptions(t);var f=new l.PlaneBufferGeometry(u,c);return a._createMesh(f,i),a}return o(n)}(ht),ai=function(t,e){void 0===t&&(t=new ni),void 0===e&&(e=new ei({color:16777215*Math.random()})),l.Mesh.call(this,t,e),this.type="LineSegments2"};ai.prototype=Object.assign(Object.create(l.Mesh.prototype),{constructor:ai,isLineSegments2:!0,computeLineDistances:function(){var t=new l.Vector3,e=new l.Vector3;return function(){for(var n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd,o=new Float32Array(2*r.count),a=0,s=0,u=r.count;a<u;a++,s+=2)t.fromBufferAttribute(r,a),e.fromBufferAttribute(i,a),o[s]=0===s?0:o[s-1],o[s+1]=o[s]+t.distanceTo(e);var c=new l.InstancedInterleavedBuffer(o,2,1);return n.setAttribute("instanceDistanceStart",new l.InterleavedBufferAttribute(c,1,0)),n.setAttribute("instanceDistanceEnd",new l.InterleavedBufferAttribute(c,1,1)),this}}(),raycast:function(){var t=new l.Vector4,e=new l.Vector4,n=new l.Vector4,r=new l.Vector3,i=new l.Matrix4,o=new l.Line3,a=new l.Vector3,s=new l.Box3,u=new l.Sphere,c=new l.Vector4;return function(h,f){null===h.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var d=void 0!==h.params.Line2&&h.params.Line2.threshold||0,p=h.ray,g=h.camera,m=g.projectionMatrix,v=this.matrixWorld,y=this.geometry,_=this.material,x=_.resolution,b=_.linewidth+d,w=y.attributes.instanceStart,M=y.attributes.instanceEnd,S=-g.near,A=2*Math.max(b/x.width,b/x.height);null===y.boundingSphere&&y.computeBoundingSphere(),u.copy(y.boundingSphere).applyMatrix4(v);var C=Math.max(g.near,u.distanceToPoint(p.origin));c.set(0,0,-C,1).applyMatrix4(g.projectionMatrix),c.multiplyScalar(1/c.w),c.applyMatrix4(g.projectionMatrixInverse);var E=.5*Math.abs(A/c.w);if(u.radius+=E,!1!==h.ray.intersectsSphere(u)){null===y.boundingBox&&y.computeBoundingBox(),s.copy(y.boundingBox).applyMatrix4(v);var T=Math.max(g.near,s.distanceToPoint(p.origin));c.set(0,0,-T,1).applyMatrix4(g.projectionMatrix),c.multiplyScalar(1/c.w),c.applyMatrix4(g.projectionMatrixInverse);var I=.5*Math.abs(A/c.w);if(s.max.x+=I,s.max.y+=I,s.max.z+=I,s.min.x-=I,s.min.y-=I,s.min.z-=I,!1!==h.ray.intersectsBox(s)){p.at(1,n),n.w=1,n.applyMatrix4(g.matrixWorldInverse),n.applyMatrix4(m),n.multiplyScalar(1/n.w),n.x*=x.x/2,n.y*=x.y/2,n.z=0,r.copy(n),i.multiplyMatrices(g.matrixWorldInverse,v);for(var L=0,P=w.count;L<P;L++)if(t.fromBufferAttribute(w,L),e.fromBufferAttribute(M,L),t.w=1,e.w=1,t.applyMatrix4(i),e.applyMatrix4(i),!(t.z>S&&e.z>S)){if(t.z>S){const n=t.z-e.z,r=(t.z-S)/n;t.lerp(e,r)}else if(e.z>S){const n=e.z-t.z,r=(e.z-S)/n;e.lerp(t,r)}t.applyMatrix4(m),e.applyMatrix4(m),t.multiplyScalar(1/t.w),e.multiplyScalar(1/e.w),t.x*=x.x/2,t.y*=x.y/2,e.x*=x.x/2,e.y*=x.y/2,o.start.copy(t),o.start.z=0,o.end.copy(e),o.end.z=0;var R=o.closestPointToPointParameter(r,!0);o.at(R,a);var O=l.MathUtils.lerp(t.z,e.z,R),k=O>=-1&&O<=1,B=r.distanceTo(a)<.5*b;if(k&&B){o.start.fromBufferAttribute(w,L),o.end.fromBufferAttribute(M,L),o.start.applyMatrix4(v),o.end.applyMatrix4(v);var F=new l.Vector3,D=new l.Vector3;p.distanceSqToSegment(o.start,o.end,D,F),f.push({point:D,pointOnLine:F,distance:p.origin.distanceTo(D),object:this,face:null,faceIndex:L,uv:null,uv2:null})}}}}}}()});var si=function(t,e){void 0===t&&(t=new ri),void 0===e&&(e=new ei({color:16777215*Math.random()})),ai.call(this,t,e),this.type="Line2"};si.prototype=Object.assign(Object.create(ai.prototype),{constructor:si,isLine2:!0});var ui={radius:100,altitude:0},ci=function(t){P(n,t);var e=F(n);function n(t,i,o,a,s){var u;r(this,n),i=h.Util.extend({},ui,i,{layer:s,coordinate:t}),(u=e.call(this))._initOptions(i);var c=i.altitude;u.object3d=new si(o,a),u.object3d.computeLineDistances(),u.object3d.scale.set(1,1,1),u.object3d.__parent=k(u);var l=s.distanceToVector3(c,c).x,f=s.coordinateToVector3(t,l);return u.getObject3d().position.copy(f),u}return o(n)}(ht),li={radius:100,altitude:0},hi=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},li,i,{layer:a,coordinate:t}),(s=e.call(this))._initOptions(i);var u=i,c=u.altitude,f=u.inradius,d=u.outradius,p=u.start,g=a.distanceToVector3(f,f).x,m=a.distanceToVector3(d,d).x,v=new l.RingBufferGeometry(g,m,14,1,p*Math.PI/180,45*Math.PI/180);s._createMesh(v,o);var y=a.distanceToVector3(c,c).x,_=a.coordinateToVector3(t,y);return s.getObject3d().position.copy(_),s}return o(n)}(ht),fi={radius:100,altitude:0},di=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},fi,i,{layer:a,coordinate:t}),(s=e.call(this))._initOptions(i);var u=i,c=u.altitude,f=u.radius,d=u.start,p=a.distanceToVector3(f,f).x,g=new l.CircleBufferGeometry(p,128,d*Math.PI/180,45*Math.PI/180);s._createMesh(g,o);var m=a.distanceToVector3(c,c).x,v=a.coordinateToVector3(t,m);return s.getObject3d().position.copy(v),s}return o(n)}(ht),pi=function(){function t(e,n,i,o){r(this,t),this.tlayer=o,this.map=o.map;var a=o.coordinateToVector3(e,0),s=i.maxdis||15e3,u=i.middis||1e4,c=i.mindis||5e3,f=s/2e3,d=i.fontsize||80,p=4*f,g=1*f,m=o.distanceToVector3(s,s).x,v=o.distanceToVector3(u,u).x,y=o.distanceToVector3(c,c).x,_=(new l.Matrix4).makeTranslation(a.x,a.y,a.z);this.matLine=new ei({color:i.color||4227327,linewidth:i.lineWidth||.002,dashed:!1,transparent:!0}),this.matLine.uniforms.opacity.value=i.opacity||.65,this.meshitems=[],this.textures=[],this.lineItems=[],this.psItems=[];var x={type:"label",x_offset:0,y_offset:g,name:"N",degree:0};this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:g,y_offset:g,name:"EN",degree:45},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:g,y_offset:0,name:"E",degree:90},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:g,y_offset:-g,name:"ES",degree:135},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:0,y_offset:-g,name:"S",degree:180},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:-g,y_offset:-g,name:"WS",degree:225},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:-g,y_offset:0,name:"W",degree:270},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:-g,y_offset:g,name:"WN",degree:315},this.createLabelNew(m,d,p,_,x),this.createCircle(m,e),this.createCircle(v,e),this.createCircle(y,e);for(var b=0;b<360;b+=45)this.lineItems.push({x1:0*Math.sin(Math.PI/180*0),y1:0*Math.cos(Math.PI/180*0),z1:0,x2:Math.sin(b*(Math.PI/180))*m,y2:Math.cos(b*(Math.PI/180))*m,z2:0});this.createLine(e);for(var w=0;w<n.length;w++)-1!=n[w].name.indexOf("A")?this.createMinPoly(c,e,n[w].color,this.getDegree(n[w].name),Object.assign(n[w],{type:"poly"})):-1!=n[w].name.indexOf("B")?this.createRing(c,u,e,n[w].color,this.getDegree(n[w].name),Object.assign(n[w],{type:"poly"})):-1!=n[w].name.indexOf("C")&&this.createRing(u,s,e,n[w].color,this.getDegree(n[w].name),Object.assign(n[w],{type:"poly"}));if(o.addMesh(this.meshitems),this.callback=i.callback,this.callback){var M={custom:!0,dy:i.dy||-48,content:"",autoOpenOn:null};this.infoWindow=new h.ui.InfoWindow(M).addTo(this.map)}this._translation=_}return o(t,[{key:"dispose",value:function(){var t=this;if(this.infoWindow&&(this.infoWindow.remove(),delete this.infoWindow),this.meshitems){this.tlayer.removeMesh(this.meshitems),this.meshitems.forEach((function(e){var n=e.getProperties();n&&"poly"===n.type&&t.closeClick(e),n&&e.getProperties()})),this.textures.length>0&&(this.textures.forEach((function(t){t.dispose()})),this.textures=[]),this.meshitems.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()}));for(var e=0;e<this.lineItems.length;e++)delete this.lineItems[e];this.lineItems=[];for(var n=0;n<this.psItems.length;n++)delete this.psItems[n];this.psItems=[]}delete this._translation}},{key:"createMinPoly",value:function(t,e,n,r,i){var o=new l.MeshBasicMaterial({color:n,transparent:!0,opacity:.5,depthTest:!1}),a=new di(e,{radius:t,start:r},o,this.tlayer);a.setProperties(i),this.attachClick(a),this.meshitems.push(a)}},{key:"createRing",value:function(t,e,n,r,i,o){var a=new l.MeshBasicMaterial({color:r,transparent:!0,opacity:.5,depthTest:!1}),s=new hi(n,{inradius:t,outradius:e,start:i},a,this.tlayer);s.setProperties(o),this.meshitems.push(s),this.attachClick(s)}},{key:"closeClick",value:function(t){t.off("click",this._setItemEvent,this)}},{key:"attachClick",value:function(t){t.on("click",this._setItemEvent,this)}},{key:"_setItemEvent",value:function(){var t=s(regeneratorRuntime.mark((function t(e){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callback){t.next=5;break}return n=e.target.getProperties(),t.next=4,this.callback(this.infoWindow,n);case 4:this.infoWindow.show({x:e.coordinate.x,y:e.coordinate.y});case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getPropertiesByName",value:function(t,e){for(var n=0;n<e.length;n++)if(e[n].name===t)return e[n]}},{key:"getDegree",value:function(t){switch(t){case"A1":case"B1":case"C1":return 45;case"A2":case"B2":case"C2":return 0;case"A8":case"B8":case"C8":return 90;case"A7":case"B7":case"C7":return 135;case"A6":case"B6":case"C6":return 180;case"A5":case"B5":case"C5":return 225;case"A4":case"B4":case"C4":return 270;case"A3":case"B3":case"C3":return 315}}},{key:"createLine",value:function(t){for(var e=[],n=0;n<this.lineItems.length;n++){(e=[]).push(this.lineItems[n].x1,this.lineItems[n].y1,this.lineItems[n].z1),e.push(this.lineItems[n].x2,this.lineItems[n].y2,this.lineItems[n].z2);var r=new ri;r.setPositions(e);var i=new ci(t,{interactive:!1},r,this.matLine,this.tlayer);this.meshitems.push(i)}}},{key:"createCircle",value:function(t,e){for(var n=[],r=0;r<=360;r++)n.push(Math.sin(r*(Math.PI/180))*t,Math.cos(r*(Math.PI/180))*t,0);var i=new ri;i.setPositions(n);var o=new ci(e,{interactive:!1},i,this.matLine,this.tlayer);this.meshitems.push(o)}},{key:"createLabelNew",value:function(t,e,n,r,i){var o=new oi({interactive:!1,width:n,height:n},this.getTextMaterial(i.name,e,"#fff"),this.tlayer),a=this.getPsVec(i.degree,t,r);o.object3d.position.set(a.x+i.x_offset,a.y+i.y_offset,0),this.psItems.push(a),o.setProperties(i),this.meshitems.push(o)}},{key:"getPsVec",value:function(t,e,n){var r=t*(Math.PI/180),i=new l.Vector3(Math.sin(r)*e,Math.cos(r)*e,0);return i=i.applyMatrix4(n)}},{key:"getTextMaterial",value:function(t,e,n){var r=document.createElement("canvas");r.width=r.height=256;var i=r.getContext("2d");i.fillStyle=n,i.font="".concat(e,"px Aria"),i.textAlign="center",i.textBaseline="middle",i.fillText(t,128,128);var o=new l.Texture(r);return o.needsUpdate=!0,this.textures.push(o),new l.MeshPhongMaterial({map:o,transparent:!0,depthTest:!1})}}]),t}(),gi=(n("20f0"),n("1340"),Math.PI/180);function mi(t){return t.getCoordinates().map((function(t){return t.toArray()}))}function vi(t){return t*gi}function yi(t,e){if(!t||!e)return 0;Array.isArray(t)||(t=t.toArray()),Array.isArray(e)||(e=e.toArray());var n=vi(t[1]),r=vi(e[1]),i=n-r,o=vi(t[0])-vi(e[0]);return n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(i/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(o/2),2))),n*=6378137,Math.round(1e5*n)/1e5}function _i(t,e){var n=t.len,r=t.c1,i=t.c2,o=i[0]-r[0],a=i[1]-r[1],s=(i[2]||0)-(r[2]||0),u=e/n;return[r[0]+u*o,r[1]+u*a,(r[2]||0)+u*s]}function xi(t,e,n){if(void 0===n&&(n={}),!0===n.final)return function(t,e){var n=xi(e,t);return n=(n+180)%360}(t,e);var r=N(t),i=N(e),o=j(r[0]),a=j(i[0]),s=j(r[1]),u=j(i[1]),c=Math.sin(a-o)*Math.cos(u),l=Math.cos(s)*Math.sin(u)-Math.sin(s)*Math.cos(u)*Math.cos(a-o);return function(t){return t%(2*Math.PI)*180/Math.PI}(Math.atan2(c,l))}var bi=n("6d6e"),wi=n.n(bi),Mi={altitude:0,height:0},Si=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),o=h.Util.extend({},Mi,o,{layer:a}),s=e.call(this);var u=o,c=u.width,f=u.height,d=u.altitude;s._initOptions(o);var p=new l.PlaneBufferGeometry(c,f);s._createMesh(p,i);var g=a.distanceToVector3(d,d).x,m=a.coordinateToVector3(t,g);return s.getObject3d().position.copy(m),s}return o(n)}(ht),Ai=function(){function t(e,n,i){var o=this;r(this,t),this.tlayer=i,this.map=i.map,n.color;var a=void 0!==n.smoothFlag&&!0===n.smoothFlag,s=void 0!==n.lineFlag&&!0===n.lineFlag;this.material=null,this.texture=null,this.curve=null,this.meshs=[],this.pts=[],this.newPts=[],this.arrows=[],this.lines=null,this.coordinates=null,this.positions=null,this.bearings=[],s&&(this.lineMaterial=new ei({color:n.lineColor||"red",transparent:!0,linewidth:n.linewidth||4,blending:l.AdditiveBlending})),this.loadTexture().then((function(t){var r=null;if(a?(e.forEach((function(t){var e=i.coordinateToVector3(t);o.pts.push(e)})),o.curve=new l.CatmullRomCurve3(o.pts,!1),o.curve.getPoints(20).forEach((function(t){var e=o.map.pointToCoordinate(t,o.map.getGLZoom());o.newPts.push(e)})),r=new h.LineString(o.newPts)):r=new h.LineString(e),s){var u=i.toFatLine(r,{},o.lineMaterial);o.meshs.push(u),o.tlayer.addMesh(o.meshs)}var c=r.getLength(),f=parseInt(c/30);f=f>10?10:f,o.ArrowNum=f;var d=1/o.ArrowNum;o.addSpan=Math.floor(100*d)/100;for(var p=0;p<o.ArrowNum;p++){var g=new Si(e[0],t,{width:n.width||.2,height:n.height||.1},o.tlayer);g.object3d.renderOrder=n.arrowOrder||1,o.arrows.push(g)}o.tlayer.addMesh(o.arrows),o.lines=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;e=Math.max(e,1),Array.isArray(t)||(t=mi(t));for(var n=t.length,r=[],i=0,o=0;o<n-1;o++){var a=yi(t[o],t[o+1]),s=Math.floor(a);r.push({c1:t[o],len:s,c2:t[o+1]}),i+=s}if(i<=e){var u=r.map((function(t){return[t.c1,t.c2]}));return u}if(1===r.length&&r[0].len<=e)return[[r[0].c1,r[0].c2]];for(var c,l=r.length,h=r[0],f=0,d=0,p=[],g=[h.c1];f<l;){var m=r[f],v=m.len,y=m.c2;if((d+=v)<e&&(g.push(y),f===l-1&&p.push(g),f++),d==e&&(g.push(y),d=0,p.push(g),g=[y],f++),d>e){var _=v-d+e;c=_i(r[f],_),g.push(c),p.push(g),d=0,r[f].c1=c,r[f].len=v-_,(g=[]).push(c)}}return p}(r,1);var m=o.lines[0][0],v=o.tlayer.coordinateToVector3(m);o.coordinates=[m],o.positions=[v],o.lines.forEach((function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.join(",").toString()!==o.coordinates[o.coordinates.length-1].join(",").toString()){o.coordinates.push(n);var r=o.tlayer.coordinateToVector3(n);r.z=.02,o.positions.push(r)}}}));for(var y=0;y<o.coordinates.length-1;y++){var _=o.coordinates[y],x=o.coordinates[y+1],b=xi(wi()(_),wi()(x));o.bearings.push((180-b)*Math.PI/180)}}))}return o(t,[{key:"loadTexture",value:function(){var t=s(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.promiseToDoSomething();case 2:return e=t.sent,this.texture=new l.CanvasTexture(e.canvas),this.material=new l.MeshBasicMaterial({map:this.texture,side:l.DoubleSide,depthWrite:!1,depthTest:!1}),t.abrupt("return",this.material);case 6:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"promiseToDoSomething",value:function(){return new Promise((function(t){var e=document.createElement("canvas").getContext("2d");e.canvas.width=64,e.canvas.height=64,e.translate(29,32),e.rotate(.5*Math.PI),e.fillStyle="rgb(0,255,255)",e.textAlign="center",e.textBaseline="middle",e.font="48px sans-serif",e.fillText("➡︎",0,0),setTimeout((function(){return t(e)}),4)}))}},{key:"naimationFunc",value:function(){if(this.coordinates)for(var t=1e-4*performance.now(),e=0;e<this.ArrowNum;e++){var n=(t+this.addSpan*e)%1,r=Math.floor(n*this.coordinates.length);this.arrows[e].getObject3d().position.copy(this.positions[r]);var i=this.bearings[r];null!=i&&(this.arrows[e].getObject3d().rotation.z=i)}}},{key:"dispose",value:function(){this.meshs&&(this.tlayer.removeMesh(this.meshs),this.meshs.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose()}))),this.arrows&&(this.tlayer.removeMesh(this.arrows),this.arrows.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose()}))),this.material&&this.material.dispose(),this.texture&&this.texture.dispose(),this.curve&&delete this.curve;for(var t=0;t<this.pts.length;t++)delete this.pts[t];this.pts=[],this.newPts=[];for(var e=0;e<this.lines.length;e++)delete this.lines[e];this.lines=[],this.coordinates=[],this.positions=[],this.bearings=[]}}]),t}(),Ci=function(){function t(e,n,i){var o=this;r(this,t),this.tlayer=i,this.map=i.map;var a=i.coordinateToVector3(e,0),s=n.distince||15e3,u=s/2,c=s/2e3,h=n.fontsize||80,f=4*c,d=1*c,p=i.distanceToVector3(s,s).x,g=i.distanceToVector3(u,u).x,m=(new l.Matrix4).makeTranslation(a.x,a.y,a.z);if(this.meshitems=[],this.textures=[],this.lineItems=[],this.psItems=[],this.arrowitems=[],this.matLine=new ei({color:n.color||4227327,linewidth:n.lineWidth||.001,dashed:!1,transparent:!0}),this.matLine.uniforms.opacity.value=n.opacity||.65,this.textureLoader=new l.TextureLoader,n.arrowImgPath){var v=n.windSpeed||0,y=n.windDirection||0;console.log(y),this.textureLoader.load(n.arrowImgPath,(function(t){o.textures.push(t),o.arrowMaterial=new l.MeshBasicMaterial({map:t});var e=new oi({interactive:!1,width:2*c,height:2*c},o.arrowMaterial,o.tlayer),n=o.getArrowPs(y,c),r=n.rotation*(Math.PI/180),i=o.getPsVec(y,p,m);o.psItems.push(i),o.psItems.push(n),e.object3d.position.set(i.x,i.y,a.z),e.object3d.rotation.z=r,o.arrowitems.push(e);var s=o.createTexture("".concat(v,"级"),60,"#fff");o.textures.push(s);var u=new oi({interactive:!1,width:f,height:f},o.getArrowTextMaterial(s),o.tlayer);u.object3d.position.set(i.x+n.offx,i.y+n.offy,a.z),o.arrowitems.push(u),o.tlayer.addMesh(o.arrowitems)}))}var _={type:"label",x_offset:0,y_offset:d,name:"N",degree:0};this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:d,y_offset:d,name:"EN",degree:45},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:d,y_offset:0,name:"E",degree:90},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:d,y_offset:-d,name:"ES",degree:135},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:0,y_offset:-d,name:"S",degree:180},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:-d,y_offset:-d,name:"WS",degree:225},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:-d,y_offset:0,name:"W",degree:270},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:-d,y_offset:d,name:"WN",degree:315},this.createLabelNew(p,h,f,m,_),this.createCircle(p,e),this.createCircle(g,e);for(var x=0;x<360;x+=22.5)this.lineItems.push({x1:0*Math.sin(Math.PI/180*0),y1:0*Math.cos(Math.PI/180*0),z1:0,x2:Math.sin(x*(Math.PI/180))*p,y2:Math.cos(x*(Math.PI/180))*p,z2:0});this.createLine(e),i.addMesh(this.meshitems),this._translation=m,this._r=p,this._factor=c}return o(t,[{key:"dispose",value:function(){if(this.meshitems){this.tlayer.removeMesh(this.meshitems),this.meshitems.forEach((function(t){t.getProperties()&&t.getProperties()})),this.textures.length>0&&(this.textures.forEach((function(t){t.dispose()})),this.textures=[]),this.meshitems.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()}));for(var t=0;t<this.lineItems.length;t++)delete this.lineItems[t];this.lineItems=[];for(var e=0;e<this.psItems.length;e++)delete this.psItems[e];this.psItems=[]}this.arrowitems&&(this.tlayer.removeMesh(this.arrowitems),this.arrowitems.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()}))),this.textureLoader&&delete this.textureLoader,delete this._translation}},{key:"createLine",value:function(t){for(var e=[],n=0;n<this.lineItems.length;n++){(e=[]).push(this.lineItems[n].x1,this.lineItems[n].y1,this.lineItems[n].z1),e.push(this.lineItems[n].x2,this.lineItems[n].y2,this.lineItems[n].z2);var r=new ri;r.setPositions(e);var i=new ci(t,{interactive:!1},r,this.matLine,this.tlayer);this.meshitems.push(i)}}},{key:"updateDirection",value:function(t,e){if(2===this.arrowitems.length){var n=this.arrowitems[0],r=this.arrowitems[1],i=this.createTexture("".concat(e||0,"级"),60,"#fff");r.object3d.material.map=i,this.textures.push(i),r.object3d.material.map.needsUpdate=!0;var o=this.getArrowPs(t,this._factor),a=o.rotation*(Math.PI/180),s=this.getPsVec(t,this._r,this._translation);n.object3d.position.set(s.x,s.y,0),this.psItems.push(s),this.psItems.push(o),n.object3d.position.set(s.x,s.y,0),n.object3d.rotation.z=a,r.object3d.position.set(s.x+o.offx,s.y+o.offy,0)}}},{key:"createCircle",value:function(t,e){for(var n=[],r=0;r<=360;r++)n.push(Math.sin(r*(Math.PI/180))*t,Math.cos(r*(Math.PI/180))*t,0);var i=new ri;i.setPositions(n);var o=new ci(e,{interactive:!1},i,this.matLine,this.tlayer);this.meshitems.push(o)}},{key:"createLabelNew",value:function(t,e,n,r,i){var o=new oi({interactive:!1,width:n,height:n},this.getTextMaterial(i.name,e,"#fff"),this.tlayer),a=this.getPsVec(i.degree,t,r);o.object3d.position.set(a.x+i.x_offset,a.y+i.y_offset,0),this.psItems.push(a),o.setProperties(i),this.meshitems.push(o)}},{key:"getPsVec",value:function(t,e,n){var r=t*(Math.PI/180),i=new l.Vector3(Math.sin(r)*e,Math.cos(r)*e,0);return i=i.applyMatrix4(n)}},{key:"getTextMaterial",value:function(t,e,n){var r=document.createElement("canvas");r.width=r.height=256;var i=r.getContext("2d");i.fillStyle=n,i.font="".concat(e,"px Aria"),i.textAlign="center",i.textBaseline="middle",i.fillText(t,128,128);var o=new l.Texture(r);return o.needsUpdate=!0,this.textures.push(o),new l.MeshPhongMaterial({map:o,transparent:!0,depthTest:!1})}},{key:"getArrowPs",value:function(t,e){var n=0,r=0,i=0;return t>180?(n=360-t+180,r=2*e,i=0):n=180-t,0==t?(r=0,i=-2*e):180==t?(i=0,i=2*e):t>0&&t<180&&(r=-2*e,i=0),{rotation:n,offx:r,offy:i}}},{key:"createTexture",value:function(t,e,n){var r=document.createElement("canvas");r.width=r.height=256;var i=r.getContext("2d");i.fillStyle=n,i.font="".concat(e,"px Aria"),i.textAlign="center",i.textBaseline="middle",i.fillText(t,128,128);var o=new l.Texture(r);return o.needsUpdate=!0,o}},{key:"getArrowTextMaterial",value:function(t){return new l.MeshPhongMaterial({map:t,transparent:!0,depthTest:!1})}}]),t}(),Ei={altitude:0,height:0},Ti=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},Ei,i,{layer:a}),(s=e.call(this))._initOptions(i);var u=i.altitude;console.log(u),s._createGroup();var c=new l.Sprite(o);c.material.sizeAttenuation=!1;var f=.005/3;c.scale.set(36*f,36*f,1),console.log(36*f/2*200),s.getObject3d().add(c);var d=a.distanceToVector3(u,u).x,p=a.coordinateToVector3(t,d);return s.getObject3d().position.copy(p),s}return o(n)}(ht),Ii=function(){function t(e,n,i){var o=this;r(this,t),this.map=i.map,this.threeLayer=i,this.lineStrings=[],this.meshs=[],this.properties=[],this.lineMaterial=new l.LineBasicMaterial({color:n.lineColor||"rgb(0,160,233)"}),this.rfields=null,this.fields=[],this.isToolTip=n.isToolTip,this.isExtrusion=n.isExtrusion,this.oriColor={},this.selectColor=new l.Color(n.selectColor),this.geojson=e,this.iconPath=n.iconPath,this.iconCidName=n.iconCidName,this.fontConfig=n.fontConfig,n.text&&(this.txtLabel=new h.VectorLayer(h.Util.GUID(),{hitDetect:!1,enableAltitude:!0}).addTo(i.map),this.rfields=n.text.match(/\{(.+?)\}/g),this.rfields.forEach((function(t){o.fields.push(t.substring(1,t.length-1))})),this.geoItems=[]),this.textureLoader=new l.TextureLoader,e.forEach((function(t){var e=t.geometry,r=h.GeoJSON.toGeometry(t),a=t.properties;o.oriColor[a.name]||(o.oriColor[a.name]=new l.Color(a.color));var s=new l.MeshPhongMaterial({transparent:!0,opacity:a.opacity||1,color:o.oriColor[a.name]}),u=.1;o.isExtrusion&&(u=a.height?200*a.height:.1);var c=i.toExtrudePolygon(r,{height:u},s);c.setProperties(t.properties),c.object3d.renderOrder=n.renderOrder||0,o.isToolTip&&c.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),o.meshs.push(c),n.isAddLine&&e.coordinates.forEach((function(e){var n=new h.LineString(e[0]),r=i.toLine(n,{altitude:.1===u?1:u,interactive:!1},o.lineMaterial);r.setProperties(t.properties),o.meshs.push(r),o.lineStrings.push(n)}));var f=r.getCenter();if(o.iconPath&&o.iconCidName&&o.iconCidName===a.name){var d=new h.Marker(f,{properties:{altitude:.1===u?1:u,name:a.name},symbol:{markerFile:o.iconPath,markerWidth:64,markerHeight:64,markerDx:0,markerDy:0,markerOpacity:1}});o.geoItems.push(d),o.txtLabel.addGeometry(d)}n.text&&o.createMark(f,u,a)})),i.addMesh(this.meshs),this._bindEvent()}return o(t,[{key:"createMark",value:function(t,e,n){var r=null;1===this.fields.length?r=new h.Marker(t,{properties:{name:n[this.fields[0]],altitude:.1===e?1:e},symbol:[{textFaceName:"sans-serif",textName:"{name}",textWeight:"normal",textStyle:"normal",textSize:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontSize?this.fontConfig[0].fontSize:12,textFont:null,textFill:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontColor?this.fontConfig[0].fontColor:"#fff",textOpacity:1,textWrapWidth:null,textWrapCharacter:"\n",textLineSpacing:0,textDx:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dx?this.fontConfig[0].dx:20,textDy:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dy?this.fontConfig[0].dy:0,textHorizontalAlignment:"top",textVerticalAlignment:"middle",textAlign:"center"}]}):2===this.fields.length&&(r=new h.Marker(t,{properties:{name:n[this.fields[0]],index:n[this.fields[1]],altitude:.1===e?1:e},symbol:[{textFaceName:"sans-serif",textName:"{name}",textWeight:"normal",textStyle:"normal",textSize:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontSize?this.fontConfig[0].fontSize:12,textFont:null,textFill:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontColor?this.fontConfig[0].fontColor:"#fff",textOpacity:1,textWrapWidth:null,textWrapCharacter:"\n",textLineSpacing:0,textDx:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dx?this.fontConfig[0].dx:20,textDy:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dy?this.fontConfig[0].dy:0,textHorizontalAlignment:"top",textVerticalAlignment:"middle",textAlign:"center"},{textFaceName:"sans-serif",textName:"{index}",textWeight:"bold",textStyle:"normal",textSize:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].fontSize?this.fontConfig[1].fontSize:20,textFont:null,textFill:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].fontColor?this.fontConfig[1].fontColor:"#fff",textOpacity:1,textWrapWidth:null,textWrapCharacter:"\n",textLineSpacing:0,textDx:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].dx?this.fontConfig[1].dx:20,textDy:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].dy?this.fontConfig[1].dy:-20,textHorizontalAlignment:"top",textVerticalAlignment:"middle",textAlign:"center"}]})),r&&(this.geoItems.push(r),this.txtLabel.addGeometry(r))}},{key:"addIcon",value:function(){var t=s(regeneratorRuntime.mark((function t(e,n){var r,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,V.addImageProcessImage(this.iconPath);case 2:r=t.sent,i=V.generateTextureOne(r,128,128),this.iconMaterial=new l.SpriteMaterial({map:i}),(o=new Ti(e,{altitude:n+=2400},this.iconMaterial,this.threeLayer)).zoomChange=function(){o.getMap()},this.threeLayer.addMesh(o);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_bindEvent",value:function(){var t=this;this.meshs.forEach((function(e){"ExtrudePolygon"===e.type&&e.on("click mousemove mouseout",t._setEvent,t)}))}},{key:"_closeEvent",value:function(){var t=this;this.meshs.forEach((function(e){"ExtrudePolygon"===e.type&&e.off("click mousemove mouseout",t._setEvent,t)}))}},{key:"_setEvent",value:function(t){var e=t.target.getProperties();"mousemove"===t.type&&t.target&&(this.isToolTip&&(t.target.getToolTip()._content="".concat(e.name)),this.selectColor&&(t.target.object3d.material.color=this.selectColor,t.target.object3d.material.color.needsUpdate=!0)),"mouseout"===t.type&&t.target&&this.selectColor&&(t.target.object3d.material.color=this.oriColor[e.name],t.target.object3d.material.color.needsUpdate=!0),"click"===t.type&&t.target&&this.clickFunc&&this.clickFunc(e)}},{key:"dispose",value:function(){for(var t in this.threeLayer.removeMesh(this.meshs),this._closeEvent(),this.meshs.forEach((function(t){"ExtrudePolygon"===t.type&&t.removeToolTip(),t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()})),this.lineMaterial&&this.lineMaterial.dispose(),this.selectColor&&delete this.selectColor,this.oriColor)delete this.oriColor[t];if(this.txtLabel&&this.map.removeLayer(this.txtLabel),this.geoItems)for(var e=0;e<this.geoItems.length;e++)delete this.geoItems[e];if(this.geoItems=[],this.geojson)for(var n=0;n<this.geojson.length;n++)delete this.geojson[n]}},{key:"findMesh",value:function(t){for(var e=0;e<this.meshs.length;e++)if("ExtrudePolygon"===this.meshs[e].type&&this.meshs[e].getProperties().name===t)return this.meshs[e]}},{key:"update",value:function(t){var e=this;this.geojson.forEach((function(n){n.geometry;for(var r=h.GeoJSON.toGeometry(n),i=n.properties,o=function(n){if(t[n].name===i.name){e.oriColor[i.name]&&(delete e.oriColor[i.name],e.oriColor[i.name]=new l.Color(t[n].color));var o=new l.MeshBasicMaterial({transparent:!0,opacity:i.opacity||1,color:e.oriColor[i.name]}),a=.1;e.isExtrusion&&(a=t[n].height?200*t[n].height:.1);for(var s=e.threeLayer.toExtrudePolygon(r,{height:a},o),u=e.findMesh(t[n].name),c=s.object3d.geometry.attributes.position.array,h=u.object3d.geometry.attributes.position.array,f=0;f<h.length;f++)h[f]=c[f];u.object3d.geometry.attributes.position.needsUpdate=!0,u.object3d.material.color=e.oriColor[i.name],u.object3d.material.color.needsUpdate=!0;var d=e.threeLayer.distanceToVector3(a,a).x;e.meshs.forEach((function(e){"Line"===e.type&&e.getProperties().name===t[n].name&&(e.object3d.position.z=d)})),s.object3d.geometry&&s.object3d.geometry.dispose(),s.object3d.material&&s.object3d.material.dispose();for(var p=0;p<e.geoItems.length;p++)e.geoItems[p].getProperties().name===t[n].name&&(e.geoItems[p].getProperties().index&&(e.geoItems[p].getProperties().index=t[n].rank),e.geoItems[p].getProperties().altitude=a,e.geoItems[p].updateSymbol({index:"{index}"}));return"break"}},a=0;a<t.length&&"break"!==o(a);a++);}))}}]),t}();n("91e5"),n("ff86"),n("2ed2");var Li=function(){function t(e){r(this,t),this.map=e,this.threeLayer=null,this.animationId=null,this.windObj=null,this.drawTool=null,this.distanceTool=null,this.trafficLayer=null,this.circleObj=null,this.shockObj=null,this.ringObj=null,this.directionObj=null,this.trips=[],this.func=[],this.polygonObjs=[]}return o(t,[{key:"createIepLayer",value:function(t){var e=function(){var t="xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return"iep".concat(t,"layer")}();if(!this.threeLayer){var n=this.threeLayer=new vr(e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){A(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({forceRenderOnMoving:!0,forceRenderOnRotating:!0,identifyCountOnEvent:1},t));return n.addTo(this.map),{layerId:e,layer:n}}}},{key:"removeIepLayer",value:function(){this.threeLayer&&this.threeLayer.getMeshes().forEach((function(t){var e;"Points"!==t.type&&"Image"!==t.type||null===(e=t.parent)||void 0===e||e.dispose()})),this.windObj&&(this.windObj.closeWind(),delete this.windObj),this.drawTool&&(this.drawTool.dispose(),delete this.drawTool),this.distanceTool&&(this.distanceTool.dispose(),delete this.distanceTool),this.trafficLayer&&(this.trafficLayer.setMap(null),delete this.trafficLayer),this.circleObj&&(this.circleObj.dispose(),delete this.circleObj),this.shockObj&&(this.shockObj.dispose(),delete this.shockObj),this.ringObj&&(this.ringObj.dispose(),delete this.ringObj),this.directionObj&&(this.directionObj.dispose(),delete this.directionObj),this.trips.length>0&&(this.func=[],this.trips.forEach((function(t){t.dispose()})),this.trips=[]),this.clearPolygon()}},{key:"prepareToDraw",value:function(){var t=this,e=function e(){var n,r;t.threeLayer._needsUpdate=!t.threeLayer._needsUpdate,t.threeLayer._needsUpdate&&(null===(n=t.threeLayer)||void 0===n||null===(r=n.getRenderer())||void 0===r||r.clearCanvas(),t.threeLayer.renderScene()),t.func.forEach((function(t){return t()})),$r.c(),t.animationId=requestAnimationFrame(e)};return new Promise((function(n){t.threeLayer.prepareToDraw=function(t,r,i){var o=new l.DirectionalLight(16777215);o.position.set(0,-10,10).normalize(),r.add(o),e(),n()}}))}},{key:"clearTrip",value:function(){this.func=[],this.trips.forEach((function(t){t.dispose()})),this.trips=[]}},{key:"clearPolygon",value:function(){for(var t=0;t<this.polygonObjs.length;t++)this.polygonObjs[t].dispose(),delete this.polygonObjs[t];this.polygonObjs=[]}},{key:"drawPolygon",value:function(t,e){var n=this;this.createIepLayer();var r=e||{};if(this.threeLayer.getScene()){var i=new Ii(t,r,this.threeLayer);this.polygonObjs.push(i)}else this.prepareToDraw().then((function(){var e=new Ii(t,r,n.threeLayer);n.polygonObjs.push(e)}))}},{key:"updatePolygon",value:function(t){this.polygonObjs.forEach((function(e){e.update(t)}))}},{key:"drawTrip",value:function(t,e){var n=this;this.createIepLayer();var r=e||{};if(this.threeLayer.getScene()){var i=new Ai(t,r,this.threeLayer);this.trips.push(i),this.func.push((function(){i.naimationFunc()}))}else this.prepareToDraw().then((function(){var e=new Ai(t,r,n.threeLayer);n.trips.push(e),n.func.push((function(){e.naimationFunc()}))}))}},{key:"clearRing",value:function(){this.ringObj&&(this.ringObj.dispose(),delete this.ringObj)}},{key:"drawRing",value:function(t,e,n,r){var i=this;this.createIepLayer();var o=r||{};this.threeLayer.getScene()?(this.ringObj&&(this.ringObj.dispose(),delete this.ringObj),setTimeout((function(){i.ringObj=new pi([t,e],n,o,i.threeLayer)}),500)):this.prepareToDraw().then((function(){i.ringObj||(i.ringObj=new pi([t,e],n,o,i.threeLayer))}))}},{key:"updateDirection",value:function(t,e){this.directionObj&&this.directionObj.updateDirection(t,e)}},{key:"clearDirection",value:function(){this.directionObj&&(this.directionObj.dispose(),delete this.directionObj)}},{key:"drawDirection",value:function(t,e,n){var r=this;this.createIepLayer();var i=n||{};this.threeLayer.getScene()?(this.directionObj&&(this.directionObj.dispose(),delete this.directionObj),setTimeout((function(){r.directionObj=new Ci([t,e],i,r.threeLayer)}),500)):this.prepareToDraw().then((function(){r.directionObj||(r.directionObj=new Ci([t,e],i,r.threeLayer))}))}},{key:"clearCircle",value:function(){this.circleObj&&(this.circleObj.dispose(),delete this.circleObj)}},{key:"drawCircle",value:function(t,e,n,r){var i=this;this.createIepLayer();var o=r||{};this.threeLayer.getScene()?this.circleObj?this.circleObj.update(t,e,n,o):this.circleObj=new Yr(t,e,n,o,this.threeLayer):this.prepareToDraw().then((function(){i.circleObj?i.circleObj.update(t,e,n,o):i.circleObj=new Yr(t,e,n,o,i.threeLayer)}))}},{key:"Traffic",value:function(t){var e=this.map.getBaseLayer();if(e){var n=e.getAMap();n&&(this.trafficLayer||(this.trafficLayer=new AMap.TileLayer.Traffic({zIndex:10})),!0===t?this.trafficLayer.setMap(n):this.trafficLayer.setMap(null))}}},{key:"distance",value:function(){var t=this;return new Promise((function(e){t.distanceTool?(t.distanceTool.enable(),e(t.distanceTool)):(t.distanceTool=new zr({},t.threeLayer),e(t.distanceTool))}))}},{key:"drawGeometry",value:function(t,e){var n=this;return new Promise((function(r){n.drawTool?(n.drawTool.setMode(t,e),r(n.drawTool)):(n.drawTool=new Gr(t,e,{},n.threeLayer),r(n.drawTool))}))}},{key:"drawWeatherData",value:function(t,e){var n=this;return new Promise((function(r){var i=null;r(t?i=new Nr(t,e||{},n.map):i),n.windObj=i}))}},{key:"drawImage",value:function(t,e,n,r){var i=this;return this.createIepLayer(),this.threeLayer.getScene()?new Promise((function(o){o(new Br(t,e,n,r,i.threeLayer))})):new Promise((function(o){i.prepareToDraw().then((function(){var a=new Br(t,e,n,r,i.threeLayer);o(a)}))}))}},{key:"getPointObjByName",value:function(t){var e=this;return new Promise((function(n){e.threeLayer&&e.threeLayer.getMeshes().forEach((function(e){"Points"===e.type&&e.parent.name===t&&n(e.parent)}))}))}},{key:"drawShock",value:function(t,e){var n=this;this.createIepLayer(),this.threeLayer.getScene()?this.shockObj&&(this.shockObj.dispose(),this.shockObj=null,setTimeout((function(){n.shockObj=new ti(t,e||{},n.threeLayer)}),500)):this.prepareToDraw().then((function(){n.shockObj=new ti(t,e||{},n.threeLayer)}))}},{key:"clearShock",value:function(){this.shockObj&&($r.b(),this.shockObj.dispose(),this.shockObj=null)}},{key:"drawPoint",value:function(t,e){var n=this;return this.createIepLayer(),this.threeLayer.getScene()?new Promise((function(r){var i=null;t.length>0?(i=new Rr(t,e,n.threeLayer)).addPoint().then((function(){r(i)})):r(i)})):new Promise((function(r){n.prepareToDraw().then((function(){var i=null;t.length>0?(i=new Rr(t,e,n.threeLayer)).addPoint().then((function(){r(i)})):r(i)}))}))}},{key:"saveIndexedDb",value:function(){return new Promise((function(t,e){var n=window.indexedDB.open("iep_db");n.onsuccess=function(e){var n=e.target.result;t(n)},n.onerror=function(t){e(t)},n.onupgradeneeded=function(t){var e=t.target.result;if(!e.objectStoreNames.contains("svg_dict")){var n=e.createObjectStore("svg_dict",{keyPath:"code"});n.createIndex("code","code",{unique:!0}),n.createIndex("file","file",{unique:!1})}}}))}},{key:"getType",value:function(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}},{key:"getDbRecord",value:function(t){var e=this,n="string"===this.getType(t)?[t]:t;return new Promise((function(t){e.saveIndexedDb().then((function(e){var r=e.transaction("svg_dict","readwrite").objectStore("svg_dict");Promise.all(n.map((function(t){return new Promise((function(e){var n=r.get(t);n.onsuccess=function(t){e(t.target.result)},n.onerror=function(t){e()}}))}))).then((function(e){t(e)}))}))}))}}]),t}(),Pi=function(t){return new Li(t)};
103
+ */function Qn(t,e,n){var r=Xn(n),i=function(t){return t.min||0}(n),o=r-i,a=n.range||null,s=0,u=1024;a&&2===a.length&&(s=(a[0]-i)/o*1024),a&&2===a.length&&(u=(a[1]-i)/o*1024);for(var c,l=n.maxOpacity||.8,h=n.minOpacity||0,f=3,d=t.length;f<d;f+=4)c=4*t[f],t[f]/256>l&&(t[f]=256*l),t[f]/256<h&&(t[f]=256*h),c&&c>=s&&c<=u?(t[f-3]=e[c],t[f-2]=e[c+1],t[f-1]=e[c+2]):t[f]=0}function Xn(t){return t.max||100}function Yn(t,e,n){var r=Xn(n),i=function(t){var e=t/2,n=t+e,r=1e4,i=Rn(2*n,2*n),o=i.getContext("2d");return o.shadowBlur=e,o.shadowColor="black",o.shadowOffsetX=o.shadowOffsetY=r,o.beginPath(),o.arc(n-r,n-r,t,0,2*Math.PI,!0),o.closePath(),o.fill(),i}(n._size||n.size||13),o=i.width/2,a=i.height/2,s=e,u={};for(var c in s.forEach((function(t){var e=void 0===t.count?1:t.count,n=Math.min(1,e/r).toFixed(2);u[n]=u[n]||[],u[n].push(t)})),u)if(!isNaN(c)){var l=u[c];t.beginPath(),n.withoutAlpha||(t.globalAlpha=c),l.forEach((function(e){var n=e.coordinate,s=void 0===e.count?1:e.count;t.globalAlpha=s/r,t.drawImage(i,n[0]-o,n[1]-a)}))}}var Jn={draw:function(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var r=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+r+")";var i=Rn(t.canvas.width,t.canvas.height),o=i.getContext("2d");o.scale(devicePixelRatio,devicePixelRatio),n=n||{},t.save();var a=new Zn({gradient:n.gradient});if(Yn(o,e,n),!n.absolute){var s=o.getImageData(0,0,t.canvas.width,t.canvas.height);Qn(s.data,a.getImageData(),n),t.putImageData(s,0,0),t.restore()}a=null,i=null}},drawGray:Yn,colorize:Qn};const qn={altitude:0,interactive:!1,min:0,max:100,size:13,gradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},gridScale:.5};var Kn=class extends ht{constructor(t,e,n,r){Array.isArray(t)||(t=[t]);let i=1/0,o=1/0,a=-1/0,s=-1/0;const u=[];for(let e=0,n=t.length;e<n;e++){const{coordinate:n,lnglat:c,xy:l}=t[e],h=n||c||l;if(!h){console.warn("not find coordinate");continue}const f=r.coordinateToVector3(h);u.push(f);const{x:d,y:p}=f;i=Math.min(i,d),o=Math.min(o,p),a=Math.max(a,d),s=Math.max(s,p)}e=h.Util.extend({},qn,e,{layer:r,points:t});let{gridScale:c,altitude:f}=e;const d=Math.abs(a-i),p=Math.abs(s-o),g=Math.max(d*c,p*c);g>2048&&(console.warn(`gridScale: ${c} it's too big. I hope it's a smaller value,canvas max size is 2048* 2048`),c=2048/(g/c));const m=Math.ceil(d*c),v=Math.ceil(p*c),y=m/d,_=v/p,x=[];for(let e=0,n=u.length;e<n;e++){const n=u[e];n.x-=i,n.y-=o,n.x*=y,n.y*=_,n.y=v-n.y,x.push({coordinate:[n.x,n.y],count:t[e].count})}let b=Rn(m,v),w=b.getContext("2d");Jn.drawGray(w,x,e);const M=w.getImageData(0,0,w.canvas.width,w.canvas.height);let S=-1/0;const A=new Float32Array(M.data.length/4),C=new Float32Array(M.data.length/4);for(let t=3,e=M.data.length,n=0;t<e;t+=4){const e=M.data[t];S=Math.max(S,e),C[n]=e,e<=0&&(A[n]=1),n++}const E=new Zn({gradient:e.gradient});Jn.colorize(M.data,E.getImageData(),e),b=null,w=null;const T=Dn(d,p,m-1,v-1),I=T.getIndex().array,L=T.attributes.position.array,P=new Float32Array(L.length),R=new Uint32Array(6*L.length),O=new l.Color;let k=0;for(let t=0,e=L.length,n=0,r=I.length,i=0,o=M.data.length,a=0;t<Math.max(e,r,o);t+=3){if(t<e){const e=C[a];e>0&&(L[t+2]=e/S)}if(n<r){const t=I[n],e=I[n+1],r=I[n+2];A[t]&&A[e]&&A[r]||(R[k]=t,R[k+1]=e,R[k+2]=r,k+=3)}if(i<o){const t=`rgb(${M.data[i]},${M.data[i+1]},${M.data[i+2]})`;O.setStyle(t),P[n]=O.r,P[n+1]=O.g,P[n+2]=O.b}n+=3,i+=4,a++}const B=new Uint32Array(k);for(let t=0;t<k;t++)B[t]=R[t];T.setIndex(new l.BufferAttribute(B,1)),J(T,"color",new l.BufferAttribute(P,3,!0)),n.vertexColors=q(),super(),this._initOptions(e),this._createMesh(T,n);const F=r.distanceToVector3(f,f).x;this.getObject3d().position.copy(new l.Vector3((i+a)/2,(o+s)/2,F)),this.type="HeatMap"}};const $n=new l.Color;let tr=1;var er=class{constructor(t){this.object3ds=[],this.layer=t,this.camera=t.getCamera(),this.renderer=t.getThreeRenderer(),this.pickingTexture=new l.WebGLRenderTarget(1,1),this.pickingScene=new l.Scene}getColor(){return $n.setHex(tr),tr++,$n}add(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=t,this.pickingScene.add(t))}return this}remove(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=null,this.pickingScene.remove(t))}return this}isEmpty(){if(0===this.pickingScene.children.length)return!0;for(let t=0,e=this.pickingScene.children.length;t<e;t++){const e=this.pickingScene.children[t];if(e){const t=e.__parent;if(t&&!0===t.getOptions().interactive)return!1}}return!0}pick(t){if(!t)return;if(this.isEmpty())return;const{camera:e,renderer:n,pickingTexture:r,pickingScene:i,object3ds:o,layer:a}=this,s=this.pickingScene.children.length;for(let t=0;t<s;t++){const e=this.pickingScene.children[t];e&&e.__parent&&(e.__parent.picked=!1)}const{width:u,height:c}=a._getRenderer().canvas,l=r.width,h=r.height;u===l&&c===h||r.setSize(u,c),n.setRenderTarget(r),n.clear(),n.render(i,e);const f=new Uint8Array(4),{x:d,y:p}=t,g=window.devicePixelRatio,m=d*g,v=r.height-p*g;n.readRenderTargetPixels(r,Math.round(m),Math.round(v),1,1,f);const y=f[0]<<16|f[1]<<8|f[2],_=o[y];if(_)_.__parent&&(o[y].__parent.picked=!0);else for(let t=0;t<s;t++){const e=this.pickingScene.children[t];if(e&&e.__parent){const t=e.__parent;if(t._colorMap&&null!=t._colorMap[y]){t.picked=!0,t.index=t._colorMap[y];break}}}n.setRenderTarget(null)}};const nr={bottomHeight:0,altitude:0};var rr=class extends ht{constructor(t,e,n,r){e=h.Util.extend({},nr,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{lineStrings:i,center:o}=Ae(t),a=[],s={};for(let t=0,n=i.length;t<n;t++){const n=we(i[t],r,o).positionsV;Pt(n,e.bottomHeight,r,s),Ce(a,n)}const u=new at;u.setPositions(a),this._setMaterialRes(r,n),this._createLine2(u,n);const{altitude:c}=e,l=r.distanceToVector3(c,c).x,f=r.coordinateToVector3(o,l);this.getObject3d().position.copy(f),this._setPickObject3d(a,n.linewidth),this._init(),this.type="FatLine"}_init(){const t=this.getLayer().getPick();this.on("add",()=>{t.add(this.pickObject3d)}),this.on("remove",()=>{t.remove(this.pickObject3d)})}_setMaterialRes(t,e){const n=t.getMap().getSize(),r=n.width,i=n.height;e.resolution.set(r,i)}_setPickObject3d(t,e){const n=new at;n.setPositions(t);const r=this.getLayer().getPick().getColor(),i=[];for(let e=0,n=t.length/3;e<n;e++)i.push(r.r,r.g,r.b);n.setColors(i);const o=new rt({color:"#fff",linewidth:e,vertexColors:q()});this._setMaterialRes(this.getLayer(),o);const a=r.getHex(),s=new st(n,o);s.position.copy(this.getObject3d().position),s._colorIndex=a,this.setPickObject3d(s)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof l.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}};const ir={altitude:0,colors:null};class or extends(qe(ht)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const i=[],o=[],a=t.length;for(let e=0;e<a;e++){const n=Ae(t[e]);i.push(n.center),o.push(n.lineStrings)}const s=Lt(i);e=h.Util.extend({},ir,e,{layer:r,lineStrings:t,coordinate:s});const u=[],c={};let l=0,f=[],d=[],p=0,g=[];for(let t=0;t<a;t++){const e=o[t];let n=0;for(let t=0,i=e.length;t<i;t++){const i=me(e[t])?e[t].properties:e[t].getProperties()||{},{positionsV:o}=we(e[t],r,s);Pt(o,i.bottomHeight,r,c),n+=2*o.length-2,Ce(g,o)}const i=n;f[t]=[l,l+i],l+=i,d[t]={position:{count:n,start:p,end:p+3*n},instanceStart:{count:n,start:p,end:p+3*n},instanceEnd:{count:n,start:p,end:p+3*n},hide:!1},p+=3*n}super(),this._initOptions(e);const m=new at;m.setPositions(g),this._setMaterialRes(r,n),this._createLine2(m,n);const{altitude:v}=e,y=r.distanceToVector3(v,v).x,_=r.coordinateToVector3(s,y);this.getObject3d().position.copy(_),this._faceMap=f,this._baseObjects=u,this._datas=t,this._geometriesAttributes=d,this.faceIndex=null,this.index=null,this._geometryCache=new at,this._geometryCache.setPositions(g),this._colorMap={},this.isHide=!1,this._initBaseObjectsEvent(u),this._setPickObject3d(g,n.linewidth),this._init(),this.type="FatLines"}_setMaterialRes(t,e){const n=t.getMap().getSize(),r=n.width,i=n.height;e.resolution.set(r,i)}_setPickObject3d(t,e){const n=this._geometryCache||new at;n.setPositions(t);const r=this.getLayer().getPick(),{_geometriesAttributes:i}=this,o=Rt(i);let a=0;for(let t=0,e=i.length;t<e;t++){const e=r.getColor(),n=e.getHex();this._colorMap[n]=t;const{count:s}=i[t].position;this._datas[t].colorIndex=n;for(let t=0;t<s;t++)o[a]=e.r,o[a+1]=e.g,o[a+2]=e.b,a+=3}n.setColors(o);const s=new rt({color:"#fff",linewidth:e,vertexColors:q()});this._setMaterialRes(this.getLayer(),s);const u=r.getColor().getHex(),c=new st(n,s);c.position.copy(this.getObject3d().position),c._colorIndex=u,this.setPickObject3d(c)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof l.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=h.Util.extend({},this.getOptions(),{index:t},me(e)?e.properties:e.getProperties());this._baseObjects[t]=new rr(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_updateAttribute(t,e){const{indexs:n}=this._getHideGeometryIndex(e),r=this._geometryCache.attributes[e].array,i=r.length;for(let e=0;e<i;e++)t.array[e]=r[e];for(let r=0;r<n.length;r++){const i=n[r],{start:o,end:a}=this._geometriesAttributes[i][e];for(let e=o;e<a;e++)t.array[e]=-1e5}return this}_showGeometry(t,e){let n;if(t&&(n=t.getOptions().index),null!=n){const t=this._geometriesAttributes[n],{hide:r}=t;if(r===e)return this;t.hide=e;const i=this.getObject3d().geometry;this._updateAttribute(i.attributes.instanceStart,"instanceStart"),this._updateAttribute(i.attributes.instanceEnd,"instanceEnd"),i.attributes.instanceStart.data.needsUpdate=!0,i.attributes.instanceEnd.data.needsUpdate=!0,this.isHide=e}return this}}var ar=or;const sr={radius:10,height:100,altitude:0,topColor:"",bottomColor:"#2d2f61"};var ur=class extends ht{constructor(t,e,n,r){e=h.Util.extend({},sr,e,{layer:r,coordinate:t}),super(),this._initOptions(e);const{height:i,radius:o,topColor:a,bottomColor:s,altitude:u}=e,c=r.distanceToVector3(i,i).x,l=r.distanceToVector3(o,o).x,f=Ct().clone();f.scale(2*l,2*l,c),a&&(St(f,s,a,"z",c/2),n.vertexColors=q()),this._createMesh(f,n);const d=r.distanceToVector3(u,u).x,p=r.coordinateToVector3(t,d);this.getObject3d().position.copy(p),this.type="Box"}};const cr={radius:10,height:100,altitude:0,topColor:null,bottomColor:"#2d2f61"};class lr extends(qe(ht)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const i=t.length,o=Lt(t),a=r.coordinateToVector3(o),s=[],u=[],c=[],l=[];let f=0,d=0,p=0,g=0;const m={};for(let e=0;e<i;e++){const i=h.Util.extend({index:e},cr,t[e]),{radius:o,altitude:v,topColor:y,bottomColor:_,height:x,coordinate:b}=i,w=It(o,r,m),M=It(x,r,m),S=It(v,r,m),A=Ct().clone();A.scale(2*w,2*w,M),y&&(St(A,_,y,"z",M/2),n.vertexColors=q());const C=r.coordinateToVector3(b).sub(a),E=A.attributes.position.array;for(let t=0,e=E.length;t<e;t+=3)E[t+2]+=S,E[t]+=C.x,E[t+1]+=C.y,E[t+2]+=C.z;s.push(A);const T=new ur(b,i,n,r);u.push(T);const I=A.index.count/3;l[e]=[f+1,f+I],f+=I;const L=A.attributes.position.count,P=A.attributes.normal.count,R=A.attributes.uv.count;c[e]={position:{count:L,start:d,end:d+3*L},normal:{count:P,start:p,end:p+3*P},uv:{count:R,start:g,end:g+2*R},hide:!1},d+=3*L,p+=3*P,g+=2*R}super(),e=h.Util.extend({},{altitude:0,layer:r,points:t},e),this._initOptions(e);const v=At(s);this._createMesh(v,n);const y=e.altitude,_=r.distanceToVector3(y,y).x,x=a.clone();x.z=_,this.getObject3d().position.copy(x),this._faceMap=l,this._baseObjects=u,this._datas=t,this._geometriesAttributes=c,this.faceIndex=null,this._geometryCache=v.clone(),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(u),this._setPickObject3d(),this._init(),this.type="Boxs"}identify(t){return this.picked}}var hr=lr;const fr=Math.PI/180,dr=[[4e3,220],[2e3,100],[1e3,30],[500,15],[100,5],[50,2],[10,1],[5,.7],[2,.1],[1,.05],[.5,.02]],pr=["mousemove","click","mousedown","mouseup","dblclick","contextmenu","touchstart","touchmove","touchend"],gr=new h.Coordinate(0,0),mr=new h.Point(0,0);class vr extends h.CanvasLayer{constructor(t,e){super(t,e),this._animationBaseObjectMap={},this._needsUpdate=!0,this._mousemoveTimeOut=0,this._baseObjects=[],this._delayMeshes=[],this.type="ThreeLayer"}isRendering(){const t=this.getMap();return!!t&&(t.isInteracting()||t.isAnimating())}prepareToDraw(...t){}draw(){this.renderScene()}drawOnInteracting(){this.renderScene()}coordinateToVector3(t,e=0){const n=this.getMap();if(!n)return null;const r=Array.isArray(t);r&&(gr.x=t[0],gr.y=t[1]),r||t instanceof h.Coordinate||(t=new h.Coordinate(t));const i=_r(n),o=xr(n,r?gr:t,i,mr);return new l.Vector3(o.x,o.y,e)}distanceToVector3(t,e,n){if(0===t&&0===e||!h.Util.isNumber(t)||!h.Util.isNumber(e))return new l.Vector3(0,0,0);const r=this.getMap(),i=_r(r);let o=n||r.getCenter();o instanceof h.Coordinate||(o=new h.Coordinate(o));const a=r.locate(o,t,e),s=xr(r,o,i),u=xr(r,a,i),c=Math.abs(u.x-s.x)*h.Util.sign(t),f=Math.abs(u.y-s.y)*h.Util.sign(e);return new l.Vector3(c,f,0)}toShape(t){if(!t)return null;if(t instanceof h.MultiPolygon)return t.getGeometries().map(t=>this.toShape(t));const e=t.getCenter(),n=this.coordinateToVector3(e),r=t.getShell().map(t=>{const e=this.coordinateToVector3(t).sub(n);return new l.Vector2(e.x,e.y)}),i=new l.Shape(r),o=t.getHoles();return o&&o.length>0&&(i.holes=o.map(t=>{const e=t.map(t=>{const e=this.coordinateToVector3(t).sub(n);return new l.Vector2(e.x,e.y)});return new l.Shape(e)})),i}toExtrudeMesh(t,e,n,r){if(!t)return null;if(t instanceof h.MultiPolygon)return t.getGeometries().map(t=>this.toExtrudeMesh(t,e,n,r));const i=t.getCoordinates();i.forEach(t=>{for(let e=t.length-1;e>=1;e--)t[e].equals(t[e-1])&&t.splice(e,1)}),t.setCoordinates(i);const o=this.toShape(t),a=this.coordinateToVector3(t.getCenter());r=h.Util.isNumber(r)?r:e,r=this.distanceToVector3(r,r).x;const s=this.distanceToVector3(e,e).x,u={bevelEnabled:!1,bevelSize:1};u[parseInt(l.REVISION)>=93?"depth":"amount"]=r;const c=new l.ExtrudeGeometry(o,u);let f=c;l.BufferGeometry.prototype.fromGeometry&&(f=new l.BufferGeometry,f.fromGeometry(c));const d=new l.Mesh(f,n);return d.position.set(a.x,a.y,s-r),d}toExtrudePolygon(t,e,n){return new je(t,e,n,this)}toBar(t,e,n){return new Tt(t,e,n,this)}toLine(t,e,n){return new Te(t,e,n,this)}toExtrudeLine(t,e,n){return new De(t,e,n,this)}toModel(t,e){return new Ge(t,e,this)}toExtrudeLineTrail(t,e,n){return new Xe(t,e,n,this)}toExtrudePolygons(t,e,n){return new on(t,e,n,this)}toPoint(t,e,n){return new cn(t,e,n,this)}toPoints(t,e,n){return new vn(t,e,n,this)}toBars(t,e,n){return new xn(t,e,n,this)}toExtrudeLines(t,e,n){return new Mn(t,e,n,this)}toLines(t,e,n){return new Cn(t,e,n,this)}toThreeVectorTileLayer(t,e,n){return new Fn(t,e,n,this)}toTerrain(t,e,n){return new zn(t,e,n,this)}toTerrainVectorTileLayer(t,e,n){return new Vn(t,e,n,this)}toHeatMap(t,e,n){return new Kn(t,e,n,this)}toFatLine(t,e,n){return new rr(t,e,n,this)}toFatLines(t,e,n){return new ar(t,e,n,this)}toBox(t,e,n){return new ur(t,e,n,this)}toBoxs(t,e,n){return new hr(t,e,n,this)}getBaseObjects(){return this.getMeshes().filter(t=>t instanceof ht)}getMeshes(){const t=this.getScene();if(!t)return[];const e=[];for(let n=0,r=t.children.length;n<r;n++){const r=t.children[n];r instanceof l.Object3D&&!(r instanceof l.Camera)&&e.push(r.__parent||r)}return e}clear(){return this.clearMesh()}clearMesh(){const t=this.getScene();if(!t)return this;for(let e=t.children.length-1;e>=0;e--){const n=t.children[e];if(n instanceof l.Object3D&&!(n instanceof l.Camera)){t.remove(n);const e=n.__parent;e&&e instanceof ht&&(e.isAdd=!1,e._fire("remove",{target:e}),delete this._animationBaseObjectMap[n.uuid])}}return this}lookAt(t){const e=this._getRenderer();return e&&e.context.lookAt(t),this}getCamera(){const t=this._getRenderer();return t?t.camera:null}getScene(){const t=this._getRenderer();return t?t.scene:null}renderScene(){const t=this._getRenderer();return t&&(t.clearCanvas(),t.renderScene()),this}loop(t=!1){const e=this._delayMeshes;if(!e.length)return;const n=this.getMap();if(!n||n.isAnimating()||n.isInteracting())return;const r=this.options.loopRenderCount||50,i=e.slice(0,r);i&&this.addMesh(i,t),e.splice(0,r)}renderPickScene(){const t=this._getRenderer();if(t){const e=t.pick;e&&e.pick(this._containerPoint)}return this}getThreeRenderer(){const t=this._getRenderer();return t?t.context:null}getPick(){const t=this._getRenderer();return t?t.pick:null}delayAddMesh(t){if(!t)return this;Array.isArray(t)||(t=[t]);for(let e=0,n=t.length;e<n;e++)this._delayMeshes.push(t[e]);return this}addMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();return t.forEach(t=>{t instanceof ht?(n.add(t.getObject3d()),t.isAdd||(t.isAdd=!0,t._fire("add",{target:t})),t._animation&&h.Util.isFunction(t._animation)&&(this._animationBaseObjectMap[t.getObject3d().uuid]=t)):t instanceof l.Object3D&&n.add(t)}),this._zoomend(),e&&this.renderScene(),this}removeMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();return t.forEach(t=>{if(t instanceof ht){n.remove(t.getObject3d()),t.isAdd&&(t.isAdd=!1,t._fire("remove",{target:t})),t._animation&&h.Util.isFunction(t._animation)&&delete this._animationBaseObjectMap[t.getObject3d().uuid];const e=this._delayMeshes;if(e.length)for(let n=0,r=e.length;n<r;n++)if(e[n]===t){e.splice(n,1);break}}else t instanceof l.Object3D&&n.remove(t)}),e&&this.renderScene(),this}_initRaycaster(){return this._raycaster||(this._raycaster=new l.Raycaster,this._mouse=new l.Vector2),this}identify(t,e){if(!t)return console.error("coordinate is null,it should be Coordinate"),[];if(Array.isArray(t)&&(t=new h.Coordinate(t)),!(t instanceof h.Coordinate))return console.error("coordinate type is error,it should be Coordinate"),[];const n=this.getMap().coordToContainerPoint(t);this._containerPoint=n;const{x:r,y:i}=n;this._initRaycaster();const o=this._raycaster,a=this._mouse,s=this.getCamera(),u=this.getScene(),c=this.getMap().getSize();if(!u)return[];const f=c.width,d=c.height;a.x=r/f*2-1,a.y=-i/d*2+1,o.setFromCamera(a,s),function(t,e){Y>113?t.params.Line.threshold=e:t.linePrecision=e}(o,this._getLinePrecision(this.getMap().getResolution()));const p=[],g=[];u.children.forEach(t=>{const e=t.__parent;if(e&&e.getOptions){const n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&h.Util.isFunction(n.identify)?g.push(n):p.push(t))}else(t instanceof l.Mesh||t instanceof l.Group)&&p.push(t)});let m=[];const v=o.intersectObjects(p,!0);v&&Array.isArray(v)&&v.length&&(m=v.map(t=>{let e=t.object;e=this._recursionMesh(e)||{};const n=e.__parent||e;return n.faceIndex=t.faceIndex,n.index=t.index,n})),this.renderPickScene(),g.length&&g.forEach(e=>{e.identify(t)&&m.push(e)});const y=m.length;for(let t=0;t<y;t++)if(m[t])for(let e=t+1;e<y;e++)m[t]===m[e]&&m.splice(e,1);const _=(e=h.Util.extend({},e)).count;return h.Util.isNumber(_)&&_>0?m.slice(0,_):m}_recursionMesh(t){for(;t&&t.parent!==this.getScene();)t=t.parent;return t}_getLinePrecision(t=10){for(let e=0,n=dr.length;e<n;e++){const[n,r]=dr[e];if(t>n)return r}return.01}_identifyBaseObjectEvents(t){if(!this.options.geometryEvents)return this;const e=this.map||this.getMap();if(e.isInteracting()||!e.options.geometryEvents)return this;const{type:n,coordinate:r}=t,i=h.Util.now();if(this._mousemoveTimeOut&&"mousemove"===n&&i-this._mousemoveTimeOut<64)return this;this._mousemoveTimeOut=i,e.resetCursor("default");const o=this.options.identifyCountOnEvent;let a=Math.max(0,h.Util.isNumber(o)?o:0);0===a&&(a=1/0);const s=this.identify(r,{count:a}),u=this.getScene();if(0===s.length&&u)for(let e=0,n=u.children.length;e<n;e++){const n=(u.children[e]||{}).__parent;n&&n.fire("empty",Object.assign({},t,{target:n}))}if("mousemove"===n){s.length&&e.setCursor("pointer");const i=[];this._baseObjects&&this._baseObjects.forEach(t=>{let e=!0;s.forEach(n=>{t===n&&(e=!1)}),e&&i.push(t)}),i.forEach(e=>{e&&e instanceof ht&&(e.getSelectMesh?e.isHide||(e._mouseover=!1,e.fire("mouseout",Object.assign({},t,{target:e,type:"mouseout",selectMesh:null})),e.closeToolTip()):(e._mouseover=!1,e.fire("mouseout",Object.assign({},t,{target:e,type:"mouseout"})),e.closeToolTip()))}),s.forEach(e=>{if(e instanceof ht){e._mouseover||(e.fire("mouseover",Object.assign({},t,{target:e,type:"mouseover",selectMesh:e.getSelectMesh?e.getSelectMesh():null})),e._mouseover=!0),e.fire(n,Object.assign({},t,{target:e,selectMesh:e.getSelectMesh?e.getSelectMesh():null}));const i=e.getToolTip();i&&!i._owner&&i.addTo(e),e.openToolTip(r)}}),this._baseObjects=s}else s.forEach(e=>{if(e instanceof ht&&(e.fire(n,Object.assign({},t,{target:e,selectMesh:e.getSelectMesh?e.getSelectMesh():null})),"click"===n)){const t=e.getInfoWindow();t&&!t._owner&&t.addTo(e),e.openInfoWindow(r)}});return this}_zoomend(){const t=this.getScene();if(!t)return;const e=this.getMap().getZoom();t.children.forEach(t=>{const n=t.__parent;if(n&&n.getOptions){const t=n;t.zoomChange&&h.Util.isFunction(t.zoomChange)&&t.zoomChange(e);const r=t.getMinZoom(),i=t.getMaxZoom();e<r||e>i?(t.isVisible()&&(t.getObject3d().visible=!1),t._zoomVisible=!1):r<=e&&e<=i&&(t._visible&&(t.getObject3d().visible=!0),t._zoomVisible=!0)}})}onAdd(){super.onAdd();const t=this.map||this.getMap();return t?(pr.forEach(e=>{t.on(e,this._identifyBaseObjectEvents,this)}),this._needsUpdate=!0,this._animationBaseObjectMap||(this._animationBaseObjectMap={}),t.on("zooming zoomend",this._zoomend,this),this):this}onRemove(){super.onRemove();const t=this.map||this.getMap();return t?(pr.forEach(e=>{t.off(e,this._identifyBaseObjectEvents,this)}),t.off("zooming zoomend",this._zoomend,this),this):this}_callbackBaseObjectAnimation(){const t=this;if(t._animationBaseObjectMap)for(const e in t._animationBaseObjectMap)t._animationBaseObjectMap[e]._animation();return this}_getFovRatio(){const t=this.getMap().getFov();return Math.tan(t/2*fr)}}vr.mergeOptions({renderer:"gl",doubleBuffer:!1,glOptions:null,geometryEvents:!0,identifyCountOnEvent:0,forceRenderOnZooming:!0,loopRenderCount:50});class yr extends h.renderer.CanvasLayerRenderer{constructor(){super(...arguments),this._renderTime=0}getPrepareParams(){return[this.scene,this.camera]}getDrawParams(){return[this.scene,this.camera]}_drawLayer(){super._drawLayer.apply(this,arguments)}hitDetect(){return!1}createCanvas(){super.createCanvas(),this.createContext()}createContext(){if(this.canvas.gl&&this.canvas.gl.wrap)this.gl=this.canvas.gl.wrap();else{const t=this.layer.options.glOptions||{alpha:!0,depth:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1};t.preserveDrawingBuffer=!0,this.gl=this.gl||this._createGLContext(this.canvas,t)}this._initThreeRenderer(),this.layer.onCanvasCreate(this.context,this.scene,this.camera)}_initThreeRenderer(){this.matrix4=new l.Matrix4;const t=new l.WebGLRenderer({context:this.gl,alpha:!0});t.autoClear=!1,t.setClearColor(new l.Color(1,1,1),0),t.setSize(this.canvas.width,this.canvas.height),t.clear(),this.context=t;const e=this.scene=new l.Scene,n=this.layer.getMap(),r=n.getFov()*Math.PI/180,i=this.camera=new l.PerspectiveCamera(r,n.width/n.height,n.cameraNear,n.cameraFar);i.matrixAutoUpdate=!1,this._syncCamera(),e.add(i),this.pick=new er(this.layer)}onCanvasCreate(){super.onCanvasCreate()}resizeCanvas(t){if(!this.canvas)return;let e,n=this.getMap();e=t||n.getSize();const r=n.getDevicePixelRatio?n.getDevicePixelRatio():h.Browser.retina?2:1,i=this.canvas;i.height=r*e.height,i.width=r*e.width,this.layer._canvas&&i.style&&(i.style.width=e.width+"px",i.style.height=e.height+"px"),this.context.setSize(i.width,i.height)}clearCanvas(){this.canvas&&this.context.clear()}prepareCanvas(){return this.canvas?this.clearCanvas():this.createCanvas(),this.layer.fire("renderstart",{context:this.context}),null}renderScene(){const t=h.Util.now();t-this._renderTime>=16&&(this.layer._callbackBaseObjectAnimation(),this._renderTime=t),this._syncCamera(),this.context.render(this.scene,this.camera),this.completeRender()}remove(){delete this._drawContext,super.remove()}_syncCamera(){const t=this.getMap(),e=this.camera;e.matrix.elements=t.cameraWorldMatrix,e.projectionMatrix.elements=t.projMatrix,this.matrix4.invert?e.projectionMatrixInverse.elements=this.matrix4.copy(e.projectionMatrix).invert().elements:e.projectionMatrixInverse.elements=this.matrix4.getInverse(e.projectionMatrix).elements}_createGLContext(t,e){const n=["webgl2","webgl","experimental-webgl"];let r=null;for(let i=0;i<n.length;++i){try{r=t.getContext(n[i],e)}catch(t){}if(r)break}return r}}function _r(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function xr(t,e,n,r){return t.coordToPointAtRes?t.coordToPointAtRes(e,n,r):t.coordinateToPoint(e,n,r)}vr.registerRenderer("gl",yr),h.registerWorkerAdapter&&h.registerWorkerAdapter("__maptalks.three__",'function(e){"use strict";var d=n,t=n;function n(e,t,n){n=n||2;var r,i,o,a,v,h=t&&t.length,l=h?t[0]*n:e.length,u=p(e,0,l,n,!0),x=[];if(!u||u.next===u.prev)return x;if(h&&(u=function(e,t,n,r){var i,o,a,v,h=[];for(i=0,o=t.length;i<o;i++)a=t[i]*r,v=i<o-1?t[i+1]*r:e.length,(v=p(e,a,v,r,!1))===v.next&&(v.steiner=!0),h.push(function(e){var t=e,n=e;for(;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next,t!==e;);return n}(v));for(h.sort(m),i=0;i<h.length;i++)!function(e,t){(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var v=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(v<=i&&a<v){if((a=v)===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}}while(r=r.next,r!==t);if(!n)return null;if(i===a)return n;var h,l=n,u=n.x,x=n.y,f=1/0;r=n;for(;i>=r.x&&r.x>=u&&i!==r.x&&M(o<x?i:a,o,u,x,o<x?a:i,o,r.x,r.y)&&(h=Math.abs(o-r.y)/(i-r.x),Z(r,e)&&(h<f||h===f&&(r.x>n.x||r.x===n.x&&function(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}(n,r)))&&(n=r,f=h)),r=r.next,r!==l;);return n}(e,t))&&(e=S(t,e),g(t,t.next),g(e,e.next))}(h[i],n),n=g(n,n.next);return n}(e,t,u,n)),e.length>80*n){for(var f=r=e[0],s=i=e[1],c=n;c<l;c+=n)(o=e[c])<f&&(f=o),(a=e[c+1])<s&&(s=a),r<o&&(r=o),i<a&&(i=a);v=0!==(v=Math.max(r-f,i-s))?1/v:0}return y(u,x,n,f,s,v),x}function p(e,t,n,r,i){var o,a;if(i===0<z(e,t,n,r))for(o=t;o<n;o+=r)a=v(o,e[o],e[o+1],a);else for(o=n-r;t<=o;o-=r)a=v(o,e[o],e[o+1],a);return a&&u(a,a.next)&&(f(a),a=a.next),a}function g(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!u(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(f(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){for(var i=e;null===i.z&&(i.z=b(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,v,h,l=1;do{for(n=e,o=e=null,a=0;n;){for(a++,r=n,t=v=0;t<l&&(v++,r=r.nextZ);t++);for(h=l;0<v||0<h&&r;)0!==v&&(0===h||!r||n.z<=r.z)?(n=(i=n).nextZ,v--):(r=(i=r).nextZ,h--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}}while(o.nextZ=null,l*=2,1<a)}(i)}(e,r,i,o);for(var v,h,l=e;e.prev!==e.next;)if(v=e.prev,h=e.next,o?function(e,t,n,r){var i=e.prev,o=e,a=e.next;if(0<=w(i,o,a))return!1;var v=(i.x<o.x?i.x<a.x?i:a:o.x<a.x?o:a).x,h=(i.y<o.y?i.y<a.y?i:a:o.y<a.y?o:a).y,l=(i.x>o.x?i.x>a.x?i:a:o.x>a.x?o:a).x,u=(i.y>o.y?i.y>a.y?i:a:o.y>a.y?o:a).y,x=b(v,h,t,n,r),f=b(l,u,t,n,r),s=e.prevZ,c=e.nextZ;for(;s&&s.z>=x&&c&&c.z<=f;){if(s!==e.prev&&s!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;if(s=s.prevZ,c!==e.prev&&c!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&0<=w(c.prev,c,c.next))return!1;c=c.nextZ}for(;s&&s.z>=x;){if(s!==e.prev&&s!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;s=s.prevZ}for(;c&&c.z<=f;){if(c!==e.prev&&c!==e.next&&M(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&0<=w(c.prev,c,c.next))return!1;c=c.nextZ}return!0}(e,r,i,o):function(e){var t=e.prev,n=e,r=e.next;if(0<=w(t,n,r))return!1;var i=e.next.next;for(;i!==e.prev;){if(M(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=w(i.prev,i,i.next))return!1;i=i.next}return!0}(e))t.push(v.i/n),t.push(e.i/n),t.push(h.i/n),f(e),e=h.next,l=h.next;else if((e=h)===l){a?1===a?y(e=function(e,t,n){var r=e;do{var i=r.prev,o=r.next.next}while(!u(i,o)&&x(i,r,r.next,o)&&Z(i,o)&&Z(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),f(r),f(r.next),r=e=o),r=r.next,r!==e);return g(r)}(g(e),t,n),t,n,r,i,o,2):2===a&&function(e,t,n,r,i,o){var a=e;do{for(var v=a.next.next;v!==a.prev;){if(a.i!==v.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&x(n,n.next,e,t))return!0}while(n=n.next,n!==e);return!1}(e,t)&&(Z(e,t)&&Z(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||u(e,t)&&0<w(e.prev,e,e.next)&&0<w(t.prev,t,t.next))}(a,v)){var h=S(a,v);return a=g(a,a.next),h=g(h,h.next),y(a,t,n,r,i,o),y(h,t,n,r,i,o)}v=v.next}}while((a=a.next)!==e)}(e,t,n,r,i,o):y(g(e),t,n,r,i,o,1);break}}}function m(e,t){return e.x-t.x}function b(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function M(e,t,n,r,i,o,a,v){return 0<=(i-a)*(t-v)-(e-a)*(o-v)&&0<=(e-a)*(r-v)-(n-a)*(t-v)&&0<=(n-a)*(o-v)-(i-a)*(r-v)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function u(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,n,r){var i=l(w(e,t,n)),o=l(w(e,t,r)),a=l(w(n,r,e)),v=l(w(n,r,t));return i!==o&&a!==v||(0===i&&h(e,n,t)||(0===o&&h(e,r,t)||(0===a&&h(n,e,r)||!(0!==v||!h(n,t,r)))))}function h(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function l(e){return 0<e?1:e<0?-1:0}function Z(e,t){return w(e.prev,e,e.next)<0?0<=w(e,t,e.next)&&0<=w(e,e.prev,t):w(e,t,e.prev)<0||w(e,e.next,t)<0}function S(e,t){var n=new a(e.i,e.x,e.y),r=new a(t.i,t.x,t.y),i=e.next,o=t.prev;return(e.next=t).prev=e,(n.next=i).prev=n,(r.next=n).prev=r,(o.next=r).prev=o,r}function v(e,t,n,r){n=new a(e,t,n);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function f(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function a(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}function r(e,t){var n=e.length-1,r=[e[0]];return function e(t,n,r,i,o){for(var a,v,h,l,u,x,f,s=i,c=n+1;c<r;c++){var p=(v=t[c],h=t[n],l=t[r],p=f=x=u=void 0,u=h[0],x=h[1],f=l[0]-u,p=l[1]-x,0===f&&0===p||(1<(h=((v[0]-u)*f+(v[1]-x)*p)/(f*f+p*p))?(u=l[0],x=l[1]):0<h&&(u+=f*h,x+=p*h)),(f=v[0]-u)*f+(p=v[1]-x)*p);s<p&&(a=c,s=p)}i<s&&(1<a-n&&e(t,n,a,i,o),o.push(t[a]),1<r-a&&e(t,a,r,i,o))}(e,0,n,t,r),r.push(e[n]),r}function A(e,t,n){if(e.length<=2)return e;t=void 0!==t?t*t:1;return e=r(e=n?e:function(e,t){for(var n,r,i,o,a=e[0],v=[a],h=1,l=e.length;h<l;h++)n=e[h],i=a,o=void 0,o=(r=n)[0]-i[0],i=r[1]-i[1],t<o*o+i*i&&(v.push(n),a=n);return a!==n&&v.push(n),v}(e,t),t)}function R(e,t){var n=t[0],r=t[1],t=Math.sqrt(n*n+r*r);return e[0]=n/t,e[1]=r/t,e}function s(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function F(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}n.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(z(e,0,o,n));if(i)for(var v=0,h=t.length;v<h;v++){var l=t[v]*n,u=v<h-1?t[v+1]*n:e.length;a-=Math.abs(z(e,l,u,n))}for(var x=0,v=0;v<r.length;v+=3){var f=r[v]*n,s=r[v+1]*n,c=r[v+2]*n;x+=Math.abs((e[f]-e[c])*(e[1+s]-e[1+f])-(e[f]-e[s])*(e[1+c]-e[1+f]))}return 0===a&&0===x?0:Math.abs((x-a)/a)},n.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[i][o][a]);0<i&&(r+=e[i-1].length,n.holes.push(r))}return n},d.default=t;var c=[];function ee(e,t,n,r){var i,o,a=(o=n,(i=t)[0]*o[0]+i[1]*o[1]+i[2]*o[2]),v=Math.acos(a)*r;return s(c,n,t,-a),r=(o=i=c)[0],n=o[1],a=o[2],o=Math.sqrt(r*r+n*n+a*a),i[0]=r/o,i[1]=n/o,i[2]=a/o,a=e,o=t,t=Math.cos(v),a[0]=o[0]*t,a[1]=o[1]*t,a[2]=o[2]*t,s(e,e,c,Math.sin(v)),e}function q(e,t,n){if(n-t<3)return 0;for(var r=0,i=2*(n-1),o=2*t;o<2*n;){var a=e[i],v=e[i+1],h=e[o],l=e[o+1],i=o;o+=2,r+=a*l-h*v}return r}var B=[],U=[],L=[];function O(e,t,n,r,i,o,a,v){var h=null!=a,l=i,u=null;h&&(u=new Uint32Array(r-n));for(var x=n;x<r;x++){var f=x===r-1?n:x+1,s=x===n?r-1:x-1,c=e[2*s],p=e[2*s+1],g=e[2*x],d=e[2*x+1],s=e[2*f],f=e[2*f+1];B[0]=g-c,B[1]=d-p,U[0]=s-g,U[1]=f-d,R(B,B),R(U,U),h&&(u[x]=l),v||x!==n?v||x!==r-1?(c=U,p=B,(s=L)[0]=c[0]+p[0],s[1]=c[1]+p[1],f=L[1],L[1]=-L[0],L[0]=f,R(L,L),s=U,p=(c=L)[0]*s[0]+c[1]*s[1],f=Math.sqrt(1-p*p),c=o*Math.min(10,1/f),h&&a<1/f&&o*p<0?(s=g+L[0]*o,p=d+L[1]*o,f=Math.acos(f)/2,f=Math.tan(f)*Math.abs(o),t[2*l]=s+L[1]*f,t[2*l+1]=p-L[0]*f,t[2*++l]=s-L[1]*f,t[2*l+1]=p+L[0]*f):(t[2*l]=g+L[0]*c,t[2*l+1]=d+L[1]*c)):(L[0]=B[1],L[1]=-B[0],R(L,L),t[2*l]=g+L[0]*o,t[2*l+1]=d+L[1]*o):(L[0]=U[1],L[1]=-U[0],R(L,L),t[2*l]=g+L[0]*o,t[2*l+1]=d+L[1]*o),l++}return u}function P(e,t,n,r,i){var o=null!=r?[]:new Float32Array(e.length);if(O(e,o,0,t&&t.length?t[0]:e.length/2,0,n,r,i),t)for(var a=0;a<t.length;a++){var v=t[a];O(e,o,v,t[a+1]||e.length/2,null!=r?o.length/2:v,n,r,i)}return o}function V(e,t,n,r){for(var i=0;i<Math.floor((r-n)/2);i++)for(var o=0;o<t;o++){var a=(i+n)*t+o,v=(r-i-1)*t+o,h=e[a];e[a]=e[v],e[v]=h}return e}function W(e){e.depth=e.depth||1,e.bevelSize=e.bevelSize||0,e.bevelSegments=null==e.bevelSegments?2:e.bevelSegments,e.smoothSide=e.smoothSide||!1,e.smoothBevel=e.smoothBevel||!1,e.simplify=e.simplify||0,"number"==typeof e.depth&&(e.bevelSize=Math.min(0<e.bevelSegments?e.bevelSize:0,e.depth/2)),0<e.bevelSize||(e.bevelSegments=0),e.bevelSegments=Math.round(e.bevelSegments);var t,n,r,i,o=e.boundingRect;e.translate=e.translate||[0,0],e.scale=e.scale||[1,1],e.fitRect&&(t=null==e.fitRect.x?o.x||0:e.fitRect.x,n=null==e.fitRect.y?o.y||0:e.fitRect.y,r=e.fitRect.width,i=e.fitRect.height,null==r?null!=i?r=i/o.height*o.width:(r=o.width,i=o.height):null==i&&(i=r/o.width*o.height),e.scale=[r/o.width,i/o.height],e.translate=[(t-o.x)*e.scale[0],(n-o.y)*e.scale[1]])}function j(e,t){function n(e,t,n,r){e[0]=t,e[1]=n,e[2]=r}for(var r,i,o,a,v,h,l,u=[],x=[],f=[],s=[],c=[],p=[],g=e.length,d=new Float32Array(t.length),y=0;y<g;){var m=3*e[y++],b=3*e[y++],M=3*e[y++];n(u,t[m],t[1+m],t[2+m]),n(x,t[b],t[1+b],t[2+b]),n(f,t[M],t[1+M],t[2+M]),F(s,u,x),F(c,x,f),r=p,o=c,l=h=v=a=void 0,a=(i=s)[0],v=i[1],h=i[2],l=o[0],i=o[1],o=o[2],r[0]=v*o-h*i,r[1]=h*l-a*o,r[2]=a*i-v*l;for(var w=0;w<3;w++)d[m+w]=d[m+w]+p[w],d[b+w]=d[b+w]+p[w],d[M+w]=d[M+w]+p[w]}for(var Z,S,z,A,R,q=0;q<d.length;)n(p,d[q],d[q+1],d[q+2]),R=A=z=void 0,z=(S=Z=p)[0],A=S[1],R=S[2],S=Math.sqrt(z*z+A*A+R*R),Z[0]=z/S,Z[1]=A/S,Z[2]=R/S,d[q++]=p[0],d[q++]=p[1],d[q++]=p[2];return d}var te=[[0,0],[1,0],[1,1],[0,0],[1,1],[0,1]];function H(e,t,n,r,i,o){var a=t.vertices,v=t.topVertices,h=t.depth,t=t.rect,l=r-n,u=o.smoothSide?1:2,x=l*u,f=o.smoothBevel?1:2,s=Math.min(h/2,o.bevelSize),c=o.bevelSegments,p=i.vertex,g=Math.max(t.width,t.height,h);if(0<s)for(var d=[0,0,1],y=[],m=[0,0,-1],b=[],M=0,w=new Float32Array(l),Z=0;Z<2;Z++)for(var S=0===Z?h-s:s,z=0;z<=c*f;z++){for(var A=0,R=void 0,q=void 0,F=0;F<l;F++){for(var B=0;B<u;B++){var U=2*((F+B)%l+n);y[0]=a[U]-v[U],y[1]=a[1+U]-v[1+U],y[2]=0;var L=Math.sqrt(y[0]*y[0]+y[1]*y[1]);y[0]/=L,y[1]/=L;var O=(Math.floor(z/f)+z%f)/c;0===Z?ee(b,d,y,O):ee(b,y,m,O);var P=0===Z?O:1-O,V=s*Math.sin(P*Math.PI/2),W=L*Math.cos(P*Math.PI/2),O=s*L/Math.sqrt(V*V+W*W),P=b[0]*O+v[U],L=b[1]*O+v[1+U],V=b[2]*O+S;e.position[3*i.vertex]=P,e.position[3*i.vertex+1]=L,e.position[3*i.vertex+2]=V,(0<F||0<B)&&(A+=Math.sqrt((R-P)*(R-P)+(q-L)*(q-L))),(0<z||0<Z)&&(W=3*(i.vertex-x),U=e.position[W],O=e.position[1+W],W=e.position[2+W],w[F]+=Math.sqrt((U-P)*(U-P)+(O-L)*(O-L)+(W-V)*(W-V))),e.uv[2*i.vertex]=A/g,e.uv[2*i.vertex+1]=w[F]/g,R=P,q=L,i.vertex++}if(1<f&&z%f||1==f&&1<=z)for(var j=0;j<6;j++){var H=(te[j][0]+F*u)%x,k=te[j][1]+M;e.indices[i.index++]=(k-1)*x+H+p}}M++}else for(var I=0;I<2;I++)for(var _=0===I?h-s:s,D=0,E=void 0,C=void 0,G=0;G<l;G++)for(var J=0;J<u;J++){var K=2*((G+J)%l+n),N=a[K],K=a[1+K];e.position[3*i.vertex]=N,e.position[3*i.vertex+1]=K,e.position[3*i.vertex+2]=_,(0<G||0<J)&&(D+=Math.sqrt((E-N)*(E-N)+(C-K)*(C-K))),e.uv[2*i.vertex]=D/g,e.uv[2*i.vertex+1]=_/g,E=N,C=K,i.vertex++}for(var Q=0<s?c*f+1:1,T=0;T<l;T++)for(var X=0;X<6;X++){var Y=(te[X][0]+T*u)%x,$=te[X][1]+Q;e.indices[i.index++]=($-1)*x+Y+p}}function k(e,t){for(var n=0,r=0,i=0;i<e.length;i++){var o=e[i],a=o.indices,v=o.vertices,h=o.holes,o=o.depth,l=v.length/2,u=0<Math.min(o/2,t.bevelSize)?t.bevelSegments:0;n+=a.length*(t.excludeBottom?1:2),r+=l*(t.excludeBottom?1:2);for(var x=2+2*u,f=0,s=0,c=0;c<(h?h.length:0)+1;c++){n+=6*((s=0===c?h&&h.length?h[0]:l:(f=h[c-1],h[c]||l))-f)*(x-1);var p=(s-f)*(t.smoothSide?1:2);r+=p*x+(t.smoothBevel?0:u*p*2)}}for(var g={position:new Float32Array(3*r),indices:new(65535<r?Uint32Array:Uint16Array)(n),uv:new Float32Array(2*r)},d={vertex:0,index:0},y=0;y<e.length;y++)!function(e,t,n,r){var i=e.indices,o=e.vertices,a=e.topVertices,v=e.rect,h=e.depth;if(!(o.length<=4)){for(var l=n.vertex,u=i.length,x=0;x<u;x++)t.indices[n.index++]=l+i[x];for(var f=Math.max(v.width,v.height),s=0;s<(r.excludeBottom?1:2);s++)for(var c=0;c<a.length;c+=2){var p=a[c],g=a[c+1];t.position[3*n.vertex]=p,t.position[3*n.vertex+1]=g,t.position[3*n.vertex+2]=(1-s)*h,t.uv[2*n.vertex]=(p-v.x)/f,t.uv[2*n.vertex+1]=(g-v.y)/f,n.vertex++}if(!r.excludeBottom)for(var d=o.length/2,y=0;y<u;y+=3)for(var m=0;m<3;m++)t.indices[n.index++]=l+d+i[y+2-m]}}(e[y],g,d,t);for(var m=0;m<e.length;m++){var b,M=e[m],w=M.holes,Z=M.vertices.length/2,S=w&&w.length?w[0]:Z;if(H(g,e[m],0,S,d,t),w)for(var z=0;z<w.length;z++)b=w[z],S=w[z+1]||Z,H(g,e[m],b,S,d,t)}for(var A=0;A<g.uv.length;A++){var R=g.uv[A];0<R&&Math.round(R)===R?g.uv[A]=1:g.uv[A]=R%1}return g.normal=j(g.indices,g.position),g.boundingRect=e[0]&&e[0].rect,g}function I(e,t){t=Object.assign({},t);for(var n=[1/0,1/0],r=[-1/0,-1/0],i=0;i<e.length;i++)D(e[i][0],n,r);t.boundingRect=t.boundingRect||{x:n[0],y:n[1],width:r[0]-n[0],height:r[1]-n[1]},W(t);for(var o=[],a=t.translate||[0,0],v=t.scale||[1,1],h=t.boundingRect,l={x:h.x*v[0]+a[0],y:h.y*v[1]+a[1],width:h.width*v[0],height:h.height*v[1]},u=Math.min(h.width,h.height)/1e5,x=0;x<e.length;x++){var f=function(e,t){for(var n=[],r=0;r<e.length;r++){for(var i=e[r],o=[],a=i.length,v=i[a-1][0],h=i[a-1][1],l=0,u=0;u<a;u++){var x=i[u][0],f=i[u][1],s=x-v,c=f-h;t<(l+=Math.sqrt(s*s+c*c))&&(o.push(i[u]),l=0),v=x,h=f}3<=o.length&&n.push(o)}return 0<n.length?n:null}(e[x],u);if(f){var s=t.simplify/Math.max(v[0],v[1]);if(f=0<s?function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];3<=(i=A(i,t,!0)).length&&n.push(i)}return 0<n.length?n:null}(f,s):f){for(var c=d.flatten(f),p=c.vertices,s=c.holes,f=c.dimensions,g=0;g<p.length;)p[g]=p[g++]*v[0]+a[0],p[g]=p[g++]*v[1]+a[1];if(!function(e,t){var n=e.length/2,r=0,i=t&&t.length?t[0]:n;0<q(e,r,i)&&V(e,2,r,i);for(var o=1;o<(t?t.length:0)+1;o++)q(e,r=t[o-1],i=t[o]||n)<0&&V(e,2,r,i)}(p,s),2!==f)throw new Error("Only 2D polygon points are supported");c=0<t.bevelSize?P(p,s,t.bevelSize,null,!0):p,f=d(c,s,f=void 0===(f=f)?2:f);o.push({indices:f,vertices:p,topVertices:c,holes:s,rect:l,depth:"function"==typeof t.depth?t.depth(x):t.depth})}}}return k(o,t)}function _(e,t){t=Object.assign({},t);for(var n=[1/0,1/0],r=[-1/0,-1/0],i=0;i<e.length;i++)D(e[i],n,r);t.boundingRect=t.boundingRect||{x:n[0],y:n[1],width:r[0]-n[0],height:r[1]-n[1]},W(t);var o=t.scale||[1,1];null==t.lineWidth&&(t.lineWidth=1),null==t.miterLimit&&(t.miterLimit=2);for(var a=[],v=0;v<e.length;v++){var h=e[v],l=t.simplify/Math.max(o[0],o[1]);0<l&&(h=A(h,l,!0)),a.push(function(e,t,n){for(var r=n.lineWidth,i=e.length,o=new Float32Array(2*i),a=n.translate||[0,0],v=n.scale||[1,1],h=0,l=0;h<i;h++)o[l++]=e[h][0]*v[0]+a[0],o[l++]=e[h][1]*v[1]+a[1];q(o,0,i)<0&&V(o,2,0,i);var u=[],x=[],f=n.miterLimit,s=O(o,x,0,i,0,-r/2,f,!1);V(o,2,0,i);for(var c=O(o,u,0,i,0,-r/2,f,!1),r=(u.length+x.length)/2,p=new Float32Array(2*r),g=0,d=x.length/2,y=0;y<x.length;y++)p[g++]=x[y];for(var m=0;m<u.length;m++)p[g++]=u[m];for(var b=new(65535<r?Uint32Array:Uint16Array)(3*(2*(i-1)+(r-2*i))),M=0,w=0;w<i-1;w++){var Z=w+1;b[M++]=d-1-s[w],b[M++]=d-1-s[w]-1,b[M++]=c[w]+1+d,b[M++]=d-1-s[w],b[M++]=c[w]+1+d,b[M++]=c[w]+d,c[Z]-c[w]==2?(b[M++]=c[w]+2+d,b[M++]=c[w]+1+d,b[M++]=d-s[Z]-1):s[Z]-s[w]==2&&(b[M++]=c[Z]+d,b[M++]=d-1-(s[w]+1),b[M++]=d-1-(s[w]+2))}return f=0<n.bevelSize?P(p,[],n.bevelSize,null,!0):p,r=n.boundingRect,{vertices:p,indices:b,topVertices:f,rect:{x:r.x*v[0]+a[0],y:r.y*v[1]+a[1],width:r.width*v[0],height:r.height*v[1]},depth:"function"==typeof n.depth?n.depth(t):n.depth,holes:[]}}(h,v,t))}return k(a,t)}function D(e,t,n){for(var r=0;r<e.length;r++)t[0]=Math.min(e[r][0],t[0]),t[1]=Math.min(e[r][1],t[1]),n[0]=Math.max(e[r][0],n[0]),n[1]=Math.max(e[r][1],n[1])}function E(e){for(var t=new Float32Array(e),n=[],r=0,i=t.length;r<i;r+=2){var o=t[r],a=t[r+1];n.push([o,a])}return n}function C(e,t){void 0===t&&(t=!1);for(var n,r,i,o,a=e.length,v=[],h=[],l=[],u=0,x=0,f=0,s=0,c=0;c<a;c++){var p=t?(p=e[c],r=i=n=o=i=r=n=void 0,n=p.data,r=p.height,i=p.width,o=p.bottomHeight,p=_(n,{lineWidth:i,depth:r}),n=p.position,i=p.normal,r=p.uv,p=p.indices,G(n,o),{position:n,normal:i,uv:r,indices:p}):(d=e[c],b=m=y=b=g=m=y=void 0,y=d.data,m=d.height,g=d.bottomHeight,b=I(y,{depth:m}),d=b.position,y=b.normal,m=b.uv,b=b.indices,G(d,g),{position:d,normal:y,uv:m,indices:b}),g=e[c].bottomHeight||0,d=p.position,y=p.normal,m=p.uv,b=p.indices;h.push(p);b=b.length/3;l[c]=[u+1,u+b],u+=b;d=d.length/3,y=y.length/3,m=m.length/2;v[c]={position:{middleZ:g+(e[c].height||0)/2,count:d,start:x,end:x+3*d},normal:{count:y,start:f,end:f+3*y},uv:{count:m,start:s,end:s+2*m},hide:!1},x+=3*d,f+=3*y,s+=2*m}var M=function(e){for(var t={},n={},r=0;r<e.length;++r){var i,o=e[r];for(i in o)void 0===t[i]&&(t[i]=[],n[i]=0),t[i].push(o[i]),n[i]+=o[i].length}var a,v={},h=0,l=[];for(a in t)if("indices"===a)for(var u=t[a],x=0,f=u.length;x<f;x++){for(var s=u[x],c=0,p=s.length;c<p;c++)l.push(s[c]+h);h+=t.position[x].length/3}else{var g=function(e,t){for(var n=new Float32Array(t),r=0,i=0;i<e.length;++i)n.set(e[i],r),r+=e[i].length;return n}(t[a],n[a]);if(!g)return null;v[a]=g}return v.indices=new Uint32Array(l),v}(h),w=M.position,Z=M.normal,S=M.uv,M=M.indices;return{position:w.buffer,normal:Z.buffer,uv:S.buffer,indices:M.buffer,faceMap:l,geometriesAttributes:v}}function G(e,t){if(void 0!==t&&"number"==typeof t&&0!==t)for(var n=0,r=e.length;n<r;n+=3)e[n+2]+=t}e.initialize=function(){},e.onmessage=function(e,t){var n=e.data,e=n.type,r=n.datas;if("Polygon"===e){!function(e){for(var t=e.length,n=0;n<t;n++)for(var r=e[n].data,i=0,o=r.length;i<o;i++)for(var a=r[i],v=0,h=a.length;v<h;v++)e[n].data[i][v]=E(a[v])}(r);n=C(r);t(null,n,[n.position,n.normal,n.uv,n.indices])}else if("LineString"===e){for(var i=0,o=r.length;i<o;i++)for(var a=0,v=r[i].data.length;a<v;a++)r[i].data[a]=E(r[i].data[a]);e=C(r,!0);t(null,e,[e.position,e.normal,e.uv,e.indices])}},Object.defineProperty(e,"__esModule",{value:!0})}');var br={altitude:0},wr=new l.Vector3,Mr={positionsConvert:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=[],i=0,o=t.length;i<o;i+=3){var a=t[i],s=t[i+1],u=t[i+2];e>0&&(u+=n.distanceToVector3(e,e).x),r.push(new l.Vector3(a,s,u))}return r},vectors2Pixel:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;t[0]instanceof l.Vector3||(t=Mr.positionsConvert(t,r,i));var o=t.map((function(t){return Mr.vector2Pixel(t,e,n)}));return o},vector2Pixel:function(t,e,n){var r=t.project(n),i=e.width/2,o=e.height/2;return{x:Math.round(r.x*i+i),y:Math.round(-r.y*o+o)}}};function Sr(t,e,n){return t[e]||(t[e]=n.distanceToVector3(e,e).x),t[e]}function Ar(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}var Cr=function(t){P(n,t);var e=F(n);function n(t,i,o,a,s){var u;r(this,n),Array.isArray(t)||(t=[t]);var c=1/0,f=1/0,d=-1/0,p=-1/0;if((i=h.Util.extend({},br,i,{layer:s,points:t})).bound)c=i.bound.minX,f=i.bound.minY,d=i.bound.maxX,p=i.bound.maxY;else for(var g=0,m=t.length;g<m;g++){var v=t[g].coordinate,y=void 0,_=void 0;Array.isArray(v)?(y=v[0],_=v[1]):v instanceof h.Coordinate&&(y=v.x,_=v.y),c=Math.min(c,y),f=Math.min(f,_),d=Math.max(d,y),p=Math.max(p,_)}for(var x=s.coordinateToVector3([(c+d)/2,(f+p)/2]),b=X.initGrids(c,f,d,p),w=b.grids,M=b.averageX,S=b.averageY,A=b.ROWS,C=(b.COLS,w.length,new Float32Array(3*t.length)),E=[],T=new Float32Array(3*t.length),I=new Float32Array(3*t.length),L=[],P=[],R=new Float32Array(t.length),O=new Float32Array(t.length),k=new Float32Array(t.length),B=new Float32Array(t.length),F=new Float32Array(t.length),D=new Float32Array(t.length),U=new Float32Array(t.length),j={},N={},G=new l.Vector3(0,0,0),z=0,H=t.length;z<H;z++){var V=t[z],W=V.coordinate,Z=V.height,Q=V.color,Y=V.fcolor1,J=V.rotation,q=V.imgflag,K=V.visibility,$=V.opavalue,tt=V.colorflag,et=V.fcolorflag,nt=V.imgnum,rt=3*z,it=Q instanceof l.Color?Q:new l.Color(Q);T[rt]=it.r,T[rt+1]=it.g,T[rt+2]=it.b,it=Q instanceof l.Color?Q:new l.Color(Y),I[rt]=it.r,I[rt+1]=it.g,I[rt+2]=it.b,R[z]=J,O[z]=q,k[z]=K,B[z]=$,F[z]=tt,D[z]=et,U[z]=nt;var ot=Sr(j,Z,s),at=s.coordinateToVector3(W,ot);G.x=at.x,G.y=at.y,G.z=at.z,G.sub(x),C[rt]=G.x,C[rt+1]=G.y,C[rt+2]=G.z,E.push(at),P[z]={position:{count:1,start:3*z,end:3*z+3},hide:!1};var st=Ar((W[1]-f)/S,4),ut=Ar((W[0]-c)/M,4);st-=1,ut-=1,st=Math.max(0,st),ut=Math.max(0,ut),st=Math.ceil(st);var ct=(ut=Math.ceil(ut))*A+st;w[ct]&&(w[ct].positions.push(at),w[ct].indexs.push(z)),N[z]=!(K<.5)}var lt=new l.BufferGeometry;lt.setAttribute("position",new l.Float32BufferAttribute(C,3,!0)),lt.setAttribute("color",new l.Float32BufferAttribute(T,3,!0)),lt.setAttribute("rotation",new l.Float32BufferAttribute(R,1,!0)),lt.setAttribute("fcolor1",new l.Float32BufferAttribute(I,3,!0)),lt.setAttribute("imgflag",new l.Float32BufferAttribute(O,1,!0)),lt.setAttribute("visibility",new l.Float32BufferAttribute(k,1,!0)),lt.setAttribute("opavalue",new l.Float32BufferAttribute(B,1,!0)),lt.setAttribute("colorflag",new l.Float32BufferAttribute(F,1,!0)),lt.setAttribute("fcolorflag",new l.Float32BufferAttribute(D,1,!0)),lt.setAttribute("imgnum",new l.Float32BufferAttribute(U,1,!0)),i.positions=E,(u=e.call(this))._initOptions(i),u._createPoints(lt,o);var ht=i.altitude,ft=s.distanceToVector3(ht,ht).x,dt=x.clone();return dt.z=ft,u.getObject3d().position.copy(dt),u._centerPt=x,u._averageX=M,u._averageY=S,u._ROWS=A,u._minX=c,u._minY=f,u._baseObjects=L,u._datas=t,u.faceIndex=null,u._geometriesAttributes=P,u.isHide=!1,u._initBaseObjectsEvent(L),u._grids=w,u._indexs_hide=N,u._bindMapEvents(),u._markTypeFunc=a,u.parent=null,u.type="Points",u}return o(n,[{key:"_bindMapEvents",value:function(){var t=this,e=this.getMap(),n="zoomstart zooming zoomend movestart moving moveend pitch rotate";this.on("add",(function(){t._updateGrids(),e.on(n,t._updateGrids,t)})),this.on("remove",(function(){e.off(n,t._updateGrids,t)}))}},{key:"updatepoints",value:function(t){Array.isArray(t)||(t=[t]);for(var e=this._grids.length,n=0;n<e;n++)this._grids[n].positions=[],this._grids[n].indexs=[];for(var r={},i=new Float32Array(3*t.length),o=new l.Vector3(0,0,0),a=0,s=t.length;a<s;a++){var u=t[a],c=u.coordinate,h=3*a,f=Sr(r,u.height,this.getLayer()),d=this.getLayer().coordinateToVector3(c,f);o.x=d.x,o.y=d.y,o.z=d.z,o.sub(this._centerPt),i[h]=o.x,i[h+1]=o.y,i[h+2]=o.z;var p=Ar((c[1]-this._minY)/this._averageY,4),g=Ar((c[0]-this._minX)/this._averageX,4);p-=1,g-=1,p=Math.max(0,p),g=Math.max(0,g),p=Math.ceil(p);var m=(g=Math.ceil(g))*this._ROWS+p;this._grids[m]&&(this._grids[m].positions.push(d),this._grids[m].indexs.push(a))}for(var v=this.getObject3d().geometry.attributes.position.array,y=0;y<i.length;y++)v[3*y+0]=i[3*y+0],v[3*y+1]=i[3*y+1],v[3*y+2]=i[3*y+2];this.getObject3d().geometry.attributes.position.needsUpdate=!0,this._updateGrids()}},{key:"_updateGrids",value:function(){var t=this.getMap();this._grids.forEach((function(e){e.indexs.length&&e.updateBBoxPixel(t)}))}},{key:"getSelectMesh",value:function(){var t=this.faceIndex;if(null!=t){if(!this._baseObjects[t]){var e=this._datas[t],n=e.coordinate,r=e.height,i=e.color;this._baseObjects[t]=this.getLayer().toPoint(n,{height:r,index:t,color:i},this.getObject3d().material),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}},{key:"identify",value:function(t){var e=this.getLayer(),n=this.getMap().getSize(),r=this.getLayer().getCamera(),i=this.getOptions().altitude,o=this.getMap(),a=e.distanceToVector3(i,i).x,s=this._markTypeFunc(this),u=o.coordToContainerPoint(t),c=[];if(this._grids&&this._grids.forEach((function(t){t.indexs.length&&t.isRecCross(u,s)&&c.push(t)})),c.length<1)return!1;for(var l=0,h=c.length;l<h;l++)for(var f=0,d=c[l].positions.length;f<d;f++){var p=c[l].positions[f];wr.x=p.x,wr.y=p.y,wr.z=p.z+a;var g=Mr.vector2Pixel(wr,n,r);if(Math.sqrt(Math.pow(u.x-g.x,2)+Math.pow(u.y-g.y,2))<=s/2){if(this.faceIndex=c[l].indexs[f],!this._indexs_hide[this.faceIndex])continue;return!0}}return!1}}]),n}(qe(ht)),Er=(n("0f55"),n("8745"),n("d3f4")),Tr=n.n(Er),Ir=function(){function t(e,n,i){var o=this;r(this,t);var a=n.altitude,s=n.isLabel,u=n.labelMinZoom,c=n.labelMaxZoom,f=n.labelLayerName,d=n.labelVisible,p=n.canvasSize,g=n.markSize,m=n.pointMinZoom,v=n.pointOrder,y=n.isToolTip,_=n.isPointNum,x=n.sizeType,b=n.iconFile;if(0!=e.length){var w=new l.PointsMaterial({sizeAttenuation:!1,transparent:!0,depthTest:!1});s&&f&&(this.layerLabel=new h.VectorLayer(f,{minZoom:u||15,geometryEvents:!1,hitDetect:!1,visible:d||!1}).addTo(i.map),this.all_labels=[]);var M=[];if(this.typeValues={},this.initTypeValue=-.9,this._initChildVar(n,i),e.slice(0,1/0).map((function(t){if(1*t.longitude>70&&1*t.longitude<138&&1*t.latitude>0&&1*t.latitude<56){var e=o._getImgType(t.businessType,t.imgSrc,t);if(o._bindDataItem(M,t,e),o.layerLabel){var r=new h.Marker([parseFloat(t.longitude),parseFloat(t.latitude)],{properties:{name:t.name,type:t.businessType,code:t.code,status:1},symbol:{textFaceName:n.nameFaceName||"microsoft yahei",textName:"{name}",textSize:n.nameFontSize||12,textFill:n.nameFontColor||"#cbd3ff",textDx:n.nameDy||0,textDy:n.nameDx||30}});1==t.visibility&&o.layerLabel.addGeometry(r),o.all_labels.push(r)}}})),this.textures=null,this.threeLayer=i,this.map=i.map,this.canvasSize=p||48,this.markSize=g||40,this.m=w,this.dataItems=M,this.point=null,this.shader=null,this.minZoom=m||8,this.markType=0===x?0:1,this.order=v||0,this.isToolTip=y||!1,this.customTooltip=n.customTooltip||!1,this.clickFunc=n.clickFunc||null,this.clickInfoFlag=void 0!==n.clickInfoFlag&&n.clickInfoFlag,this.iconFile=b||null,this.isPointNum=_||!1,this.iconFile&&(this.Infolayer=this.map.getLayer("infoLayer"),this.Infolayer||(this.Infolayer=new h.VectorLayer("infoLayer",{geometryEvents:!1,hitDetect:!1}).addTo(i.map)),this.iconCode=null),this.clickInfoFlag){var S={custom:!0,dy:n.infoDy||-48,content:"",animation:!1,autoOpenOn:null};this.infoWindow=new h.ui.InfoWindow(S).addTo(this.map)}this.layerPointNumLabel=new h.VectorLayer(h.Util.GUID(),{hitDetect:!1,zIndex:1001}).addTo(i.map),this.selectItems=[],this.funcsNew={},this.fitZoom=null,this.isCtrol=!0,this.rbush=new Tr.a,this.GLOBALSCALE=32768,this.XMAX=178,this.YMAX=85,this.MAXZOOM=31,this.SCALES=[];for(var A=0;A<this.MAXZOOM;A++)this.SCALES.push(129202.08021/Math.pow(2,A));this.clusterItemsCache={},this.clusterMinZoom=9,this.clusterMaxZoom=18,this.altitude=a,this.labelMaxZoom=c}else console.error("需要绘制的点位数量为0")}return o(t,[{key:"_initChildVar",value:function(t,e){throw new Error(e,"需要在派生类中实现")}},{key:"_bindMapEvents",value:function(){this.map.on("zooming zoomend",this._setSizeOn,this),this.point&&this.point.on("click empty mousemove mouseout",this._setPointEvent,this)}},{key:"_setSizeOn",value:function(){var t=this._getRate();for(var e in this.shader&&(this.shader.uniforms.size1.value=this.markSize*t),this.funcsNew)this.funcsNew[e]()}},{key:"_addIcon",value:function(t){this.Infolayer.clear(),new h.Marker([t.coordinate[0],t.coordinate[1]],{symbol:{markerFile:this.iconFile,markerWidth:48,markerHeight:48,markerDx:0,markerDy:0,markerOpacity:1}}).addTo(this.Infolayer),this.iconCode=t.code}},{key:"addContent",value:function(){var t=s(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.clickInfoFlag){t.next=5;break}return t.next=3,this.clickFunc(this.infoWindow,e);case 3:t.next=7;break;case 5:return t.next=7,this.clickFunc(e);case 7:this.iconFile&&this._addIcon(e),this.clickInfoFlag&&this.infoWindow.show({x:e.coordinate[0],y:e.coordinate[1]});case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_setPointEvent",value:function(t){var e,n=t.selectMesh;if(n&&(e=n.data),"mousemove"===t.type&&e){var r=e.value;this.isToolTip&&(this.point.getToolTip()._content="".concat(r)),this.customTooltip&&this.clickFunc&&this.addContent(e)}"mouseout"===t.type&&this.customTooltip&&this.clickFunc&&this.infoWindow.hide(),"click"===t.type&&e&&this.clickFunc&&!this.customTooltip&&this.addContent(e)}},{key:"_bindDataItem",value:function(t,e,n){throw new Error(t,e,n,"需要在派生类中实现")}},{key:"_getImgType",value:function(t,e,n){throw new Error(t,e,"需要在派生类中实现")}},{key:"_deleteFunsKey",value:function(t){if(t){for(var e in this.funcsNew)if(t&&t===e){delete this.funcsNew[e];break}}else for(var n in this.funcsNew)delete this.funcsNew[n]}},{key:"dispose",value:function(){for(var t in this.isToolTip&&this.point&&this.point.removeToolTip(),this.clearIcon(),this.Infolayer&&(this.map.removeLayer(this.Infolayer),delete this.Infolayer),this.rbush&&(this.rbush.clear(),delete this.rbush),this.layerLabel&&(this.map.removeLayer(this.layerLabel),delete this.layerLabel,this.all_labels=[]),this.layerPointNumLabel&&this.map&&(this.map.removeLayer(this.layerPointNumLabel),delete this.layerPointNumLabel),this._closeEvent(),this._deleteFunsKey(),this.typeValues)delete this.typeValues[t];if(this.typeValues={},this.point){if(this.threeLayer.removeMesh(this.point),this.point.object3d.geometry&&this.point.object3d.geometry.dispose(),this.point.object3d.material&&this.point.object3d.material.dispose(),this.point._indexs_hide){for(var e in this.point._indexs_hide)delete this.point._indexs_hide[e];delete this.point._indexs_hide}this.point._datas=[],this.point._geometriesAttributes=[],this.point._grids=[],delete this.point.object3d,this.point.toolTip&&delete this.point.toolTip,this.point.options.points=[],this.point.options.positions=[],delete this.point}this.infoWindow&&(this.infoWindow.remove(),delete this.infoWindow),this.clickFunc&&delete this.clickFunc,this.textures&&this.textures.length>0&&(this.textures.forEach((function(t){t.dispose()})),delete this.textures),this.dataItems=[],this.threeLayer=null,this.map=null,delete this.shader,this.m&&(this.m.dispose(),delete this.m),this.selectItems=[]}},{key:"findItemByCode",value:function(t){for(var e=0;e<this.dataItems.length;e++)if(this.dataItems[e].code===t)return e}},{key:"changePointMinZoom",value:function(t){this.point&&(this.point.options.minZoom=t)}},{key:"_closeEvent",value:function(){this.point&&this.map.off("zooming zoomend",this._setSizeOn,this),this.point&&this.point.off("click empty mousemove mouseout",this._setPointEvent,this)}},{key:"clearIcon",value:function(){this.Infolayer&&this.Infolayer.clear(),this.infoWindow&&this.infoWindow.hide(),this.iconCode=null}},{key:"_loadTexture",value:function(){var t=s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("需要在派生类中实现");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"pointShowHide",value:function(t,e,n,r,i){this.point&&(this.layerPointNumLabel&&this.layerPointNumLabel.clear(),this.layerLabel&&this.layerLabel.clear(),this.bzlayerNum&&this.bzlayerNum.clear(),this._deleteFunsKey(),this.selectItems=[],this.point.show(),this._pointShowHide(t,e,n,r,i))}},{key:"_pointShowHide",value:function(t,e,n,r,i){throw new Error(t,e,n,r,i,"需要在派生类中实现")}},{key:"_changePtVisible",value:function(t){var e=this;this.layerLabel&&this.layerLabel.clear();var n=this.point.object3d.geometry.attributes.visibility.array;if(0===t.length)for(var r=0;r<this.dataItems.length;r++)1===this.dataItems[r].visibility?(n[r]=1,this.point._indexs_hide[r]=!0,this.layerLabel.addGeometry(this.all_labels[r])):(n[r]=.1,this.point._indexs_hide[r]=!1);else{this.dataItems.forEach((function(t){t.visibility=.1})),t.forEach((function(t){e.dataItems[t].visibility=1}));for(var i=0;i<this.dataItems.length;i++)1===this.dataItems[i].visibility?(n[i]=1,this.point._indexs_hide[i]=!0,this.layerLabel&&this.layerLabel.addGeometry(this.all_labels[i])):(n[i]=.1,this.point._indexs_hide[i]=!1)}this.point.object3d.geometry.attributes.visibility.needsUpdate=!0}},{key:"pointShowHideByCode",value:function(t,e){this.layerPointNumLabel&&this.layerPointNumLabel.clear(),this._deleteFunsKey(),this.selectItems=[],this.point.show();for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<this.dataItems.length;a++){var s=this.dataItems[a];t.includes(s.code)?(n=Math.min(n,this.dataItems[a].coordinate[0]),r=Math.min(r,this.dataItems[a].coordinate[1]),i=Math.max(i,this.dataItems[a].coordinate[0]),o=Math.max(o,this.dataItems[a].coordinate[1]),s.visibility=1):s.visibility=.1}this._changePtVisible([]),e&&this.map.fitExtent(new h.Extent(n,r,i,o),0)}},{key:"_itemHide",value:function(t,e,n,r,i,o){var a,s=n||!0,u=r||!0;e&&"MultiPolygon"===e.getType()&&(a=e.toGeoJSON());var c=this.point.object3d.geometry.attributes.visibility.array;if(t.length>0){for(var l=0;l<this.dataItems.length;l++){var h=this.dataItems[l],f=!0;if(1===h.status?f=!0===s:0===h.status&&(f=!0===u),e&&(f&=!!("MultiPolygon"===e.getType()?V.containsCoordinate2(this.dataItems[l].coordinate,a):V.containsCoordinate1(this.dataItems[l].coordinate,e))),i&&i.rangeArr.length>0){var d=1*this.dataItems[l].pvalue;f&=!!V.isInLevels(i,d)}h.imgflag==o&&(f?(c[l]=1,this.point._indexs_hide[l]=!0,this.selectItems.push(l),this.layerLabel&&this.layerLabel.addGeometry(this.all_labels[l]),this.bzlayerNum&&this.bzlayerNum.addGeometry(this.bz_all_nums[l])):(c[l]=.1,this.point._indexs_hide[l]=!1))}this.point.object3d.geometry.attributes.visibility.needsUpdate=!0}else{for(var p=0;p<this.dataItems.length;p++)this.dataItems[p].imgflag==o&&(c[p]=.1,this.point._indexs_hide[p]=!1);this.point.object3d.geometry.attributes.visibility.needsUpdate=!0}}},{key:"_getRate",value:function(){var t=this.map.getZoom()-8;return.2*(t=t>4?4:t)+.2}},{key:"_getMarkSize",value:function(t){var e=t.parent;return e.markSize*e._getRate()}},{key:"addPoint",value:function(){var t=s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("需要在派生类中实现");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"pointShowHideShowNumSingle",value:function(t,e,n){var r=this,i=n||12;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey(),this.selectItems=[],this._pointShowHide(t,e);var o=1/0,a=1/0,s=-1/0,u=-1/0;this.selectItems.forEach((function(t){o=Math.min(o,r.dataItems[t].coordinate[0]),a=Math.min(a,r.dataItems[t].coordinate[1]),s=Math.max(s,r.dataItems[t].coordinate[0]),u=Math.max(u,r.dataItems[t].coordinate[1])}));var c=[(o+s)/2,(a+u)/2];this._addClusterLabel(c,this.selectItems.length,{}).on("click",(function(){r.layerPointNumLabel.hide(),r.map.fitExtent(new h.Extent(o,a,s,u),0),setTimeout((function(){r.point.show()}),500)})),this.point.hide(),this.funcsNew.a=function(){r.map.getZoom()<i?(r.point.hide(),r.layerPointNumLabel.show()):(r.point.show(),r.layerPointNumLabel.hide())}}},{key:"_clearClusterCache",value:function(){for(var t in this.clusterItemsCache)delete this.clusterItemsCache[t];this.clusterItemsCache={}}},{key:"pointShowHideShowNumbyCodeMultiple",value:function(t,e){var n=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey();for(var r=[],i=[],o=0;o<e.length;o++)r.push({code:o,geo:e[o],geojson:e[o].toGeoJSON(),ptnum:0,val:t,ptids:[]});this.dataItems.forEach((function(t){t.visibility=.1})),r.forEach((function(e){for(var r=0;r<n.dataItems.length;r++){var o=n.dataItems[r];t.includes(o.code)&&V.containsCoordinate2(n.dataItems[r].coordinate,e.geojson)&&(e.ptnum+=1,e.ptids.push(r),i.push(r),o.visibility=1)}})),r.forEach((function(t){n._addClusterLabel(t.geo.getCenter(),t.ptnum,t).on("click",(function(t){n.selectItems=[];var e=t.target.properties.item;e.ptnum>0&&(setTimeout((function(){n.point.show()}),500),n._changePtVisible(e.ptids),n._zoomSelect1(e.ptids,e.geo,i))}))})),this._changePtVisible(i),this.map.getZoom()<9.4?this.point.hide():(this.point.show(),this.layerPointNumLabel.hide()),this.funcsNew.b=function(){n.isCtrol&&(n.map.getZoom()<9.4?(n.point.hide(),n.layerPointNumLabel.show()):(n.point.show(),n.layerPointNumLabel.hide()))}}},{key:"pointShowHideShowNumMultiple",value:function(t,e){var n=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey();for(var r=[],i=[],o=0;o<e.length;o++)r.push({code:o,geo:e[o],geojson:e[o].toGeoJSON(),ptnum:0,val:t,ptids:[]});this.dataItems.forEach((function(t){t.visibility=.1})),r.forEach((function(e){for(var r=function(r){var o=n.dataItems[r];t.filter((function(t){return t===o.type})).length>0&&V.containsCoordinate2(n.dataItems[r].coordinate,e.geojson)&&(e.ptnum+=1,e.ptids.push(r),i.push(r),o.visibility=1)},o=0;o<n.dataItems.length;o++)r(o)})),r.forEach((function(t){n._addClusterLabel(t.geo.getCenter(),t.ptnum,t).on("click",(function(t){n.selectItems=[];var e=t.target.properties.item;e.ptnum>0&&(setTimeout((function(){n.point.show()}),500),n._changePtVisible(e.ptids),n._zoomSelect1(e.ptids,e.geo,i))}))})),this._changePtVisible(i),this.map.getZoom()<9.4?this.point.hide():(this.point.show(),this.layerPointNumLabel.hide()),this.funcsNew.b=function(){n.isCtrol&&(n.map.getZoom()<9.4?(n.point.hide(),n.layerPointNumLabel.show()):(n.point.show(),n.layerPointNumLabel.hide()))}}},{key:"_zoomSelect1",value:function(t,e,n){var r=this,i=1/0,o=1/0,a=-1/0,s=-1/0;t.forEach((function(t){i=Math.min(i,r.dataItems[t].coordinate[0]),o=Math.min(o,r.dataItems[t].coordinate[1]),a=Math.max(a,r.dataItems[t].coordinate[0]),s=Math.max(s,r.dataItems[t].coordinate[1])})),this.layerPointNumLabel.hide(),this.map.fitExtent(new h.Extent(i,o,a,s),0),this.isCtrol=!1,setTimeout((function(){r.funcsNew.a=function(){r.fitZoom||(r.fitZoom=r.map.getZoom()),r.map.getZoom()<r.fitZoom-.5&&(r.point.hide(),r.layerPointNumLabel.show(),r._deleteFunsKey("a"),r.fitZoom=null,r.isCtrol=!0,r._changePtVisible(n))}}),500)}},{key:"_addClusterLabelSmall",value:function(t,e,n,r,i){var o=r||"#50fcfc",a=i||"#000",s=new h.Marker(t,{properties:{item:n},symbol:[{type:"1",markerType:"ellipse",markerFill:o,markerFillOpacity:1,markerLineWidth:0,markerLineOpacity:1,markerWidth:{stops:[[9,32],[12,52]]},markerHeight:{stops:[[9,32],[12,52]]}}]});return this.layerPointNumLabel.addGeometry(s),new h.Marker(t,{properties:{name:e},symbol:{textFaceName:"sans-serif",textName:"{name}",textSize:{stops:[[9,12],[12,18],[15,24]]},textFill:a}}).addTo(this.layerPointNumLabel),s}},{key:"_addClusterLabel",value:function(t,e,n,r,i){var o=r||"#50fcfc",a=i||"#000",s=new h.Marker(t,{properties:{item:n},symbol:[{type:"1",markerType:"ellipse",markerFill:o,markerFillOpacity:1,markerLineWidth:0,markerLineOpacity:1,markerWidth:{stops:[[9,32],[12,52],[15,82]]},markerHeight:{stops:[[9,32],[12,52],[15,82]]}},{type:"2",markerType:"ellipse",markerFill:o,markerFillOpacity:"0.4",markerLineWidth:0,markerLineOpacity:1,markerWidth:{stops:[[9,54],[12,74],[15,104]]},markerHeight:{stops:[[9,54],[12,74],[15,104]]}}]});return this.layerPointNumLabel.addGeometry(s),new h.Marker(t,{properties:{name:e},symbol:{textFaceName:"sans-serif",textName:"{name}",textSize:{stops:[[9,12],[12,18],[15,24]]},textFill:a}}).addTo(this.layerPointNumLabel),s}},{key:"getClosestZoom",value:function(t){for(var e=0;e<this.MAXZOOM-1;e++){var n=this.SCALES[e],r=this.SCALES[e+1];if(n===t)return e;if(r===t)return e+1;if(t<n&&r<t)return Math.abs(t-n)<=Math.abs(t-r)?e:e+1}}},{key:"calColNum",value:function(t,e,n){var r=this;this.rbush.clear();for(var i=[],o=[],a=0;a<this.dataItems.length;a++)if(e&&e.length>0&&e.includes(a)){var s=this.getRect(this.dataItems[a],a);this.rbush.insert(s)}for(var u=0;u<this.dataItems.length;u++)if(e.includes(u))if(t>=18){var c=[u];o.push(c)}else i.includes(u)||function(){var t=r.getRect(r.dataItems[u]),e=r.rbush.search(t),n=[];if(e.forEach((function(t){n.push(t.idx)})),o.length>0){for(var a=[],s=0;s<o.length;s++)o[s].filter((function(t){return n.includes(t)})).length>0&&a.push(s);if(0===a.length)o.push(n.sort((function(t,e){return t-e})));else if(1===a.length){var c=o[a[0]].concat(n.filter((function(t){return!o[a[0]].includes(t)})));o[a[0]]=c.sort((function(t,e){return t-e}))}else{for(var l=[],h=[],f=0;f<o.length;f++)a.includes(f)?h.push(o[f]):l.push(o[f]);var d=h.flat(),p=d.concat(n.filter((function(t){return!d.includes(t)})));o=[],l.forEach((function(t){o.push(t)})),o.push(p)}}else o.push(n);i=o.flat()}();n.push(o)}},{key:"testCluster",value:function(t){var e=this;this.layerPointNumLabel.clear(),t.forEach((function(t){if(t.length>1){var n=1/0,r=1/0,i=-1/0,o=-1/0;t.forEach((function(t){n=Math.min(n,e.dataItems[t].coordinate[0]),r=Math.min(r,e.dataItems[t].coordinate[1]),i=Math.max(i,e.dataItems[t].coordinate[0]),o=Math.max(o,e.dataItems[t].coordinate[1]),e.dataItems[t].visibility=.1}));var a=[(n+i)/2,(r+o)/2];e._addClusterLabelSmall(a,t.length,{})}else e.dataItems[t[0]].visibility=1})),this._changePtVisible([])}},{key:"testMinClusterZoom",value:function(t){var e=this;this.layerPointNumLabel.clear(),t.forEach((function(t){e._addClusterLabel(t.geo.getCenter(),t.ptnum,t)})),this.dataItems.forEach((function(t){t.visibility=.1})),this._changePtVisible([])}},{key:"getRect",value:function(t,e){var n=this.threeLayer.coordinateToVector3(t.coordinate,0),r=this.getPixel(n),i=r.x,o=r.y,a=this._getRate(),s=this.markSize*a;return{minX:i-s/2,minY:o-s/2,maxX:i+s/2,maxY:o+s/2,idx:e}}},{key:"getPixel",value:function(t){var e=this.map.getSize(),n=this.threeLayer.getCamera();return V.vector2Pixel(t,e,n)}}]),t}(),Lr={factor:{aqi:{unit:"",name:"AQI",colorMap:{"00e400":[0,50],ffff00:[50,100],ff7e00:[100,150],ff0000:[150,200],"99004c":[200,300],"7e0023":[300,500],"6e6e6e":[500]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},pm25:{unit:"μg/m³",name:"PM2.5",colorMap:{"00e400":[0,35],ffff00:[35,75],ff7e00:[75,115],ff0000:[115,150],"99004c":[150,250],"7e0023":[250,500],"7e0022":[500]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},pm10:{unit:"μg/m³",name:"PM10",colorMap:{"00e400":[0,50],ffff00:[50,150],ff7e00:[150,250],ff0000:[250,350],"99004c":[350,420],"7e0023":[420,600],"7e0022":[600]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},so2:{unit:"μg/m³",name:"SO₂",colorMap:{"00e400":[0,50],ffff00:[50,150],ff7e00:[150,475],ff0000:[475,800],"99004c":[800,1600],"7e0023":[1600,2620],"6e6e6e":[2620]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},no2:{unit:"μg/m³",name:"NO₂",colorMap:{"00e400":[0,40],ffff00:[40,80],ff7e00:[80,180],ff0000:[180,280],"99004c":[280,565],"7e0023":[565,940],"6e6e6e":[940]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},co:{unit:"mg/m³",name:"CO",colorMap:{"00e400":[0,2],ffff00:[2,4],ff7e00:[4,14],ff0000:[14,24],"99004c":[24,36],"7e0023":[36,60],"6e6e6e":[60]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},o3:{unit:"μg/m³",name:"O₃",colorMap:{"00e400":[0,100],ffff00:[100,160],ff7e00:[160,215],ff0000:[215,265],"99004c":[265,800],"7e0023":[800,1200],"6e6e6e":[1200]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},ci:{unit:"μg/m³",name:"CI",colorMap:{"00e400":[0,1.3],ffff00:[1.3,4],ff7e00:[4,8],ff0000:[8,12],"99004c":[12,20],"7e0023":[20]},degreeMap:{"00e400":"(优)",ffff00:"(良)",ff7e00:"(轻度)",ff0000:"(中度)","99004c":"(重度)","7e0023":"(严重)"}},tsp:{unit:"μg/m³",name:"TSP",colorMap:{"00e400":[0,120],ffff00:[120,300],ff7e00:[300,400],ff0000:[400,500],"99004c":[500,625],"7e0023":[625,3e3],"6e6e6e":[3e3]},degreeMap:{"00e400":"",ffff00:"",ff7e00:"",ff0000:"","99004c":"","7e0023":""}},voc:{unit:"mg/m³",name:"VOC",colorMap:{"00e400":[0,.19],ffff00:[.19,.59],ff7e00:[.59,1.79],ff0000:[1.79,2.29],"99004c":[2.29,3],"7e0023":[3]},degreeMap:{"00e400":"",ffff00:"",ff7e00:"",ff0000:"","99004c":"","7e0023":""}},temperature:{unit:"℃",name:"温度",colorMap:{"8274cc":[-40,-30],acb3e2:[-30,-20],"95d0d8":[-20,-10],"61afff":[-10,0],"87b922":[0,10],e5aa06:[10,20],e45914:[20,30],"8a2b0a":[30]},degreeMap:{"8274cc":"",acb3e2:"","95d0d8":"","61afff":"","87b922":"",e5aa06:"",e45914:"","8a2b0a":""}},humidity:{unit:"%",name:"湿度",colorMap:{c4be20:[0,20],c4be21:[20,40],"4fcb46":[40,60],"45afde":[60,80],"6661f1":[80]},degreeMap:{c4be20:"",c4be21:"","4fcb46":"","45afde":"","6661f1":""}},pressure:{unit:"Pa",name:"气压",colorMap:{"6493FF":[1,1e17]},degreeMap:{"6493FF":""}}},colorForValue:{"00e400":"优",ffff00:"良",ff7e00:"轻度",ff0000:"中度","99004c":"重度","7e0023":"严重","6e6e6e":"无"},colorForFont:{"#00e400":"#000","#ffff00":"#000","#ff7e00":"#fff","#ff0000":"#fff","#99004c":"#fff","#7e0023":"#fff","#6e6e6e":"#fff"},wind:{"东北⻛":[22.5,67.5],"东⻛":[67.5,112.5],"东南⻛":[112.5,157.5],"南⻛":[157.5,202.5],"⻄南⻛":[202.5,247.5],"⻄⻛":[247.5,292.5],"⻄北⻛":[292.5,337.5]},windLevel:{"0级":[0,.2],"1级":[.2,1.5],"2级":[1.5,3.3],"3级":[3.3,5.4],"4级":[5.4,7.9],"5级":[7.9,10.7],"6级":[10.7,13.8],"7级":[13.8,17.1],"8级":[17.1,20.7],"9级":[20.7,24.4],"10级":[24.4,28.4],"11级":[28.4,32.6]},windLevelZh:{"零级(⽆⻛)":[0,.2],"⼀级(软⻛)":[.2,1.5],"⼆级(轻⻛)":[1.5,3.3],"三级(微⻛)":[3.3,5.4],"四级(和⻛)":[5.4,7.9],"五级(劲⻛)":[7.9,10.7],"六级(强⻛)":[10.7,13.8],"七级(疾⻛)":[13.8,17.1],"⼋级(⼤⻛)":[17.1,20.7],"九级(烈⻛)":[20.7,24.4],"⼗级(狂⻛)":[24.4,28.4],"⼗⼀级(暴⻛)":[28.4,32.6]}},Pr=function(t,e){return Lr.colorForFont[function(t,e){if(!e)return"#8a97a0";var n=(Lr.factor[e]||Lr.factor[e.toLowerCase()]||{}).colorMap;if(!n)return"#8a97a0";for(var r in t=+t,n){if(1===n[r].length&&n[r][0]<t)return"#"+r;if(n[r][0]<t&&t<=n[r][1])return"#"+r}return"#8a97a0"}(t,e.toLowerCase())]},Rr=function(t){P(n,t);var e=F(n);function n(t,i,o){var a;return r(this,n),(a=e.call(this,t,i,o)).InforItems=[],a.curZoom=9,a.clusterMinZoom=9,a.name=i.labelLayerName,a.zoomPara=.05,a.canvasSize=i.canvasSize||40,a._bound=i.bound,a.pLen=t.length-1,a.updateIndex=t.length-1,a}return o(n,[{key:"_initChildVar",value:function(t,e){!0===t.addValueLabel&&(this.bzlayerNum=new h.VectorLayer(h.Util.GUID(),{minZoom:t.valueMinZoom||11,geometryEvents:!1,hitDetect:!1,visible:!1}).addTo(e.map),this.bz_all_nums=[],this.valueFaceName=t.valueFaceName||"microsoft yahei",this.valueFontSize=t.valueFontSize||12,this.valueDy=t.valueDy||0,this.valueDx=t.valueDx||0),this.paraName=t.paraName||"pm25",this.typeImgNum=-1}},{key:"_bindDataItem",value:function(t,e,n){var r=parseFloat(e.value)||0,i=parseFloat(e.opavalue)?parseFloat(e.opavalue):1,o=0;e.imgSrc&&(o=e.imgSrc.length);var a=.9,s="#fff";e.imgColor&&e.imgColor.length>=1&&(a=1.9,s=e.imgColor[0]);var u=.9,c="#fff";e.imgColor&&e.imgColor.length>=2&&(u=1.9,c=e.imgColor[1]);var l=(parseFloat(e.windDirection)||0)+.01,f=parseFloat(l*(Math.PI/180));if(t.push({coordinate:[parseFloat(e.longitude),parseFloat(e.latitude)],height:0,color:s,colorflag:a,fcolorflag:u,fcolor1:c,imgnum:o,value:e.name,imgflag:n,rotation:f,visibility:1==e.visibility?1:.1,code:e.code,opavalue:i,pvalue:e.value||0,data:e.data}),this.bzlayerNum){var d=e.valueFontColr||Pr(r,this.paraName),p=new h.Marker([parseFloat(e.longitude),parseFloat(e.latitude)],{properties:{name:r,type:e.businessType,pvalue:r},symbol:{textFaceName:this.valueFaceName,textName:"{name}",textSize:this.valueFontSize,textFill:d,textDx:this.valueDx,textDy:this.valueDy}});1==e.visibility&&this.bzlayerNum.addGeometry(p),this.bz_all_nums.push(p)}}},{key:"_getRate",value:function(){if(1===this.markType)return I(E(n.prototype),"_getRate",this).call(this);var t=this.map.getZoom()-3;return.1*(t=t>9?9:t)+.1}},{key:"_getImgType",value:function(t,e,n){return void 0===this.typeValues[t]&&(0===Object.keys(this.typeValues).length?this.initTypeValue=.9:this.initTypeValue+=this.typeImgNum,this.typeImgNum=e.length,this.typeValues[t]={v:this.initTypeValue,img:e,inImgWidth:parseInt(n.inImgWidth)||16}),this.typeValues[t].v}},{key:"_pointShowHide",value:function(t,e,n,r,i){var o=this;this.layerLabel&&this.layerLabel.clear();var a=function(a){var s=t.filter((function(t){return t===a}));o._itemHide(s,e,n,r,i,o.typeValues[a].v)};for(var s in this.typeValues)a(s)}},{key:"pointFindByCode",value:function(t,e,n){var r=this.dataItems.filter((function(e){return e.code===t}));r.length>0&&(e&&this.map.fitExtent(new h.Extent(r[0].coordinate[0]-this.zoomPara,r[0].coordinate[1]-this.zoomPara,r[0].coordinate[0]+this.zoomPara,r[0].coordinate[1]+this.zoomPara),0),n&&this.iconFile&&this._addIcon(r[0]))}},{key:"_loadTexture",value:function(){var t=s(regeneratorRuntime.mark((function t(){var e,n,r,i,o,a,s,u,c,l,h,f,d,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=[],t.t0=regeneratorRuntime.keys(this.typeValues);case 2:if((t.t1=t.t0()).done){t.next=32;break}if(n=t.t1.value,!this.typeValues[n].img||!Array.isArray(this.typeValues[n].img)){t.next=30;break}r=0;case 6:if(!(r<this.typeValues[n].img.length)){t.next=30;break}if(i=this.typeValues[n].img[r],o=i,!i.includes(".svg")){t.next=16;break}return t.next=12,fetch(i);case 12:return a=t.sent,t.next=15,a.text();case 15:o=t.sent;case 16:return s=new DOMParser,u=s.parseFromString(o,"image/svg+xml"),c=1*(u.documentElement.getAttribute("width")||1),l=1*(u.documentElement.getAttribute("height")||1),h=l/c,f=parseInt(this.canvasSize/h),d=parseInt(f*h),t.next=25,V.addImageProcess(o);case 25:p=t.sent,0===r?e.push({type:"img",src:p,w:this.canvasSize,h:this.canvasSize,iw:f,ih:d}):(f=parseInt(this.typeValues[n].inImgWidth/h),d=parseInt(f*h),e.push({type:"img1",src:p,w:this.canvasSize,h:this.canvasSize,iw:f,ih:d}));case 27:r++,t.next=6;break;case 30:t.next=2;break;case 32:return t.abrupt("return",V.generateTexture(e));case 33:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"addPoint",value:function(){var t=s(regeneratorRuntime.mark((function t(){var e,n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.dataItems){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this._loadTexture();case 4:return e=t.sent,this.textures||(this.textures=[]),this.textures.push(e.texture),n=this._getRate(),this.m.onBeforeCompile=function(t){r=o._createShaderPol(t,e.texture,e.xys,e.textureSize,o.markSize*n),o.shader=r},i=new Cr(this.dataItems,{minZoom:this.minZoom,bound:this._bound},this.m,this._getMarkSize,this.threeLayer),this.isToolTip&&i.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),i.object3d.renderOrder=this.order,this.point=i,this.point.parent=this,this.threeLayer.addMesh(this.point),this._bindMapEvents(),t.abrupt("return",i);case 17:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"addInfo",value:function(t){if(t.length!==this.InforItems.length)for(var e=0;e<this.dataItems.length;e++)if(t.includes(e)){var n=this.dataItems[e],r=n.data.infoWindowData;if(n.data.law_num&&n.data.punish_num&&(r=[{key:"案件数",value:n.data.law_num},{key:"处罚金额",value:"".concat(n.data.punish_num,"万元")}]),!r||!r.length)continue;var i={single:!1,custom:!0,dy:-16,autoOpenOn:null,animation:!1,autoPanDuration:!1,autoPan:!1,content:'<div style="background: rgba(0,0,0,0.42); border-radius: 6px; font-size: 12px; color: #ffffff; padding: 6px;display: flex;\n flex-direction: column;\n align-items: center; width: 128px">\n <span>'.concat(r[0].key,":").concat(r[0].value,"</span>\n <span>").concat(r[1].key,":").concat(r[1].value,"</span>\n </div>")},o=new h.ui.InfoWindow(i);this.InforItems.push(o),o.addTo(this.map).show({x:n.coordinate[0],y:n.coordinate[1]})}}},{key:"hideInfoWindows",value:function(){this.InforItems.length>0&&(this.InforItems.forEach((function(t){t.remove()})),this.InforItems=[])}},{key:"pointShowStatisticsByeCodeMultiple",value:function(t,e,n,r,i){var o=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this.hideInfoWindows(),this._deleteFunsKey();for(var a=[],s=[],u=0;u<e.length;u++)a.push({code:u,geo:e[u],geojson:e[u].toGeoJSON(),ptnum:0,val:t,sum:0,ptids:[]});a.forEach((function(e){for(var r=0;r<o.dataItems.length;r++){var i=o.dataItems[r];t.includes(i.code)&&V.containsCoordinate2(o.dataItems[r].coordinate,e.geojson)&&(e.ptnum+=1,e.ptids.push(r),s.push(r),o.dataItems[r].data[n]?(e.sum+=parseFloat(o.dataItems[r].data[n])||0,e.sum=Math.floor(100*e.sum)/100):e.sum+=0)}})),this._clearClusterCache();var c=this.clusterMinZoom;this.clusterItemsCache[c]=a,this.testMinClusterZoom1(this.clusterItemsCache[c],r,i),this.funcsNew.c=function(){var t=o.getClosestZoom(o.map.pixelToDistance(1,0));if(!(t<9||t>18)&&o.curZoom!==t)if(o.curZoom=t,o.clusterItemsCache[t])if(t===o.clusterMinZoom)o.hideInfoWindows(),o.testMinClusterZoom1(o.clusterItemsCache[t],r,i);else{var e=o.clusterItemsCache[t];o.testCluster1(e,r,i,n)}else{var s=[];a.forEach((function(e){o.calColNum(t,e.ptids,s)})),o.clusterItemsCache[t]=s.flat(),o.testCluster1(o.clusterItemsCache[t],r,i,n)}}}},{key:"testMinClusterZoom1",value:function(t,e,n){var r=this;this.layerPointNumLabel.clear(),t.forEach((function(t){r._addClusterLabel(t.geo.getCenter(),t.sum,t,e,n)})),this.dataItems.forEach((function(t){t.visibility=.1})),this._changePtVisible([])}},{key:"testCluster1",value:function(t,e,n,r){var i=this;this.layerPointNumLabel.clear();var o=[];t.forEach((function(t){if(t.length>1){var a=1/0,s=1/0,u=-1/0,c=-1/0,l=0;t.forEach((function(t){a=Math.min(a,i.dataItems[t].coordinate[0]),s=Math.min(s,i.dataItems[t].coordinate[1]),u=Math.max(u,i.dataItems[t].coordinate[0]),c=Math.max(c,i.dataItems[t].coordinate[1]),i.dataItems[t].visibility=.1,i.dataItems[t].data[r]?(l+=parseFloat(i.dataItems[t].data[r])||0,l=Math.floor(100*l)/100):l+=0}));var h=[(a+u)/2,(s+c)/2];i._addClusterLabelSmall(h,l,{},e,n)}else i.dataItems[t[0]].visibility=1,o.push(t[0])})),this._changePtVisible([]),this.hideInfoWindows(),this.addInfo(o)}},{key:"pointShowStatisticsByeTypeMultiple",value:function(t,e,n){var r=this;this.layerPointNumLabel.clear(),this.layerPointNumLabel.show(),this._deleteFunsKey();for(var i=[],o=0;o<e.length;o++)i.push({code:o,geo:e[o],geojson:e[o].toGeoJSON(),sum:0,val:t,ptnum:0});i.forEach((function(e){for(var i=function(i){var o=r.dataItems[i];t.filter((function(t){return t.includes(o.type)})).length>0&&V.containsCoordinate2(r.dataItems[i].coordinate,e.geojson)&&(e.ptnum+=1,r.dataItems[i].data[n]?e.sum+=parseFloat(r.dataItems[i].data[n])||0:e.sum+=0)},o=0;o<r.dataItems.length;o++)i(o)})),i.forEach((function(e){r._addClusterLabel(e.geo.getCenter(),e.sum,e).on("click",(function(e){r.selectItems=[];var n=e.target.properties.item;n.ptnum>0&&(setTimeout((function(){r.point.show()}),500),r._pointShowHide(n.val,n.geo),r._zoomSelect(t,n.geo))}))})),this._pointShowHide(t),this.map.getZoom()<9.4?this.point.hide():(this.point.show(),this.layerPointNumLabel.hide()),this.funcsNew.b=function(){r.isCtrol&&(r.map.getZoom()<9.4?(r.point.hide(),r.layerPointNumLabel.show()):(r.point.show(),r.layerPointNumLabel.hide()))}}},{key:"showValue",value:function(t,e){if(this.shader){if(void 0===e){var n=!0===t?0:1;this.shader.uniforms.flag.value=n}this.bzlayerNum&&(this.bzlayerNum.options.visible=t)}}},{key:"showName",value:function(t){this.layerLabel&&(this.layerLabel.options.visible=t)}},{key:"changePositionValueOne",value:function(t,e){if(this.point){this.paraName=e||this.paraName;var n=this.point.object3d.geometry.attributes.color.array,r=parseFloat(t.value)||0,i="#fff";t.imgColor&&t.imgColor.length>=1&&(i=t.imgColor[0]),void 0!==this.updateIndex&&(this.dataItems[this.updateIndex].coordinate=[parseFloat(t.longitude),parseFloat(t.latitude)],this.dataItems[this.updateIndex].color=i,this.dataItems[this.updateIndex].pvalue=r,this.bz_all_nums[this.updateIndex].setCoordinates([parseFloat(t.longitude),parseFloat(t.latitude)]));try{this.point.updatepoints(this.dataItems);for(var o=0;o<this.dataItems.length;o++){var a=new l.Color(this.dataItems[o].color);n[3*o+0]=a.r,n[3*o+1]=a.g,n[3*o+2]=a.b}this.point.object3d.geometry.attributes.color.needsUpdate=!0,this.updateIndex=this.updateIndex-1<0?this.pLen:this.updateIndex-1}catch(t){throw t}}}},{key:"changePositionValue",value:function(t,e){var n=this;if(this.point){this.paraName=e||this.paraName;var r=this.point.object3d.geometry.attributes.color.array,i=this.point.object3d.geometry.attributes.rotation.array,o=this.point.object3d.geometry.attributes.opavalue.array;t.slice(0,1/0).map((function(t){var e=parseFloat(t.value)||0,r=parseFloat(t.opavalue)?parseFloat(t.opavalue):1,i="#fff";t.imgColor&&t.imgColor.length>=1&&(i=t.imgColor[0]);var o=(parseFloat(t.windDirection)||0)+.01,a=parseFloat(o*(Math.PI/180)),s=n.findItemByCode(t.code);void 0!==s&&(n.dataItems[s].coordinate=[parseFloat(t.longitude),parseFloat(t.latitude)],n.dataItems[s].color=i,n.dataItems[s].rotation=a,n.dataItems[s].pvalue=e,n.dataItems[s].opavalue=r,n.all_labels[s].setCoordinates([parseFloat(t.longitude),parseFloat(t.latitude)]),n.iconCode&&n.iconCode===t.code)&&n.Infolayer.getGeometries().forEach((function(e){e.setCoordinates([parseFloat(t.longitude),parseFloat(t.latitude)])}))}));try{this.point.updatepoints(this.dataItems);for(var a=0;a<this.dataItems.length;a++){var s=new l.Color(this.dataItems[a].color);r[3*a+0]=s.r,r[3*a+1]=s.g,r[3*a+2]=s.b,i[a]=this.dataItems[a].rotation,o[a]=this.dataItems[a].opavalue}this.point.object3d.geometry.attributes.color.needsUpdate=!0,this.point.object3d.geometry.attributes.rotation.needsUpdate=!0,this.point.object3d.geometry.attributes.opavalue.needsUpdate=!0}catch(t){throw t}}}},{key:"changeParaValue",value:function(t,e){var n=this;if(this.point){this.paraName=e||this.paraName;var r=this.point.object3d.geometry.attributes.color.array,i=this.point.object3d.geometry.attributes.fcolor1.array,o=this.point.object3d.geometry.attributes.opavalue.array;t.slice(0,1/0).map((function(t){var e=parseFloat(t.value)||0,r=parseFloat(t.opavalue)?parseFloat(t.opavalue):1,i="#fff";t.imgColor&&t.imgColor.length>=1&&(i=t.imgColor[0]);var o="#fff";t.imgColor&&t.imgColor.length>=2&&(o=t.imgColor[1]);var a=(parseFloat(t.windDirection)||0)+.01,s=(parseFloat(a*(Math.PI/180)),n.findItemByCode(t.code));if(void 0!==s&&(n.dataItems[s].color=i,n.dataItems[s].fcolor1=o,n.dataItems[s].pvalue=e,n.dataItems[s].opavalue=r,n.bzlayerNum)){var u=Pr(e,n.paraName);n.bz_all_nums[s].getProperties().name=e,n.bz_all_nums[s].updateSymbol({textName:"{name}",textFill:u})}}));for(var a=0;a<this.dataItems.length;a++){var s=new l.Color(this.dataItems[a].color);r[3*a+0]=s.r,r[3*a+1]=s.g,r[3*a+2]=s.b;var u=new l.Color(this.dataItems[a].fcolor1);i[3*a+0]=u.r,i[3*a+1]=u.g,i[3*a+2]=u.b,o[a]=this.dataItems[a].opavalue}this.point.object3d.geometry.attributes.color.needsUpdate=!0,this.point.object3d.geometry.attributes.fcolor1.needsUpdate=!0,this.point.object3d.geometry.attributes.opavalue.needsUpdate=!0}}},{key:"dispose",value:function(){this.InforItems.length>0&&this.hideInfoWindows(),this.bzlayerNum&&(this.map.removeLayer(this.bzlayerNum),this.bz_all_nums=[]),this.bound&&delete this.bound,I(E(n.prototype),"dispose",this).call(this)}},{key:"_createShaderPol",value:function(t,e,n,r,i){return t.uniforms.imgdatas={value:n},t.uniforms.texture1={value:e},t.uniforms.textureSize={value:r},t.uniforms.size1={value:i},t.uniforms.flag={value:1},t.vertexShader="uniform float size1;\n attribute float imgflag;\n attribute float rotation;\n attribute vec3 color;\n attribute vec3 fcolor1;\n varying float vimgflag;\n attribute float visibility;\n varying float vVisible;\n varying float vRotation;\n varying vec3 vColor;\n varying vec3 vFcolor;\n attribute float opavalue;\n varying float vOpavalue;\n attribute float colorflag;\n varying float vColorflag;\n attribute float fcolorflag;\n varying float vFcolorflag;\n attribute float imgnum;\n varying float vImgnum;\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <project_vertex>","\n #include <project_vertex>\n vimgflag = imgflag;\n vVisible = visibility;\n vRotation = rotation;\n vColor = color;\n vOpavalue = opavalue;\n vColorflag = colorflag;\n vFcolorflag = fcolorflag;\n vFcolor = fcolor1;\n vImgnum = imgnum;\n ").replace("gl_PointSize = size;","\n gl_PointSize = size1;\n "),t.fragmentShader="struct imgdata {\n float u;\n float v;\n float w;\n float h;\n };\n uniform imgdata imgdatas[".concat(n.length,"];\n uniform sampler2D texture1;\n uniform float textureSize;\n varying float vimgflag;\n varying float vVisible;\n varying float vRotation;\n varying vec3 vColor;\n varying float vOpavalue;\n varying float vColorflag;\n varying float vFcolorflag;\n varying float vImgnum;\n varying vec3 vFcolor;\n uniform int flag;\n ")+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("gl_FragColor = vec4( outgoingLight, diffuseColor.a );","\n highp int index = int(vimgflag);\n float width = gl_PointCoord.x / textureSize * imgdatas[index].w;\n float height = gl_PointCoord.y / textureSize * imgdatas[index].h;\n float x = imgdatas[index].u;\n float y = 1.0 - imgdatas[index].v;\n vec2 uv = vec2(x + width, y - height);\n\n float xx = x + 0.5 / textureSize * imgdatas[index].w;\n float yy = y - 0.5 / textureSize * imgdatas[index].h;\n float angle = 1.0;\n float s = sin(vRotation);\n float c = cos(vRotation);\n mat2 rotationMatrix = mat2( c, s,\n -s, c);\n vec2 pivot = vec2( xx, yy);\n uv = rotationMatrix * (uv - pivot) + pivot;\n\n vec4 rotatedTexture = texture2D( texture1, uv);\n vec4 texColor;\n if (vColorflag > 1.0) {\n texColor = vec4(vColor, vOpavalue) * rotatedTexture;\n } else {\n texColor = rotatedTexture;\n }\n\n if (vImgnum > 1.0 && flag == 1) {\n index += 1;\n width = gl_PointCoord.x / textureSize * imgdatas[index].w;\n height = gl_PointCoord.y / textureSize * imgdatas[index].h;\n x = imgdatas[index].u;\n y = 1.0 - imgdatas[index].v;\n vec4 img = texture2D( texture1, vec2(x + width, y - height) );\n vec4 Ca;\n img.a *= img.r;\n if(vFcolorflag > 1.0){\n Ca = vec4(vFcolor, 1.0) * img;\n }\n else{\n Ca = img;\n }\n //Ca.a *= Ca.r;\n\n\n // 第三种\n /*texColor.xyz *= texColor.a; //premultiply source \n gl_FragColor = mix(texColor, Ca, Ca.a);\n gl_FragColor.rgb /= gl_FragColor.a;*/\n \n vec3 rgb = mix(texColor.xyz * texColor.a, Ca.xyz, Ca.a);\n float a = Ca.a + texColor.a * (1. - Ca.a);\n vec4 dst = vec4(rgb / a, a);\n gl_FragColor = dst;\n\n /*vec3 rgb = mix(texColor.xyz * texColor.a, Ca.rgb, Ca.a);\n float a = Ca.a + texColor.a * (1. - Ca.a);\n vec4 dst = vec4(rgb, a);\n gl_FragColor = dst;*/\n \n // 第一种\n /*vec4 out_Color;\n outgoingLight *= texColor.xyz;\n gl_FragColor = vec4( outgoingLight, texColor.a * diffuseColor.a );\n gl_FragColor = mix(gl_FragColor, Ca, Ca.a);\n gl_FragColor.rgb /= gl_FragColor.a;*/\n \n } else {\n outgoingLight *= texColor.xyz;\n gl_FragColor = vec4( outgoingLight, texColor.a * diffuseColor.a );\n }\n\n if (vVisible < 0.5) discard;\n "),t}}]),n}(Ir),Or=(n("8195"),{interactive:!1,altitude:0,imageWidth:512,imageHeight:512,texture:null}),kr=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n);var u=i=h.Util.extend({},Or,i),c=u.altitude;u.imageHeight,u.imageWidth,t instanceof h.Extent||(t=new h.Extent(t));var f=t,d=f.xmin,p=f.ymin,g=f.xmax,m=f.ymax,v=1/0,y=1/0,_=-1/0,x=-1/0;[[d,p],[d,m],[g,m],[g,p]].forEach((function(t){var e=a.coordinateToVector3(t),n=e.x,r=e.y;v=Math.min(n,v),y=Math.min(r,y),_=Math.max(n,_),x=Math.max(r,x)}));var b=Math.abs(_-v),w=Math.abs(x-y),M=new l.PlaneBufferGeometry(b,w);(s=e.call(this))._initOptions(i),s._createMesh(M,o);var S=a.distanceToVector3(c,c).x,A=a.coordinateToVector3(t.getCenter(),S);return s.getObject3d().position.copy(A),s.parent=null,s.type="Image",s}return o(n)}(ht),Br=function(){function t(e,n,i,o,a){var s=this;r(this,t),this.threelayer=a,this.textureLoader=new l.TextureLoader;var u=e.split(","),c=n.split(","),f=parseFloat(u[0]),d=parseFloat(u[1]),p=parseFloat(c[0]),g=parseFloat(c[1]),m=o.maxZoom||11,v=o.renderOrder||0,y=o.opacity||1,_=o.maxZoom||3,x=new h.Extent(f,d,p,g);this.textureLoader.load(i,(function(t){var e=new l.MeshBasicMaterial({map:t,transparent:!0,opacity:y}),n=new kr(x,{imageWidth:512,imageHeight:512,maxZoom:m,minZoom:_},e,s.threelayer);n.object3d.renderOrder=v,s.imgMesh=n,s.imgMesh.parent=s,s.m=e,s.texture=t,s.threelayer.addMesh(s.imgMesh)}))}return o(t,[{key:"updateImage",value:function(t){var e=this;this.textureLoader.load(t,(function(t){e.texture&&e.texture.dispose(),delete e.texture,t.magFilter=l.NearestFilter,t.minFilter=l.NearestFilter,e.imgMesh.object3d.material.map=t,e.imgMesh.object3d.material.map.needsUpdate=!0,e.texture=t}))}},{key:"clearImage",value:function(){this.imgMesh&&this.threelayer.removeMesh(this.imgMesh)}},{key:"dispose",value:function(){this.threelayer.removeMesh(this.imgMesh),this.imgMesh.object3d.geometry&&this.imgMesh.object3d.geometry.dispose(),this.imgMesh.object3d.material&&(this.imgMesh.object3d.material.dispose(),delete this.m),this.texture&&(this.texture&&this.texture.dispose(),delete this.texture),this.threelayer=null,this.textureLoader&&delete this.textureLoader}}]),t}(),Fr=(n("0132"),n("2b0f"),n("5d56")),Dr={0:.05,1:.05,2:.05,3:.003,4:.003,5:.003,6:.003,7:.003,8:.002,9:.001,10:5e-4,11:3e-4,12:15e-5,13:1e-4,14:5e-5,15:25e-6,16:1e-5,16.99:1e-5,17:5e-6,18:2e-6,19:1e-6,20:5e-7,21:2e-7,22:1e-7},Ur=Object(u.map)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var n=22.5,r=n*e;return{bearing:r,range:[r-n/2,r+n/2],label:t}})),jr=function(t,e,n){return t>=e&&t<n},Nr=function(){function t(e,n,i){var o=this;r(this,t),this.map=i,this.windLayer=this.map.getLayer("windLayer"),this.windLayer?this.windLayer.setData(e):(this.windLayer=new Fr.a("windLayer",e,{windOptions:{colorScale:["rgba(68,162,255,1)","rgba(110,223,255,1)","rgba(142,228,187,1)","rgba(179,253,163,1)","rgba(213,247,176,1)","rgba(255,252,213,1)","rgba(255,238,159,1)","rgba(252,217,125,1)","rgba(255,182,100,1)","rgba(252,150,75,1)","rgba(250,112,52,1)","rgba(245,64,32,1)","rgba(237,45,28,1)","rgba(220,24,32,1)","rgba(180,0,35,1)"],velocityScale:function(){var t=o.map.getZoom();return Dr[parseInt(t)]||1/40},frameRate:16,maxAge:60,globalAlpha:.9,paths:3782}}),this.map.addLayer(this.windLayer)),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}return o(t,[{key:"_bindMapEvents",value:function(){this.map.on("mousemove",this._onWind,this)}},{key:"_closeEvent",value:function(){this.map.off("mousemove",this._onWind,this)}},{key:"_onWind",value:function(t){var e,n=this.windLayer.field.interpolatedValueAt(t.coordinate.x,t.coordinate.y);if(n){var r=this.vectorToDegrees(n.u,n.v,"bearingCCW"),i=this.vectorToSpeed(n.u,n.v,"m/s");this.toolTip._content="".concat(null===(e=function(t){return Object(u.find)(Ur,(function(e){return jr(t,e.range[0],e.range[1])||jr(t-360,e.range[0],e.range[1])}))}(r))||void 0===e?void 0:e.label).concat(this.windLevel(i),"级;速度").concat(i.toFixed(2),"m/s;高度10米")}}},{key:"windLevel",value:function(t){return t<=0?0:t<=.3?1:t<=1.6?2:t<=3.4?3:t<=5.5?4:t<=8?5:t<=10.8?6:t<=13.9?7:t<=17.2?8:t<=20.8?9:t<=24.5?10:t<=28.5?11:12}},{key:"setToolTip",value:function(t,e){this.removeToolTip(),this.toolTip=new h.ui.ToolTip(t,e),this.toolTip.addTo(this.map)}},{key:"removeToolTip",value:function(){var t;this.toolTip&&(null===(t=this.toolTip)||void 0===t||t.remove(),this.toolTip=null)}},{key:"vectorToDegrees",value:function(t,e,n){n.endsWith("CCW")&&(e=e>0?e=-e:Math.abs(e));var r=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i=180*Math.atan2(t/r,e/r)/Math.PI+180;return"bearingCW"!==n&&"meteoCCW"!==n||(i+=180)>=360&&(i-=360),i}},{key:"vectorToSpeed",value:function(t,e,n){var r=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return"k/h"===n?3.6*r:"kt"===n?r/.514:r}},{key:"closeWind",value:function(){this._closeEvent(),this.removeToolTip(),this.map.removeLayer(this.windLayer),delete this.windLayer,this.windLayer=null}}]),t}(),Gr=function(){function t(e,n,i,o){r(this,t),this.map=o.map,this.tlayer=o,this.drawTool=new h.DrawTool({mode:e,symbol:{lineColor:"#E40D56",lineWidth:2,lineDasharray:[5,5],polygonFill:"#E40D56",polygonOpacity:.2}}).addTo(this.map).enable(),this.toolLayer=this.map.getLayer("toolLayer"),this.toolLayer||(this.toolLayer=new h.VectorLayer("toolLayer",{geometryEvents:!1,hitDetect:!1}).addTo(this.map)),this._drawEnd=n,this._bindEvent(),this.geometry=null,this.mode=e,this.type="drawTool",V.setPointEventStatus(o,!1)}return o(t,[{key:"_bindEvent",value:function(){this.drawTool.on("drawend",this.drawEnd,this)}},{key:"_closeEvent",value:function(){this.drawTool.off("drawend",this.drawEnd,this)}},{key:"drawEnd",value:function(t){this.toolLayer&&this.toolLayer.addGeometry(t.geometry),this._drawEnd&&("Circle"===this.mode?this._drawEnd(t.geometry.getCoordinates(),t.geometry.getRadius()):this._drawEnd(t.geometry.getCoordinates())),this.geometry=t.geometry}},{key:"disableTool",value:function(){this.drawTool.disable(),V.setPointEventStatus(this.tlayer,!0)}},{key:"clearGeometry",value:function(){this.toolLayer&&this.toolLayer.clear()}},{key:"setMode",value:function(t,e){V.setPointEventStatus(this.tlayer,!1),this._drawEnd&&delete this._drawEnd,this._drawEnd=e,this.drawTool.setMode(t).enable(),this.mode=t}},{key:"startEdit",value:function(){this.disableTool(),this.geometry&&this.geometry.startEdit()}},{key:"endEdit",value:function(t){this.geometry&&(this.geometry.endEdit(),t&&("Circle"===this.mode?t(this.geometry.getCoordinates(),this.geometry.getRadius()):t(this.geometry.getCoordinates())))}},{key:"dispose",value:function(){this._closeEvent(),this._drawEnd&&delete this._drawEnd,this.geometry&&delete this.geometry,this.map.removeLayer(this.toolLayer),delete this.toolLayer,delete this.drawTool}}]),t}(),zr=function(){function t(e,n){r(this,t),this.tlayer=n,this.map=n.map,this.distanceTool=new h.DistanceTool({symbol:{lineColor:"#34495e",lineWidth:2},vertexSymbol:{markerType:"ellipse",markerFill:"#1bbc9b",markerLineColor:"#000",markerLineWidth:3,markerWidth:10,markerHeight:10},labelOptions:{textSymbol:{textFaceName:"monospace",textFill:"#fff",textLineSpacing:1,textHorizontalAlignment:"right",textDx:15,markerLineColor:"#b4b3b3",markerFill:"#000"},boxStyle:{padding:[6,2],symbol:{markerType:"square",markerFill:"#000",markerFillOpacity:.9,markerLineColor:"#b4b3b3"}}},clearButtonSymbol:[{markerType:"square",markerFill:"#000",markerLineColor:"#b4b3b3",markerLineWidth:2,markerWidth:15,markerHeight:15,markerDx:20},{markerType:"x",markerWidth:10,markerHeight:10,markerLineColor:"#fff",markerDx:20}],language:"zh-CN"}).addTo(this.map),V.setPointEventStatus(n,!1)}return o(t,[{key:"dispose",value:function(){this.distanceTool&&(this.distanceTool.clear(),delete this.distanceTool),this.tlayer=null,this.map=null}},{key:"disable",value:function(){this.distanceTool.disable(),V.setPointEventStatus(this.tlayer,!0)}},{key:"enable",value:function(){V.setPointEventStatus(this.tlayer,!1),this.distanceTool.enable()}},{key:"clear",value:function(){this.distanceTool.clear()}}]),t}(),Hr=n("8b15"),Vr={fontSize:20,altitude:0,color:"#fff",text:"hello",weight:0,zoomFilter:!1},Wr={positionsConvert:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=[],i=0,o=t.length;i<o;i+=3){var a=t[i],s=t[i+1],u=t[i+2];e>0&&(u+=n.distanceToVector3(e,e).x),r.push(new l.Vector3(a,s,u))}return r},vectors2Pixel:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0;t[0]instanceof l.Vector3||(t=Wr.positionsConvert(t,r,i));var o=t.map((function(t){return Wr.vector2Pixel(t,e,n)}));return o},vector2Pixel:function(t,e,n){var r=t.project(n),i=e.width/2,o=e.height/2;return{x:Math.round(r.x*i+i),y:Math.round(-r.y*o+o)}}},Zr=function(t){P(n,t);var e=F(n);function n(t,i,o){var a;r(this,n),i=h.Util.extend({},Vr,i,{layer:o,position:t}),(a=e.call(this))._initOptions(i);var s=i,u=(s.altitude,s.fontSize),c=s.color,f=s.text,d=s.rotation,p=d*(Math.PI/180);a._createGroup();var g=new Hr.SpriteText2D(f,{align:Hr.textAlign.center,font:"".concat(2*u,"px Arial"),fillStyle:c,antialias:!1});g.children[0].material.sizeAttenuation=!1,g.children[0].material.rotation=p;var m=.001/3;return g.scale.set(m,m,m),a.getObject3d().add(g),a.getObject3d().name=d,a.getObject3d().position.copy(t),a.textRect={width:a.calTextWidth(f,u)+3*u,height:u+3*u},a._vector=new l.Vector3,a._pixel={x:0,y:0},a}return o(n,[{key:"getTextRect",value:function(){this.getPixel();var t=this._pixel,e=t.x,n=t.y,r=this.textRect,i=r.width,o=r.height;return{minX:e-i/2,minY:n-o/2,maxX:e+i/2,maxY:n+o/2}}},{key:"calTextWidth",value:function(t,e){var n=(t.match(/[\u4e00-\u9fa5]/g)||"").length;return n*e+.5*(t.length-n)*e}},{key:"getPixel",value:function(){var t=this.getMap().getSize(),e=this.getLayer().getCamera(),n=this.getObject3d().position;this._vector.x=n.x,this._vector.y=n.y,this._vector.z=n.z,this._pixel=Wr.vector2Pixel(this._vector,t,e)}},{key:"identify",value:function(t){var e=this.getTextRect(),n=e.minX,r=e.minY,i=e.maxX,o=e.maxY,a=this.getMap().coordToContainerPoint(t);return a.x>=n&&a.x<=i&&a.y>=r&&a.y<=o}}]),n}(ht),Qr={radius:100,altitude:0},Xr=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},Qr,i,{layer:a,coordinate:t}),(s=e.call(this))._initOptions(i);var u=i,c=u.altitude,f=u.radius,d=a.distanceToVector3(f,f).x,p=new l.CircleBufferGeometry(d,128,0,90*Math.PI/180);s._createMesh(p,o);var g=a.distanceToVector3(c,c).x,m=a.coordinateToVector3(t,g);return s.getObject3d().position.copy(m),s}return o(n)}(ht),Yr=function(){function t(e,n,i,o,a){var s=this;r(this,t),this.threelayer=a,this.map=a.map,this.all_cirles=[],this.rItems={},this.all_texts={},this.all_sectors={},this.textSprites=[],this.rbush=new Tr.a,this.material=new l.MeshBasicMaterial({color:"#233F75",transparent:!0,opacity:.5,depthTest:!1}),this.vector_circle_layer=this.map.getLayer("vector_circle"),this.vector_circle_layer||(this.vector_circle_layer=new h.VectorLayer("vector_circle",{geometryEvents:!1,hitDetect:!1}).addTo(a.map)),this.sector=null;for(var u=this.threelayer.coordinateToVector3([e,n],0),c=(new l.Matrix4).makeTranslation(u.x,u.y,u.z),f=1e3;f<=1e4;f+=1e3){this.createLine([e,n],f);var d=this.threelayer.distanceToVector3(f,f).x;this.rItems[f]=d,this.all_texts[f]=[]}for(var p=this.vector_circle_layer.getGeometries(),g=0;g<p.length;g++)this.all_cirles.push(p[g]);for(var m=3;m<=360;){for(var v in this.rItems){var y=this.createLabel("".concat(v/1e3,"km"),m,this.rItems[v],c,5,a);this.all_texts[v].push(y)}m+=24}var _=this.createParty(e,n,3e3);this.all_sectors[3e3]=_;var x=this.createParty(e,n,5e3);this.all_sectors[5e3]=x;var b=this.createParty(e,n,1e4);this.all_sectors[1e4]=b,this.vector_circle_layer.clear();for(var w=i/1e3,M=void 0,S=0;S<w;S++){var A=this.all_texts[1e3*(S+1)];A&&A.forEach((function(t){s.textSprites.push(t)})),this.vector_circle_layer.addGeometry(this.all_cirles[S]),S===w-1&&(M=this.all_cirles[S])}if(this.vector_circle_layer.options.visible=!0,this.threelayer.addMesh(this.textSprites),o.rotation){var C=this.all_sectors[i],E=this.calDirection(o.rotation);C.object3d.rotation.z=E*Math.PI/180,this.threelayer.addMesh(C),this.sector=C}this.collides(),this._bindEvent(),o.callback&&o.callback(M)}return o(t,[{key:"update",value:function(t,e,n,r){var i=this;this._closeEvent();var o=this.threelayer.coordinateToVector3([t,e],0),a=(new l.Matrix4).makeTranslation(o.x,o.y,o.z);this.all_cirles.forEach((function(n){n.setCoordinates([t,e])}));for(var s=3,u=0;s<=360;){for(var c in this.rItems){var h=this.getPsVec(s,this.rItems[c],a);this.all_texts[c][u].object3d.position.copy(h)}s+=24,u+=1}for(var f in this.all_sectors)this.all_sectors[f].object3d.position.copy(o);this.threelayer.removeMesh(this.textSprites),this.textSprites=[],this.vector_circle_layer.clear(),this.threelayer.removeMesh(this.sector);for(var d=n/1e3,p=void 0,g=0;g<d;g++){var m=this.all_texts[1e3*(g+1)];m&&m.forEach((function(t){i.textSprites.push(t)})),this.vector_circle_layer.addGeometry(this.all_cirles[g]),g===d-1&&(p=this.all_cirles[g])}if(this.vector_circle_layer.show(),this.threelayer.addMesh(this.textSprites),r.rotation){var v=this.all_sectors[n],y=this.calDirection(r.rotation);v.object3d.rotation.z=y*Math.PI/180,this.threelayer.addMesh(v),this.sector=v}this.collides(),this._bindEvent(),r.callback&&r.callback(p)}},{key:"_bindEvent",value:function(){this.map.on("zooming zoomend moveend animateend",this.circleTextOn,this),this.map.on("rotate",this.circleTextRotationOn,this)}},{key:"_closeEvent",value:function(){this.map.off("zooming zoomend moveend animateend",this.circleTextOn,this),this.map.off("rotate",this.circleTextRotationOn,this)}},{key:"circleTextOn",value:function(){this.textSprites.sort((function(t,e){return e.getOptions().weight-t.getOptions().weight})),this.collides()}},{key:"circleTextRotationOn",value:function(){for(var t=0;t<this.textSprites.length;t++)this.textSprites[t].object3d.children[0].material.rotation=(parseFloat(this.textSprites[t].object3d.name)+this.map.getBearing())*(Math.PI/180);this.textSprites.sort((function(t,e){return e.getOptions().weight-t.getOptions().weight})),this.collides()}},{key:"dispose",value:function(){for(var t in this._closeEvent(),this.all_cirles=[],this.rItems)delete this.rItems[t];for(var e in this.threelayer.removeMesh(this.textSprites),this.rbush.clear(),delete this.rbush,this.textSprites=[],this.all_texts)this.all_texts[e].forEach((function(t){t.object3d.children[0].sprite&&t.object3d.children[0].sprite.geometry&&t.object3d.children[0].sprite.geometry.dispose(),t.object3d.children[0].material&&t.object3d.children[0].material.dispose(),t.object3d.children[0].texture&&t.object3d.children[0].texture.dispose()})),delete this.all_texts[e];for(var n in this.sector=null,this.all_sectors){var r=this.all_sectors[n];r.object3d.geometry&&r.object3d.geometry.dispose(),delete this.all_sectors[n]}this.material&&this.material.dispose(),this.map.removeLayer(this.vector_circle_layer)}},{key:"createLine",value:function(t,e){1e3===e?new h.Circle(t,e,{symbol:{lineColor:"#1bbc9b",lineWidth:1,lineOpacity:1,polygonFill:"#1bbc9b",polygonOpacity:0}}).addTo(this.vector_circle_layer):new h.Circle(t,e,{symbol:{lineColor:"#1bbc9b",lineWidth:1,lineDasharray:[5,5,5],lineOpacity:1,polygonFill:"#1bbc9b",polygonOpacity:0}}).addTo(this.vector_circle_layer)}},{key:"createParty",value:function(t,e,n){return new Xr([t,e],{radius:n,interactive:!1},this.material,this.threelayer)}},{key:"createLabel",value:function(t,e,n,r,i,o){var a=this.getArrowPs(e,1),s=this.getPsVec(e,n,r),u=new Zr(s,{text:t,color:"white",fontSize:18,weight:i,interactive:!1,rotation:a.rotation,minZoom:11},o);return u.object3d.renderOrder=3,u}},{key:"collides",value:function(){this.rbush.clear();for(var t=0,e=this.textSprites.length;t<e;t++){var n=this.textSprites[t],r=n.getTextRect();this.rbush.collides(r)?n.hide():(n.show(),this.rbush.insert(r))}}},{key:"getPsVec",value:function(t,e,n){var r=t*(Math.PI/180),i=new l.Vector3(Math.sin(r)*e,Math.cos(r)*e,0);return i=i.applyMatrix4(n)}},{key:"calDirection",value:function(t){return t<=22.5&&t>337.5?45:t<=67.5&&t>22.5?0:t<=112.5&&t>67.5?315:t<=157.5&&t>112.5?270:t<=202.5&&t>157.5?225:t<=247.5&&t>202.5?180:t<=292.5&&t>247.5?135:t<=337.5&&t>292.5?90:0}},{key:"getArrowPs",value:function(t,e){var n=0;return t<=90?n=-t:t>90&&t<=180||t>180&&t<=270?n=180-t:t>270&&t<360&&(n=360-t),{rotation:n}}}]),t}(),Jr={altitude:0,height:0},qr=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),t=h.Util.extend({},Jr,t,{layer:a}),s=e.call(this);var u=t;return u.width,u.height,u.altitude,s._initOptions(t),s._createMesh(i,o),s}return o(n)}(ht),Kr={computeTangents:function(t){t.computeTangents(),console.warn("THREE.BufferGeometryUtils: .computeTangents() has been removed. Use BufferGeometry.computeTangents() instead.")},mergeBufferGeometries:function(t,e){for(var n=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),o={},a={},s=t[0].morphTargetsRelative,u=new l.BufferGeometry,c=0,h=0;h<t.length;++h){var f=t[h],d=0;if(n!==(null!==f.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var p in f.attributes){if(!r.has(p))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+p+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[p]&&(o[p]=[]),o[p].push(f.attributes[p]),d++}if(d!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(s!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var p in f.morphAttributes){if(!i.has(p))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[p]&&(a[p]=[]),a[p].push(f.morphAttributes[p])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(f.userData),e){var g;if(n)g=f.index.count;else{if(void 0===f.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;g=f.attributes.position.count}u.addGroup(c,g,h),c+=g}}if(n){var m=0,v=[];for(h=0;h<t.length;++h){for(var y=t[h].index,_=0;_<y.count;++_)v.push(y.getX(_)+m);m+=t[h].attributes.position.count}u.setIndex(v)}for(var p in o){var x=this.mergeBufferAttributes(o[p]);if(!x)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+p+" attribute."),null;u.setAttribute(p,x)}for(var p in a){var b=a[p][0].length;if(0===b)break;for(u.morphAttributes=u.morphAttributes||{},u.morphAttributes[p]=[],h=0;h<b;++h){var w=[];for(_=0;_<a[p].length;++_)w.push(a[p][_][h]);var M=this.mergeBufferAttributes(w);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+p+" morphAttribute."),null;u.morphAttributes[p].push(M)}}return u},mergeBufferAttributes:function(t){for(var e,n,r,i=0,o=0;o<t.length;++o){var a=t[o];if(a.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=a.array.length}var s=new e(i),u=0;for(o=0;o<t.length;++o)s.set(t[o].array,u),u+=t[o].array.length;return new l.BufferAttribute(s,n,r)},interleaveAttributes:function(t){for(var e,n=0,r=0,i=0,o=t.length;i<o;++i){var a=t[i];if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=a.array.length,r+=a.itemSize}var s=new l.InterleavedBuffer(new e(n),r),u=0,c=[],h=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],d=0;for(o=t.length;d<o;d++){var p=(a=t[d]).itemSize,g=a.count,m=new l.InterleavedBufferAttribute(s,p,u,a.normalized);c.push(m),u+=p;for(var v=0;v<g;v++)for(var y=0;y<p;y++)m[f[y]](v,a[h[y]](v))}return c},estimateBytesUsed:function(t){var e=0;for(var n in t.attributes){var r=t.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=t.getIndex();return e+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);for(var n={},r=t.getIndex(),i=t.getAttribute("position"),o=r?r.count:i.count,a=0,s=Object.keys(t.attributes),u={},c={},h=[],f=["getX","getY","getZ","getW"],d=0,p=s.length;d<p;d++){var g=s[d];u[g]=[];var m=t.morphAttributes[g];m&&(c[g]=new Array(m.length).fill().map(()=>[]))}var v=Math.log10(1/e),y=Math.pow(10,v);for(d=0;d<o;d++){var _=r?r.getX(d):d,x="",b=0;for(p=s.length;b<p;b++){g=s[b];for(var w=t.getAttribute(g),M=w.itemSize,S=0;S<M;S++)x+=~~(w[f[S]](_)*y)+","}if(x in n)h.push(n[x]);else{for(b=0,p=s.length;b<p;b++){g=s[b],w=t.getAttribute(g),m=t.morphAttributes[g],M=w.itemSize;var A=u[g],C=c[g];for(S=0;S<M;S++){var E=f[S];if(A.push(w[E](_)),m)for(var T=0,I=m.length;T<I;T++)C[T].push(m[T][E](_))}}n[x]=a,h.push(a),a++}}const L=t.clone();for(d=0,p=s.length;d<p;d++){g=s[d];var P=t.getAttribute(g),R=new P.array.constructor(u[g]);if(w=new l.BufferAttribute(R,P.itemSize,P.normalized),L.setAttribute(g,w),g in c)for(b=0;b<c[g].length;b++){var O=t.morphAttributes[g][b],k=(R=new O.array.constructor(c[g][b]),new l.BufferAttribute(R,O.itemSize,O.normalized));L.morphAttributes[g][b]=k}}return L.setIndex(h),L},toTrianglesDrawMode:function(t,e){if(e===l.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===l.TriangleFanDrawMode||e===l.TriangleStripDrawMode){var n=t.getIndex();if(null===n){var r=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<i.count;o++)r.push(o);t.setIndex(r),n=t.getIndex()}var a=n.count-2,s=[];if(e===l.TriangleFanDrawMode)for(o=1;o<=a;o++)s.push(n.getX(0)),s.push(n.getX(o)),s.push(n.getX(o+1));else for(o=0;o<a;o++)o%2==0?(s.push(n.getX(o)),s.push(n.getX(o+1)),s.push(n.getX(o+2))):(s.push(n.getX(o+2)),s.push(n.getX(o+1)),s.push(n.getX(o)));s.length/3!==a&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(s),u.clearGroups(),u}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t},computeMorphedAttributes:function(t){if(!0!==t.geometry.isBufferGeometry)return console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry."),null;var e=new l.Vector3,n=new l.Vector3,r=new l.Vector3,i=new l.Vector3,o=new l.Vector3,a=new l.Vector3,s=new l.Vector3,u=new l.Vector3,c=new l.Vector3;function h(t,l,h,f,d,p,g,m,v){e.fromBufferAttribute(h,p),n.fromBufferAttribute(h,g),r.fromBufferAttribute(h,m);var y=t.morphTargetInfluences;if(l.morphTargets&&f&&y){s.set(0,0,0),u.set(0,0,0),c.set(0,0,0);for(var _=0,x=f.length;_<x;_++){var b=y[_],w=f[_];0!==b&&(i.fromBufferAttribute(w,p),o.fromBufferAttribute(w,g),a.fromBufferAttribute(w,m),d?(s.addScaledVector(i,b),u.addScaledVector(o,b),c.addScaledVector(a,b)):(s.addScaledVector(i.sub(e),b),u.addScaledVector(o.sub(n),b),c.addScaledVector(a.sub(r),b)))}e.add(s),n.add(u),r.add(c)}t.isSkinnedMesh&&(t.boneTransform(p,e),t.boneTransform(g,n),t.boneTransform(m,r)),v[3*p+0]=e.x,v[3*p+1]=e.y,v[3*p+2]=e.z,v[3*g+0]=n.x,v[3*g+1]=n.y,v[3*g+2]=n.z,v[3*m+0]=r.x,v[3*m+1]=r.y,v[3*m+2]=r.z}var f,d,p,g,m,v,y,_,x,b=t.geometry,w=t.material,M=b.index,S=b.attributes.position,A=b.morphAttributes.position,C=b.morphTargetsRelative,E=b.attributes.normal,T=b.morphAttributes.position,I=b.groups,L=b.drawRange,P=new Float32Array(S.count*S.itemSize),R=new Float32Array(E.count*E.itemSize);if(null!==M)if(Array.isArray(w))for(g=0,v=I.length;g<v;g++)for(x=w[(_=I[g]).materialIndex],m=Math.max(_.start,L.start),y=Math.min(_.start+_.count,L.start+L.count);m<y;m+=3)h(t,x,S,A,C,f=M.getX(m),d=M.getX(m+1),p=M.getX(m+2),P),h(t,x,E,T,C,f,d,p,R);else for(g=Math.max(0,L.start),v=Math.min(M.count,L.start+L.count);g<v;g+=3)h(t,w,S,A,C,f=M.getX(g),d=M.getX(g+1),p=M.getX(g+2),P),h(t,w,E,T,C,f,d,p,R);else if(void 0!==S)if(Array.isArray(w))for(g=0,v=I.length;g<v;g++)for(x=w[(_=I[g]).materialIndex],m=Math.max(_.start,L.start),y=Math.min(_.start+_.count,L.start+L.count);m<y;m+=3)h(t,x,S,A,C,f=m,d=m+1,p=m+2,P),h(t,x,E,T,C,f,d,p,R);else for(g=Math.max(0,L.start),v=Math.min(S.count,L.start+L.count);g<v;g+=3)h(t,w,S,A,C,f=g,d=g+1,p=g+2,P),h(t,w,E,T,C,f,d,p,R);return{positionAttribute:S,normalAttribute:E,morphedPositionAttribute:new l.Float32BufferAttribute(P,3),morphedNormalAttribute:new l.Float32BufferAttribute(R,3)}}},$r=n("faa4"),ti=function(){function t(e,n,i){var o=this;r(this,t);var a=n.width||64,s=e.length>100?100:e.length,u=new l.PlaneBufferGeometry(a,a);this.texture=this._createBackGround(a),this.radius=a/3;var c,h=new l.MeshStandardMaterial({map:this.texture}),f=[];this.impacts=[],this.tweens=[],e.slice(0,s).map((function(t){var e=u.clone(),n=i.coordinateToVector3(t,0),r=(new l.Matrix4).makeTranslation(n.x,n.y,n.z);e.applyMatrix4(r),f.push(e),o.impacts.push({impactPosition:new l.Vector3(0,0,0).applyMatrix4(r),impactMaxRadius:o.radius,impactRatio:1})})),h.onBeforeCompile=function(t){t.uniforms.impacts={value:o.impacts},t.uniforms.impactRadius={value:a/2},t.vertexShader="varying vec3 vPosition;\n"+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <worldpos_vertex>","#include <worldpos_vertex>\n vPosition = transformed.xyz;"),t.fragmentShader="struct impact {\n vec3 impactPosition;\n float impactMaxRadius;\n float impactRatio;\n };\n uniform impact impacts[".concat(s,"];\n uniform float impactRadius;\n varying vec3 vPosition;\n ")+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("#include <dithering_fragment>","#include <dithering_fragment>\n float finalStep = 0.0;\n for (int i = 0; i < ".concat(s,";i++){\n \n float dist = distance(vPosition, impacts[i].impactPosition);\n //float curRadius = impacts[i].impactMaxRadius * impacts[i].impactRatio;\n float curRadius = impactRadius * impacts[i].impactRatio;\n float sstep = smoothstep(0., curRadius, dist) - smoothstep(curRadius - ( 0.25 * impacts[i].impactRatio ), curRadius, dist);\n sstep *= 1. - impacts[i].impactRatio;\n finalStep += sstep;\n\n }\n finalStep = 1. - clamp(finalStep, 0., 1.);\n\n //vec3 col = mix(vec3(1., 0.5, 0.0625), vec3(1.,0.125, 0.0625), finalStep);\n vec3 col = mix(vec3(1.,0., 0.), vec3(1.,0., 0.), finalStep);\n gl_FragColor = vec4( mix( col, gl_FragColor.rgb, finalStep), diffuseColor.a );")),c=t,o.materialShader=t};var d=Kr.mergeBufferGeometries(f),p=new qr({interactive:!1},d,h,i);i.addMesh(p),this.map=i.map,this.curscale=this.map.getScale();for(var g=this,m=function(t){o.tweens.push({runTween:function(){new $r.a({value:0}).to({value:1},l.Math.randInt(2500,5e3)).delay(l.Math.randInt(500,2e3)).onUpdate((function(e){c&&c.uniforms.impacts.value[t]&&(c.uniforms.impacts.value[t].impactRatio=e.value)})).onComplete((function(){var e;null===(e=g.tweens[t])||void 0===e||e.runTween()})).start()}})},v=0;v<s;v++)m(v);this.tweens.forEach((function(t){t.runTween()})),this.width=a,this.shockMeshs=p,this.threelayer=i,this.points=e,this._geom=u,this._bindMapEvents()}return o(t,[{key:"_bindMapEvents",value:function(){this.map&&this.map.on("zooming zoomend",this._setSizeOn,this)}},{key:"_closeEvent",value:function(){this.map&&this.map.off("zooming zoomend",this._setSizeOn,this)}},{key:"_setSizeOn",value:function(){if(this.materialShader){var t=this.map.getScale()/this.curscale;t=(t=t>1?1:t)<.5?.5:t,this.materialShader.uniforms.impactRadius.value=this.radius*t}}},{key:"_createBackGround",value:function(t){var e=document.createElement("canvas");e.width=e.height=t;var n=e.getContext("2d");n.globalCompositeOperation,n.globalAlpha=0,n.fillRect(0,0,e.width,e.height);var r=new l.Texture(e);return r.needsUpdate=!0,r}},{key:"hide",value:function(){this.shockMeshs&&this.threelayer.removeMesh(this.shockMeshs)}},{key:"show",value:function(){this.shockMeshs&&this.threelayer.addMesh(this.shockMeshs)}},{key:"dispose",value:function(){if(this.shockMeshs&&(this.threelayer.removeMesh(this.shockMeshs),this.shockMeshs.object3d.geometry&&this.shockMeshs.object3d.geometry.dispose(),delete this.shockMeshs,this.texture&&this.texture.dispose(),this.material&&(this.material.dispose(),delete this.material)),this.tweens.length>0){for(var t=0;t<this.tweens.length;t++)delete this.tweens[t];this.tweens=[]}if(this.impacts.length>0){for(var e=0;e<this.impacts.length;e++)delete this.impacts[e];this.impacts=[]}this._geom&&(this._geom.dispose(),delete this._geom),this._closeEvent(),this.points=[],this.materialShader&&delete this.materialShader,this.map=null}}]),t}();l.UniformsLib.line={linewidth:{value:1},resolution:{value:new l.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},l.ShaderLib.line={uniforms:l.UniformsUtils.merge([l.UniformsLib.common,l.UniformsLib.fog,l.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\tfloat a = vUv.x;\n\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\tfloat len2 = a * a + b * b;\n\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t}\n\n\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};var ei=function(t){l.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:l.UniformsUtils.clone(l.ShaderLib.line.uniforms),vertexShader:l.ShaderLib.line.vertexShader,fragmentShader:l.ShaderLib.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)};(ei.prototype=Object.create(l.ShaderMaterial.prototype)).constructor=ei,ei.prototype.isLineMaterial=!0;var ni=function(){l.InstancedBufferGeometry.call(this),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new l.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new l.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))};ni.prototype=Object.assign(Object.create(l.InstancedBufferGeometry.prototype),{constructor:ni,isLineSegmentsGeometry:!0,applyMatrix4:function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},setPositions:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new l.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new l.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new l.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new l.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new l.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new l.InterleavedBufferAttribute(n,3,3)),this},fromWireframeGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromEdgesGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromMesh:function(t){return this.fromWireframeGeometry(new l.WireframeGeometry(t.geometry)),this},fromLineSegments:function(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")},computeBoundingBox:function(){var t=new l.Box3;return function(){null===this.boundingBox&&(this.boundingBox=new l.Box3);var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==e&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(e),t.setFromBufferAttribute(n),this.boundingBox.union(t))}}(),computeBoundingSphere:function(){var t=new l.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new l.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==e&&void 0!==n){var r=this.boundingSphere.center;this.boundingBox.getCenter(r);for(var i=0,o=0,a=e.count;o<a;o++)t.fromBufferAttribute(e,o),i=Math.max(i,r.distanceToSquared(t)),t.fromBufferAttribute(n,o),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}}(),toJSON:function(){},applyMatrix:function(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}});var ri=function(){ni.call(this),this.type="LineGeometry"};ri.prototype=Object.assign(Object.create(ni.prototype),{constructor:ri,isLineGeometry:!0,setPositions:function(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return ni.prototype.setPositions.call(this,n),this},setColors:function(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return ni.prototype.setColors.call(this,n),this},fromLine:function(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")},copy:function(){return this}});var ii={altitude:0,height:0},oi=function(t){P(n,t);var e=F(n);function n(t,i,o){var a;r(this,n),t=h.Util.extend({},ii,t,{layer:o}),a=e.call(this);var s=t,u=s.width,c=s.height;s.altitude,a._initOptions(t);var f=new l.PlaneBufferGeometry(u,c);return a._createMesh(f,i),a}return o(n)}(ht),ai=function(t,e){void 0===t&&(t=new ni),void 0===e&&(e=new ei({color:16777215*Math.random()})),l.Mesh.call(this,t,e),this.type="LineSegments2"};ai.prototype=Object.assign(Object.create(l.Mesh.prototype),{constructor:ai,isLineSegments2:!0,computeLineDistances:function(){var t=new l.Vector3,e=new l.Vector3;return function(){for(var n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd,o=new Float32Array(2*r.count),a=0,s=0,u=r.count;a<u;a++,s+=2)t.fromBufferAttribute(r,a),e.fromBufferAttribute(i,a),o[s]=0===s?0:o[s-1],o[s+1]=o[s]+t.distanceTo(e);var c=new l.InstancedInterleavedBuffer(o,2,1);return n.setAttribute("instanceDistanceStart",new l.InterleavedBufferAttribute(c,1,0)),n.setAttribute("instanceDistanceEnd",new l.InterleavedBufferAttribute(c,1,1)),this}}(),raycast:function(){var t=new l.Vector4,e=new l.Vector4,n=new l.Vector4,r=new l.Vector3,i=new l.Matrix4,o=new l.Line3,a=new l.Vector3,s=new l.Box3,u=new l.Sphere,c=new l.Vector4;return function(h,f){null===h.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var d=void 0!==h.params.Line2&&h.params.Line2.threshold||0,p=h.ray,g=h.camera,m=g.projectionMatrix,v=this.matrixWorld,y=this.geometry,_=this.material,x=_.resolution,b=_.linewidth+d,w=y.attributes.instanceStart,M=y.attributes.instanceEnd,S=-g.near,A=2*Math.max(b/x.width,b/x.height);null===y.boundingSphere&&y.computeBoundingSphere(),u.copy(y.boundingSphere).applyMatrix4(v);var C=Math.max(g.near,u.distanceToPoint(p.origin));c.set(0,0,-C,1).applyMatrix4(g.projectionMatrix),c.multiplyScalar(1/c.w),c.applyMatrix4(g.projectionMatrixInverse);var E=.5*Math.abs(A/c.w);if(u.radius+=E,!1!==h.ray.intersectsSphere(u)){null===y.boundingBox&&y.computeBoundingBox(),s.copy(y.boundingBox).applyMatrix4(v);var T=Math.max(g.near,s.distanceToPoint(p.origin));c.set(0,0,-T,1).applyMatrix4(g.projectionMatrix),c.multiplyScalar(1/c.w),c.applyMatrix4(g.projectionMatrixInverse);var I=.5*Math.abs(A/c.w);if(s.max.x+=I,s.max.y+=I,s.max.z+=I,s.min.x-=I,s.min.y-=I,s.min.z-=I,!1!==h.ray.intersectsBox(s)){p.at(1,n),n.w=1,n.applyMatrix4(g.matrixWorldInverse),n.applyMatrix4(m),n.multiplyScalar(1/n.w),n.x*=x.x/2,n.y*=x.y/2,n.z=0,r.copy(n),i.multiplyMatrices(g.matrixWorldInverse,v);for(var L=0,P=w.count;L<P;L++)if(t.fromBufferAttribute(w,L),e.fromBufferAttribute(M,L),t.w=1,e.w=1,t.applyMatrix4(i),e.applyMatrix4(i),!(t.z>S&&e.z>S)){if(t.z>S){const n=t.z-e.z,r=(t.z-S)/n;t.lerp(e,r)}else if(e.z>S){const n=e.z-t.z,r=(e.z-S)/n;e.lerp(t,r)}t.applyMatrix4(m),e.applyMatrix4(m),t.multiplyScalar(1/t.w),e.multiplyScalar(1/e.w),t.x*=x.x/2,t.y*=x.y/2,e.x*=x.x/2,e.y*=x.y/2,o.start.copy(t),o.start.z=0,o.end.copy(e),o.end.z=0;var R=o.closestPointToPointParameter(r,!0);o.at(R,a);var O=l.MathUtils.lerp(t.z,e.z,R),k=O>=-1&&O<=1,B=r.distanceTo(a)<.5*b;if(k&&B){o.start.fromBufferAttribute(w,L),o.end.fromBufferAttribute(M,L),o.start.applyMatrix4(v),o.end.applyMatrix4(v);var F=new l.Vector3,D=new l.Vector3;p.distanceSqToSegment(o.start,o.end,D,F),f.push({point:D,pointOnLine:F,distance:p.origin.distanceTo(D),object:this,face:null,faceIndex:L,uv:null,uv2:null})}}}}}}()});var si=function(t,e){void 0===t&&(t=new ri),void 0===e&&(e=new ei({color:16777215*Math.random()})),ai.call(this,t,e),this.type="Line2"};si.prototype=Object.assign(Object.create(ai.prototype),{constructor:si,isLine2:!0});var ui={radius:100,altitude:0},ci=function(t){P(n,t);var e=F(n);function n(t,i,o,a,s){var u;r(this,n),i=h.Util.extend({},ui,i,{layer:s,coordinate:t}),(u=e.call(this))._initOptions(i);var c=i.altitude;u.object3d=new si(o,a),u.object3d.computeLineDistances(),u.object3d.scale.set(1,1,1),u.object3d.__parent=k(u);var l=s.distanceToVector3(c,c).x,f=s.coordinateToVector3(t,l);return u.getObject3d().position.copy(f),u}return o(n)}(ht),li={radius:100,altitude:0},hi=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},li,i,{layer:a,coordinate:t}),(s=e.call(this))._initOptions(i);var u=i,c=u.altitude,f=u.inradius,d=u.outradius,p=u.start,g=a.distanceToVector3(f,f).x,m=a.distanceToVector3(d,d).x,v=new l.RingBufferGeometry(g,m,14,1,p*Math.PI/180,45*Math.PI/180);s._createMesh(v,o);var y=a.distanceToVector3(c,c).x,_=a.coordinateToVector3(t,y);return s.getObject3d().position.copy(_),s}return o(n)}(ht),fi={radius:100,altitude:0},di=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},fi,i,{layer:a,coordinate:t}),(s=e.call(this))._initOptions(i);var u=i,c=u.altitude,f=u.radius,d=u.start,p=a.distanceToVector3(f,f).x,g=new l.CircleBufferGeometry(p,128,d*Math.PI/180,45*Math.PI/180);s._createMesh(g,o);var m=a.distanceToVector3(c,c).x,v=a.coordinateToVector3(t,m);return s.getObject3d().position.copy(v),s}return o(n)}(ht),pi=function(){function t(e,n,i,o){r(this,t),this.tlayer=o,this.map=o.map;var a=o.coordinateToVector3(e,0),s=i.maxdis||15e3,u=i.middis||1e4,c=i.mindis||5e3,f=s/2e3,d=i.fontsize||80,p=4*f,g=1*f,m=o.distanceToVector3(s,s).x,v=o.distanceToVector3(u,u).x,y=o.distanceToVector3(c,c).x,_=(new l.Matrix4).makeTranslation(a.x,a.y,a.z);this.matLine=new ei({color:i.color||4227327,linewidth:i.lineWidth||.002,dashed:!1,transparent:!0}),this.matLine.uniforms.opacity.value=i.opacity||.65,this.meshitems=[],this.textures=[],this.lineItems=[],this.psItems=[];var x={type:"label",x_offset:0,y_offset:g,name:"N",degree:0};this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:g,y_offset:g,name:"EN",degree:45},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:g,y_offset:0,name:"E",degree:90},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:g,y_offset:-g,name:"ES",degree:135},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:0,y_offset:-g,name:"S",degree:180},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:-g,y_offset:-g,name:"WS",degree:225},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:-g,y_offset:0,name:"W",degree:270},this.createLabelNew(m,d,p,_,x),x={type:"label",x_offset:-g,y_offset:g,name:"WN",degree:315},this.createLabelNew(m,d,p,_,x),this.createCircle(m,e),this.createCircle(v,e),this.createCircle(y,e);for(var b=0;b<360;b+=45)this.lineItems.push({x1:0*Math.sin(Math.PI/180*0),y1:0*Math.cos(Math.PI/180*0),z1:0,x2:Math.sin(b*(Math.PI/180))*m,y2:Math.cos(b*(Math.PI/180))*m,z2:0});this.createLine(e);for(var w=0;w<n.length;w++)-1!=n[w].name.indexOf("A")?this.createMinPoly(c,e,n[w].color,this.getDegree(n[w].name),Object.assign(n[w],{type:"poly"})):-1!=n[w].name.indexOf("B")?this.createRing(c,u,e,n[w].color,this.getDegree(n[w].name),Object.assign(n[w],{type:"poly"})):-1!=n[w].name.indexOf("C")&&this.createRing(u,s,e,n[w].color,this.getDegree(n[w].name),Object.assign(n[w],{type:"poly"}));if(o.addMesh(this.meshitems),this.callback=i.callback,this.callback){var M={custom:!0,dy:i.dy||-48,content:"",autoOpenOn:null};this.infoWindow=new h.ui.InfoWindow(M).addTo(this.map)}this._translation=_}return o(t,[{key:"dispose",value:function(){var t=this;if(this.infoWindow&&(this.infoWindow.remove(),delete this.infoWindow),this.meshitems){this.tlayer.removeMesh(this.meshitems),this.meshitems.forEach((function(e){var n=e.getProperties();n&&"poly"===n.type&&t.closeClick(e),n&&e.getProperties()})),this.textures.length>0&&(this.textures.forEach((function(t){t.dispose()})),this.textures=[]),this.meshitems.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()}));for(var e=0;e<this.lineItems.length;e++)delete this.lineItems[e];this.lineItems=[];for(var n=0;n<this.psItems.length;n++)delete this.psItems[n];this.psItems=[]}delete this._translation}},{key:"createMinPoly",value:function(t,e,n,r,i){var o=new l.MeshBasicMaterial({color:n,transparent:!0,opacity:.5,depthTest:!1}),a=new di(e,{radius:t,start:r},o,this.tlayer);a.setProperties(i),this.attachClick(a),this.meshitems.push(a)}},{key:"createRing",value:function(t,e,n,r,i,o){var a=new l.MeshBasicMaterial({color:r,transparent:!0,opacity:.5,depthTest:!1}),s=new hi(n,{inradius:t,outradius:e,start:i},a,this.tlayer);s.setProperties(o),this.meshitems.push(s),this.attachClick(s)}},{key:"closeClick",value:function(t){t.off("click",this._setItemEvent,this)}},{key:"attachClick",value:function(t){t.on("click",this._setItemEvent,this)}},{key:"_setItemEvent",value:function(){var t=s(regeneratorRuntime.mark((function t(e){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callback){t.next=5;break}return n=e.target.getProperties(),t.next=4,this.callback(this.infoWindow,n);case 4:this.infoWindow.show({x:e.coordinate.x,y:e.coordinate.y});case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getPropertiesByName",value:function(t,e){for(var n=0;n<e.length;n++)if(e[n].name===t)return e[n]}},{key:"getDegree",value:function(t){switch(t){case"A1":case"B1":case"C1":return 45;case"A2":case"B2":case"C2":return 0;case"A8":case"B8":case"C8":return 90;case"A7":case"B7":case"C7":return 135;case"A6":case"B6":case"C6":return 180;case"A5":case"B5":case"C5":return 225;case"A4":case"B4":case"C4":return 270;case"A3":case"B3":case"C3":return 315}}},{key:"createLine",value:function(t){for(var e=[],n=0;n<this.lineItems.length;n++){(e=[]).push(this.lineItems[n].x1,this.lineItems[n].y1,this.lineItems[n].z1),e.push(this.lineItems[n].x2,this.lineItems[n].y2,this.lineItems[n].z2);var r=new ri;r.setPositions(e);var i=new ci(t,{interactive:!1},r,this.matLine,this.tlayer);this.meshitems.push(i)}}},{key:"createCircle",value:function(t,e){for(var n=[],r=0;r<=360;r++)n.push(Math.sin(r*(Math.PI/180))*t,Math.cos(r*(Math.PI/180))*t,0);var i=new ri;i.setPositions(n);var o=new ci(e,{interactive:!1},i,this.matLine,this.tlayer);this.meshitems.push(o)}},{key:"createLabelNew",value:function(t,e,n,r,i){var o=new oi({interactive:!1,width:n,height:n},this.getTextMaterial(i.name,e,"#fff"),this.tlayer),a=this.getPsVec(i.degree,t,r);o.object3d.position.set(a.x+i.x_offset,a.y+i.y_offset,0),this.psItems.push(a),o.setProperties(i),this.meshitems.push(o)}},{key:"getPsVec",value:function(t,e,n){var r=t*(Math.PI/180),i=new l.Vector3(Math.sin(r)*e,Math.cos(r)*e,0);return i=i.applyMatrix4(n)}},{key:"getTextMaterial",value:function(t,e,n){var r=document.createElement("canvas");r.width=r.height=256;var i=r.getContext("2d");i.fillStyle=n,i.font="".concat(e,"px Aria"),i.textAlign="center",i.textBaseline="middle",i.fillText(t,128,128);var o=new l.Texture(r);return o.needsUpdate=!0,this.textures.push(o),new l.MeshPhongMaterial({map:o,transparent:!0,depthTest:!1})}}]),t}(),gi=(n("20f0"),n("1340"),Math.PI/180);function mi(t){return t.getCoordinates().map((function(t){return t.toArray()}))}function vi(t){return t*gi}function yi(t,e){if(!t||!e)return 0;Array.isArray(t)||(t=t.toArray()),Array.isArray(e)||(e=e.toArray());var n=vi(t[1]),r=vi(e[1]),i=n-r,o=vi(t[0])-vi(e[0]);return n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(i/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(o/2),2))),n*=6378137,Math.round(1e5*n)/1e5}function _i(t,e){var n=t.len,r=t.c1,i=t.c2,o=i[0]-r[0],a=i[1]-r[1],s=(i[2]||0)-(r[2]||0),u=e/n;return[r[0]+u*o,r[1]+u*a,(r[2]||0)+u*s]}function xi(t,e,n){if(void 0===n&&(n={}),!0===n.final)return function(t,e){var n=xi(e,t);return n=(n+180)%360}(t,e);var r=N(t),i=N(e),o=j(r[0]),a=j(i[0]),s=j(r[1]),u=j(i[1]),c=Math.sin(a-o)*Math.cos(u),l=Math.cos(s)*Math.sin(u)-Math.sin(s)*Math.cos(u)*Math.cos(a-o);return function(t){return t%(2*Math.PI)*180/Math.PI}(Math.atan2(c,l))}var bi=n("6d6e"),wi=n.n(bi),Mi={altitude:0,height:0},Si=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),o=h.Util.extend({},Mi,o,{layer:a}),s=e.call(this);var u=o,c=u.width,f=u.height,d=u.altitude;s._initOptions(o);var p=new l.PlaneBufferGeometry(c,f);s._createMesh(p,i);var g=a.distanceToVector3(d,d).x,m=a.coordinateToVector3(t,g);return s.getObject3d().position.copy(m),s}return o(n)}(ht),Ai=function(){function t(e,n,i){var o=this;r(this,t),this.tlayer=i,this.map=i.map,n.color;var a=void 0!==n.smoothFlag&&!0===n.smoothFlag,s=void 0!==n.lineFlag&&!0===n.lineFlag;this.material=null,this.texture=null,this.curve=null,this.meshs=[],this.pts=[],this.newPts=[],this.arrows=[],this.lines=null,this.coordinates=null,this.positions=null,this.bearings=[],s&&(this.lineMaterial=new ei({color:n.lineColor||"red",transparent:!0,linewidth:n.linewidth||4,blending:l.AdditiveBlending})),this.loadTexture().then((function(t){var r=null;if(a?(e.forEach((function(t){var e=i.coordinateToVector3(t);o.pts.push(e)})),o.curve=new l.CatmullRomCurve3(o.pts,!1),o.curve.getPoints(20).forEach((function(t){var e=o.map.pointToCoordinate(t,o.map.getGLZoom());o.newPts.push(e)})),r=new h.LineString(o.newPts)):r=new h.LineString(e),s){var u=i.toFatLine(r,{},o.lineMaterial);o.meshs.push(u),o.tlayer.addMesh(o.meshs)}var c=r.getLength(),f=parseInt(c/30);f=f>10?10:f,o.ArrowNum=f;var d=1/o.ArrowNum;o.addSpan=Math.floor(100*d)/100;for(var p=0;p<o.ArrowNum;p++){var g=new Si(e[0],t,{width:n.width||.2,height:n.height||.1},o.tlayer);g.object3d.renderOrder=n.arrowOrder||1,o.arrows.push(g)}o.tlayer.addMesh(o.arrows),o.lines=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;e=Math.max(e,1),Array.isArray(t)||(t=mi(t));for(var n=t.length,r=[],i=0,o=0;o<n-1;o++){var a=yi(t[o],t[o+1]),s=Math.floor(a);r.push({c1:t[o],len:s,c2:t[o+1]}),i+=s}if(i<=e){var u=r.map((function(t){return[t.c1,t.c2]}));return u}if(1===r.length&&r[0].len<=e)return[[r[0].c1,r[0].c2]];for(var c,l=r.length,h=r[0],f=0,d=0,p=[],g=[h.c1];f<l;){var m=r[f],v=m.len,y=m.c2;if((d+=v)<e&&(g.push(y),f===l-1&&p.push(g),f++),d==e&&(g.push(y),d=0,p.push(g),g=[y],f++),d>e){var _=v-d+e;c=_i(r[f],_),g.push(c),p.push(g),d=0,r[f].c1=c,r[f].len=v-_,(g=[]).push(c)}}return p}(r,1);var m=o.lines[0][0],v=o.tlayer.coordinateToVector3(m);o.coordinates=[m],o.positions=[v],o.lines.forEach((function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.join(",").toString()!==o.coordinates[o.coordinates.length-1].join(",").toString()){o.coordinates.push(n);var r=o.tlayer.coordinateToVector3(n);r.z=.02,o.positions.push(r)}}}));for(var y=0;y<o.coordinates.length-1;y++){var _=o.coordinates[y],x=o.coordinates[y+1],b=xi(wi()(_),wi()(x));o.bearings.push((180-b)*Math.PI/180)}}))}return o(t,[{key:"loadTexture",value:function(){var t=s(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.promiseToDoSomething();case 2:return e=t.sent,this.texture=new l.CanvasTexture(e.canvas),this.material=new l.MeshBasicMaterial({map:this.texture,side:l.DoubleSide,depthWrite:!1,depthTest:!1}),t.abrupt("return",this.material);case 6:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"promiseToDoSomething",value:function(){return new Promise((function(t){var e=document.createElement("canvas").getContext("2d");e.canvas.width=64,e.canvas.height=64,e.translate(29,32),e.rotate(.5*Math.PI),e.fillStyle="rgb(0,255,255)",e.textAlign="center",e.textBaseline="middle",e.font="48px sans-serif",e.fillText("➡︎",0,0),setTimeout((function(){return t(e)}),4)}))}},{key:"naimationFunc",value:function(){if(this.coordinates)for(var t=1e-4*performance.now(),e=0;e<this.ArrowNum;e++){var n=(t+this.addSpan*e)%1,r=Math.floor(n*this.coordinates.length);this.arrows[e].getObject3d().position.copy(this.positions[r]);var i=this.bearings[r];null!=i&&(this.arrows[e].getObject3d().rotation.z=i)}}},{key:"dispose",value:function(){this.meshs&&(this.tlayer.removeMesh(this.meshs),this.meshs.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose()}))),this.arrows&&(this.tlayer.removeMesh(this.arrows),this.arrows.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose()}))),this.material&&this.material.dispose(),this.texture&&this.texture.dispose(),this.curve&&delete this.curve;for(var t=0;t<this.pts.length;t++)delete this.pts[t];this.pts=[],this.newPts=[];for(var e=0;e<this.lines.length;e++)delete this.lines[e];this.lines=[],this.coordinates=[],this.positions=[],this.bearings=[]}}]),t}(),Ci=function(){function t(e,n,i){var o=this;r(this,t),this.tlayer=i,this.map=i.map;var a=i.coordinateToVector3(e,0),s=n.distince||15e3,u=s/2,c=s/2e3,h=n.fontsize||80,f=4*c,d=1*c,p=i.distanceToVector3(s,s).x,g=i.distanceToVector3(u,u).x,m=(new l.Matrix4).makeTranslation(a.x,a.y,a.z);if(this.meshitems=[],this.textures=[],this.lineItems=[],this.psItems=[],this.arrowitems=[],this.matLine=new ei({color:n.color||4227327,linewidth:n.lineWidth||.001,dashed:!1,transparent:!0}),this.matLine.uniforms.opacity.value=n.opacity||.65,this.textureLoader=new l.TextureLoader,n.arrowImgPath){var v=n.windSpeed||0,y=n.windDirection||0;console.log(y),this.textureLoader.load(n.arrowImgPath,(function(t){o.textures.push(t),o.arrowMaterial=new l.MeshBasicMaterial({map:t});var e=new oi({interactive:!1,width:2*c,height:2*c},o.arrowMaterial,o.tlayer),n=o.getArrowPs(y,c),r=n.rotation*(Math.PI/180),i=o.getPsVec(y,p,m);o.psItems.push(i),o.psItems.push(n),e.object3d.position.set(i.x,i.y,a.z),e.object3d.rotation.z=r,o.arrowitems.push(e);var s=o.createTexture("".concat(v,"级"),60,"#fff");o.textures.push(s);var u=new oi({interactive:!1,width:f,height:f},o.getArrowTextMaterial(s),o.tlayer);u.object3d.position.set(i.x+n.offx,i.y+n.offy,a.z),o.arrowitems.push(u),o.tlayer.addMesh(o.arrowitems)}))}var _={type:"label",x_offset:0,y_offset:d,name:"N",degree:0};this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:d,y_offset:d,name:"EN",degree:45},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:d,y_offset:0,name:"E",degree:90},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:d,y_offset:-d,name:"ES",degree:135},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:0,y_offset:-d,name:"S",degree:180},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:-d,y_offset:-d,name:"WS",degree:225},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:-d,y_offset:0,name:"W",degree:270},this.createLabelNew(p,h,f,m,_),_={type:"label",x_offset:-d,y_offset:d,name:"WN",degree:315},this.createLabelNew(p,h,f,m,_),this.createCircle(p,e),this.createCircle(g,e);for(var x=0;x<360;x+=22.5)this.lineItems.push({x1:0*Math.sin(Math.PI/180*0),y1:0*Math.cos(Math.PI/180*0),z1:0,x2:Math.sin(x*(Math.PI/180))*p,y2:Math.cos(x*(Math.PI/180))*p,z2:0});this.createLine(e),i.addMesh(this.meshitems),this._translation=m,this._r=p,this._factor=c}return o(t,[{key:"dispose",value:function(){if(this.meshitems){this.tlayer.removeMesh(this.meshitems),this.meshitems.forEach((function(t){t.getProperties()&&t.getProperties()})),this.textures.length>0&&(this.textures.forEach((function(t){t.dispose()})),this.textures=[]),this.meshitems.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()}));for(var t=0;t<this.lineItems.length;t++)delete this.lineItems[t];this.lineItems=[];for(var e=0;e<this.psItems.length;e++)delete this.psItems[e];this.psItems=[]}this.arrowitems&&(this.tlayer.removeMesh(this.arrowitems),this.arrowitems.forEach((function(t){t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()}))),this.textureLoader&&delete this.textureLoader,delete this._translation}},{key:"createLine",value:function(t){for(var e=[],n=0;n<this.lineItems.length;n++){(e=[]).push(this.lineItems[n].x1,this.lineItems[n].y1,this.lineItems[n].z1),e.push(this.lineItems[n].x2,this.lineItems[n].y2,this.lineItems[n].z2);var r=new ri;r.setPositions(e);var i=new ci(t,{interactive:!1},r,this.matLine,this.tlayer);this.meshitems.push(i)}}},{key:"updateDirection",value:function(t,e){if(2===this.arrowitems.length){var n=this.arrowitems[0],r=this.arrowitems[1],i=this.createTexture("".concat(e||0,"级"),60,"#fff");r.object3d.material.map=i,this.textures.push(i),r.object3d.material.map.needsUpdate=!0;var o=this.getArrowPs(t,this._factor),a=o.rotation*(Math.PI/180),s=this.getPsVec(t,this._r,this._translation);n.object3d.position.set(s.x,s.y,0),this.psItems.push(s),this.psItems.push(o),n.object3d.position.set(s.x,s.y,0),n.object3d.rotation.z=a,r.object3d.position.set(s.x+o.offx,s.y+o.offy,0)}}},{key:"createCircle",value:function(t,e){for(var n=[],r=0;r<=360;r++)n.push(Math.sin(r*(Math.PI/180))*t,Math.cos(r*(Math.PI/180))*t,0);var i=new ri;i.setPositions(n);var o=new ci(e,{interactive:!1},i,this.matLine,this.tlayer);this.meshitems.push(o)}},{key:"createLabelNew",value:function(t,e,n,r,i){var o=new oi({interactive:!1,width:n,height:n},this.getTextMaterial(i.name,e,"#fff"),this.tlayer),a=this.getPsVec(i.degree,t,r);o.object3d.position.set(a.x+i.x_offset,a.y+i.y_offset,0),this.psItems.push(a),o.setProperties(i),this.meshitems.push(o)}},{key:"getPsVec",value:function(t,e,n){var r=t*(Math.PI/180),i=new l.Vector3(Math.sin(r)*e,Math.cos(r)*e,0);return i=i.applyMatrix4(n)}},{key:"getTextMaterial",value:function(t,e,n){var r=document.createElement("canvas");r.width=r.height=256;var i=r.getContext("2d");i.fillStyle=n,i.font="".concat(e,"px Aria"),i.textAlign="center",i.textBaseline="middle",i.fillText(t,128,128);var o=new l.Texture(r);return o.needsUpdate=!0,this.textures.push(o),new l.MeshPhongMaterial({map:o,transparent:!0,depthTest:!1})}},{key:"getArrowPs",value:function(t,e){var n=0,r=0,i=0;return t>180?(n=360-t+180,r=2*e,i=0):n=180-t,0==t?(r=0,i=-2*e):180==t?(i=0,i=2*e):t>0&&t<180&&(r=-2*e,i=0),{rotation:n,offx:r,offy:i}}},{key:"createTexture",value:function(t,e,n){var r=document.createElement("canvas");r.width=r.height=256;var i=r.getContext("2d");i.fillStyle=n,i.font="".concat(e,"px Aria"),i.textAlign="center",i.textBaseline="middle",i.fillText(t,128,128);var o=new l.Texture(r);return o.needsUpdate=!0,o}},{key:"getArrowTextMaterial",value:function(t){return new l.MeshPhongMaterial({map:t,transparent:!0,depthTest:!1})}}]),t}(),Ei={altitude:0,height:0},Ti=function(t){P(n,t);var e=F(n);function n(t,i,o,a){var s;r(this,n),i=h.Util.extend({},Ei,i,{layer:a}),(s=e.call(this))._initOptions(i);var u=i.altitude;console.log(u),s._createGroup();var c=new l.Sprite(o);c.material.sizeAttenuation=!1;var f=.005/3;c.scale.set(36*f,36*f,1),console.log(36*f/2*200),s.getObject3d().add(c);var d=a.distanceToVector3(u,u).x,p=a.coordinateToVector3(t,d);return s.getObject3d().position.copy(p),s}return o(n)}(ht),Ii=function(){function t(e,n,i){var o=this;r(this,t),this.map=i.map,this.threeLayer=i,this.lineStrings=[],this.meshs=[],this.properties=[],this.lineMaterial=new l.LineBasicMaterial({color:n.lineColor||"rgb(0,160,233)"}),this.rfields=null,this.fields=[],this.isToolTip=n.isToolTip,this.isExtrusion=n.isExtrusion,this.oriColor={},this.selectColor=new l.Color(n.selectColor),this.geojson=e,this.iconPath=n.iconPath,this.iconCidName=n.iconCidName,this.fontConfig=n.fontConfig,n.text&&(this.txtLabel=new h.VectorLayer(h.Util.GUID(),{hitDetect:!1,enableAltitude:!0}).addTo(i.map),this.rfields=n.text.match(/\{(.+?)\}/g),this.rfields.forEach((function(t){o.fields.push(t.substring(1,t.length-1))})),this.geoItems=[]),this.textureLoader=new l.TextureLoader,e.forEach((function(t){var e=t.geometry,r=h.GeoJSON.toGeometry(t),a=t.properties;o.oriColor[a.name]||(o.oriColor[a.name]=new l.Color(a.color));var s=new l.MeshPhongMaterial({transparent:!0,opacity:a.opacity||1,color:o.oriColor[a.name]}),u=.1;o.isExtrusion&&(u=a.height?200*a.height:.1);var c=i.toExtrudePolygon(r,{height:u},s);c.setProperties(t.properties),c.object3d.renderOrder=n.renderOrder||0,o.isToolTip&&c.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),o.meshs.push(c),n.isAddLine&&e.coordinates.forEach((function(e){var n=new h.LineString(e[0]),r=i.toLine(n,{altitude:.1===u?1:u,interactive:!1},o.lineMaterial);r.setProperties(t.properties),o.meshs.push(r),o.lineStrings.push(n)}));var f=r.getCenter();if(o.iconPath&&o.iconCidName&&o.iconCidName===a.name){var d=new h.Marker(f,{properties:{altitude:.1===u?1:u,name:a.name},symbol:{markerFile:o.iconPath,markerWidth:64,markerHeight:64,markerDx:0,markerDy:0,markerOpacity:1}});o.geoItems.push(d),o.txtLabel.addGeometry(d)}n.text&&o.createMark(f,u,a)})),i.addMesh(this.meshs),this._bindEvent()}return o(t,[{key:"createMark",value:function(t,e,n){var r=null;1===this.fields.length?r=new h.Marker(t,{properties:{name:n[this.fields[0]],altitude:.1===e?1:e},symbol:[{textFaceName:"sans-serif",textName:"{name}",textWeight:"normal",textStyle:"normal",textSize:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontSize?this.fontConfig[0].fontSize:12,textFont:null,textFill:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontColor?this.fontConfig[0].fontColor:"#fff",textOpacity:1,textWrapWidth:null,textWrapCharacter:"\n",textLineSpacing:0,textDx:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dx?this.fontConfig[0].dx:20,textDy:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dy?this.fontConfig[0].dy:0,textHorizontalAlignment:"top",textVerticalAlignment:"middle",textAlign:"center"}]}):2===this.fields.length&&(r=new h.Marker(t,{properties:{name:n[this.fields[0]],index:n[this.fields[1]],altitude:.1===e?1:e},symbol:[{textFaceName:"sans-serif",textName:"{name}",textWeight:"normal",textStyle:"normal",textSize:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontSize?this.fontConfig[0].fontSize:12,textFont:null,textFill:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].fontColor?this.fontConfig[0].fontColor:"#fff",textOpacity:1,textWrapWidth:null,textWrapCharacter:"\n",textLineSpacing:0,textDx:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dx?this.fontConfig[0].dx:20,textDy:this.fontConfig&&this.fontConfig[0]&&this.fontConfig[0].dy?this.fontConfig[0].dy:0,textHorizontalAlignment:"top",textVerticalAlignment:"middle",textAlign:"center"},{textFaceName:"sans-serif",textName:"{index}",textWeight:"bold",textStyle:"normal",textSize:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].fontSize?this.fontConfig[1].fontSize:20,textFont:null,textFill:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].fontColor?this.fontConfig[1].fontColor:"#fff",textOpacity:1,textWrapWidth:null,textWrapCharacter:"\n",textLineSpacing:0,textDx:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].dx?this.fontConfig[1].dx:20,textDy:this.fontConfig&&this.fontConfig[1]&&this.fontConfig[1].dy?this.fontConfig[1].dy:-20,textHorizontalAlignment:"top",textVerticalAlignment:"middle",textAlign:"center"}]})),r&&(this.geoItems.push(r),this.txtLabel.addGeometry(r))}},{key:"addIcon",value:function(){var t=s(regeneratorRuntime.mark((function t(e,n){var r,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,V.addImageProcessImage(this.iconPath);case 2:r=t.sent,i=V.generateTextureOne(r,128,128),this.iconMaterial=new l.SpriteMaterial({map:i}),(o=new Ti(e,{altitude:n+=2400},this.iconMaterial,this.threeLayer)).zoomChange=function(){o.getMap()},this.threeLayer.addMesh(o);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_bindEvent",value:function(){var t=this;this.meshs.forEach((function(e){"ExtrudePolygon"===e.type&&e.on("click mousemove mouseout",t._setEvent,t)}))}},{key:"_closeEvent",value:function(){var t=this;this.meshs.forEach((function(e){"ExtrudePolygon"===e.type&&e.off("click mousemove mouseout",t._setEvent,t)}))}},{key:"_setEvent",value:function(t){var e=t.target.getProperties();"mousemove"===t.type&&t.target&&(this.isToolTip&&(t.target.getToolTip()._content="".concat(e.name)),this.selectColor&&(t.target.object3d.material.color=this.selectColor,t.target.object3d.material.color.needsUpdate=!0)),"mouseout"===t.type&&t.target&&this.selectColor&&(t.target.object3d.material.color=this.oriColor[e.name],t.target.object3d.material.color.needsUpdate=!0),"click"===t.type&&t.target&&this.clickFunc&&this.clickFunc(e)}},{key:"dispose",value:function(){for(var t in this.threeLayer.removeMesh(this.meshs),this._closeEvent(),this.meshs.forEach((function(t){"ExtrudePolygon"===t.type&&t.removeToolTip(),t.object3d.geometry&&t.object3d.geometry.dispose(),t.object3d.material&&t.object3d.material.dispose()})),this.lineMaterial&&this.lineMaterial.dispose(),this.selectColor&&delete this.selectColor,this.oriColor)delete this.oriColor[t];if(this.txtLabel&&this.map.removeLayer(this.txtLabel),this.geoItems)for(var e=0;e<this.geoItems.length;e++)delete this.geoItems[e];if(this.geoItems=[],this.geojson)for(var n=0;n<this.geojson.length;n++)delete this.geojson[n]}},{key:"findMesh",value:function(t){for(var e=0;e<this.meshs.length;e++)if("ExtrudePolygon"===this.meshs[e].type&&this.meshs[e].getProperties().name===t)return this.meshs[e]}},{key:"update",value:function(t){var e=this;this.geojson.forEach((function(n){n.geometry;for(var r=h.GeoJSON.toGeometry(n),i=n.properties,o=function(n){if(t[n].name===i.name){e.oriColor[i.name]&&(delete e.oriColor[i.name],e.oriColor[i.name]=new l.Color(t[n].color));var o=new l.MeshBasicMaterial({transparent:!0,opacity:i.opacity||1,color:e.oriColor[i.name]}),a=.1;e.isExtrusion&&(a=t[n].height?200*t[n].height:.1);for(var s=e.threeLayer.toExtrudePolygon(r,{height:a},o),u=e.findMesh(t[n].name),c=s.object3d.geometry.attributes.position.array,h=u.object3d.geometry.attributes.position.array,f=0;f<h.length;f++)h[f]=c[f];u.object3d.geometry.attributes.position.needsUpdate=!0,u.object3d.material.color=e.oriColor[i.name],u.object3d.material.color.needsUpdate=!0;var d=e.threeLayer.distanceToVector3(a,a).x;e.meshs.forEach((function(e){"Line"===e.type&&e.getProperties().name===t[n].name&&(e.object3d.position.z=d)})),s.object3d.geometry&&s.object3d.geometry.dispose(),s.object3d.material&&s.object3d.material.dispose();for(var p=0;p<e.geoItems.length;p++)e.geoItems[p].getProperties().name===t[n].name&&(e.geoItems[p].getProperties().index&&(e.geoItems[p].getProperties().index=t[n].rank),e.geoItems[p].getProperties().altitude=a,e.geoItems[p].updateSymbol({index:"{index}"}));return"break"}},a=0;a<t.length&&"break"!==o(a);a++);}))}}]),t}();n("91e5"),n("ff86"),n("2ed2");var Li=function(){function t(e){r(this,t),this.map=e,this.threeLayer=null,this.animationId=null,this.windObj=null,this.drawTool=null,this.distanceTool=null,this.trafficLayer=null,this.circleObj=null,this.shockObj=null,this.ringObj=null,this.directionObj=null,this.trips=[],this.func=[],this.polygonObjs=[]}return o(t,[{key:"createIepLayer",value:function(t){var e=function(){var t="xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return"iep".concat(t,"layer")}();if(!this.threeLayer){var n=this.threeLayer=new vr(e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){A(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({forceRenderOnMoving:!0,forceRenderOnRotating:!0,identifyCountOnEvent:1},t));return n.addTo(this.map),{layerId:e,layer:n}}}},{key:"removeIepLayer",value:function(){this.threeLayer&&this.threeLayer.getMeshes().forEach((function(t){var e;"Points"!==t.type&&"Image"!==t.type||null===(e=t.parent)||void 0===e||e.dispose()})),this.windObj&&(this.windObj.closeWind(),delete this.windObj),this.drawTool&&(this.drawTool.dispose(),delete this.drawTool),this.distanceTool&&(this.distanceTool.dispose(),delete this.distanceTool),this.trafficLayer&&(this.trafficLayer.setMap(null),delete this.trafficLayer),this.circleObj&&(this.circleObj.dispose(),delete this.circleObj),this.shockObj&&(this.shockObj.dispose(),delete this.shockObj),this.ringObj&&(this.ringObj.dispose(),delete this.ringObj),this.directionObj&&(this.directionObj.dispose(),delete this.directionObj),this.trips.length>0&&(this.func=[],this.trips.forEach((function(t){t.dispose()})),this.trips=[]),this.clearPolygon()}},{key:"prepareToDraw",value:function(){var t=this,e=function e(){var n,r;t.threeLayer._needsUpdate=!t.threeLayer._needsUpdate,t.threeLayer._needsUpdate&&(null===(n=t.threeLayer)||void 0===n||null===(r=n.getRenderer())||void 0===r||r.clearCanvas(),t.threeLayer.renderScene()),t.func.forEach((function(t){return t()})),$r.c(),t.animationId=requestAnimationFrame(e)};return new Promise((function(n){t.threeLayer.prepareToDraw=function(t,r,i){var o=new l.DirectionalLight(16777215);o.position.set(0,-10,10).normalize(),r.add(o),e(),n()}}))}},{key:"clearTrip",value:function(){this.func=[],this.trips.forEach((function(t){t.dispose()})),this.trips=[]}},{key:"clearPolygon",value:function(){for(var t=0;t<this.polygonObjs.length;t++)this.polygonObjs[t].dispose(),delete this.polygonObjs[t];this.polygonObjs=[]}},{key:"drawPolygon",value:function(t,e){var n=this;this.createIepLayer();var r=e||{};if(this.threeLayer.getScene()){var i=new Ii(t,r,this.threeLayer);this.polygonObjs.push(i)}else this.prepareToDraw().then((function(){var e=new Ii(t,r,n.threeLayer);n.polygonObjs.push(e)}))}},{key:"updatePolygon",value:function(t){this.polygonObjs.forEach((function(e){e.update(t)}))}},{key:"drawTrip",value:function(t,e){var n=this;this.createIepLayer();var r=e||{};if(this.threeLayer.getScene()){var i=new Ai(t,r,this.threeLayer);this.trips.push(i),this.func.push((function(){i.naimationFunc()}))}else this.prepareToDraw().then((function(){var e=new Ai(t,r,n.threeLayer);n.trips.push(e),n.func.push((function(){e.naimationFunc()}))}))}},{key:"clearRing",value:function(){this.ringObj&&(this.ringObj.dispose(),delete this.ringObj)}},{key:"drawRing",value:function(t,e,n,r){var i=this;this.createIepLayer();var o=r||{};this.threeLayer.getScene()?(this.ringObj&&(this.ringObj.dispose(),delete this.ringObj),setTimeout((function(){i.ringObj=new pi([t,e],n,o,i.threeLayer)}),500)):this.prepareToDraw().then((function(){i.ringObj||(i.ringObj=new pi([t,e],n,o,i.threeLayer))}))}},{key:"updateDirection",value:function(t,e){this.directionObj&&this.directionObj.updateDirection(t,e)}},{key:"clearDirection",value:function(){this.directionObj&&(this.directionObj.dispose(),delete this.directionObj)}},{key:"drawDirection",value:function(t,e,n){var r=this;this.createIepLayer();var i=n||{};this.threeLayer.getScene()?(this.directionObj&&(this.directionObj.dispose(),delete this.directionObj),setTimeout((function(){r.directionObj=new Ci([t,e],i,r.threeLayer)}),500)):this.prepareToDraw().then((function(){r.directionObj||(r.directionObj=new Ci([t,e],i,r.threeLayer))}))}},{key:"clearCircle",value:function(){this.circleObj&&(this.circleObj.dispose(),delete this.circleObj)}},{key:"drawCircle",value:function(t,e,n,r){var i=this;this.createIepLayer();var o=r||{};this.threeLayer.getScene()?this.circleObj?this.circleObj.update(t,e,n,o):this.circleObj=new Yr(t,e,n,o,this.threeLayer):this.prepareToDraw().then((function(){i.circleObj?i.circleObj.update(t,e,n,o):i.circleObj=new Yr(t,e,n,o,i.threeLayer)}))}},{key:"Traffic",value:function(t){var e=this.map.getBaseLayer();if(e){var n=e.getAMap();n&&(this.trafficLayer||(this.trafficLayer=new AMap.TileLayer.Traffic({zIndex:10})),!0===t?this.trafficLayer.setMap(n):this.trafficLayer.setMap(null))}}},{key:"distance",value:function(){var t=this;return new Promise((function(e){t.distanceTool?(t.distanceTool.enable(),e(t.distanceTool)):(t.distanceTool=new zr({},t.threeLayer),e(t.distanceTool))}))}},{key:"drawGeometry",value:function(t,e){var n=this;return new Promise((function(r){n.drawTool?(n.drawTool.setMode(t,e),r(n.drawTool)):(n.drawTool=new Gr(t,e,{},n.threeLayer),r(n.drawTool))}))}},{key:"drawWeatherData",value:function(t,e){var n=this;return new Promise((function(r){var i=null;r(t?i=new Nr(t,e||{},n.map):i),n.windObj=i}))}},{key:"drawImage",value:function(t,e,n,r){var i=this;return this.createIepLayer(),this.threeLayer.getScene()?new Promise((function(o){o(new Br(t,e,n,r,i.threeLayer))})):new Promise((function(o){i.prepareToDraw().then((function(){var a=new Br(t,e,n,r,i.threeLayer);o(a)}))}))}},{key:"getPointObjByName",value:function(t){var e=this;return new Promise((function(n){e.threeLayer&&e.threeLayer.getMeshes().forEach((function(e){"Points"===e.type&&e.parent.name===t&&n(e.parent)}))}))}},{key:"drawShock",value:function(t,e){var n=this;this.createIepLayer(),this.threeLayer.getScene()?this.shockObj&&(this.shockObj.dispose(),this.shockObj=null,setTimeout((function(){n.shockObj=new ti(t,e||{},n.threeLayer)}),500)):this.prepareToDraw().then((function(){n.shockObj=new ti(t,e||{},n.threeLayer)}))}},{key:"clearShock",value:function(){this.shockObj&&($r.b(),this.shockObj.dispose(),this.shockObj=null)}},{key:"drawPoint",value:function(t,e){var n=this;return this.createIepLayer(),this.threeLayer.getScene()?new Promise((function(r){var i=null;t.length>0?(i=new Rr(t,e,n.threeLayer)).addPoint().then((function(){r(i)})):r(i)})):new Promise((function(r){n.prepareToDraw().then((function(){var i=null;t.length>0?(i=new Rr(t,e,n.threeLayer)).addPoint().then((function(){r(i)})):r(i)}))}))}},{key:"saveIndexedDb",value:function(){return new Promise((function(t,e){var n=window.indexedDB.open("iep_db");n.onsuccess=function(e){var n=e.target.result;t(n)},n.onerror=function(t){e(t)},n.onupgradeneeded=function(t){var e=t.target.result;if(!e.objectStoreNames.contains("svg_dict")){var n=e.createObjectStore("svg_dict",{keyPath:"code"});n.createIndex("code","code",{unique:!0}),n.createIndex("file","file",{unique:!1})}}}))}},{key:"getType",value:function(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}},{key:"getDbRecord",value:function(t){var e=this,n="string"===this.getType(t)?[t]:t;return new Promise((function(t){e.saveIndexedDb().then((function(e){var r=e.transaction("svg_dict","readwrite").objectStore("svg_dict");Promise.all(n.map((function(t){return new Promise((function(e){var n=r.get(t);n.onsuccess=function(t){e(t.target.result)},n.onerror=function(t){e()}}))}))).then((function(e){t(e)}))}))}))}}]),t}(),Pi=function(t){return new Li(t)};
104
104
  /*!
105
105
  * maptalks.amap v0.10.1
106
106
  * LICENSE : MIT