win-chart 2.13.0 → 3.0.0

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.
Files changed (62) hide show
  1. package/README.md +55 -7
  2. package/dist/cjs/components/ChartWrapper.cjs +39 -0
  3. package/dist/cjs/components/EarthChart.cjs +168 -0
  4. package/dist/cjs/components/GanttChart.cjs +302 -0
  5. package/dist/cjs/components/WinChart.cjs +125 -0
  6. package/dist/cjs/index.cjs +58 -0
  7. package/dist/cjs/types/index.cjs +51 -0
  8. package/dist/cjs/utils/const.cjs +68 -0
  9. package/dist/cjs/utils/data.cjs +9382 -0
  10. package/dist/cjs/utils/earthMockData.cjs +6017 -0
  11. package/dist/cjs/utils/getAreaSpec.cjs +143 -0
  12. package/dist/cjs/utils/getBarSpec.cjs +171 -0
  13. package/dist/cjs/utils/getChartOptions.cjs +78 -0
  14. package/dist/cjs/utils/getColumnSpec.cjs +127 -0
  15. package/dist/cjs/utils/getDualSpec.cjs +171 -0
  16. package/dist/cjs/utils/getFunnelSpec.cjs +89 -0
  17. package/dist/cjs/utils/getLineSpec.cjs +72 -0
  18. package/dist/cjs/utils/getPieSpec.cjs +140 -0
  19. package/dist/cjs/utils/getRadarSpec.cjs +100 -0
  20. package/dist/cjs/utils/tool.cjs +240 -0
  21. package/dist/esm/components/ChartWrapper.js +5 -0
  22. package/dist/esm/components/EarthChart.js +134 -0
  23. package/dist/esm/components/GanttChart.js +268 -0
  24. package/dist/esm/components/WinChart.js +79 -0
  25. package/dist/esm/index.js +6 -0
  26. package/dist/esm/types/index.js +17 -0
  27. package/dist/esm/utils/const.js +31 -0
  28. package/dist/esm/utils/data.js +9342 -0
  29. package/dist/esm/utils/earthMockData.js +5983 -0
  30. package/dist/esm/utils/getAreaSpec.js +106 -0
  31. package/dist/esm/utils/getBarSpec.js +134 -0
  32. package/dist/esm/utils/getChartOptions.js +44 -0
  33. package/dist/esm/utils/getColumnSpec.js +90 -0
  34. package/dist/esm/utils/getDualSpec.js +134 -0
  35. package/dist/esm/utils/getFunnelSpec.js +55 -0
  36. package/dist/esm/utils/getLineSpec.js +38 -0
  37. package/dist/esm/utils/getPieSpec.js +103 -0
  38. package/dist/esm/utils/getRadarSpec.js +66 -0
  39. package/dist/esm/utils/tool.js +146 -0
  40. package/dist/index.js +1219 -0
  41. package/dist/types/components/GanttChart.d.ts +0 -1
  42. package/dist/types/demos/DualSystemComparisonChart.d.ts +1 -0
  43. package/dist/types/demos/EastWestResourceComparisonChart.d.ts +1 -0
  44. package/dist/types/demos/PolicyGrowthChart.d.ts +1 -0
  45. package/dist/types/demos/PolicyOpennessChart.d.ts +1 -0
  46. package/dist/types/demos/PracticalUsageTrendChart.d.ts +1 -0
  47. package/dist/types/demos/index.d.ts +5 -0
  48. package/dist/types/types/index.d.ts +14 -14
  49. package/dist/types/utils/getAreaSpec.d.ts +1 -1
  50. package/dist/types/utils/getBarSpec.d.ts +1 -1
  51. package/dist/types/utils/getChartOptions.d.ts +1 -1
  52. package/dist/types/utils/getColumnSpec.d.ts +1 -1
  53. package/dist/types/utils/getDualSpec.d.ts +1 -1
  54. package/dist/types/utils/getFunnelSpec.d.ts +1 -1
  55. package/dist/types/utils/getLineSpec.d.ts +1 -1
  56. package/dist/types/utils/getPieSpec.d.ts +1 -1
  57. package/dist/types/utils/getRadarSpec.d.ts +1 -1
  58. package/dist/types/utils/tool.d.ts +59 -3
  59. package/package.json +33 -32
  60. package/dist/bundle.esm.js +0 -22
  61. package/dist/index.d.ts +0 -147
  62. package/dist/types/app.d.ts +0 -1
@@ -1,22 +0,0 @@
1
- import e,{useRef as t,useDebugValue as n,createElement as r,useContext as i,useState as o,useEffect as a}from"react";var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var h=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},d=new function(){this.browser=new h,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(d.wxa=!0,d.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?d.worker=!0:!d.hasGlobalWindow||"Deno"in window?(d.node=!0,d.svgSupported=!0):function(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),o=e.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(e);r&&(n.firefox=!0,n.version=r[1]);i&&(n.ie=!0,n.version=i[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);t.svgSupported="undefined"!=typeof SVGRect,t.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,t.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported="undefined"!=typeof document;var s=document.documentElement.style;t.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,d);var p="sans-serif",f="12px "+p;var g,m,v=function(e){var t={};if("undefined"==typeof JSON)return t;for(var n=0;n<e.length;n++){var r=String.fromCharCode(n+32),i=(e.charCodeAt(n)-20)/100;t[r]=i}return t}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),y={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(e,t){if(!g){var n=y.createCanvas();g=n&&n.getContext("2d")}if(g)return m!==t&&(m=g.font=t||f),g.measureText(e);e=e||"";var r=/((?:\d+)?\.?\d*)px/.exec(t=t||f),i=r&&+r[1]||12,o=0;if(t.indexOf("mono")>=0)o=i*e.length;else for(var a=0;a<e.length;a++){var s=v[e[a]];o+=null==s?i:s*i}return{width:o}},loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r}};function _(e){for(var t in y)e[t]&&(y[t]=e[t])}var x=X(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],(function(e,t){return e["[object "+t+"]"]=!0,e}),{}),b=X(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(e,t){return e["[object "+t+"Array]"]=!0,e}),{}),w=Object.prototype.toString,S=Array.prototype,T=S.forEach,M=S.filter,C=S.slice,D=S.map,A=function(){}.constructor,I=A?A.prototype:null,E="__proto__",L=2311;function N(){return L++}function P(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"undefined"!=typeof console&&console.error.apply(console,e)}function O(e){if(null==e||"object"!=typeof e)return e;var t=e,n=w.call(e);if("[object Array]"===n){if(!xe(e)){t=[];for(var r=0,i=e.length;r<i;r++)t[r]=O(e[r])}}else if(b[n]){if(!xe(e)){var o=e.constructor;if(o.from)t=o.from(e);else{t=new o(e.length);for(r=0,i=e.length;r<i;r++)t[r]=e[r]}}}else if(!x[n]&&!xe(e)&&!ae(e))for(var a in t={},e)e.hasOwnProperty(a)&&a!==E&&(t[a]=O(e[a]));return t}function R(e,t,n){if(!re(t)||!re(e))return n?O(t):e;for(var r in t)if(t.hasOwnProperty(r)&&r!==E){var i=e[r],o=t[r];!re(o)||!re(i)||J(o)||J(i)||ae(o)||ae(i)||ie(o)||ie(i)||xe(o)||xe(i)?!n&&r in e||(e[r]=O(t[r])):R(i,o,n)}return e}function k(e,t){for(var n=e[0],r=1,i=e.length;r<i;r++)n=R(n,e[r],t);return n}function z(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==E&&(e[n]=t[n]);return e}function V(e,t,n){for(var r=q(t),i=0,o=r.length;i<o;i++){var a=r[i];(n?null!=t[a]:null==e[a])&&(e[a]=t[a])}return e}var B=y.createCanvas;function F(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1}function G(e,t){var n=e.prototype;function r(){}for(var i in r.prototype=t.prototype,e.prototype=new r,n)n.hasOwnProperty(i)&&(e.prototype[i]=n[i]);e.prototype.constructor=e,e.superClass=t}function H(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++){var o=r[i];"constructor"!==o&&(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}else V(e,t,n)}function U(e){return!!e&&("string"!=typeof e&&"number"==typeof e.length)}function W(e,t,n){if(e&&t)if(e.forEach&&e.forEach===T)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function j(e,t,n){if(!e)return[];if(!t)return fe(e);if(e.map&&e.map===D)return e.map(t,n);for(var r=[],i=0,o=e.length;i<o;i++)r.push(t.call(n,e[i],i,e));return r}function X(e,t,n,r){if(e&&t){for(var i=0,o=e.length;i<o;i++)n=t.call(r,n,e[i],i,e);return n}}function Y(e,t,n){if(!e)return[];if(!t)return fe(e);if(e.filter&&e.filter===M)return e.filter(t,n);for(var r=[],i=0,o=e.length;i<o;i++)t.call(n,e[i],i,e)&&r.push(e[i]);return r}function Z(e,t,n){if(e&&t)for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return e[r]}function q(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}var K=I&&Q(I.bind)?I.call.bind(I.bind):function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return e.apply(t,n.concat(C.call(arguments)))}};function $(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(C.call(arguments)))}}function J(e){return Array.isArray?Array.isArray(e):"[object Array]"===w.call(e)}function Q(e){return"function"==typeof e}function ee(e){return"string"==typeof e}function te(e){return"[object String]"===w.call(e)}function ne(e){return"number"==typeof e}function re(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function ie(e){return!!x[w.call(e)]}function oe(e){return!!b[w.call(e)]}function ae(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function se(e){return null!=e.colorStops}function le(e){return null!=e.image}function ue(e){return"[object RegExp]"===w.call(e)}function ce(e){return e!=e}function he(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e.length;n<r;n++)if(null!=e[n])return e[n]}function de(e,t){return null!=e?e:t}function pe(e,t,n){return null!=e?e:null!=t?t:n}function fe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return C.apply(e,t)}function ge(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e}function me(e,t){if(!e)throw new Error(t)}function ve(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var ye="__ec_primitive__";function _e(e){e[ye]=!0}function xe(e){return e[ye]}var be=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return q(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),we="function"==typeof Map;var Se=function(){function e(t){var n=J(t);this.data=we?new Map:new be;var r=this;function i(e,t){n?r.set(e,t):r.set(t,e)}t instanceof e?t.each(i):t&&W(t,i)}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach((function(n,r){e.call(t,n,r)}))},e.prototype.keys=function(){var e=this.data.keys();return we?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function Te(e){return new Se(e)}function Me(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];var i=e.length;for(r=0;r<t.length;r++)n[r+i]=t[r];return n}function Ce(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e,n=new r}return t&&z(n,t),n}function De(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function Ae(e,t){return e.hasOwnProperty(t)}function Ie(){}var Ee=180/Math.PI,Le=Object.freeze({__proto__:null,HashMap:Se,RADIAN_TO_DEGREE:Ee,assert:me,bind:K,clone:O,concatArray:Me,createCanvas:B,createHashMap:Te,createObject:Ce,curry:$,defaults:V,disableUserSelect:De,each:W,eqNaN:ce,extend:z,filter:Y,find:Z,guid:N,hasOwn:Ae,indexOf:F,inherits:G,isArray:J,isArrayLike:U,isBuiltInObject:ie,isDom:ae,isFunction:Q,isGradientObject:se,isImagePatternObject:le,isNumber:ne,isObject:re,isPrimitive:xe,isRegExp:ue,isString:ee,isStringSafe:te,isTypedArray:oe,keys:q,logError:P,map:j,merge:R,mergeAll:k,mixin:H,noop:Ie,normalizeCssArray:ge,reduce:X,retrieve:he,retrieve2:de,retrieve3:pe,setAsPrimitive:_e,slice:fe,trim:ve});function Ne(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function Pe(e,t){return e[0]=t[0],e[1]=t[1],e}function Oe(e){return[e[0],e[1]]}function Re(e,t,n){return e[0]=t,e[1]=n,e}function ke(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function ze(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}function Ve(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function Be(e){return Math.sqrt(Ge(e))}var Fe=Be;function Ge(e){return e[0]*e[0]+e[1]*e[1]}var He=Ge;function Ue(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function We(e,t){var n=Be(t);return 0===n?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function je(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var Xe=je;function Ye(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Ze=Ye;function qe(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e}function Ke(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function $e(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function Je(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}var Qe=Object.freeze({__proto__:null,add:ke,applyTransform:Ke,clone:Oe,copy:Pe,create:Ne,dist:Xe,distSquare:Ze,distance:je,distanceSquare:Ye,div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},len:Be,lenSquare:Ge,length:Fe,lengthSquare:He,lerp:qe,max:Je,min:$e,mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},normalize:We,scale:Ue,scaleAndAdd:ze,set:Re,sub:Ve}),et=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},tt=function(){function e(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new et(t,e),"dragstart",e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,o=r-this._y;this._x=n,this._y=r,t.drift(i,o,e),this.handler.dispatchToElement(new et(t,e),"drag",e.event);var a=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=a,t!==a&&(s&&a!==s&&this.handler.dispatchToElement(new et(s,e),"dragleave",e.event),a&&a!==s&&this.handler.dispatchToElement(new et(a,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new et(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new et(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),nt=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||(this._$handlers={});var i=this._$handlers;if("function"==typeof t&&(r=n,n=t,t=null),!n||!e)return this;var o=this._$eventProcessor;null!=t&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),i[e]||(i[e]=[]);for(var a=0;a<i[e].length;a++)if(i[e][a].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},l=i[e].length-1,u=i[e][l];return u&&u.callAtLast?i[e].splice(l,0,s):i[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var o=t.length,a=r.length,s=0;s<a;s++){var l=r[s];if(!i||!i.filter||null==l.query||i.filter(e,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,t[0]);break;case 2:l.h.call(l.ctx,t[0],t[1]);break;default:l.h.apply(l.ctx,t)}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var o=t.length,a=t[o-1],s=r.length,l=0;l<s;l++){var u=r[l];if(!i||!i.filter||null==u.query||i.filter(e,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,t[0]);break;case 2:u.h.call(a,t[0],t[1]);break;default:u.h.apply(a,t.slice(1,o-1))}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e}(),rt=Math.log(2);function it(e,t,n,r,i,o){var a=r+"-"+i,s=e.length;if(o.hasOwnProperty(a))return o[a];if(1===t){var l=Math.round(Math.log((1<<s)-1&~i)/rt);return e[n][l]}for(var u=r|1<<n,c=n+1;r&1<<c;)c++;for(var h=0,d=0,p=0;d<s;d++){var f=1<<d;f&i||(h+=(p%2?-1:1)*e[n][d]*it(e,t-1,c,u,i|f,o),p++)}return o[a]=h,h}function ot(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],r={},i=it(n,8,0,0,0,r);if(0!==i){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*it(n,7,0===a?1:0,1<<a,1<<s,r)/i*t[a];return function(e,t,n){var r=t*o[6]+n*o[7]+1;e[0]=(t*o[0]+n*o[1]+o[2])/r,e[1]=(t*o[3]+n*o[4]+o[5])/r}}}var at="___zrEVENTSAVED",st=[];function lt(e,t,n,r,i){if(t.getBoundingClientRect&&d.domSupported&&!ut(t)){var o=t[at]||(t[at]={}),a=function(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=["left","right"],i=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,l=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[s]+":0",i[l]+":0",r[1-s]+":auto",i[1-l]+":auto",""].join("!important;"),e.appendChild(a),n.push(a)}return n}(t,o),s=function(e,t,n){for(var r=n?"invTrans":"trans",i=t[r],o=t.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,d=c.left,p=c.top;a.push(d,p),l=l&&o&&d===o[h]&&p===o[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=a,t[r]=n?ot(s,a):ot(a,s))}(a,o,i);if(s)return s(e,n,r),!0}return!1}function ut(e){return"CANVAS"===e.nodeName.toUpperCase()}var ct=/([&<>"'])/g,ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function dt(e){return null==e?"":(e+"").replace(ct,(function(e,t){return ht[t]}))}var pt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ft=[],gt=d.browser.firefox&&+d.browser.version.split(".")[0]<39;function mt(e,t,n,r){return n=n||{},r?vt(e,t,n):gt&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):vt(e,t,n),n}function vt(e,t,n){if(d.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(ut(e)){var o=e.getBoundingClientRect();return n.zrX=r-o.left,void(n.zrY=i-o.top)}if(lt(ft,e,r,i))return n.zrX=ft[0],void(n.zrY=ft[1])}n.zrX=n.zrY=0}function yt(e){return e||window.event}function _t(e,t,n){if(null!=(t=yt(t)).zrX)return t;var r=t.type;if(r&&r.indexOf("touch")>=0){var i="touchend"!==r?t.targetTouches[0]:t.changedTouches[0];i&&mt(e,i,t,n)}else{mt(e,t,t,n);var o=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(null==n||null==r)return t;var i=0!==r?Math.abs(r):Math.abs(n),o=r>0?-1:r<0?1:n>0?-1:1;return 3*i*o}(t);t.zrDelta=o?o/120:-(t.detail||0)/3}var a=t.button;return null==t.which&&void 0!==a&&pt.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t}function xt(e,t,n,r){e.addEventListener(t,n,r)}var bt=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function wt(e){return 2===e.which||3===e.which}var St=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},o=0,a=r.length;o<a;o++){var s=r[o],l=mt(n,s,{});i.points.push([l.zrX,l.zrY]),i.touches.push(s)}this._track.push(i)}},e.prototype._recognize=function(e){for(var t in Mt)if(Mt.hasOwnProperty(t)){var n=Mt[t](this._track,e);if(n)return n}},e}();function Tt(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}var Mt={pinch:function(e,t){var n=e.length;if(n){var r,i=(e[n-1]||{}).points,o=(e[n-2]||{}).points||i;if(o&&o.length>1&&i&&i.length>1){var a=Tt(i)/Tt(o);!isFinite(a)&&(a=1),t.pinchScale=a;var s=[((r=i)[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}};function Ct(){return[1,0,0,1,0,0]}function Dt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function At(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function It(e,t,n){var r=t[0]*n[0]+t[2]*n[1],i=t[1]*n[0]+t[3]*n[1],o=t[0]*n[2]+t[2]*n[3],a=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e}function Et(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function Lt(e,t,n,r){void 0===r&&(r=[0,0]);var i=t[0],o=t[2],a=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(n),h=Math.cos(n);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=o*h+l*c,e[3]=-o*c+h*l,e[4]=h*(a-r[0])+c*(u-r[1])+r[0],e[5]=h*(u-r[1])-c*(a-r[0])+r[1],e}function Nt(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e}function Pt(e,t){var n=t[0],r=t[2],i=t[4],o=t[1],a=t[3],s=t[5],l=n*a-o*r;return l?(l=1/l,e[0]=a*l,e[1]=-o*l,e[2]=-r*l,e[3]=n*l,e[4]=(r*s-a*i)*l,e[5]=(o*i-n*s)*l,e):null}function Ot(e){var t=[1,0,0,1,0,0];return At(t,e),t}var Rt=Object.freeze({__proto__:null,clone:Ot,copy:At,create:Ct,identity:Dt,invert:Pt,mul:It,rotate:Lt,scale:Nt,translate:Et}),kt=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),zt=Math.min,Vt=Math.max,Bt=new kt,Ft=new kt,Gt=new kt,Ht=new kt,Ut=new kt,Wt=new kt,jt=function(){function e(e,t,n,r){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),this.x=e,this.y=t,this.width=n,this.height=r}return e.prototype.union=function(e){var t=zt(e.x,this.x),n=zt(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Vt(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Vt(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,r=e.height/t.height,i=[1,0,0,1,0,0];return Et(i,i,[-t.x,-t.y]),Nt(i,i,[n,r]),Et(i,i,[e.x,e.y]),i},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var r=this,i=r.x,o=r.x+r.width,a=r.y,s=r.y+r.height,l=t.x,u=t.x+t.width,c=t.y,h=t.y+t.height,d=!(o<l||u<i||s<c||h<a);if(n){var p=1/0,f=0,g=Math.abs(o-l),m=Math.abs(u-i),v=Math.abs(s-c),y=Math.abs(h-a),_=Math.min(g,m),x=Math.min(v,y);o<l||u<i?_>f&&(f=_,g<m?kt.set(Wt,-g,0):kt.set(Wt,m,0)):_<p&&(p=_,g<m?kt.set(Ut,g,0):kt.set(Ut,-m,0)),s<c||h<a?x>f&&(f=x,v<y?kt.set(Wt,0,-v):kt.set(Wt,0,y)):_<p&&(p=_,v<y?kt.set(Ut,0,v):kt.set(Ut,0,-y))}return n&&kt.copy(n,d?Ut:Wt),d},e.prototype.contain=function(e,t){var n=this;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,r){if(r){if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],o=r[3],a=r[4],s=r[5];return t.x=n.x*i+a,t.y=n.y*o+s,t.width=n.width*i,t.height=n.height*o,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}Bt.x=Gt.x=n.x,Bt.y=Ht.y=n.y,Ft.x=Ht.x=n.x+n.width,Ft.y=Gt.y=n.y+n.height,Bt.transform(r),Ht.transform(r),Ft.transform(r),Gt.transform(r),t.x=zt(Bt.x,Ft.x,Gt.x,Ht.x),t.y=zt(Bt.y,Ft.y,Gt.y,Ht.y);var l=Vt(Bt.x,Ft.x,Gt.x,Ht.x),u=Vt(Bt.y,Ft.y,Gt.y,Ht.y);t.width=l-t.x,t.height=u-t.y}else t!==n&&e.copy(t,n)},e}(),Xt="silent";function Yt(){bt(this.event)}var Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return l(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(nt),qt=function(e,t){this.x=e,this.y=t},Kt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],$t=new jt(0,0,0,0),Jt=function(e){function t(t,n,r,i,o){var a=e.call(this)||this;return a._hovered=new qt(0,0),a.storage=t,a.painter=n,a.painterRoot=i,a._pointerSize=o,r=r||new Zt,a.proxy=null,a.setHandlerProxy(r),a._draggingMgr=new tt(a),a}return l(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(W(Kt,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=tn(this,t,n),i=this._hovered,o=i.target;o&&!o.__zr&&(o=(i=this.findHover(i.x,i.y)).target);var a=this._hovered=r?new qt(t,n):this.findHover(t,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",e),this.dispatchToElement(a,"mousemove",e),s&&s!==o&&this.dispatchToElement(a,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new qt(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var r=(e=e||{}).target;if(!r||!r.silent){for(var i="on"+t,o=function(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Yt}}(t,e,n);r&&(r[i]&&(o.cancelBubble=!!r[i].call(r,o)),r.trigger(t,o),r=r.__hostTarget?r.__hostTarget:r.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(t,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[i]&&e[i].call(e,o),e.trigger&&e.trigger(t,o)})))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new qt(e,t);if(en(r,i,e,t,n),this._pointerSize&&!i.target){for(var o=[],a=this._pointerSize,s=a/2,l=new jt(e-s,t-s,a,a),u=r.length-1;u>=0;u--){var c=r[u];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||($t.copy(c.getBoundingRect()),c.transform&&$t.applyTransform(c.transform),$t.intersect(l)&&o.push(c))}if(o.length)for(var h=Math.PI/12,d=2*Math.PI,p=0;p<s;p+=4)for(var f=0;f<d;f+=h){if(en(o,i,e+p*Math.cos(f),t+p*Math.sin(f),n),i.target)return i}}return i},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new St);var n=this._gestureMgr;"start"===t&&n.clear();var r=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),r){var i=r.type;e.gestureEvent=i;var o=new qt;o.target=r.target,this.dispatchToElement(o,i,r.event)}},t}(nt);function Qt(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var r=e,i=void 0,o=!1;r;){if(r.ignoreClip&&(o=!0),!o){var a=r.getClipPath();if(a&&!a.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s||r.parent}return!i||Xt}return!1}function en(e,t,n,r,i){for(var o=e.length-1;o>=0;o--){var a=e[o],s=void 0;if(a!==i&&!a.ignore&&(s=Qt(a,n,r))&&(!t.topTarget&&(t.topTarget=a),s!==Xt)){t.target=a;break}}}function tn(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}W(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Jt.prototype[e]=function(t){var n,r,i=t.zrX,o=t.zrY,a=tn(this,i,o);if("mouseup"===e&&a||(r=(n=this.findHover(i,o)).target),"mousedown"===e)this._downEl=r,this._downPoint=[t.zrX,t.zrY],this._upEl=r;else if("mouseup"===e)this._upEl=r;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Xe(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));function nn(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i<n&&r(e[i],e[i-1])<0;)i++;!function(e,t,n){n--;for(;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}(e,t,i)}else for(;i<n&&r(e[i],e[i-1])>=0;)i++;return i-t}function rn(e,t,n,r,i){for(r===t&&r++;r<n;r++){for(var o,a=e[r],s=t,l=r;s<l;)i(a,e[o=s+l>>>1])<0?l=o:s=o+1;var u=r-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=a}}function on(e,t,n,r,i,o){var a=0,s=0,l=1;if(o(e,t[n+i])>0){for(s=r-i;l<s&&o(e,t[n+i+l])>0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}else{for(s=i+1;l<s&&o(e,t[n+i-l])<=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])>0?a=c+1:l=c}return l}function an(e,t,n,r,i,o){var a=0,s=0,l=1;if(o(e,t[n+i])<0){for(s=i+1;l<s&&o(e,t[n+i-l])<0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}else{for(s=r-i;l<s&&o(e,t[n+i+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])<0?l=c:a=c+1}return l}function sn(e,t){var n,r,i=7,o=0,a=[];function s(s){var l=n[s],u=r[s],c=n[s+1],h=r[s+1];r[s]=u+h,s===o-3&&(n[s+1]=n[s+2],r[s+1]=r[s+2]),o--;var d=an(e[c],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(h=on(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,r,o,s){var l=0;for(l=0;l<r;l++)a[l]=e[n+l];var u=0,c=o,h=n;if(e[h++]=e[c++],0==--s){for(l=0;l<r;l++)e[h+l]=a[u+l];return}if(1===r){for(l=0;l<s;l++)e[h+l]=e[c+l];return void(e[h+s]=a[u])}var d,p,f,g=i;for(;;){d=0,p=0,f=!1;do{if(t(e[c],a[u])<0){if(e[h++]=e[c++],p++,d=0,0==--s){f=!0;break}}else if(e[h++]=a[u++],d++,p=0,1==--r){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=an(e[c],a,u,r,0,t))){for(l=0;l<d;l++)e[h+l]=a[u+l];if(h+=d,u+=d,(r-=d)<=1){f=!0;break}}if(e[h++]=e[c++],0==--s){f=!0;break}if(0!==(p=on(a[u],e,c,s,0,t))){for(l=0;l<p;l++)e[h+l]=e[c+l];if(h+=p,c+=p,0===(s-=p)){f=!0;break}}if(e[h++]=a[u++],1==--r){f=!0;break}g--}while(d>=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((i=g)<1&&(i=1),1===r){for(l=0;l<s;l++)e[h+l]=e[c+l];e[h+s]=a[u]}else{if(0===r)throw new Error;for(l=0;l<r;l++)e[h+l]=a[u+l]}}(l,u,c,h):function(n,r,o,s){var l=0;for(l=0;l<s;l++)a[l]=e[o+l];var u=n+r-1,c=s-1,h=o+s-1,d=0,p=0;if(e[h--]=e[u--],0==--r){for(d=h-(s-1),l=0;l<s;l++)e[d+l]=a[l];return}if(1===s){for(p=(h-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)e[p+l]=e[d+l];return void(e[h]=a[c])}var f=i;for(;;){var g=0,m=0,v=!1;do{if(t(a[c],e[u])<0){if(e[h--]=e[u--],g++,m=0,0==--r){v=!0;break}}else if(e[h--]=a[c--],m++,g=0,1==--s){v=!0;break}}while((g|m)<f);if(v)break;do{if(0!==(g=r-an(a[c],e,n,r,r-1,t))){for(r-=g,p=(h-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)e[p+l]=e[d+l];if(0===r){v=!0;break}}if(e[h--]=a[c--],1==--s){v=!0;break}if(0!==(m=s-on(e[u],a,0,s,s-1,t))){for(s-=m,p=(h-=m)+1,d=(c-=m)+1,l=0;l<m;l++)e[p+l]=a[d+l];if(s<=1){v=!0;break}}if(e[h--]=e[u--],0==--r){v=!0;break}f--}while(g>=7||m>=7);if(v)break;f<0&&(f=0),f+=2}(i=f)<1&&(i=1);if(1===s){for(p=(h-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)e[p+l]=e[d+l];e[h]=a[c]}else{if(0===s)throw new Error;for(d=h-(s-1),l=0;l<s;l++)e[d+l]=a[l]}}(l,u,c,h))}return n=[],r=[],{mergeRuns:function(){for(;o>1;){var e=o-2;if(e>=1&&r[e-1]<=r[e]+r[e+1]||e>=2&&r[e-2]<=r[e]+r[e-1])r[e-1]<r[e+1]&&e--;else if(r[e]>r[e+1])break;s(e)}},forceMergeRuns:function(){for(;o>1;){var e=o-2;e>0&&r[e-1]<r[e+1]&&e--,s(e)}},pushRun:function(e,t){n[o]=e,r[o]=t,o+=1}}}function ln(e,t,n,r){n||(n=0),r||(r=e.length);var i=r-n;if(!(i<2)){var o=0;if(i<32)rn(e,n,r,n+(o=nn(e,n,r,t)),t);else{var a=sn(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(i);do{if((o=nn(e,n,r,t))<s){var l=i;l>s&&(l=s),rn(e,n,n+l,n+o,t),o=l}a.pushRun(n,o),a.mergeRuns(),i-=o,n+=o}while(0!==i);a.forceMergeRuns()}}}var un=!1;function cn(){un||(un=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function hn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var dn,pn=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=hn}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t=t||!1;var n=this._displayList;return!e&&n.length||this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,r=0,i=t.length;r<i;r++)this._updateAndAddDisplayable(t[r],null,e);n.length=this._displayListLen,ln(n,hn)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath();if(e.ignoreClip)t=null;else if(r){t=t?t.slice():[];for(var i=r,o=e;i;)i.parent=o,i.updateTransform(),t.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var a=e.childrenRef(),s=0;s<a.length;s++){var l=a[s];e.__dirty&&(l.__dirty|=1),this._updateAndAddDisplayable(l,t,n)}e.__dirty=0}else{var u=e;t&&t.length?u.__clipPaths=t:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(cn(),u.z=0),isNaN(u.z2)&&(cn(),u.z2=0),isNaN(u.zlevel)&&(cn(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);else{var r=F(this._roots,e);r>=0&&this._roots.splice(r,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}();dn=d.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var fn={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-fn.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*fn.bounceIn(2*e):.5*fn.bounceOut(2*e-1)+.5}},gn=Math.pow,mn=Math.sqrt,vn=1e-4,yn=mn(3),_n=1/3,xn=Ne(),bn=Ne(),wn=Ne();function Sn(e){return e>-1e-8&&e<1e-8}function Tn(e){return e>1e-8||e<-1e-8}function Mn(e,t,n,r,i){var o=1-i;return o*o*(o*e+3*i*t)+i*i*(i*r+3*o*n)}function Cn(e,t,n,r,i){var o=1-i;return 3*(((t-e)*o+2*(n-t)*i)*o+(r-n)*i*i)}function Dn(e,t,n,r,i,o){var a=r+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-i,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Sn(c)&&Sn(h)){if(Sn(s))o[0]=0;else(T=-l/s)>=0&&T<=1&&(o[p++]=T)}else{var f=h*h-4*c*d;if(Sn(f)){var g=h/c,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m)}else if(f>0){var v=mn(f),y=c*s+1.5*a*(-h+v),_=c*s+1.5*a*(-h-v);(T=(-s-((y=y<0?-gn(-y,_n):gn(y,_n))+(_=_<0?-gn(-_,_n):gn(_,_n))))/(3*a))>=0&&T<=1&&(o[p++]=T)}else{var x=(2*c*s-3*a*h)/(2*mn(c*c*c)),b=Math.acos(x)/3,w=mn(c),S=Math.cos(b),T=(-s-2*w*S)/(3*a),M=(m=(-s+w*(S+yn*Math.sin(b)))/(3*a),(-s+w*(S-yn*Math.sin(b)))/(3*a));T>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m),M>=0&&M<=1&&(o[p++]=M)}}return p}function An(e,t,n,r,i){var o=6*n-12*t+6*e,a=9*t+3*r-3*e-9*n,s=3*t-3*e,l=0;if(Sn(a)){if(Tn(o))(c=-s/o)>=0&&c<=1&&(i[l++]=c)}else{var u=o*o-4*a*s;if(Sn(u))i[0]=-o/(2*a);else if(u>0){var c,h=mn(u),d=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function In(e,t,n,r,i,o){var a=(t-e)*i+e,s=(n-t)*i+t,l=(r-n)*i+n,u=(s-a)*i+a,c=(l-s)*i+s,h=(c-u)*i+u;o[0]=e,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=r}function En(e,t,n,r,i,o,a,s,l,u,c){var h,d,p,f,g,m=.005,v=1/0;xn[0]=l,xn[1]=u;for(var y=0;y<1;y+=.05)bn[0]=Mn(e,n,i,a,y),bn[1]=Mn(t,r,o,s,y),(f=Ze(xn,bn))<v&&(h=y,v=f);v=1/0;for(var _=0;_<32&&!(m<vn);_++)d=h-m,p=h+m,bn[0]=Mn(e,n,i,a,d),bn[1]=Mn(t,r,o,s,d),f=Ze(bn,xn),d>=0&&f<v?(h=d,v=f):(wn[0]=Mn(e,n,i,a,p),wn[1]=Mn(t,r,o,s,p),g=Ze(wn,xn),p<=1&&g<v?(h=p,v=g):m*=.5);return c&&(c[0]=Mn(e,n,i,a,h),c[1]=Mn(t,r,o,s,h)),mn(v)}function Ln(e,t,n,r,i,o,a,s,l){for(var u=e,c=t,h=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Mn(e,n,i,a,f),m=Mn(t,r,o,s,f),v=g-u,y=m-c;h+=Math.sqrt(v*v+y*y),u=g,c=m}return h}function Nn(e,t,n,r){var i=1-r;return i*(i*e+2*r*t)+r*r*n}function Pn(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function On(e,t,n){var r=e+n-2*t;return 0===r?.5:(e-t)/r}function Rn(e,t,n,r,i){var o=(t-e)*r+e,a=(n-t)*r+t,s=(a-o)*r+o;i[0]=e,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=n}function kn(e,t,n,r,i,o,a,s,l){var u,c=.005,h=1/0;xn[0]=a,xn[1]=s;for(var d=0;d<1;d+=.05){bn[0]=Nn(e,n,i,d),bn[1]=Nn(t,r,o,d),(m=Ze(xn,bn))<h&&(u=d,h=m)}h=1/0;for(var p=0;p<32&&!(c<vn);p++){var f=u-c,g=u+c;bn[0]=Nn(e,n,i,f),bn[1]=Nn(t,r,o,f);var m=Ze(bn,xn);if(f>=0&&m<h)u=f,h=m;else{wn[0]=Nn(e,n,i,g),wn[1]=Nn(t,r,o,g);var v=Ze(wn,xn);g<=1&&v<h?(u=g,h=v):c*=.5}}return l&&(l[0]=Nn(e,n,i,u),l[1]=Nn(t,r,o,u)),mn(h)}function zn(e,t,n,r,i,o,a){for(var s=e,l=t,u=0,c=1/a,h=1;h<=a;h++){var d=h*c,p=Nn(e,n,i,d),f=Nn(t,r,o,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}var Vn=/cubic-bezier\(([0-9,\.e ]+)\)/;function Bn(e){var t=e&&Vn.exec(e);if(t){var n=t[1].split(","),r=+ve(n[0]),i=+ve(n[1]),o=+ve(n[2]),a=+ve(n[3]);if(isNaN(r+i+o+a))return;var s=[];return function(e){return e<=0?0:e>=1?1:Dn(0,r,o,1,e,s)&&Mn(0,i,a,1,s[0])}}}var Fn=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Ie,this.ondestroy=e.ondestroy||Ie,this.onrestart=e.onrestart||Ie,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),!this._paused){var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,a=o?o(i):i;if(this.onframe(a),1===i){if(!this.loop)return!0;var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=t},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=Q(e)?e:fn[e]||Bn(e)},e}(),Gn=function(e){this.value=e},Hn=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Gn(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Un=function(){function e(e){this._list=new Hn,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(null==r[e]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=t:a=new Gn(t),a.key=e,n.insertEntry(a),r[e]=a}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),Wn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function jn(e){return(e=Math.round(e))<0?0:e>255?255:e}function Xn(e){return e<0?0:e>1?1:e}function Yn(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?jn(parseFloat(t)/100*255):jn(parseInt(t,10))}function Zn(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Xn(parseFloat(t)/100):Xn(parseFloat(t))}function qn(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function Kn(e,t,n){return e+(t-e)*n}function $n(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Jn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Qn=new Un(20),er=null;function tr(e,t){er&&Jn(er,t),er=Qn.put(e,er||t.slice())}function nr(e,t){if(e){t=t||[];var n=Qn.get(e);if(n)return Jn(t,n);var r=(e+="").replace(/ /g,"").toLowerCase();if(r in Wn)return Jn(t,Wn[r]),tr(e,t),t;var i,o=r.length;if("#"===r.charAt(0))return 4===o||5===o?(i=parseInt(r.slice(1,4),16))>=0&&i<=4095?($n(t,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,5===o?parseInt(r.slice(4),16)/15:1),tr(e,t),t):void $n(t,0,0,0,1):7===o||9===o?(i=parseInt(r.slice(1,7),16))>=0&&i<=16777215?($n(t,(16711680&i)>>16,(65280&i)>>8,255&i,9===o?parseInt(r.slice(7),16)/255:1),tr(e,t),t):void $n(t,0,0,0,1):void 0;var a=r.indexOf("("),s=r.indexOf(")");if(-1!==a&&s+1===o){var l=r.substr(0,a),u=r.substr(a+1,s-(a+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?$n(t,+u[0],+u[1],+u[2],1):$n(t,0,0,0,1);c=Zn(u.pop());case"rgb":return u.length>=3?($n(t,Yn(u[0]),Yn(u[1]),Yn(u[2]),3===u.length?c:Zn(u[3])),tr(e,t),t):void $n(t,0,0,0,1);case"hsla":return 4!==u.length?void $n(t,0,0,0,1):(u[3]=Zn(u[3]),rr(u,t),tr(e,t),t);case"hsl":return 3!==u.length?void $n(t,0,0,0,1):(rr(u,t),tr(e,t),t);default:return}}$n(t,0,0,0,1)}}function rr(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Zn(e[1]),i=Zn(e[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return $n(t=t||[],jn(255*qn(a,o,n+1/3)),jn(255*qn(a,o,n)),jn(255*qn(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function ir(e,t){var n=nr(e);if(n){for(var r=0;r<3;r++)n[r]=t<0?n[r]*(1-t)|0:(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return hr(n,4===n.length?"rgba":"rgb")}}function or(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=t[i],s=t[o],l=r-i;return n[0]=jn(Kn(a[0],s[0],l)),n[1]=jn(Kn(a[1],s[1],l)),n[2]=jn(Kn(a[2],s[2],l)),n[3]=Xn(Kn(a[3],s[3],l)),n}}var ar=or;function sr(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=nr(t[i]),s=nr(t[o]),l=r-i,u=hr([jn(Kn(a[0],s[0],l)),jn(Kn(a[1],s[1],l)),jn(Kn(a[2],s[2],l)),Xn(Kn(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}}var lr=sr;function ur(e,t,n,r){var i=nr(e);if(e)return i=function(e){if(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?t=d-h:i===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(i),null!=t&&(i[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(i[1]=Zn(n)),null!=r&&(i[2]=Zn(r)),hr(rr(i),"rgba")}function cr(e,t){var n=nr(e);if(n&&null!=t)return n[3]=Xn(t),hr(n,"rgba")}function hr(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function dr(e,t){var n=nr(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var pr=new Un(100);function fr(e){if(ee(e)){var t=pr.get(e);return t||(t=ir(e,-.1),pr.put(e,t)),t}if(se(e)){var n=z({},e);return n.colorStops=j(e.colorStops,(function(e){return{offset:e.offset,color:ir(e.color,-.1)}})),n}return e}var gr=Object.freeze({__proto__:null,fastLerp:or,fastMapToColor:ar,lerp:sr,lift:ir,liftColor:fr,lum:dr,mapToColor:lr,modifyAlpha:cr,modifyHSL:ur,parse:nr,random:function(){return hr([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")},stringify:hr,toHex:function(e){var t=nr(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}}),mr=Math.round;function vr(e){var t;if(e&&"transparent"!==e){if("string"==typeof e&&e.indexOf("rgba")>-1){var n=nr(e);n&&(e="rgb("+n[0]+","+n[1]+","+n[2]+")",t=n[3])}}else e="none";return{color:e,opacity:null==t?1:t}}function yr(e){return e<1e-4&&e>-1e-4}function _r(e){return mr(1e3*e)/1e3}function xr(e){return mr(1e4*e)/1e4}var br={left:"start",right:"end",center:"middle",middle:"middle"};function wr(e){return e&&!!e.image}function Sr(e){return wr(e)||function(e){return e&&!!e.svgElement}(e)}function Tr(e){return"linear"===e.type}function Mr(e){return"radial"===e.type}function Cr(e){return e&&("linear"===e.type||"radial"===e.type)}function Dr(e){return"url(#"+e+")"}function Ar(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Ir(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*Ee,i=de(e.scaleX,1),o=de(e.scaleY,1),a=e.skewX||0,s=e.skewY||0,l=[];return(t||n)&&l.push("translate("+t+"px,"+n+"px)"),r&&l.push("rotate("+r+")"),1===i&&1===o||l.push("scale("+i+","+o+")"),(a||s)&&l.push("skew("+mr(a*Ee)+"deg, "+mr(s*Ee)+"deg)"),l.join(" ")}var Er=d.hasGlobalWindow&&Q(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:"undefined"!=typeof Buffer?function(e){return Buffer.from(e).toString("base64")}:function(e){return"production"!==process.env.NODE_ENV&&P("Base64 isn't natively supported in the current environment."),null},Lr=Array.prototype.slice;function Nr(e,t,n){return(t-e)*n+e}function Pr(e,t,n,r){for(var i=t.length,o=0;o<i;o++)e[o]=Nr(t[o],n[o],r);return e}function Or(e,t,n,r){for(var i=t.length,o=0;o<i;o++)e[o]=t[o]+n[o]*r;return e}function Rr(e,t,n,r){for(var i=t.length,o=i&&t[0].length,a=0;a<i;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=t[a][s]+n[a][s]*r}return e}function kr(e,t){for(var n=e.length,r=t.length,i=n>r?t:e,o=Math.min(n,r),a=i[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,r);s++)i.push({offset:a.offset,color:a.color.slice()})}function zr(e,t,n){var r=e,i=t;if(r.push&&i.push){var o=r.length,a=i.length;if(o!==a)if(o>a)r.length=a;else for(var s=o;s<a;s++)r.push(1===n?i[s]:Lr.call(i[s]));var l=r[0]&&r[0].length;for(s=0;s<r.length;s++)if(1===n)isNaN(r[s])&&(r[s]=i[s]);else for(var u=0;u<l;u++)isNaN(r[s][u])&&(r[s][u]=i[s][u])}}function Vr(e){if(U(e)){var t=e.length;if(U(e[0])){for(var n=[],r=0;r<t;r++)n.push(Lr.call(e[r]));return n}return Lr.call(e)}return e}function Br(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=null==e[3]?1:e[3],"rgba("+e.join(",")+")"}function Fr(e){return 4===e||5===e}function Gr(e){return 1===e||2===e}var Hr=[0,0,0,0],Ur=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,o=!1,a=6,s=t;if(U(t)){var l=function(e){return U(e&&e[0])?2:1}(t);a=l,(1===l&&!ne(t[0])||2===l&&!ne(t[0][0]))&&(o=!0)}else if(ne(t)&&!ce(t))a=0;else if(ee(t))if(isNaN(+t)){var u=nr(t);u&&(s=u,a=3)}else a=0;else if(se(t)){var c=z({},s);c.colorStops=j(t.colorStops,(function(e){return{offset:e.offset,color:nr(e.color)}})),Tr(t)?a=4:Mr(t)&&(a=5),s=c}0===i?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var h={time:e,value:s,rawValue:t,percent:0};return n&&(h.easing=n,h.easingFunc=Q(n)?n:fn[n]||Bn(n)),r.push(h),h},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort((function(e,t){return e.time-t.time}));for(var r=this.valType,i=n.length,o=n[i-1],a=this.discrete,s=Gr(r),l=Fr(r),u=0;u<i;u++){var c=n[u],h=c.value,d=o.value;c.percent=c.time/e,a||(s&&u!==i-1?zr(h,d,r):l&&kr(h.colorStops,d.colorStops))}if(!a&&5!==r&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;var p=n[0].value;for(u=0;u<i;u++)0===r?n[u].additiveValue=n[u].value-p:3===r?n[u].additiveValue=Or([],n[u].value,p,-1):Gr(r)&&(n[u].additiveValue=1===r?Or([],n[u].value,p,-1):Rr([],n[u].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,r,i,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,u=l.length,c=this.propName,h=3===s,d=this._lastFr,p=Math.min;if(1===u)r=i=l[0];else{if(t<0)n=0;else if(t<this._lastFrP){for(n=p(d+1,u-1);n>=0&&!(l[n].percent<=t);n--);n=p(n,u-2)}else{for(n=d;n<u&&!(l[n].percent>t);n++);n=p(n-1,u-2)}i=l[n+1],r=l[n]}if(r&&i){this._lastFr=n,this._lastFrP=t;var f=i.percent-r.percent,g=0===f?1:p((t-r.percent)/f,1);i.easingFunc&&(g=i.easingFunc(g));var m=o?this._additiveValue:h?Hr:e[c];if(!Gr(s)&&!h||m||(m=this._additiveValue=[]),this.discrete)e[c]=g<1?r.rawValue:i.rawValue;else if(Gr(s))1===s?Pr(m,r[a],i[a],g):function(e,t,n,r){for(var i=t.length,o=i&&t[0].length,a=0;a<i;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=Nr(t[a][s],n[a][s],r)}}(m,r[a],i[a],g);else if(Fr(s)){var v=r[a],y=i[a],_=4===s;e[c]={type:_?"linear":"radial",x:Nr(v.x,y.x,g),y:Nr(v.y,y.y,g),colorStops:j(v.colorStops,(function(e,t){var n=y.colorStops[t];return{offset:Nr(e.offset,n.offset,g),color:Br(Pr([],e.color,n.color,g))}})),global:y.global},_?(e[c].x2=Nr(v.x2,y.x2,g),e[c].y2=Nr(v.y2,y.y2,g)):e[c].r=Nr(v.r,y.r,g)}else if(h)Pr(m,r[a],i[a],g),o||(e[c]=Br(m));else{var x=Nr(r[a],i[a],g);o?this._additiveValue=x:e[c]=x}o&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;0===t?e[n]=e[n]+r:3===t?(nr(e[n],Hr),Or(Hr,Hr,r,1),e[n]=Br(Hr)):1===t?Or(e[n],e[n],r,1):2===t&&Rr(e[n],e[n],r,1)},e}(),Wr=function(){function e(e,t,n,r){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r?P("Can' use additive animation on looped animation."):(this._additiveAnimators=r,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,q(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,o=0;o<n.length;o++){var a=n[o],s=i[a];if(!s){s=i[a]=new Ur(a);var l=void 0,u=this._getAdditiveTrack(a);if(u){var c=u.keyframes,h=c[c.length-1];l=h&&h.value,3===u.valType&&l&&(l=Br(l))}else l=this._target[a];if(null==l)continue;e>0&&s.addKeyframe(0,Vr(l),r),this._trackKeys.push(a)}s.addKeyframe(e,Vr(t[a]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,u=l.length;if(a.prepare(r,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var c=l[u-1];c&&(t._target[a.propName]=c.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var h=new Fn({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,o=0;o<r.length;o++)if(r[o]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(o=0;o<n.length;o++)n[o].step(t._target,e);var a=t._onframeCbs;if(a)for(o=0;o<a.length;o++)a[o](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return j(this._trackKeys,(function(t){return e._tracks[t]}))},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(t?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var a=!0;for(i=0;i<r.length;i++)if(!n[r[i]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},e.prototype.saveTo=function(e,t,n){if(e){t=t||this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],o=this._tracks[i];if(o&&!o.isFinished()){var a=o.keyframes,s=a[n?0:a.length-1];s&&(e[i]=Vr(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t=t||q(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var o=i.keyframes;if(o.length>1){var a=o.pop();i.addKeyframe(a.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}();function jr(){return(new Date).getTime()}var Xr,Yr,Zr=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return l(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=jr()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,dn((function t(){e._running&&(dn(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=jr(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=jr(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=jr()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Wr(e,t.loop);return this.addAnimator(n),n},t}(nt),qr=d.domSupported,Kr=(Yr={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Xr=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:j(Xr,(function(e){var t=e.replace("mouse","pointer");return Yr.hasOwnProperty(t)?t:e}))}),$r=["mousemove","mouseup"],Jr=["pointermove","pointerup"],Qr=!1;function ei(e){var t=e.pointerType;return"pen"===t||"touch"===t}function ti(e){e&&(e.zrByTouch=!0)}function ni(e,t){for(var n=t,r=!1;n&&9!==n.nodeType&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var ri=function(e,t){this.stopPropagation=Ie,this.stopImmediatePropagation=Ie,this.preventDefault=Ie,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},ii={mousedown:function(e){e=_t(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=_t(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=_t(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){ni(this,(e=_t(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){Qr=!0,e=_t(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){Qr||(e=_t(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){ti(e=_t(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),ii.mousemove.call(this,e),ii.mousedown.call(this,e)},touchmove:function(e){ti(e=_t(this.dom,e)),this.handler.processGesture(e,"change"),ii.mousemove.call(this,e)},touchend:function(e){ti(e=_t(this.dom,e)),this.handler.processGesture(e,"end"),ii.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<300&&ii.click.call(this,e)},pointerdown:function(e){ii.mousedown.call(this,e)},pointermove:function(e){ei(e)||ii.mousemove.call(this,e)},pointerup:function(e){ii.mouseup.call(this,e)},pointerout:function(e){ei(e)||ii.mouseout.call(this,e)}};W(["click","dblclick","contextmenu"],(function(e){ii[e]=function(t){t=_t(this.dom,t),this.trigger(e,t)}}));var oi={pointermove:function(e){ei(e)||oi.mousemove.call(this,e)},pointerup:function(e){oi.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function ai(e,t){var n=t.domHandlers;d.pointerEventsSupported?W(Kr.pointer,(function(r){li(t,r,(function(t){n[r].call(e,t)}))})):(d.touchEventsSupported&&W(Kr.touch,(function(r){li(t,r,(function(i){n[r].call(e,i),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),W(Kr.mouse,(function(r){li(t,r,(function(i){i=yt(i),t.touching||n[r].call(e,i)}))})))}function si(e,t){function n(n){li(t,n,(function(r){r=yt(r),ni(e,r.target)||(r=function(e,t){return _t(e.dom,new ri(e,t),!0)}(e,r),t.domHandlers[n].call(e,r))}),{capture:!0})}d.pointerEventsSupported?W(Jr,n):d.touchEventsSupported||W($r,n)}function li(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,xt(e.domTarget,t,n,r)}function ui(e){var t,n,r,i,o=e.mounted;for(var a in o)o.hasOwnProperty(a)&&(t=e.domTarget,n=a,r=o[a],i=e.listenerOpts[a],t.removeEventListener(n,r,i));e.mounted={}}var ci=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},hi=function(e){function t(t,n){var r=e.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=n,r._localHandlerScope=new ci(t,ii),qr&&(r._globalHandlerScope=new ci(document,oi)),ai(r,r._localHandlerScope),r}return l(t,e),t.prototype.dispose=function(){ui(this._localHandlerScope),qr&&ui(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,qr&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?si(this,t):ui(t)}},t}(nt),di=1;d.hasGlobalWindow&&(di=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var pi=di,fi="#333",gi="#ccc",mi=Dt;function vi(e){return e>5e-5||e<-5e-5}var yi=[],_i=[],xi=[1,0,0,1,0,0],bi=Math.abs,wi=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return vi(this.rotation)||vi(this.x)||vi(this.y)||vi(this.scaleX-1)||vi(this.scaleY-1)||vi(this.skewX)||vi(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n=n||[1,0,0,1,0,0],t?this.getLocalTransform(n):mi(n),e&&(t?It(n,e,n):At(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(mi(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(yi);var n=yi[0]<0?-1:1,r=yi[1]<0?-1:1,i=((yi[0]-n)*t+n)/yi[0]||0,o=((yi[1]-r)*t+r)/yi[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],Pt(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||[1,0,0,1,0,0],It(_i,e.invTransform,t),t=_i);var n=this.originX,r=this.originY;(n||r)&&(xi[4]=n,xi[5]=r,It(_i,t,xi),_i[4]-=n,_i[5]-=r,t=_i),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Ke(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Ke(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&bi(e[0]-1)>1e-10&&bi(e[3]-1)>1e-10?Math.sqrt(bi(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){Ti(this,e)},e.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,o=e.scaleY,a=e.anchorX,s=e.anchorY,l=e.rotation||0,u=e.x,c=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||r||a||s){var p=n+a,f=r+s;t[4]=-p*i-h*f*o,t[5]=-f*o-d*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=o,t[1]=d*i,t[2]=h*o,l&&Lt(t,t,l),t[4]+=n+u,t[5]+=r+c,t},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),Si=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Ti(e,t){for(var n=0;n<Si.length;n++){var r=Si[n];e[r]=t[r]}}var Mi={};function Ci(e,t){var n=Mi[t=t||f];n||(n=Mi[t]=new Un(500));var r=n.get(e);return null==r&&(r=y.measureText(e,t).width,n.put(e,r)),r}function Di(e,t,n,r){var i=Ci(e,t),o=Li(t),a=Ii(0,i,n),s=Ei(0,o,r);return new jt(a,s,i,o)}function Ai(e,t,n,r){var i=((e||"")+"").split("\n");if(1===i.length)return Di(i[0],t,n,r);for(var o=new jt(0,0,0,0),a=0;a<i.length;a++){var s=Di(i[a],t,n,r);0===a?o.copy(s):o.union(s)}return o}function Ii(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function Ei(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function Li(e){return Ci("国",e)}function Ni(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function Pi(e,t,n){var r=t.position||"inside",i=null!=t.distance?t.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,c="left",h="top";if(r instanceof Array)l+=Ni(r[0],n.width),u+=Ni(r[1],n.height),c=null,h=null;else switch(r){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+a,u+=s,h="middle";break;case"top":l+=a/2,u-=i,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+i,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=a-i,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=i,c="center";break;case"insideBottom":l+=a/2,u+=o-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=a-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=o-i,h="bottom";break;case"insideBottomRight":l+=a-i,u+=o-i,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var Oi="__zr_normal__",Ri=Si.concat(["ignore"]),ki=X(Si,(function(e,t){return e[t]=!0,e}),{ignore:!1}),zi={},Vi=new jt(0,0,0,0),Bi=function(){function e(e){this.id=N(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,r=n.local,i=t.innerTransformable,o=void 0,a=void 0,s=!1;i.parent=r?this:null;var l=!1;if(i.copyTransform(t),null!=n.position){var u=Vi;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),r||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(zi,n,u):Pi(zi,n,u),i.x=zi.x,i.y=zi.y,o=zi.align,a=zi.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,d=void 0;"center"===c?(h=.5*u.width,d=.5*u.height):(h=Ni(c[0],u.width),d=Ni(c[1],u.height)),l=!0,i.originX=-i.x+h+(r?0:u.x),i.originY=-i.y+d+(r?0:u.y)}}null!=n.rotation&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],l||(i.originX=-p[0],i.originY=-p[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,v=void 0,y=void 0;f&&this.canBeInsideText()?(m=n.insideFill,v=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(m),y=!0)):(m=n.outsideFill,v=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(m),y=!0)),(m=m||"#000")===g.fill&&v===g.stroke&&y===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=m,g.stroke=v,g.autoStroke=y,g.align=o,g.verticalAlign=a,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?gi:fi},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&nr(t);n||(n=[255,255,255,1]);for(var r=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*r+(i?0:255)*(1-r);return n[3]=1,hr(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},z(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(re(e))for(var n=q(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==Oi)){var o=r.targetName,a=o?t[o]:t;r.saveTo(a)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,Ri)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];null==e[i]||i in t||(t[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(Oi,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===Oi;if(this.hasState()||!i){var o=this.currentStates,a=this.stateTransition;if(!(F(o,e)>=0)||!t&&1!==o.length){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),s||i){i||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||r);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&a&&a.duration>0,a);var u=this._textContent,c=this._textGuide;return u&&u.useState(e,t,n,l),c&&c.useState(e,t,n,l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}P("State "+e+" not exists.")}}},e.prototype.useStates=function(e,t,n){if(e.length){var r=[],i=this.currentStates,o=e.length,a=o===i.length;if(a)for(var s=0;s<o;s++)if(e[s]!==i[s]){a=!1;break}if(a)return;for(s=0;s<o;s++){var l=e[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,e)),u||(u=this.states[l]),u&&r.push(u)}var c=r[o-1],h=!!(c&&c.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(r),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(e,t,h),g&&g.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=F(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=F(r,e),o=F(r,t)>=0;i>=0?o?r.splice(i,1):r[i]=t:n&&!o&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},r=0;r<e.length;r++){var i=e[r];z(n,i),i.textConfig&&z(t=t||{},i.textConfig)}return t&&(n.textConfig=t),n},e.prototype._applyStateObj=function(e,t,n,r,i,o){var a=!(t&&r);t&&t.textConfig?(this.textConfig=z({},r?this.textConfig:n.textConfig),z(this.textConfig,t.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<Ri.length;u++){var c=Ri[u],h=i&&ki[c];t&&null!=t[c]?h?(l=!0,s[c]=t[c]):this[c]=t[c]:a&&null!=n[c]&&(h?(l=!0,s[c]=n[c]):this[c]=n[c])}if(!i)for(u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(t||n)[p]:t||n)}l&&this._transitionState(e,s,o)},e.prototype._attachComponent=function(e){if(!e.__zr||e.__hostTarget){if(e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}else if("production"!==process.env.NODE_ENV)throw new Error("Recursive component attachment.")}else if("production"!==process.env.NODE_ENV)throw new Error("Text element has been added to zrender.")},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;if(t!==e){if(t&&t!==e&&this.removeTextContent(),"production"!==process.env.NODE_ENV&&e.__zr&&!e.__hostTarget)throw new Error("Text element has been added to zrender.");e.innerTransformable=new wi,this._attachComponent(e),this._textContent=e,this.markRedraw()}},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),z(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,n=this._textGuide;t&&(t.__inHover=e),n&&(n.__inHover=e)},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var r=e?this[e]:this;if("production"===process.env.NODE_ENV||r){var i=new Wr(r,t,n);return e&&(i.targetName=e),this.addAnimator(i,e),i}P('Property "'+e+'" is not existed in element '+this.id)},e.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during((function(){r.updateDuringAnimation(t)})).done((function(){var t=r.animators,n=F(t,e);n>=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],o=0;o<r;o++){var a=n[o];e&&e!==a.scope?i.push(a):a.stop(t)}return this.animators=i,this},e.prototype.animateTo=function(e,t,n){Fi(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){Fi(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,r){for(var i=Fi(this,t,n,r),o=0;o<i.length;o++)i[o].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=function(){var t=e.prototype;t.type="element",t.name="",t.ignore=t.silent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=1;var n={};function r(e,t,r){n[e+t+r]||(console.warn("DEPRECATED: '"+e+"' has been deprecated. use '"+t+"', '"+r+"' instead"),n[e+t+r]=!0)}function i(e,n,i,o){function a(e,t){Object.defineProperty(t,0,{get:function(){return e[i]},set:function(t){e[i]=t}}),Object.defineProperty(t,1,{get:function(){return e[o]},set:function(t){e[o]=t}})}Object.defineProperty(t,e,{get:function(){("production"!==process.env.NODE_ENV&&r(e,i,o),this[n])||a(this,this[n]=[]);return this[n]},set:function(t){"production"!==process.env.NODE_ENV&&r(e,i,o),this[i]=t[0],this[o]=t[1],this[n]=t,a(this,t)}})}Object.defineProperty&&(i("position","_legacyPos","x","y"),i("scale","_legacyScale","scaleX","scaleY"),i("origin","_legacyOrigin","originX","originY"))}(),e}();function Fi(e,t,n,r,i){var o=[];Ui(e,"",e,t,n=n||{},r,o,i);var a=o.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},h=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),o.length>0&&n.during&&o[0].during((function(e,t){n.during(t)}));for(var d=0;d<o.length;d++){var p=o[d];p.done(c),p.aborted(h),n.force&&p.duration(n.duration),p.start(n.easing)}return o}function Gi(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function Hi(e,t,n){if(U(t[n]))if(U(e[n])||(e[n]=[]),oe(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),Gi(e[n],t[n],r))}else{var i=t[n],o=e[n],a=i.length;if(U(i[0]))for(var s=i[0].length,l=0;l<a;l++)o[l]?Gi(o[l],i[l],s):o[l]=Array.prototype.slice.call(i[l]);else Gi(o,i,a);o.length=i.length}else e[n]=t[n]}function Ui(e,t,n,r,i,o,a,s){for(var l=q(r),u=i.duration,c=i.delay,h=i.additive,d=i.setToFinal,p=!re(o),f=e.animators,g=[],m=0;m<l.length;m++){var v=l[m],y=r[v];if(null!=y&&null!=n[v]&&(p||o[v]))if(!re(y)||U(y)||se(y))g.push(v);else{if(t){s||(n[v]=y,e.updateDuringAnimation(t));continue}Ui(e,v,n[v],y,i,o&&o[v],a,s)}else s||(n[v]=y,e.updateDuringAnimation(t),g.push(v))}var _=g.length;if(!h&&_)for(var x=0;x<f.length;x++){if((w=f[x]).targetName===t)if(w.stopTracks(g)){var b=F(f,w);f.splice(b,1)}}if(i.force||(g=Y(g,(function(e){return t=r[e],i=n[e],!(t===i||U(t)&&U(i)&&function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(t,i));var t,i})),_=g.length),_>0||i.force&&!a.length){var w,S=void 0,T=void 0,M=void 0;if(s){T={},d&&(S={});for(x=0;x<_;x++){T[v=g[x]]=n[v],d?S[v]=r[v]:n[v]=r[v]}}else if(d){M={};for(x=0;x<_;x++){M[v=g[x]]=Vr(n[v]),Hi(n,r,v)}}(w=new Wr(n,!1,!1,h?Y(f,(function(e){return e.targetName===t})):null)).targetName=t,i.scope&&(w.scope=i.scope),d&&S&&w.whenWithKeys(0,S,g),M&&w.whenWithKeys(0,M,g),w.whenWithKeys(null==u?500:u,s?T:r,g).delay(c||0),e.addAnimator(w,t),a.push(w)}}H(Bi,nt),H(Bi,wi);var Wi=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return l(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){if(e&&(e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),"production"!==process.env.NODE_ENV&&e.__hostTarget))throw"This elemenet has been used as an attachment";return this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=F(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=F(n,e);return r<0||(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++){this._children[n].addSelfToZr(t)}},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++){this._children[n].removeSelfFromZr(t)}},t.prototype.getBoundingRect=function(e){for(var t=new jt(0,0,0,0),n=e||this._children,r=[],i=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(r);l?(jt.applyTransform(t,s,l),(i=i||t.clone()).union(t)):(i=i||s.clone()).union(s)}}return i||t},t}(Bi);Wi.prototype.type="group";
2
- /*!
3
- * ZRender, a high performance 2d drawing library.
4
- *
5
- * Copyright (c) 2013, Baidu Inc.
6
- * All rights reserved.
7
- *
8
- * LICENSE
9
- * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
10
- */
11
- var ji={},Xi={};var Yi,Zi=function(){function e(e,t,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=t,this.id=e;var i=new pn,o=n.renderer||"canvas";if(ji[o]||(o=q(ji)[0]),"production"!==process.env.NODE_ENV&&!ji[o])throw new Error("Renderer '"+o+"' is not imported. Please import it first.");n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var a=new ji[o](t,i,n,e),s=n.ssr||a.ssrOnly;this.storage=i,this.painter=a;var l,u=d.node||d.worker||s?null:new hi(a.getViewportRoot(),a.root),c=n.useCoarsePointer;(null==c||"auto"===c?d.touchEventsSupported:!!c)&&(l=de(n.pointerSize,44)),this.handler=new Jt(i,a,u,a.root,l),this.animation=new Zr({stage:{update:s?null:function(){return r._flush(!0)}}}),s||this.animation.start()}return e.prototype.add=function(e){!this._disposed&&e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){!this._disposed&&e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=function(e){if(!e)return!1;if("string"==typeof e)return dr(e,1)<.4;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,i=0;i<r;i++)n+=dr(t[i].color,1);return(n/=r)<.4}return!1}(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(e){var t,n=jr();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var r=jr();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:r-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Wi&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){var e;this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,e=this.id,delete Xi[e])},e}();function qi(e,t){var n=new Zi(N(),e,t);return Xi[n.id]=n,n}function Ki(e,t){ji[e]=t}function $i(e){if("function"==typeof Yi)return Yi(e)}function Ji(e){Yi=e}var Qi=Object.freeze({__proto__:null,dispose:function(e){e.dispose()},disposeAll:function(){for(var e in Xi)Xi.hasOwnProperty(e)&&Xi[e].dispose();Xi={}},getElementSSRData:$i,getInstance:function(e){return Xi[e]},init:qi,registerPainter:Ki,registerSSRDataGetter:Ji,version:"5.6.1"});function eo(e,t,n,r){var i=t[0],o=t[1],a=n[0],s=n[1],l=o-i,u=s-a;if(0===l)return 0===u?a:(a+s)/2;if(r)if(l>0){if(e<=i)return a;if(e>=o)return s}else{if(e>=i)return a;if(e<=o)return s}else{if(e===i)return a;if(e===o)return s}return(e-i)/l*u+a}function to(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return ee(e)?(n=e,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var n}function no(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function ro(e){return e.sort((function(e,t){return e-t})),e}function io(e){if(e=+e,isNaN(e))return 0;if(e>1e-14)for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n;return oo(e)}function oo(e){var t=e.toString().toLowerCase(),n=t.indexOf("e"),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,o=t.indexOf("."),a=o<0?0:i-1-o;return Math.max(0,a-r)}function ao(e,t){var n=Math.log,r=Math.LN10,i=Math.floor(n(e[1]-e[0])/r),o=Math.round(n(Math.abs(t[1]-t[0]))/r),a=Math.min(Math.max(-i+o,0),20);return isFinite(a)?a:20}function so(e,t){var n=X(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return[];for(var r=Math.pow(10,t),i=j(e,(function(e){return(isNaN(e)?0:e)/n*r*100})),o=100*r,a=j(i,(function(e){return Math.floor(e)})),s=X(a,(function(e,t){return e+t}),0),l=j(i,(function(e,t){return e-a[t]}));s<o;){for(var u=Number.NEGATIVE_INFINITY,c=null,h=0,d=l.length;h<d;++h)l[h]>u&&(u=l[h],c=h);++a[c],l[c]=0,++s}return j(a,(function(e){return e/r}))}function lo(e,t){var n=Math.max(io(e),io(t)),r=e+t;return n>20?r:no(r,n)}var uo=9007199254740991;function co(e){var t=2*Math.PI;return(e%t+t)%t}function ho(e){return e>-1e-4&&e<1e-4}var po=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function fo(e){if(e instanceof Date)return e;if(ee(e)){var t=po.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}return null==e?new Date(NaN):new Date(Math.round(e))}function go(e){return Math.pow(10,mo(e))}function mo(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}function vo(e,t){var n=mo(e),r=Math.pow(10,n),i=e/r;return e=(t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,n>=-20?+e.toFixed(n<0?-n:0):e}function yo(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i}function _o(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,r=0;r<e.length;){for(var i=e[r].interval,o=e[r].close,a=0;a<2;a++)i[a]<=t&&(i[a]=t,o[a]=a?1:1-n),t=i[a],n=o[a];i[0]===i[1]&&o[0]*o[1]!=1?e.splice(r,1):r++}return e;function s(e,t,n){return e.interval[n]<t.interval[n]||e.interval[n]===t.interval[n]&&(e.close[n]-t.close[n]==(n?-1:1)||!n&&s(e,t,1))}}function xo(e){var t=parseFloat(e);return t==e&&(0!==t||!ee(e)||e.indexOf("x")<=0)?t:NaN}function bo(e){return!isNaN(xo(e))}function wo(){return Math.round(9*Math.random())}function So(e,t){return 0===t?e:So(t,e%t)}function To(e,t){return null==e?t:null==t?e:e*t/So(e,t)}var Mo={},Co="undefined"!=typeof console&&console.warn&&console.log;function Do(e,t,n){if(Co){if(n){if(Mo[t])return;Mo[t]=!0}console[e]("[ECharts] "+t)}}function Ao(e,t){Do("warn",e,t)}function Io(e,t){Do("error",e,t)}function Eo(e){"production"!==process.env.NODE_ENV&&Do("warn","DEPRECATED: "+e,!0)}function Lo(e,t,n){"production"!==process.env.NODE_ENV&&Eo((n?"["+n+"]":"")+e+" is deprecated, use "+t+" instead.")}function No(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";if("production"!==process.env.NODE_ENV){var r=function(e){return void 0===e?"undefined":e===1/0?"Infinity":e===-1/0?"-Infinity":ce(e)?"NaN":e instanceof Date?"Date("+e.toISOString()+")":Q(e)?"function () { ... }":ue(e)?e+"":null};n=j(e,(function(e){if(ee(e))return e;var t=r(e);if(null!=t)return t;if("undefined"==typeof JSON||!JSON.stringify)return"?";try{return JSON.stringify(e,(function(e,t){var n=r(t);return null==n?t:n}))}catch(e){return"?"}})).join(" ")}return n}function Po(e){throw new Error(e)}function Oo(e,t,n){return(t-e)*n+e}var Ro="series\0",ko="\0_ec_\0";function zo(e){return e instanceof Array?e:null==e?[]:[e]}function Vo(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,i=n.length;r<i;r++){var o=n[r];!e.emphasis[t].hasOwnProperty(o)&&e[t].hasOwnProperty(o)&&(e.emphasis[t][o]=e[t][o])}}}var Bo=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Fo(e){return!re(e)||J(e)||e instanceof Date?e:e.value}function Go(e){return re(e)&&!(e instanceof Array)}function Ho(e,t,n){var r="normalMerge"===n,i="replaceMerge"===n,o="replaceAll"===n;e=e||[],t=(t||[]).slice();var a=Te();W(t,(function(e,n){re(e)?"production"!==process.env.NODE_ENV&&(null==e.id||Yo(e.id)||Xo(e.id),null==e.name||Yo(e.name)||Xo(e.name)):t[n]=null}));var s,l,u=function(e,t,n){var r=[];if("replaceAll"===n)return r;for(var i=0;i<e.length;i++){var o=e[i];o&&null!=o.id&&t.set(o.id,i),r.push({existing:"replaceMerge"===n||qo(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return r}(e,a,n);return(r||i)&&function(e,t,n,r){W(r,(function(i,o){if(i&&null!=i.id){var a=Wo(i.id),s=n.get(a);if(null!=s){var l=e[s];me(!l.newOption,'Duplicated option on id "'+a+'".'),l.newOption=i,l.existing=t[s],r[o]=null}}}))}(u,e,a,t),r&&function(e,t){W(t,(function(n,r){if(n&&null!=n.name)for(var i=0;i<e.length;i++){var o=e[i].existing;if(!e[i].newOption&&o&&(null==o.id||null==n.id)&&!qo(n)&&!qo(o)&&Uo("name",o,n))return e[i].newOption=n,void(t[r]=null)}}))}(u,t),r||i?function(e,t,n){W(t,(function(t){if(t){for(var r,i=0;(r=e[i])&&(r.newOption||qo(r.existing)||r.existing&&null!=t.id&&!Uo("id",t,r.existing));)i++;r?(r.newOption=t,r.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),i++}}))}(u,t,i):o&&function(e,t){W(t,(function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})}))}(u,t),s=u,l=Te(),W(s,(function(e){var t=e.existing;t&&l.set(t.id,e)})),W(s,(function(e){var t=e.newOption;me(!t||null==t.id||!l.get(t.id)||l.get(t.id)===e,"id duplicates: "+(t&&t.id)),t&&null!=t.id&&l.set(t.id,e),!e.keyInfo&&(e.keyInfo={})})),W(s,(function(e,t){var n=e.existing,r=e.newOption,i=e.keyInfo;if(re(r)){if(i.name=null!=r.name?Wo(r.name):n?n.name:Ro+t,n)i.id=Wo(n.id);else if(null!=r.id)i.id=Wo(r.id);else{var o=0;do{i.id="\0"+i.name+"\0"+o++}while(l.get(i.id))}l.set(i.id,e)}})),u}function Uo(e,t,n){var r=jo(t[e],null),i=jo(n[e],null);return null!=r&&null!=i&&r===i}function Wo(e){if("production"!==process.env.NODE_ENV&&null==e)throw new Error;return jo(e,"")}function jo(e,t){return null==e?t:ee(e)?e:ne(e)||te(e)?e+"":t}function Xo(e){"production"!==process.env.NODE_ENV&&Ao("`"+e+"` is invalid id or name. Must be a string or number.")}function Yo(e){return te(e)||bo(e)}function Zo(e){var t=e.name;return!(!t||!t.indexOf(Ro))}function qo(e){return e&&null!=e.id&&0===Wo(e.id).indexOf(ko)}function Ko(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?J(t.dataIndex)?j(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?J(t.name)?j(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}function $o(){var e="__ec_inner_"+Jo++;return function(t){return t[e]||(t[e]={})}}var Jo=wo();function Qo(e,t,n){var r=ea(t,n),i=r.mainTypeSpecified,o=r.queryOptionMap,a=r.others,s=n?n.defaultMainType:null;return!i&&s&&o.set(s,{}),o.each((function(t,r){var i=ra(e,r,t,{useDefault:s===r,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[r+"Models"]=i.models,a[r+"Model"]=i.models[0]})),a}function ea(e,t){var n;if(ee(e)){var r={};r[e+"Index"]=0,n=r}else n=e;var i=Te(),o={},a=!1;return W(n,(function(e,n){if("dataIndex"!==n&&"dataIndexInside"!==n){var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],l=(r[2]||"").toLowerCase();if(s&&l&&!(t&&t.includeMainTypes&&F(t.includeMainTypes,s)<0))a=a||!!s,(i.get(s)||i.set(s,{}))[l]=e}else o[n]=e})),{mainTypeSpecified:a,queryOptionMap:i,others:o}}var ta={useDefault:!0,enableAll:!1,enableNone:!1},na={useDefault:!1,enableAll:!0,enableNone:!0};function ra(e,t,n,r){r=r||ta;var i=n.index,o=n.id,a=n.name,s={models:null,specified:null!=i||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=r.useDefault&&(l=e.getComponent(t))?[l]:[],s}return"none"===i||!1===i?(me(r.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):("all"===i&&(me(r.enableAll,'`"all"` is not a valid value on index option.'),i=o=a=null),s.models=e.queryComponents({mainType:t,index:i,id:o,name:a}),s)}function ia(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function oa(e,t){var n=Te(),r=[];return W(e,(function(e){var i=t(e);(n.get(i)||(r.push(i),n.set(i,[]))).push(e)})),{keys:r,buckets:n}}function aa(e,t,n,r,i){var o=null==t||"auto"===t;if(null==r)return r;if(ne(r))return no(f=Oo(n||0,r,i),o?Math.max(io(n||0),io(r)):t);if(ee(r))return i<1?n:r;for(var a=[],s=n,l=r,u=Math.max(s?s.length:0,l.length),c=0;c<u;++c){var h=e.getDimensionInfo(c);if(h&&"ordinal"===h.type)a[c]=(i<1&&s?s:l)[c];else{var d=s&&s[c]?s[c]:0,p=l[c],f=Oo(d,p,i);a[c]=no(f,o?Math.max(io(d),io(p)):t)}}return a}var sa="___EC__COMPONENT__CONTAINER___",la="___EC__EXTENDED_CLASS___";function ua(e){var t={main:"",sub:""};if(e){var n=e.split(".");t.main=n[0]||"",t.sub=n[1]||""}return t}function ca(e,t){e.$constructor=e,e.extend=function(e){"production"!==process.env.NODE_ENV&&W(t,(function(t){e[t]||console.warn("Method `"+t+"` should be implemented"+(e.type?" in "+e.type:"")+".")}));var n,r,i=this;return Q(r=i)&&/^class\s/.test(Function.prototype.toString.call(r))?n=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(i):(n=function(){(e.$constructor||i).apply(this,arguments)},G(n,this)),z(n.prototype,e),n[la]=!0,n.extend=this.extend,n.superCall=pa,n.superApply=fa,n.superClass=i,n}}function ha(e,t){e.extend=t.extend}var da=Math.round(10*Math.random());function pa(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return this.superClass.prototype[t].apply(e,n)}function fa(e,t,n){return this.superClass.prototype[t].apply(e,n)}function ga(e){var t={};e.registerClass=function(e){var n,r=e.type||e.prototype.type;if(r){me(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=r),'componentType "'+n+'" illegal'),e.prototype.type=r;var i=ua(r);if(i.sub){if(i.sub!==sa){var o=function(e){var n=t[e.main];n&&n[sa]||((n=t[e.main]={})[sa]=!0);return n}(i);o[i.sub]=e}}else"production"!==process.env.NODE_ENV&&t[i.main]&&console.warn(i.main+" exists."),t[i.main]=e}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[sa]&&(i=n?i[n]:null),r&&!i)throw new Error(n?"Component "+e+"."+(n||"")+" is used but not imported.":e+".type should be specified.");return i},e.getClassesByMainType=function(e){var n=ua(e),r=[],i=t[n.main];return i&&i[sa]?W(i,(function(e,t){t!==sa&&r.push(e)})):r.push(i),r},e.hasClass=function(e){var n=ua(e);return!!t[n.main]},e.getAllClassMainTypes=function(){var e=[];return W(t,(function(t,n){e.push(n)})),e},e.hasSubTypes=function(e){var n=ua(e),r=t[n.main];return r&&r[sa]}}function ma(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(n,r,i){for(var o={},a=0;a<e.length;a++){var s=e[a][1];if(!(r&&F(r,s)>=0||i&&F(i,s)<0)){var l=n.getShallow(s,t);null!=l&&(o[e[a][0]]=l)}}return o}}var va=ma([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ya=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return va(this,e,t)},e}(),_a=new Un(50);function xa(e){if("string"==typeof e){var t=_a.get(e);return t&&t.image}return e}function ba(e,t,n,r,i){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var o=_a.get(e),a={hostEl:n,cb:r,cbPayload:i};return o?!Sa(t=o.image)&&o.pending.push(a):((t=y.loadImage(e,wa,wa)).__zrImageSrc=e,_a.put(e,t.__cachedImgObj={image:t,pending:[a]})),t}return e}return t}function wa(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function Sa(e){return e&&e.width&&e.height}var Ta=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Ma(e,t,n,r,i,o){if(!n)return e.text="",void(e.isTruncated=!1);var a=(t+"").split("\n");o=Ca(n,r,i,o);for(var s=!1,l={},u=0,c=a.length;u<c;u++)Da(l,a[u],o),a[u]=l.textLine,s=s||l.isTruncated;e.text=a.join("\n"),e.isTruncated=s}function Ca(e,t,n,r){var i=z({},r=r||{});i.font=t,n=de(n,"..."),i.maxIterations=de(r.maxIterations,2);var o=i.minChar=de(r.minChar,0);i.cnCharWidth=Ci("国",t);var a=i.ascCharWidth=Ci("a",t);i.placeholder=de(r.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<o&&s>=a;l++)s-=a;var u=Ci(n,t);return u>s&&(n="",u=0),s=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=e,i}function Da(e,t,n){var r=n.containerWidth,i=n.font,o=n.contentWidth;if(!r)return e.textLine="",void(e.isTruncated=!1);var a=Ci(t,i);if(a<=r)return e.textLine=t,void(e.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){t+=n.ellipsis;break}var l=0===s?Aa(t,o,n.ascCharWidth,n.cnCharWidth):a>0?Math.floor(t.length*o/a):0;a=Ci(t=t.substr(0,l),i)}""===t&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function Aa(e,t,n,r){for(var i=0,o=0,a=e.length;o<a&&i<t;o++){var s=e.charCodeAt(o);i+=0<=s&&s<=127?n:r}return o}var Ia=function(){},Ea=function(e){this.tokens=[],e&&(this.tokens=e)},La=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1};function Na(e,t,n,r,i){var o,a,s=""===t,l=i&&n.rich[i]||{},u=e.lines,c=l.font||n.font,h=!1;if(r){var d=l.padding,p=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var f=Ni(l.width,r.width)+p;u.length>0&&f+r.accumWidth>r.width&&(o=t.split("\n"),h=!0),r.accumWidth=f}else{var g=Ra(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=t.split("\n");for(var m=0;m<o.length;m++){var v=o[m],y=new Ia;if(y.styleName=i,y.text=v,y.isLineHolder=!v&&!s,"number"==typeof l.width?y.width=l.width:y.width=a?a[m]:Ci(v,c),m||h)u.push(new Ea([y]));else{var _=(u[u.length-1]||(u[0]=new Ea)).tokens,x=_.length;1===x&&_[0].isLineHolder?_[0]=y:(v||!x||s)&&_.push(y)}}}var Pa=X(",&?/;] ".split(""),(function(e,t){return e[t]=!0,e}),{});function Oa(e){return!function(e){var t=e.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}(e)||!!Pa[e]}function Ra(e,t,n,r,i){for(var o=[],a=[],s="",l="",u=0,c=0,h=0;h<e.length;h++){var d=e.charAt(h);if("\n"!==d){var p=Ci(d,t),f=!r&&!Oa(d);(o.length?c+p>n:i+c+p>n)?c?(s||l)&&(f?(s||(s=l,l="",c=u=0),o.push(s),a.push(c-u),l+=d,s="",c=u+=p):(l&&(s+=l,l="",u=0),o.push(s),a.push(c),s=d,c=p)):f?(o.push(l),a.push(u),l=d,u=p):(o.push(d),a.push(p)):(c+=p,f?(l+=d,u+=p):(l&&(s+=l,l="",u=0),s+=d))}else l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0}return o.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(c)),1===o.length&&(c+=i),{accumWidth:c,lines:o,linesWidths:a}}var ka="__zr_style_"+Math.round(10*Math.random()),za={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Va={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};za[ka]=!0;var Ba=["z","z2","invisible"],Fa=["invisible"],Ga=function(e){function t(t){return e.call(this,t)||this}var n;return l(t,e),t.prototype._init=function(t){for(var n=q(t),r=0;r<n.length;r++){var i=n[r];"style"===i?this.useStyle(t[i]):e.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,t,n,r){var i=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(e,t,n){Ha.copy(e.getBoundingRect()),e.transform&&Ha.applyTransform(e.transform);return Ua.width=t,Ua.height=n,!Ha.intersect(Ua)}(this,e,t)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths)for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1;if(r&&this.parent)for(var a=this.parent;a;){if(a.ignore)return!1;a=a.parent}return!0},t.prototype.contain=function(e,t){return this.rectContain(e,t)},t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,o=r.shadowOffsetX||0,a=r.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new jt(0,0,0,0)),t?jt.applyTransform(e,n,t):e.copy(n),(i||o||a)&&(e.width+=2*i+Math.abs(o),e.height+=2*i+Math.abs(a),e.x=Math.min(e.x,e.x+o-i),e.y=Math.min(e.y,e.y+a-i));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+2*s),e.height=Math.ceil(e.height+1+2*s))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new jt(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate("style",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(t,n){"style"!==t?e.prototype.attrKV.call(this,t,n):this.style?this.setStyle(n):this.useStyle(n)},t.prototype.setStyle=function(e,t){return"string"==typeof e?this.style[e]=t:z(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(2&this.__dirty)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(e){return Ce(za,e)},t.prototype.useStyle=function(e){e[ka]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[ka]},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,Ba)},t.prototype._applyStateObj=function(t,n,r,i,o,a){e.prototype._applyStateObj.call(this,t,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.style?o?i?s=n.style:(s=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(s,n.style)):l&&(s=r.style),s)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var c=q(u),h=0;h<c.length;h++){(p=c[h])in s&&(s[p]=s[p],this.style[p]=u[p])}var d=q(s);for(h=0;h<d.length;h++){var p=d[h];this.style[p]=this.style[p]}this._transitionState(t,{style:s},a,this.getAnimationStyleProps())}else this.useStyle(s);var f=this.__inHover?Fa:Ba;for(h=0;h<f.length;h++){p=f[h];n&&null!=n[p]?this[p]=n[p]:l&&null!=r[p]&&(this[p]=r[p])}},t.prototype._mergeStates=function(t){for(var n,r=e.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var o=t[i];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(r.style=n),r},t.prototype._mergeStyle=function(e,t){return z(e,t),e},t.prototype.getAnimationStyleProps=function(){return Va},t.initDefaultProps=((n=t.prototype).type="displayable",n.invisible=!1,n.z=0,n.z2=0,n.zlevel=0,n.culling=!1,n.cursor="pointer",n.rectHover=!1,n.incremental=!1,n._rect=null,n.dirtyRectTolerance=0,void(n.__dirty=3)),t}(Bi),Ha=new jt(0,0,0,0),Ua=new jt(0,0,0,0);var Wa=Math.min,ja=Math.max,Xa=Math.sin,Ya=Math.cos,Za=2*Math.PI,qa=Ne(),Ka=Ne(),$a=Ne();function Ja(e,t,n){if(0!==e.length){for(var r=e[0],i=r[0],o=r[0],a=r[1],s=r[1],l=1;l<e.length;l++)r=e[l],i=Wa(i,r[0]),o=ja(o,r[0]),a=Wa(a,r[1]),s=ja(s,r[1]);t[0]=i,t[1]=a,n[0]=o,n[1]=s}}function Qa(e,t,n,r,i,o){i[0]=Wa(e,n),i[1]=Wa(t,r),o[0]=ja(e,n),o[1]=ja(t,r)}var es=[],ts=[];function ns(e,t,n,r,i,o,a,s,l,u){var c=An,h=Mn,d=c(e,n,i,a,es);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p<d;p++){var f=h(e,n,i,a,es[p]);l[0]=Wa(f,l[0]),u[0]=ja(f,u[0])}d=c(t,r,o,s,ts);for(p=0;p<d;p++){var g=h(t,r,o,s,ts[p]);l[1]=Wa(g,l[1]),u[1]=ja(g,u[1])}l[0]=Wa(e,l[0]),u[0]=ja(e,u[0]),l[0]=Wa(a,l[0]),u[0]=ja(a,u[0]),l[1]=Wa(t,l[1]),u[1]=ja(t,u[1]),l[1]=Wa(s,l[1]),u[1]=ja(s,u[1])}function rs(e,t,n,r,i,o,a,s){var l=On,u=Nn,c=ja(Wa(l(e,n,i),1),0),h=ja(Wa(l(t,r,o),1),0),d=u(e,n,i,c),p=u(t,r,o,h);a[0]=Wa(e,i,d),a[1]=Wa(t,o,p),s[0]=ja(e,i,d),s[1]=ja(t,o,p)}function is(e,t,n,r,i,o,a,s,l){var u=$e,c=Je,h=Math.abs(i-o);if(h%Za<1e-4&&h>1e-4)return s[0]=e-n,s[1]=t-r,l[0]=e+n,void(l[1]=t+r);if(qa[0]=Ya(i)*n+e,qa[1]=Xa(i)*r+t,Ka[0]=Ya(o)*n+e,Ka[1]=Xa(o)*r+t,u(s,qa,Ka),c(l,qa,Ka),(i%=Za)<0&&(i+=Za),(o%=Za)<0&&(o+=Za),i>o&&!a?o+=Za:i<o&&a&&(i+=Za),a){var d=o;o=i,i=d}for(var p=0;p<o;p+=Math.PI/2)p>i&&($a[0]=Ya(p)*n+e,$a[1]=Xa(p)*r+t,u(s,$a,s),c(l,$a,l))}var os={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},as=[],ss=[],ls=[],us=[],cs=[],hs=[],ds=Math.min,ps=Math.max,fs=Math.cos,gs=Math.sin,ms=Math.abs,vs=Math.PI,ys=2*vs,_s="undefined"!=typeof Float32Array,xs=[];function bs(e){return Math.round(e/vs*1e8)/1e8%2*vs}function ws(e,t){var n=bs(e[0]);n<0&&(n+=ys);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=ys?i=n+ys:t&&n-i>=ys?i=n-ys:!t&&n>i?i=n+(ys-bs(n-i)):t&&n<i&&(i=n-(ys-bs(i-n))),e[0]=n,e[1]=i}var Ss=function(){function e(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(e,t,n){(n=n||0)>0&&(this._ux=ms(n/pi/e)||0,this._uy=ms(n/pi/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(os.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=ms(e-this._xi),r=ms(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(os.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+r*r;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._drawPendingPt(),this.addData(os.C,e,t,n,r,i,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,o),this._xi=i,this._yi=o,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(os.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,o){this._drawPendingPt(),xs[0]=r,xs[1]=i,ws(xs,o),r=xs[0];var a=(i=xs[1])-r;return this.addData(os.A,e,t,n,n,r,a,0,o?0:1),this._ctx&&this._ctx.arc(e,t,n,r,i,o),this._xi=fs(i)*n+e,this._yi=gs(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(os.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(os.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;this.data&&this.data.length===t||!_s||(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t},e.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,n=0,r=this._len,i=0;i<t;i++)n+=e[i].len();_s&&this.data instanceof Float32Array&&(this.data=new Float32Array(r+n));for(i=0;i<t;i++)for(var o=e[i].data,a=0;a<o.length;a++)this.data[r++]=o[a];this._len=r},e.prototype.addData=function(e,t,n,r,i,o,a,s,l){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var c=0;c<arguments.length;c++)u[this._len++]=arguments[c]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,_s&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){ls[0]=ls[1]=cs[0]=cs[1]=Number.MAX_VALUE,us[0]=us[1]=hs[0]=hs[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,r=0,i=0,o=0;for(e=0;e<this._len;){var a=t[e++],s=1===e;switch(s&&(i=n=t[e],o=r=t[e+1]),a){case os.M:n=i=t[e++],r=o=t[e++],cs[0]=i,cs[1]=o,hs[0]=i,hs[1]=o;break;case os.L:Qa(n,r,t[e],t[e+1],cs,hs),n=t[e++],r=t[e++];break;case os.C:ns(n,r,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],cs,hs),n=t[e++],r=t[e++];break;case os.Q:rs(n,r,t[e++],t[e++],t[e],t[e+1],cs,hs),n=t[e++],r=t[e++];break;case os.A:var l=t[e++],u=t[e++],c=t[e++],h=t[e++],d=t[e++],p=t[e++]+d;e+=1;var f=!t[e++];s&&(i=fs(d)*c+l,o=gs(d)*h+u),is(l,u,c,h,d,p,f,cs,hs),n=fs(p)*c+l,r=gs(p)*h+u;break;case os.R:Qa(i=n=t[e++],o=r=t[e++],i+t[e++],o+t[e++],cs,hs);break;case os.Z:n=i,r=o}$e(ls,ls,cs),Je(us,us,hs)}return 0===e&&(ls[0]=ls[1]=us[0]=us[1]=0),new jt(ls[0],ls[1],us[0]-ls[0],us[1]-ls[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,r=this._uy,i=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,c=0,h=0;h<t;){var d=e[h++],p=1===h;p&&(a=i=e[h],s=o=e[h+1]);var f=-1;switch(d){case os.M:i=a=e[h++],o=s=e[h++];break;case os.L:var g=e[h++],m=(_=e[h++])-o;(ms(I=g-i)>n||ms(m)>r||h===t-1)&&(f=Math.sqrt(I*I+m*m),i=g,o=_);break;case os.C:var v=e[h++],y=e[h++],_=(g=e[h++],e[h++]),x=e[h++],b=e[h++];f=Ln(i,o,v,y,g,_,x,b,10),i=x,o=b;break;case os.Q:f=zn(i,o,v=e[h++],y=e[h++],g=e[h++],_=e[h++],10),i=g,o=_;break;case os.A:var w=e[h++],S=e[h++],T=e[h++],M=e[h++],C=e[h++],D=e[h++],A=D+C;h+=1,p&&(a=fs(C)*T+w,s=gs(C)*M+S),f=ps(T,M)*ds(ys,Math.abs(D)),i=fs(A)*T+w,o=gs(A)*M+S;break;case os.R:a=i=e[h++],s=o=e[h++],f=2*e[h++]+2*e[h++];break;case os.Z:var I=a-i;m=s-o;f=Math.sqrt(I*I+m*m),i=a,o=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},e.prototype.rebuildPath=function(e,t){var n,r,i,o,a,s,l,u,c,h,d=this.data,p=this._ux,f=this._uy,g=this._len,m=t<1,v=0,y=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))e:for(var x=0;x<g;){var b=d[x++],w=1===x;switch(w&&(n=i=d[x],r=o=d[x+1]),b!==os.L&&_>0&&(e.lineTo(c,h),_=0),b){case os.M:n=i=d[x++],r=o=d[x++],e.moveTo(i,o);break;case os.L:a=d[x++],s=d[x++];var S=ms(a-i),T=ms(s-o);if(S>p||T>f){if(m){if(v+(Z=l[y++])>u){var M=(u-v)/Z;e.lineTo(i*(1-M)+a*M,o*(1-M)+s*M);break e}v+=Z}e.lineTo(a,s),i=a,o=s,_=0}else{var C=S*S+T*T;C>_&&(c=a,h=s,_=C)}break;case os.C:var D=d[x++],A=d[x++],I=d[x++],E=d[x++],L=d[x++],N=d[x++];if(m){if(v+(Z=l[y++])>u){In(i,D,I,L,M=(u-v)/Z,as),In(o,A,E,N,M,ss),e.bezierCurveTo(as[1],ss[1],as[2],ss[2],as[3],ss[3]);break e}v+=Z}e.bezierCurveTo(D,A,I,E,L,N),i=L,o=N;break;case os.Q:D=d[x++],A=d[x++],I=d[x++],E=d[x++];if(m){if(v+(Z=l[y++])>u){Rn(i,D,I,M=(u-v)/Z,as),Rn(o,A,E,M,ss),e.quadraticCurveTo(as[1],ss[1],as[2],ss[2]);break e}v+=Z}e.quadraticCurveTo(D,A,I,E),i=I,o=E;break;case os.A:var P=d[x++],O=d[x++],R=d[x++],k=d[x++],z=d[x++],V=d[x++],B=d[x++],F=!d[x++],G=R>k?R:k,H=ms(R-k)>.001,U=z+V,W=!1;if(m)v+(Z=l[y++])>u&&(U=z+V*(u-v)/Z,W=!0),v+=Z;if(H&&e.ellipse?e.ellipse(P,O,R,k,B,z,U,F):e.arc(P,O,G,z,U,F),W)break e;w&&(n=fs(z)*R+P,r=gs(z)*k+O),i=fs(U)*R+P,o=gs(U)*k+O;break;case os.R:n=i=d[x],r=o=d[x+1],a=d[x++],s=d[x++];var j=d[x++],X=d[x++];if(m){if(v+(Z=l[y++])>u){var Y=u-v;e.moveTo(a,s),e.lineTo(a+ds(Y,j),s),(Y-=j)>0&&e.lineTo(a+j,s+ds(Y,X)),(Y-=X)>0&&e.lineTo(a+ps(j-Y,0),s+X),(Y-=j)>0&&e.lineTo(a,s+ps(X-Y,0));break e}v+=Z}e.rect(a,s,j,X);break;case os.Z:if(m){var Z;if(v+(Z=l[y++])>u){M=(u-v)/Z;e.lineTo(i*(1-M)+n*M,o*(1-M)+r*M);break e}v+=Z}e.closePath(),i=n,o=r}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.CMD=os,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function Ts(e,t,n,r,i,o,a){if(0===i)return!1;var s=i,l=0;if(a>t+s&&a>r+s||a<t-s&&a<r-s||o>e+s&&o>n+s||o<e-s&&o<n-s)return!1;if(e===n)return Math.abs(o-e)<=s/2;var u=(l=(t-r)/(e-n))*o-a+(e*r-n*t)/(e-n);return u*u/(l*l+1)<=s/2*s/2}function Ms(e,t,n,r,i,o,a,s,l,u,c){if(0===l)return!1;var h=l;return!(c>t+h&&c>r+h&&c>o+h&&c>s+h||c<t-h&&c<r-h&&c<o-h&&c<s-h||u>e+h&&u>n+h&&u>i+h&&u>a+h||u<e-h&&u<n-h&&u<i-h&&u<a-h)&&En(e,t,n,r,i,o,a,s,u,c,null)<=h/2}function Cs(e,t,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;return!(l>t+u&&l>r+u&&l>o+u||l<t-u&&l<r-u&&l<o-u||s>e+u&&s>n+u&&s>i+u||s<e-u&&s<n-u&&s<i-u)&&kn(e,t,n,r,i,o,s,l,null)<=u/2}var Ds=2*Math.PI;function As(e){return(e%=Ds)<0&&(e+=Ds),e}var Is=2*Math.PI;function Es(e,t,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;s-=e,l-=t;var c=Math.sqrt(s*s+l*l);if(c-u>n||c+u<n)return!1;if(Math.abs(r-i)%Is<1e-4)return!0;if(o){var h=r;r=As(i),i=As(h)}else r=As(r),i=As(i);r>i&&(i+=Is);var d=Math.atan2(l,s);return d<0&&(d+=Is),d>=r&&d<=i||d+Is>=r&&d+Is<=i}function Ls(e,t,n,r,i,o){if(o>t&&o>r||o<t&&o<r)return 0;if(r===t)return 0;var a=(o-t)/(r-t),s=r<t?1:-1;1!==a&&0!==a||(s=r<t?.5:-.5);var l=a*(n-e)+e;return l===i?1/0:l>i?s:0}var Ns=Ss.CMD,Ps=2*Math.PI;var Os=[-1,-1,-1],Rs=[-1,-1];function ks(e,t,n,r,i,o,a,s,l,u){if(u>t&&u>r&&u>o&&u>s||u<t&&u<r&&u<o&&u<s)return 0;var c,h=Dn(t,r,o,s,u,Os);if(0===h)return 0;for(var d=0,p=-1,f=void 0,g=void 0,m=0;m<h;m++){var v=Os[m],y=0===v||1===v?.5:1;Mn(e,n,i,a,v)<l||(p<0&&(p=An(t,r,o,s,Rs),Rs[1]<Rs[0]&&p>1&&(c=void 0,c=Rs[0],Rs[0]=Rs[1],Rs[1]=c),f=Mn(t,r,o,s,Rs[0]),p>1&&(g=Mn(t,r,o,s,Rs[1]))),2===p?v<Rs[0]?d+=f<t?y:-y:v<Rs[1]?d+=g<f?y:-y:d+=s<g?y:-y:v<Rs[0]?d+=f<t?y:-y:d+=s<f?y:-y)}return d}function zs(e,t,n,r,i,o,a,s){if(s>t&&s>r&&s>o||s<t&&s<r&&s<o)return 0;var l=function(e,t,n,r,i){var o=e-2*t+n,a=2*(t-e),s=e-r,l=0;if(Sn(o))Tn(a)&&(c=-s/a)>=0&&c<=1&&(i[l++]=c);else{var u=a*a-4*o*s;if(Sn(u))(c=-a/(2*o))>=0&&c<=1&&(i[l++]=c);else if(u>0){var c,h=mn(u),d=(-a-h)/(2*o);(c=(-a+h)/(2*o))>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}(t,r,o,s,Os);if(0===l)return 0;var u=On(t,r,o);if(u>=0&&u<=1){for(var c=0,h=Nn(t,r,o,u),d=0;d<l;d++){var p=0===Os[d]||1===Os[d]?.5:1;Nn(e,n,i,Os[d])<a||(Os[d]<u?c+=h<t?p:-p:c+=o<h?p:-p)}return c}p=0===Os[0]||1===Os[0]?.5:1;return Nn(e,n,i,Os[0])<a?0:o<t?p:-p}function Vs(e,t,n,r,i,o,a,s){if((s-=t)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Os[0]=-l,Os[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=Ps-1e-4){r=0,i=Ps;var c=o?1:-1;return a>=Os[0]+e&&a<=Os[1]+e?c:0}if(r>i){var h=r;r=i,i=h}r<0&&(r+=Ps,i+=Ps);for(var d=0,p=0;p<2;p++){var f=Os[p];if(f+e>a){var g=Math.atan2(s,f);c=o?1:-1;g<0&&(g=Ps+g),(g>=r&&g<=i||g+Ps>=r&&g+Ps<=i)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}function Bs(e,t,n,r,i){for(var o,a,s,l,u=e.data,c=e.len(),h=0,d=0,p=0,f=0,g=0,m=0;m<c;){var v=u[m++],y=1===m;switch(v===Ns.M&&m>1&&(n||(h+=Ls(d,p,f,g,r,i))),y&&(f=d=u[m],g=p=u[m+1]),v){case Ns.M:d=f=u[m++],p=g=u[m++];break;case Ns.L:if(n){if(Ts(d,p,u[m],u[m+1],t,r,i))return!0}else h+=Ls(d,p,u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case Ns.C:if(n){if(Ms(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],t,r,i))return!0}else h+=ks(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case Ns.Q:if(n){if(Cs(d,p,u[m++],u[m++],u[m],u[m+1],t,r,i))return!0}else h+=zs(d,p,u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case Ns.A:var _=u[m++],x=u[m++],b=u[m++],w=u[m++],S=u[m++],T=u[m++];m+=1;var M=!!(1-u[m++]);o=Math.cos(S)*b+_,a=Math.sin(S)*w+x,y?(f=o,g=a):h+=Ls(d,p,o,a,r,i);var C=(r-_)*w/b+_;if(n){if(Es(_,x,w,S,S+T,M,t,C,i))return!0}else h+=Vs(_,x,w,S,S+T,M,C,i);d=Math.cos(S+T)*b+_,p=Math.sin(S+T)*w+x;break;case Ns.R:if(f=d=u[m++],g=p=u[m++],o=f+u[m++],a=g+u[m++],n){if(Ts(f,g,o,g,t,r,i)||Ts(o,g,o,a,t,r,i)||Ts(o,a,f,a,t,r,i)||Ts(f,a,f,g,t,r,i))return!0}else h+=Ls(o,g,o,a,r,i),h+=Ls(f,a,f,g,r,i);break;case Ns.Z:if(n){if(Ts(d,p,f,g,t,r,i))return!0}else h+=Ls(d,p,f,g,r,i);d=f,p=g}}return n||(s=p,l=g,Math.abs(s-l)<1e-4)||(h+=Ls(d,p,f,g,r,i)||0),0!==h}var Fs=V({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},za),Gs={style:V({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Va.style)},Hs=Si.concat(["invisible","culling","z","z2","zlevel","parent"]),Us=function(e){function t(t){return e.call(this,t)||this}var n;return l(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var o=i.style;for(var a in r)o[a]!==r[a]&&(o[a]=r[a]);o.fill=r.fill?r.decal:null,o.decal=null,o.shadowColor=null,r.strokeFirst&&(o.stroke=null);for(var s=0;s<Hs.length;++s)i[Hs[s]]=this[Hs[s]];i.__dirty|=1}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=q(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var o=n[i],a=t[o];"style"===o?this.style?z(this.style,a):this.useStyle(a):"shape"===o?z(this.shape,a):e.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if("none"!==e){if(ee(e)){var t=dr(e,0);return t>.5?fi:t>.2?"#eee":gi}if(e)return gi}return fi},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(ee(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===dr(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Ss(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||4&this.__dirty)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){o.copy(e);var a=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var o=this.path;if(this.hasStroke()){var a=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(e,t,n,r){return Bs(e,t,!0,n,r)}(o,a/s,e,t)))return!0}if(this.hasFill())return function(e,t,n){return Bs(e,0,!1,t,n)}(o,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:z(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(4&this.__dirty)},t.prototype.createStyle=function(e){return Ce(Fs,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=z({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,o,a){e.prototype._applyStateObj.call(this,t,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.shape?o?i?s=n.shape:(s=z({},r.shape),z(s,n.shape)):(s=z({},i?this.shape:r.shape),z(s,n.shape)):l&&(s=r.shape),s)if(o){this.shape=z({},this.shape);for(var u={},c=q(s),h=0;h<c.length;h++){var d=c[h];"object"==typeof s[d]?this.shape[d]=s[d]:u[d]=s[d]}this._transitionState(t,{shape:u},a)}else this.shape=s,this.dirtyShape()},t.prototype._mergeStates=function(t){for(var n,r=e.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var o=t[i];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(r.shape=n),r},t.prototype.getAnimationStyleProps=function(){return Gs},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){function n(n){var r=t.call(this,n)||this;return e.init&&e.init.call(r,n),r}return l(n,t),n.prototype.getDefaultStyle=function(){return O(e.style)},n.prototype.getDefaultShape=function(){return O(e.shape)},n}(t);for(var r in e)"function"==typeof e[r]&&(n.prototype[r]=e[r]);return n},t.initDefaultProps=((n=t.prototype).type="path",n.strokeContainThreshold=5,n.segmentIgnoreThreshold=0,n.subPixelOptimize=!1,n.autoBatch=!1,void(n.__dirty=7)),t}(Ga),Ws=V({strokeFirst:!0,font:f,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Fs),js=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return Ce(Ws,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=Ai(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var r=e.lineWidth;n.x-=r/2,n.y-=r/2,n.width+=r,n.height+=r}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(Ga);js.prototype.type="tspan";var Xs=V({x:0,y:0},za),Ys={style:V({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Va.style)};var Zs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.createStyle=function(e){return Ce(Xs,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(null!=n)return n;var r,i=(r=t.image)&&"string"!=typeof r&&r.width&&r.height?t.image:this.__image;if(!i)return 0;var o="width"===e?"height":"width",a=t[o];return null==a?i[e]:i[e]/i[o]*a},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return Ys},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new jt(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(Ga);Zs.prototype.type="image";var qs=Math.round;function Ks(e,t,n){if(t){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;e.x1=r,e.x2=i,e.y1=o,e.y2=a;var s=n&&n.lineWidth;return s?(qs(2*r)===qs(2*i)&&(e.x1=e.x2=Js(r,s,!0)),qs(2*o)===qs(2*a)&&(e.y1=e.y2=Js(o,s,!0)),e):e}}function $s(e,t,n){if(t){var r=t.x,i=t.y,o=t.width,a=t.height;e.x=r,e.y=i,e.width=o,e.height=a;var s=n&&n.lineWidth;return s?(e.x=Js(r,s,!0),e.y=Js(i,s,!0),e.width=Math.max(Js(r+o,s,!1)-e.x,0===o?0:1),e.height=Math.max(Js(i+a,s,!1)-e.y,0===a?0:1),e):e}}function Js(e,t,n){if(!t)return e;var r=qs(2*e);return(r+qs(t))%2==0?r/2:(r+(n?1:-1))/2}var Qs=function(){this.x=0,this.y=0,this.width=0,this.height=0},el={},tl=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new Qs},t.prototype.buildPath=function(e,t){var n,r,i,o;if(this.subPixelOptimize){var a=$s(el,t,this.style);n=a.x,r=a.y,i=a.width,o=a.height,a.r=t.r,t=a}else n=t.x,r=t.y,i=t.width,o=t.height;t.r?function(e,t){var n,r,i,o,a,s=t.x,l=t.y,u=t.width,c=t.height,h=t.r;u<0&&(s+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof h?n=r=i=o=h:h instanceof Array?1===h.length?n=r=i=o=h[0]:2===h.length?(n=i=h[0],r=o=h[1]):3===h.length?(n=h[0],r=o=h[1],i=h[2]):(n=h[0],r=h[1],i=h[2],o=h[3]):n=r=i=o=0,n+r>u&&(n*=u/(a=n+r),r*=u/a),i+o>u&&(i*=u/(a=i+o),o*=u/a),r+i>c&&(r*=c/(a=r+i),i*=c/a),n+o>c&&(n*=c/(a=n+o),o*=c/a),e.moveTo(s+n,l),e.lineTo(s+u-r,l),0!==r&&e.arc(s+u-r,l+r,r,-Math.PI/2,0),e.lineTo(s+u,l+c-i),0!==i&&e.arc(s+u-i,l+c-i,i,0,Math.PI/2),e.lineTo(s+o,l+c),0!==o&&e.arc(s+o,l+c-o,o,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(e,t):e.rect(n,r,i,o)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Us);tl.prototype.type="rect";var nl={fill:"#000"},rl={style:V({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Va.style)},il=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=nl,n.attr(t),n}return l(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){var e;this._childCursor=0,hl(e=this.style),W(e.rich,hl),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new jt(0,0,0,0),t=this._children,n=[],r=null,i=0;i<t.length;i++){var o=t[i],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(e.copy(a),e.applyTransform(s),(r=r||e.clone()).union(e)):(r=r||a.clone()).union(a)}this._rect=r||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||nl},t.prototype.setTextContent=function(e){if("production"!==process.env.NODE_ENV)throw new Error("Can't attach text on another text")},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,r=e.rich||n&&{};return z(e,t),n&&r?(this._mergeRich(r,n),e.rich=r):r&&(e.rich=r),e},t.prototype._mergeRich=function(e,t){for(var n=q(t),r=0;r<n.length;r++){var i=n[r];e[i]=e[i]||{},z(e[i],t[i])}},t.prototype.getAnimationStyleProps=function(){return rl},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||f,n=e.padding,r=function(e,t){null!=e&&(e+="");var n,r=t.overflow,i=t.padding,o=t.font,a="truncate"===r,s=Li(o),l=de(t.lineHeight,s),u=!!t.backgroundColor,c="truncate"===t.lineOverflow,h=!1,d=t.width,p=(n=null==d||"break"!==r&&"breakAll"!==r?e?e.split("\n"):[]:e?Ra(e,t.font,d,"breakAll"===r,0).lines:[]).length*l,f=de(t.height,p);if(p>f&&c){var g=Math.floor(f/l);h=h||n.length>g,n=n.slice(0,g)}if(e&&a&&null!=d)for(var m=Ca(d,o,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),v={},y=0;y<n.length;y++)Da(v,n[y],m),n[y]=v.textLine,h=h||v.isTruncated;var _=f,x=0;for(y=0;y<n.length;y++)x=Math.max(Ci(n[y],o),x);null==d&&(d=x);var b=x;return i&&(_+=i[0]+i[2],b+=i[1]+i[3],d+=i[1]+i[3]),u&&(b=d),{lines:n,height:f,outerWidth:b,outerHeight:_,lineHeight:l,calculatedLineHeight:s,contentWidth:x,contentHeight:p,width:d,isTruncated:h}}(gl(e),e),i=ml(e),o=!!e.backgroundColor,a=r.outerHeight,s=r.outerWidth,l=r.contentWidth,u=r.lines,c=r.lineHeight,h=this._defaultStyle;this.isTruncated=!!r.isTruncated;var d=e.x||0,p=e.y||0,g=e.align||h.align||"left",m=e.verticalAlign||h.verticalAlign||"top",v=d,y=Ei(p,r.contentHeight,m);if(i||n){var _=Ii(d,s,g),x=Ei(p,a,m);i&&this._renderBackground(e,e,_,x,s,a)}y+=c/2,n&&(v=fl(d,g,n),"top"===m?y+=n[0]:"bottom"===m&&(y-=n[2]));for(var b=0,w=!1,S=(pl("fill"in e?e.fill:(w=!0,h.fill))),T=(dl("stroke"in e?e.stroke:o||h.autoStroke&&!w?null:(b=2,h.stroke))),M=e.textShadowBlur>0,C=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),D=r.calculatedLineHeight,A=0;A<u.length;A++){var I=this._getOrCreateChild(js),E=I.createStyle();I.useStyle(E),E.text=u[A],E.x=v,E.y=y,E.textAlign=g,E.textBaseline="middle",E.opacity=e.opacity,E.strokeFirst=!0,M&&(E.shadowBlur=e.textShadowBlur||0,E.shadowColor=e.textShadowColor||"transparent",E.shadowOffsetX=e.textShadowOffsetX||0,E.shadowOffsetY=e.textShadowOffsetY||0),E.stroke=T,E.fill=S,T&&(E.lineWidth=e.lineWidth||b,E.lineDash=e.lineDash,E.lineDashOffset=e.lineDashOffset||0),E.font=t,ul(E,e),y+=c,C&&I.setBoundingRect(new jt(Ii(E.x,l,E.textAlign),Ei(E.y,D,E.textBaseline),l,D))}},t.prototype._updateRichTexts=function(){var e=this.style,t=function(e,t){var n=new La;if(null!=e&&(e+=""),!e)return n;for(var r,i=t.width,o=t.height,a=t.overflow,s="break"!==a&&"breakAll"!==a||null==i?null:{width:i,accumWidth:0,breakAll:"breakAll"===a},l=Ta.lastIndex=0;null!=(r=Ta.exec(e));){var u=r.index;u>l&&Na(n,e.substring(l,u),t,s),Na(n,r[2],t,s,r[1]),l=Ta.lastIndex}l<e.length&&Na(n,e.substring(l,e.length),t,s);var c=[],h=0,d=0,p=t.padding,f="truncate"===a,g="truncate"===t.lineOverflow,m={};function v(e,t,n){e.width=t,e.lineHeight=n,h+=n,d=Math.max(d,t)}e:for(var y=0;y<n.lines.length;y++){for(var _=n.lines[y],x=0,b=0,w=0;w<_.tokens.length;w++){var S=(O=_.tokens[w]).styleName&&t.rich[O.styleName]||{},T=O.textPadding=S.padding,M=T?T[1]+T[3]:0,C=O.font=S.font||t.font;O.contentHeight=Li(C);var D=de(S.height,O.contentHeight);if(O.innerHeight=D,T&&(D+=T[0]+T[2]),O.height=D,O.lineHeight=pe(S.lineHeight,t.lineHeight,D),O.align=S&&S.align||t.align,O.verticalAlign=S&&S.verticalAlign||"middle",g&&null!=o&&h+O.lineHeight>o){var A=n.lines.length;w>0?(_.tokens=_.tokens.slice(0,w),v(_,b,x),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y),n.isTruncated=n.isTruncated||n.lines.length<A;break e}var I=S.width,E=null==I||"auto"===I;if("string"==typeof I&&"%"===I.charAt(I.length-1))O.percentWidth=I,c.push(O),O.contentWidth=Ci(O.text,C);else{if(E){var L=S.backgroundColor,N=L&&L.image;N&&Sa(N=xa(N))&&(O.width=Math.max(O.width,N.width*D/N.height))}var P=f&&null!=i?i-b:null;null!=P&&P<O.width?!E||P<M?(O.text="",O.width=O.contentWidth=0):(Ma(m,O.text,P-M,C,t.ellipsis,{minChar:t.truncateMinChar}),O.text=m.text,n.isTruncated=n.isTruncated||m.isTruncated,O.width=O.contentWidth=Ci(O.text,C)):O.contentWidth=Ci(O.text,C)}O.width+=M,b+=O.width,S&&(x=Math.max(x,O.lineHeight))}v(_,b,x)}for(n.outerWidth=n.width=de(i,d),n.outerHeight=n.height=de(o,h),n.contentHeight=h,n.contentWidth=d,p&&(n.outerWidth+=p[1]+p[3],n.outerHeight+=p[0]+p[2]),y=0;y<c.length;y++){var O,R=(O=c[y]).percentWidth;O.width=parseInt(R,10)/100*n.width}return n}(gl(e),e),n=t.width,r=t.outerWidth,i=t.outerHeight,o=e.padding,a=e.x||0,s=e.y||0,l=this._defaultStyle,u=e.align||l.align,c=e.verticalAlign||l.verticalAlign;this.isTruncated=!!t.isTruncated;var h=Ii(a,r,u),d=Ei(s,i,c),p=h,f=d;o&&(p+=o[3],f+=o[0]);var g=p+n;ml(e)&&this._renderBackground(e,e,h,d,r,i);for(var m=!!e.backgroundColor,v=0;v<t.lines.length;v++){for(var y=t.lines[v],_=y.tokens,x=_.length,b=y.lineHeight,w=y.width,S=0,T=p,M=g,C=x-1,D=void 0;S<x&&(!(D=_[S]).align||"left"===D.align);)this._placeToken(D,e,b,f,T,"left",m),w-=D.width,T+=D.width,S++;for(;C>=0&&"right"===(D=_[C]).align;)this._placeToken(D,e,b,f,M,"right",m),w-=D.width,M-=D.width,C--;for(T+=(n-(T-p)-(g-M)-w)/2;S<=C;)D=_[S],this._placeToken(D,e,b,f,T+D.width/2,"center",m),T+=D.width,S++;f+=b}},t.prototype._placeToken=function(e,t,n,r,i,o,a){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=r+n/2;"top"===l?u=r+e.height/2:"bottom"===l&&(u=r+n-e.height/2),!e.isLineHolder&&ml(s)&&this._renderBackground(s,t,"right"===o?i-e.width:"center"===o?i-e.width/2:i,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(i=fl(i,o,h),u-=e.height/2-h[0]-e.innerHeight/2);var d=this._getOrCreateChild(js),p=d.createStyle();d.useStyle(p);var g=this._defaultStyle,m=!1,v=0,y=pl("fill"in s?s.fill:"fill"in t?t.fill:(m=!0,g.fill)),_=dl("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||a||g.autoStroke&&!m?null:(v=2,g.stroke)),x=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=o,p.textBaseline="middle",p.font=e.font||f,p.opacity=pe(s.opacity,t.opacity,1),ul(p,s),_&&(p.lineWidth=pe(s.lineWidth,t.lineWidth,v),p.lineDash=de(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=_),y&&(p.fill=y);var b=e.contentWidth,w=e.contentHeight;d.setBoundingRect(new jt(Ii(p.x,b,p.textAlign),Ei(p.y,w,p.textBaseline),b,w))},t.prototype._renderBackground=function(e,t,n,r,i,o){var a,s,l,u=e.backgroundColor,c=e.borderWidth,h=e.borderColor,d=u&&u.image,p=u&&!d,f=e.borderRadius,g=this;if(p||e.lineHeight||c&&h){(a=this._getOrCreateChild(tl)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=r,m.width=i,m.height=o,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=de(e.fillOpacity,1);else if(d){(s=this._getOrCreateChild(Zs)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=r,v.width=i,v.height=o}c&&h&&((l=a.style).lineWidth=c,l.stroke=h,l.strokeOpacity=de(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(a||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=pe(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";return cl(e)&&(t=[e.fontStyle,e.fontWeight,ll(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),t&&ve(t)||e.textFont||e.font},t}(Ga),ol={left:!0,right:1,center:1},al={top:1,bottom:1,middle:1},sl=["fontStyle","fontWeight","fontSize","fontFamily"];function ll(e){return"string"!=typeof e||-1===e.indexOf("px")&&-1===e.indexOf("rem")&&-1===e.indexOf("em")?isNaN(+e)?"12px":e+"px":e}function ul(e,t){for(var n=0;n<sl.length;n++){var r=sl[n],i=t[r];null!=i&&(e[r]=i)}}function cl(e){return null!=e.fontSize||e.fontFamily||e.fontWeight}function hl(e){if(e){e.font=il.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||ol[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||al[n]?n:"top",e.padding&&(e.padding=ge(e.padding))}}function dl(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function pl(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function fl(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function gl(e){var t=e.text;return null!=t&&(t+=""),t}function ml(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}var vl=$o(),yl=function(e,t,n,r){if(r){var i=vl(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType="chart","group"===r.type&&r.traverse((function(r){var i=vl(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType="chart"}))}},_l=1,xl={},bl=$o(),wl=$o(),Sl=["emphasis","blur","select"],Tl=["normal","emphasis","blur","select"],Ml=10,Cl="highlight",Dl="downplay",Al="select",Il="unselect",El="toggleSelect";function Ll(e){return null!=e&&"none"!==e}function Nl(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function Pl(e){Nl(e,"emphasis",2)}function Ol(e){2===e.hoverState&&Nl(e,"normal",0)}function Rl(e){Nl(e,"blur",1)}function kl(e){1===e.hoverState&&Nl(e,"normal",0)}function zl(e){e.selected=!0}function Vl(e){e.selected=!1}function Bl(e,t,n){t(e,n)}function Fl(e,t,n){Bl(e,t,n),e.isGroup&&e.traverse((function(e){Bl(e,t,n)}))}function Gl(e,t){switch(t){case"emphasis":e.hoverState=2;break;case"normal":e.hoverState=0;break;case"blur":e.hoverState=1;break;case"select":e.selected=!0}}function Hl(e,t){var n=this.states[e];if(this.style){if("emphasis"===e)return function(e,t,n,r){var i=n&&F(n,"select")>=0,o=!1;if(e instanceof Us){var a=bl(e),s=i&&a.selectFill||a.normalFill,l=i&&a.selectStroke||a.normalStroke;if(Ll(s)||Ll(l)){var u=(r=r||{}).style||{};"inherit"===u.fill?(o=!0,r=z({},r),(u=z({},u)).fill=s):!Ll(u.fill)&&Ll(s)?(o=!0,r=z({},r),(u=z({},u)).fill=fr(s)):!Ll(u.stroke)&&Ll(l)&&(o||(r=z({},r),u=z({},u)),u.stroke=fr(l)),r.style=u}}if(r&&null==r.z2){o||(r=z({},r));var c=e.z2EmphasisLift;r.z2=e.z2+(null!=c?c:Ml)}return r}(this,0,t,n);if("blur"===e)return function(e,t,n){var r=F(e.currentStates,t)>=0,i=e.style.opacity,o=r?null:function(e,t,n,r){for(var i=e.style,o={},a=0;a<t.length;a++){var s=t[a],l=i[s];o[s]=null==l?r[s]:l}for(a=0;a<e.animators.length;a++){var u=e.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveTo(o,t)}return o}(e,["opacity"],t,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(n=z({},n),a=z({opacity:r?i:.1*o.opacity},a),n.style=a),n}(this,e,n);if("select"===e)return function(e,t,n){if(n&&null==n.z2){n=z({},n);var r=e.z2SelectLift;n.z2=e.z2+(null!=r?r:9)}return n}(this,0,n)}return n}function Ul(e){e.stateProxy=Hl;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Hl),n&&(n.stateProxy=Hl)}function Wl(e,t){!Jl(e,t)&&!e.__highByOuter&&Fl(e,Pl)}function jl(e,t){!Jl(e,t)&&!e.__highByOuter&&Fl(e,Ol)}function Xl(e,t){e.__highByOuter|=1<<(t||0),Fl(e,Pl)}function Yl(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Fl(e,Ol)}function Zl(e){Fl(e,Rl)}function ql(e){Fl(e,kl)}function Kl(e){Fl(e,zl)}function $l(e){Fl(e,Vl)}function Jl(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Ql(e){var t=e.getModel(),n=[],r=[];t.eachComponent((function(t,i){var o=wl(i),a="series"===t,s=a?e.getViewOfSeriesModel(i):e.getViewOfComponentModel(i);!a&&r.push(s),o.isBlured&&(s.group.traverse((function(e){kl(e)})),a&&n.push(i)),o.isBlured=!1})),W(r,(function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)}))}function eu(e,t,n,r){var i=r.getModel();function o(e,t){for(var n=0;n<t.length;n++){var r=e.getItemGraphicEl(t[n]);r&&ql(r)}}if(n=n||"coordinateSystem",null!=e&&t&&"none"!==t){var a=i.getSeriesByIndex(e),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];i.eachSeries((function(e){var i=a===e,u=e.coordinateSystem;if(u&&u.master&&(u=u.master),!("series"===n&&!i||"coordinateSystem"===n&&!(u&&s?u===s:i)||"series"===t&&i)){if(r.getViewOfSeriesModel(e).group.traverse((function(e){e.__highByOuter&&i&&"self"===t||Rl(e)})),U(t))o(e.getData(),t);else if(re(t))for(var c=q(t),h=0;h<c.length;h++)o(e.getData(c[h]),t[c[h]]);l.push(e),wl(e).isBlured=!0}})),i.eachComponent((function(e,t){if("series"!==e){var n=r.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,i)}}))}}function tu(e,t,n){if(null!=e&&null!=t){var r=n.getModel().getComponent(e,t);if(r){wl(r).isBlured=!0;var i=n.getViewOfComponentModel(r);i&&i.focusBlurEnabled&&i.group.traverse((function(e){Rl(e)}))}}}function nu(e,t,n,r){var i={focusSelf:!1,dispatchers:null};if(null==e||"series"===e||null==t||null==n)return i;var o=r.getModel().getComponent(e,t);if(!o)return i;var a=r.getViewOfComponentModel(o);if(!a||!a.findHighDownDispatchers)return i;for(var s,l=a.findHighDownDispatchers(n),u=0;u<l.length;u++)if("production"===process.env.NODE_ENV||du(l[u])||Io("param should be highDownDispatcher"),"self"===vl(l[u]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function ru(e){W(e.getAllData(),(function(t){var n=t.data,r=t.type;n.eachItemGraphicEl((function(t,n){e.isSelected(n,r)?Kl(t):$l(t)}))}))}function iu(e){var t=[];return e.eachSeries((function(e){W(e.getAllData(),(function(n){n.data;var r=n.type,i=e.getSelectedDataIndices();if(i.length>0){var o={dataIndex:i,seriesIndex:e.seriesIndex};null!=r&&(o.dataType=r),t.push(o)}}))})),t}function ou(e,t,n){hu(e,!0),Fl(e,Ul),su(e,t,n)}function au(e,t,n,r){r?function(e){hu(e,!1)}(e):ou(e,t,n)}function su(e,t,n){var r=vl(e);null!=t?(r.focus=t,r.blurScope=n):r.focus&&(r.focus=null)}var lu=["emphasis","blur","select"],uu={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function cu(e,t,n,r){n=n||"itemStyle";for(var i=0;i<lu.length;i++){var o=lu[i],a=t.getModel([o,n]);e.ensureState(o).style=r?r(a):a[uu[n]]()}}function hu(e,t){var n=!1===t,r=e;e.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=e.highDownSilentOnTouch),n&&!r.__highDownDispatcher||(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function du(e){return!(!e||!e.__highDownDispatcher)}function pu(e){var t=e.type;return t===Al||t===Il||t===El}function fu(e){var t=e.type;return t===Cl||t===Dl}var gu=Ss.CMD,mu=[[],[],[]],vu=Math.sqrt,yu=Math.atan2;function _u(e,t){if(t){var n,r,i,o,a,s,l=e.data,u=e.len(),c=gu.M,h=gu.C,d=gu.L,p=gu.R,f=gu.A,g=gu.Q;for(i=0,o=0;i<u;){switch(n=l[i++],o=i,r=0,n){case c:case d:r=1;break;case h:r=3;break;case g:r=2;break;case f:var m=t[4],v=t[5],y=vu(t[0]*t[0]+t[1]*t[1]),_=vu(t[2]*t[2]+t[3]*t[3]),x=yu(-t[1]/_,t[0]/y);l[i]*=y,l[i++]+=m,l[i]*=_,l[i++]+=v,l[i++]*=y,l[i++]*=_,l[i++]+=x,l[i++]+=x,o=i+=2;break;case p:s[0]=l[i++],s[1]=l[i++],Ke(s,s,t),l[o++]=s[0],l[o++]=s[1],s[0]+=l[i++],s[1]+=l[i++],Ke(s,s,t),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<r;a++){var b=mu[a];b[0]=l[i++],b[1]=l[i++],Ke(b,b,t),l[o++]=b[0],l[o++]=b[1]}}e.increaseVersion()}}var xu=Math.sqrt,bu=Math.sin,wu=Math.cos,Su=Math.PI;function Tu(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Mu(e,t){return(e[0]*t[0]+e[1]*t[1])/(Tu(e)*Tu(t))}function Cu(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Mu(e,t))}function Du(e,t,n,r,i,o,a,s,l,u,c){var h=l*(Su/180),d=wu(h)*(e-n)/2+bu(h)*(t-r)/2,p=-1*bu(h)*(e-n)/2+wu(h)*(t-r)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=xu(f),s*=xu(f));var g=(i===o?-1:1)*xu((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,v=g*-s*d/a,y=(e+n)/2+wu(h)*m-bu(h)*v,_=(t+r)/2+bu(h)*m+wu(h)*v,x=Cu([1,0],[(d-m)/a,(p-v)/s]),b=[(d-m)/a,(p-v)/s],w=[(-1*d-m)/a,(-1*p-v)/s],S=Cu(b,w);if(Mu(b,w)<=-1&&(S=Su),Mu(b,w)>=1&&(S=0),S<0){var T=Math.round(S/Su*1e6)/1e6;S=2*Su+T%2*Su}c.addData(u,y,_,a,s,x,S,h,o)}var Au=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Iu=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Eu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.applyTransform=function(e){},t}(Us);function Lu(e){return null!=e.setData}function Nu(e,t){var n=function(e){var t=new Ss;if(!e)return t;var n,r=0,i=0,o=r,a=i,s=Ss.CMD,l=e.match(Au);if(!l)return t;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),d=void 0,p=c.match(Iu)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=r,M=i,C=void 0,D=void 0;switch(h){case"l":r+=p[m++],i+=p[m++],d=s.L,t.addData(d,r,i);break;case"L":r=p[m++],i=p[m++],d=s.L,t.addData(d,r,i);break;case"m":r+=p[m++],i+=p[m++],d=s.M,t.addData(d,r,i),o=r,a=i,h="l";break;case"M":r=p[m++],i=p[m++],d=s.M,t.addData(d,r,i),o=r,a=i,h="L";break;case"h":r+=p[m++],d=s.L,t.addData(d,r,i);break;case"H":r=p[m++],d=s.L,t.addData(d,r,i);break;case"v":i+=p[m++],d=s.L,t.addData(d,r,i);break;case"V":i=p[m++],d=s.L,t.addData(d,r,i);break;case"C":d=s.C,t.addData(d,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),r=p[m-2],i=p[m-1];break;case"c":d=s.C,t.addData(d,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i),r+=p[m-2],i+=p[m-1];break;case"S":v=r,y=i,C=t.len(),D=t.data,n===s.C&&(v+=r-D[C-4],y+=i-D[C-3]),d=s.C,T=p[m++],M=p[m++],r=p[m++],i=p[m++],t.addData(d,v,y,T,M,r,i);break;case"s":v=r,y=i,C=t.len(),D=t.data,n===s.C&&(v+=r-D[C-4],y+=i-D[C-3]),d=s.C,T=r+p[m++],M=i+p[m++],r+=p[m++],i+=p[m++],t.addData(d,v,y,T,M,r,i);break;case"Q":T=p[m++],M=p[m++],r=p[m++],i=p[m++],d=s.Q,t.addData(d,T,M,r,i);break;case"q":T=p[m++]+r,M=p[m++]+i,r+=p[m++],i+=p[m++],d=s.Q,t.addData(d,T,M,r,i);break;case"T":v=r,y=i,C=t.len(),D=t.data,n===s.Q&&(v+=r-D[C-4],y+=i-D[C-3]),r=p[m++],i=p[m++],d=s.Q,t.addData(d,v,y,r,i);break;case"t":v=r,y=i,C=t.len(),D=t.data,n===s.Q&&(v+=r-D[C-4],y+=i-D[C-3]),r+=p[m++],i+=p[m++],d=s.Q,t.addData(d,v,y,r,i);break;case"A":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Du(T=r,M=i,r=p[m++],i=p[m++],w,S,_,x,b,d=s.A,t);break;case"a":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Du(T=r,M=i,r+=p[m++],i+=p[m++],w,S,_,x,b,d=s.A,t)}}"z"!==h&&"Z"!==h||(d=s.Z,t.addData(d),r=o,i=a),n=d}return t.toStatic(),t}(e),r=z({},t);return r.buildPath=function(e){if(Lu(e)){e.setData(n.data),(t=e.getContext())&&e.rebuildPath(t,1)}else{var t=e;n.rebuildPath(t,1)}},r.applyTransform=function(e){_u(n,e),this.dirtyShape()},r}function Pu(e,t){return new Eu(Nu(e,t))}function Ou(e,t){t=t||{};var n=new Us;return e.shape&&n.setShape(e.shape),n.setStyle(e.style),t.bakeTransform?_u(n.path,e.getComputedTransform()):t.toLocal?n.setLocalTransform(e.getComputedTransform()):n.copyTransform(e),n.buildPath=e.buildPath,n.applyTransform=n.applyTransform,n.z=e.z,n.z2=e.z2,n.zlevel=e.zlevel,n}var Ru=function(){this.cx=0,this.cy=0,this.r=0},ku=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new Ru},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)},t}(Us);ku.prototype.type="circle";var zu=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Vu=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new zu},t.prototype.buildPath=function(e,t){var n=.5522848,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=o*n,l=a*n;e.moveTo(r-o,i),e.bezierCurveTo(r-o,i-l,r-s,i-a,r,i-a),e.bezierCurveTo(r+s,i-a,r+o,i-l,r+o,i),e.bezierCurveTo(r+o,i+l,r+s,i+a,r,i+a),e.bezierCurveTo(r-s,i+a,r-o,i+l,r-o,i),e.closePath()},t}(Us);Vu.prototype.type="ellipse";var Bu=Math.PI,Fu=2*Bu,Gu=Math.sin,Hu=Math.cos,Uu=Math.acos,Wu=Math.atan2,ju=Math.abs,Xu=Math.sqrt,Yu=Math.max,Zu=Math.min,qu=1e-4;function Ku(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/Xu(s*s+l*l),c=u*l,h=-u*s,d=e+c,p=t+h,f=n+c,g=r+h,m=(d+f)/2,v=(p+g)/2,y=f-d,_=g-p,x=y*y+_*_,b=i-o,w=d*g-f*p,S=(_<0?-1:1)*Xu(Yu(0,b*b*x-w*w)),T=(w*_-y*S)/x,M=(-w*y-_*S)/x,C=(w*_+y*S)/x,D=(-w*y+_*S)/x,A=T-m,I=M-v,E=C-m,L=D-v;return A*A+I*I>E*E+L*L&&(T=C,M=D),{cx:T,cy:M,x0:-c,y0:-h,x1:T*(i/b-1),y1:M*(i/b-1)}}function $u(e,t){var n,r=Yu(t.r,0),i=Yu(t.r0||0,0),o=r>0;if(o||i>0){if(o||(r=i,i=0),i>r){var a=r;r=i,i=a}var s=t.startAngle,l=t.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=t.cx,c=t.cy,h=!!t.clockwise,d=ju(l-s),p=d>Fu&&d%Fu;if(p>qu&&(d=p),r>qu)if(d>Fu-qu)e.moveTo(u+r*Hu(s),c+r*Gu(s)),e.arc(u,c,r,s,l,!h),i>qu&&(e.moveTo(u+i*Hu(l),c+i*Gu(l)),e.arc(u,c,i,l,s,h));else{var f=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=void 0,M=void 0,C=void 0,D=void 0,A=void 0,I=void 0,E=r*Hu(s),L=r*Gu(s),N=i*Hu(l),P=i*Gu(l),O=d>qu;if(O){var R=t.cornerRadius;R&&(n=function(e){var t;if(J(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var k=ju(r-i)/2;if(y=Zu(k,m),_=Zu(k,v),x=Zu(k,f),b=Zu(k,g),T=w=Yu(y,_),M=S=Yu(x,b),(w>qu||S>qu)&&(C=r*Hu(l),D=r*Gu(l),A=i*Hu(s),I=i*Gu(s),d<Bu)){var z=function(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=h*l-c*u;if(!(d*d<qu))return[e+(d=(c*(t-o)-h*(e-i))/d)*l,t+d*u]}(E,L,A,I,C,D,N,P);if(z){var V=E-z[0],B=L-z[1],F=C-z[0],G=D-z[1],H=1/Gu(Uu((V*F+B*G)/(Xu(V*V+B*B)*Xu(F*F+G*G)))/2),U=Xu(z[0]*z[0]+z[1]*z[1]);T=Zu(w,(r-U)/(H+1)),M=Zu(S,(i-U)/(H-1))}}}if(O)if(T>qu){var W=Zu(m,T),j=Zu(v,T),X=Ku(A,I,E,L,r,W,h),Y=Ku(C,D,N,P,r,j,h);e.moveTo(u+X.cx+X.x0,c+X.cy+X.y0),T<w&&W===j?e.arc(u+X.cx,c+X.cy,T,Wu(X.y0,X.x0),Wu(Y.y0,Y.x0),!h):(W>0&&e.arc(u+X.cx,c+X.cy,W,Wu(X.y0,X.x0),Wu(X.y1,X.x1),!h),e.arc(u,c,r,Wu(X.cy+X.y1,X.cx+X.x1),Wu(Y.cy+Y.y1,Y.cx+Y.x1),!h),j>0&&e.arc(u+Y.cx,c+Y.cy,j,Wu(Y.y1,Y.x1),Wu(Y.y0,Y.x0),!h))}else e.moveTo(u+E,c+L),e.arc(u,c,r,s,l,!h);else e.moveTo(u+E,c+L);if(i>qu&&O)if(M>qu){W=Zu(f,M),X=Ku(N,P,C,D,i,-(j=Zu(g,M)),h),Y=Ku(E,L,A,I,i,-W,h);e.lineTo(u+X.cx+X.x0,c+X.cy+X.y0),M<S&&W===j?e.arc(u+X.cx,c+X.cy,M,Wu(X.y0,X.x0),Wu(Y.y0,Y.x0),!h):(j>0&&e.arc(u+X.cx,c+X.cy,j,Wu(X.y0,X.x0),Wu(X.y1,X.x1),!h),e.arc(u,c,i,Wu(X.cy+X.y1,X.cx+X.x1),Wu(Y.cy+Y.y1,Y.cx+Y.x1),h),W>0&&e.arc(u+Y.cx,c+Y.cy,W,Wu(Y.y1,Y.x1),Wu(Y.y0,Y.x0),!h))}else e.lineTo(u+N,c+P),e.arc(u,c,i,l,s,h);else e.lineTo(u+N,c+P)}else e.moveTo(u,c);e.closePath()}}}var Ju=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Qu=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new Ju},t.prototype.buildPath=function(e,t){$u(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Us);Qu.prototype.type="sector";var ec=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},tc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new ec},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=2*Math.PI;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(Us);function nc(e,t,n){var r=t.smooth,i=t.points;if(i&&i.length>=2){if(r){var o=function(e,t,n,r){var i,o,a,s,l=[],u=[],c=[],h=[];if(r){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=e.length;d<p;d++)$e(a,a,e[d]),Je(s,s,e[d]);$e(a,a,r[0]),Je(s,s,r[1])}for(d=0,p=e.length;d<p;d++){var f=e[d];if(n)i=e[d?d-1:p-1],o=e[(d+1)%p];else{if(0===d||d===p-1){l.push(Oe(e[d]));continue}i=e[d-1],o=e[d+1]}Ve(u,o,i),Ue(u,u,t);var g=je(f,i),m=je(f,o),v=g+m;0!==v&&(g/=v,m/=v),Ue(c,u,-g),Ue(h,u,m);var y=ke([],f,c),_=ke([],f,h);r&&(Je(y,y,a),$e(y,y,s),Je(_,_,a),$e(_,_,s)),l.push(y),l.push(_)}return n&&l.push(l.shift()),l}(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var a=i.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=i[(s+1)%a];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);s=1;for(var h=i.length;s<h;s++)e.lineTo(i[s][0],i[s][1])}n&&e.closePath()}}tc.prototype.type="ring";var rc=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ic=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new rc},t.prototype.buildPath=function(e,t){nc(e,t,!0)},t}(Us);ic.prototype.type="polygon";var oc=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ac=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new oc},t.prototype.buildPath=function(e,t){nc(e,t,!1)},t}(Us);ac.prototype.type="polyline";var sc={},lc=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},uc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new lc},t.prototype.buildPath=function(e,t){var n,r,i,o;if(this.subPixelOptimize){var a=Ks(sc,t,this.style);n=a.x1,r=a.y1,i=a.x2,o=a.y2}else n=t.x1,r=t.y1,i=t.x2,o=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,o=r*(1-s)+o*s),e.lineTo(i,o))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(Us);uc.prototype.type="line";var cc=[],hc=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function dc(e,t,n){var r=e.cpx2,i=e.cpy2;return null!=r||null!=i?[(n?Cn:Mn)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?Cn:Mn)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?Pn:Nn)(e.x1,e.cpx1,e.x2,t),(n?Pn:Nn)(e.y1,e.cpy1,e.y2,t)]}var pc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new hc},t.prototype.buildPath=function(e,t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2,a=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,r),null==l||null==u?(c<1&&(Rn(n,a,i,c,cc),a=cc[1],i=cc[2],Rn(r,s,o,c,cc),s=cc[1],o=cc[2]),e.quadraticCurveTo(a,s,i,o)):(c<1&&(In(n,a,l,i,c,cc),a=cc[1],l=cc[2],i=cc[3],In(r,s,u,o,c,cc),s=cc[1],u=cc[2],o=cc[3]),e.bezierCurveTo(a,s,l,u,i,o)))},t.prototype.pointAt=function(e){return dc(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=dc(this.shape,e,!0);return We(t,t)},t}(Us);pc.prototype.type="bezier-curve";var fc=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},gc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new fc},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r,0),o=t.startAngle,a=t.endAngle,s=t.clockwise,l=Math.cos(o),u=Math.sin(o);e.moveTo(l*i+n,u*i+r),e.arc(n,r,i,o,a,!s)},t}(Us);gc.prototype.type="arc";var mc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return l(t,e),t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t=t||e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],r=0;r<n.length;r++)n[r].buildPath(e,n[r].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Us.prototype.getBoundingRect.call(this)},t}(Us),vc=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),yc=function(e){function t(t,n,r,i,o,a){var s=e.call(this,o)||this;return s.x=null==t?0:t,s.y=null==n?0:n,s.x2=null==r?1:r,s.y2=null==i?0:i,s.type="linear",s.global=a||!1,s}return l(t,e),t}(vc),_c=function(e){function t(t,n,r,i,o){var a=e.call(this,i)||this;return a.x=null==t?.5:t,a.y=null==n?.5:n,a.r=null==r?.5:r,a.type="radial",a.global=o||!1,a}return l(t,e),t}(vc),xc=[0,0],bc=[0,0],wc=new kt,Sc=new kt,Tc=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new kt;for(n=0;n<2;n++)this._axes[n]=new kt;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,r=this._axes,i=e.x,o=e.y,a=i+e.width,s=o+e.height;if(n[0].set(i,o),n[1].set(a,o),n[2].set(a,s),n[3].set(i,s),t)for(var l=0;l<4;l++)n[l].transform(t);kt.sub(r[0],n[1],n[0]),kt.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(l=0;l<2;l++)this._origin[l]=r[l].dot(n[0])},e.prototype.intersect=function(e,t){var n=!0,r=!t;return wc.set(1/0,1/0),Sc.set(0,0),!this._intersectCheckOneSide(this,e,wc,Sc,r,1)&&(n=!1,r)||!this._intersectCheckOneSide(e,this,wc,Sc,r,-1)&&(n=!1,r)||r||kt.copy(t,n?wc:Sc),n},e.prototype._intersectCheckOneSide=function(e,t,n,r,i,o){for(var a=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,e._corners,xc),this._getProjMinMaxOnAxis(s,t._corners,bc),xc[1]<bc[0]||xc[0]>bc[1]){if(a=!1,i)return a;var u=Math.abs(bc[0]-xc[1]),c=Math.abs(xc[0]-bc[1]);Math.min(u,c)>r.len()&&(u<c?kt.scale(r,l,-u*o):kt.scale(r,l,c*o))}else if(n){u=Math.abs(bc[0]-xc[1]),c=Math.abs(xc[0]-bc[1]);Math.min(u,c)<n.len()&&(u<c?kt.scale(n,l,u*o):kt.scale(n,l,-c*o))}}return a},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,o=t[0].dot(r)+i[e],a=o,s=o,l=1;l<t.length;l++){var u=t[l].dot(r)+i[e];a=Math.min(u,a),s=Math.max(u,s)}n[0]=a,n[1]=s},e}(),Mc=[],Cc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return l(t,e),t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t=t||!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){(t=this._displayables[e]).parent=this,t.update(),t.parent=null}for(e=0;e<this._temporaryDisplayables.length;e++){var t;(t=this._temporaryDisplayables[e]).parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new jt(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(Mc)),e.union(r)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1]))for(var r=0;r<this._displayables.length;r++){if(this._displayables[r].contain(e,t))return!0}return!1},t}(Ga),Dc=$o();function Ac(e,t,n,r,i){var o;if(t&&t.ecModel){var a=t.ecModel.getUpdatePayload();o=a&&a.animation}var s="update"===e;if(t&&t.isAnimationEnabled()){var l=void 0,u=void 0,c=void 0;return r?(l=de(r.duration,200),u=de(r.easing,"cubicOut"),c=0):(l=t.getShallow(s?"animationDurationUpdate":"animationDuration"),u=t.getShallow(s?"animationEasingUpdate":"animationEasing"),c=t.getShallow(s?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(u=o.easing),null!=o.delay&&(c=o.delay)),Q(c)&&(c=c(n,i)),Q(l)&&(l=l(n)),{duration:l||0,delay:c,easing:u}}return null}function Ic(e,t,n,r,i,o,a){var s,l=!1;Q(i)?(a=o,o=i,i=null):re(i)&&(o=i.cb,a=i.during,l=i.isFrom,s=i.removeOpt,i=i.dataIndex);var u="leave"===e;u||t.stopAnimation("leave");var c=Ac(e,r,i,u?s||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(t,i):null);if(c&&c.duration>0){var h={duration:c.duration,delay:c.delay||0,easing:c.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:e,during:a};l?t.animateFrom(n,h):t.animateTo(n,h)}else t.stopAnimation(),!l&&t.attr(n),a&&a(1),o&&o()}function Ec(e,t,n,r,i,o){Ic("update",e,t,n,r,i,o)}function Lc(e,t,n,r,i,o){Ic("enter",e,t,n,r,i,o)}function Nc(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++){if("leave"===e.animators[t].scope)return!0}return!1}function Pc(e,t,n,r,i,o){Nc(e)||Ic("leave",e,t,n,r,i,o)}function Oc(e,t,n,r){e.removeTextContent(),e.removeTextGuideLine(),Pc(e,{style:{opacity:0}},t,n,r)}function Rc(e,t,n){function r(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse((function(e){e.isGroup||Oc(e,t,n,r)})):Oc(e,t,n,r)}function kc(e){Dc(e).oldStyle=e.style}var zc=Math.max,Vc=Math.min,Bc={};function Fc(e){return Us.extend(e)}var Gc=function(e,t){var n=Nu(e,t);return function(e){function t(t){var r=e.call(this,t)||this;return r.applyTransform=n.applyTransform,r.buildPath=n.buildPath,r}return l(t,e),t}(Eu)};function Hc(e,t){return Gc(e,t)}function Uc(e,t){Bc[e]=t}function Wc(e){if(Bc.hasOwnProperty(e))return Bc[e]}function jc(e,t,n,r){var i=Pu(e,t);return n&&("center"===r&&(n=Yc(n,i.getBoundingRect())),qc(i,n)),i}function Xc(e,t,n){var r=new Zs({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===n){var i={width:e.width,height:e.height};r.setStyle(Yc(t,i))}}});return r}function Yc(e,t){var n,r=t.width/t.height,i=e.height*r;return n=i<=e.width?e.height:(i=e.width)/r,{x:e.x+e.width/2-i/2,y:e.y+e.height/2-n/2,width:i,height:n}}var Zc=function(e,t){for(var n=[],r=e.length,i=0;i<r;i++){var o=e[i];n.push(o.getUpdatedPathProxy(!0))}var a=new Us(t);return a.createPathProxy(),a.buildPath=function(e){if(Lu(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},a};function qc(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function Kc(e,t){return Ks(e,e,{lineWidth:t}),e}var $c=Js;function Jc(e,t){for(var n=Dt([]);e&&e!==t;)It(n,e.getLocalTransform(),n),e=e.parent;return n}function Qc(e,t,n){return t&&!U(t)&&(t=wi.getLocalTransform(t)),n&&(t=Pt([],t)),Ke([],e,t)}function eh(e,t,n){var r=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),i=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),o=["left"===e?-r:"right"===e?r:0,"top"===e?-i:"bottom"===e?i:0];return o=Qc(o,t,n),Math.abs(o[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function th(e){return!e.isGroup}function nh(e,t,n){if(e&&t){var r=function(e){var t={};return e.traverse((function(e){th(e)&&e.anid&&(t[e.anid]=e)})),t}(e);t.traverse((function(e){if(th(e)&&e.anid){var t=r[e.anid];if(t){var o=i(e);e.attr(i(t)),Ec(e,o,n,vl(e).dataIndex)}}}))}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return function(e){return null!=e.shape}(e)&&(t.shape=z({},e.shape)),t}}function rh(e,t){return j(e,(function(e){var n=e[0];n=zc(n,t.x),n=Vc(n,t.x+t.width);var r=e[1];return r=zc(r,t.y),[n,r=Vc(r,t.y+t.height)]}))}function ih(e,t){var n=zc(e.x,t.x),r=Vc(e.x+e.width,t.x+t.width),i=zc(e.y,t.y),o=Vc(e.y+e.height,t.y+t.height);if(r>=n&&o>=i)return{x:n,y:i,width:r-n,height:o-i}}function oh(e,t,n){var r=z({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(i.image=e.slice(8),V(i,n),new Zs(r)):jc(e.replace("path://",""),r,n,"center")}function ah(e,t,n,r,i){for(var o=0,a=i[i.length-1];o<i.length;o++){var s=i[o];if(sh(e,t,n,r,s[0],s[1],a[0],a[1]))return!0;a=s}}function sh(e,t,n,r,i,o,a,s){var l,u=n-e,c=r-t,h=a-i,d=s-o,p=lh(h,d,u,c);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-i,g=t-o,m=lh(f,g,u,c)/p;if(m<0||m>1)return!1;var v=lh(f,g,h,d)/p;return!(v<0||v>1)}function lh(e,t,n,r){return e*r-n*t}function uh(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=ee(t)?{formatter:t}:t,o=n.mainType,a=n.componentIndex,s={componentType:o,name:r,$vars:["name"]};s[o+"Index"]=a;var l=e.formatterParamsExtra;l&&W(q(l),(function(e){Ae(s,e)||(s[e]=l[e],s.$vars.push(e))}));var u=vl(e.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:r,option:V({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function ch(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function hh(e,t){if(e)if(J(e))for(var n=0;n<e.length;n++)ch(e[n],t);else ch(e,t)}Uc("circle",ku),Uc("ellipse",Vu),Uc("sector",Qu),Uc("ring",tc),Uc("polygon",ic),Uc("polyline",ac),Uc("rect",tl),Uc("line",uc),Uc("bezierCurve",pc),Uc("arc",gc);var dh=Object.freeze({__proto__:null,Arc:gc,BezierCurve:pc,BoundingRect:jt,Circle:ku,CompoundPath:mc,Ellipse:Vu,Group:Wi,Image:Zs,IncrementalDisplayable:Cc,Line:uc,LinearGradient:yc,OrientedBoundingRect:Tc,Path:Us,Point:kt,Polygon:ic,Polyline:ac,RadialGradient:_c,Rect:tl,Ring:tc,Sector:Qu,Text:il,applyTransform:Qc,clipPointsByRect:rh,clipRectByRect:ih,createIcon:oh,extendPath:Hc,extendShape:Fc,getShapeClass:Wc,getTransform:Jc,groupTransition:nh,initProps:Lc,isElementRemoved:Nc,lineLineIntersect:sh,linePolygonIntersect:ah,makeImage:Xc,makePath:jc,mergePath:Zc,registerShape:Uc,removeElement:Pc,removeElementWithFadeOut:Rc,resizePath:qc,setTooltipConfig:uh,subPixelOptimize:$c,subPixelOptimizeLine:Kc,subPixelOptimizeRect:function(e){return $s(e.shape,e.shape,e.style),e},transformDirection:eh,traverseElements:hh,updateProps:Ec}),ph={};function fh(e,t){for(var n=0;n<Sl.length;n++){var r=Sl[n],i=t[r],o=e.ensureState(r);o.style=o.style||{},o.style.text=i}var a=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(a,!0)}function gh(e,t,n){var r,i=e.labelFetcher,o=e.labelDataIndex,a=e.labelDimIndex,s=t.normal;i&&(r=i.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==r&&(r=Q(e.defaultText)?e.defaultText(o,e,n):e.defaultText);for(var l={normal:r},u=0;u<Sl.length;u++){var c=Sl[u],h=t[c];l[c]=de(i?i.getFormattedLabel(o,c,null,a,h&&h.get("formatter")):null,r)}return l}function mh(e,t,n,r){n=n||ph;for(var i=e instanceof il,o=!1,a=0;a<Tl.length;a++){if((d=t[Tl[a]])&&d.getShallow("show")){o=!0;break}}var s=i?e:e.getTextContent();if(o){i||(s||(s=new il,e.setTextContent(s)),e.stateProxy&&(s.stateProxy=e.stateProxy));var l=gh(n,t),u=t.normal,c=!!u.getShallow("show"),h=yh(u,r&&r.normal,n,!1,!i);h.text=l.normal,i||e.setTextConfig(_h(u,n,!1));for(a=0;a<Sl.length;a++){var d,p=Sl[a];if(d=t[p]){var f=s.ensureState(p),g=!!de(d.getShallow("show"),c);if(g!==c&&(f.ignore=!g),f.style=yh(d,r&&r[p],n,!0,!i),f.style.text=l[p],!i)e.ensureState(p).textConfig=_h(d,n,!0)}}s.silent=!!u.getShallow("silent"),null!=s.style.x&&(h.x=s.style.x),null!=s.style.y&&(h.y=s.style.y),s.ignore=!c,s.useStyle(h),s.dirty(),n.enableTextSetter&&(Mh(s).setLabelText=function(e){var r=gh(n,t,e);fh(s,r)})}else s&&(s.ignore=!0);e.dirty()}function vh(e,t){t=t||"label";for(var n={normal:e.getModel(t)},r=0;r<Sl.length;r++){var i=Sl[r];n[i]=e.getModel([i,t])}return n}function yh(e,t,n,r,i){var o={};return function(e,t,n,r,i){n=n||ph;var o,a=t.ecModel,s=a&&a.option.textStyle,l=function(e){var t;for(;e&&e!==e.ecModel;){var n=(e.option||ph).rich;if(n){t=t||{};for(var r=q(n),i=0;i<r.length;i++){t[r[i]]=1}}e=e.parentModel}return t}(t);if(l)for(var u in o={},l)if(l.hasOwnProperty(u)){var c=t.getModel(["rich",u]);Sh(o[u]={},c,s,n,r,i,!1,!0)}o&&(e.rich=o);var h=t.get("overflow");h&&(e.overflow=h);var d=t.get("minMargin");null!=d&&(e.margin=d);Sh(e,t,s,n,r,i,!0,!1)}(o,e,n,r,i),t&&z(o,t),o}function _h(e,t,n){t=t||{};var r,i={},o=e.getShallow("rotate"),a=de(e.getShallow("distance"),n?null:5),s=e.getShallow("offset");return"outside"===(r=e.getShallow("position")||(n?null:"inside"))&&(r=t.defaultOutsidePosition||"top"),null!=r&&(i.position=r),null!=s&&(i.offset=s),null!=o&&(o*=Math.PI/180,i.rotation=o),null!=a&&(i.distance=a),i.outsideFill="inherit"===e.get("color")?t.inheritColor||null:"auto",i}var xh=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],bh=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],wh=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Sh(e,t,n,r,i,o,a,s){n=!i&&n||ph;var l=r&&r.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=de(t.getShallow("opacity"),n.opacity);"inherit"!==u&&"auto"!==u||("production"!==process.env.NODE_ENV&&"auto"===u&&Lo("color: 'auto'","color: 'inherit'"),u=l||null),"inherit"!==c&&"auto"!==c||("production"!==process.env.NODE_ENV&&"auto"===c&&Lo("color: 'auto'","color: 'inherit'"),c=l||null),o||(u=u||n.color,c=c||n.textBorderColor),null!=u&&(e.fill=u),null!=c&&(e.stroke=c);var d=de(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(e.lineWidth=d);var p=de(t.getShallow("textBorderType"),n.textBorderType);null!=p&&(e.lineDash=p);var f=de(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(e.lineDashOffset=f),i||null!=h||s||(h=r&&r.defaultOpacity),null!=h&&(e.opacity=h),i||o||null==e.fill&&r.inheritColor&&(e.fill=r.inheritColor);for(var g=0;g<xh.length;g++){var m=xh[g];null!=(y=de(t.getShallow(m),n[m]))&&(e[m]=y)}for(g=0;g<bh.length;g++){m=bh[g];null!=(y=t.getShallow(m))&&(e[m]=y)}if(null==e.verticalAlign){var v=t.getShallow("baseline");null!=v&&(e.verticalAlign=v)}if(!a||!r.disableBox){for(g=0;g<wh.length;g++){var y;m=wh[g];null!=(y=t.getShallow(m))&&(e[m]=y)}var _=t.getShallow("borderType");null!=_&&(e.borderDash=_),"auto"!==e.backgroundColor&&"inherit"!==e.backgroundColor||!l||("production"!==process.env.NODE_ENV&&"auto"===e.backgroundColor&&Lo("backgroundColor: 'auto'","backgroundColor: 'inherit'"),e.backgroundColor=l),"auto"!==e.borderColor&&"inherit"!==e.borderColor||!l||("production"!==process.env.NODE_ENV&&"auto"===e.borderColor&&Lo("borderColor: 'auto'","borderColor: 'inherit'"),e.borderColor=l)}}function Th(e,t){var n=t&&t.getModel("textStyle");return ve([e.fontStyle||n&&n.getShallow("fontStyle")||"",e.fontWeight||n&&n.getShallow("fontWeight")||"",(e.fontSize||n&&n.getShallow("fontSize")||12)+"px",e.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var Mh=$o();function Ch(e,t,n,r){if(e){var i=Mh(e);i.prevValue=i.value,i.value=n;var o=t.normal;i.valueAnimation=o.get("valueAnimation"),i.valueAnimation&&(i.precision=o.get("precision"),i.defaultInterpolatedText=r,i.statesModels=t)}}function Dh(e,t,n,r,i){var o=Mh(e);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=de(o.interpolatedValue,o.prevValue),l=o.value;e.percent=0,(null==o.prevValue?Lc:Ec)(e,{percent:1},r,t,null,(function(r){var u=aa(n,o.precision,s,l,r);o.interpolatedValue=1===r?null:u;var c=gh({labelDataIndex:t,labelFetcher:i,defaultText:a?a(u):u+""},o.statesModels,u);fh(e,c)}))}}var Ah,Ih,Eh=["textStyle","color"],Lh=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Nh=new il,Ph=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(Eh):null)},e.prototype.getFont=function(){return Th({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<Lh.length;n++)t[Lh[n]]=this.getShallow(Lh[n]);return Nh.useStyle(t),Nh.update(),Nh.getBoundingRect()},e}(),Oh=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],Rh=ma(Oh),kh=function(){function e(){}return e.prototype.getLineStyle=function(e){return Rh(this,e)},e}(),zh=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],Vh=ma(zh),Bh=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return Vh(this,e,t)},e}(),Fh=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){},e.prototype.mergeOption=function(e,t){R(this.option,e,!0)},e.prototype.get=function(e,t){return null==e?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,r=null==n?n:n[e];if(null==r&&!t){var i=this.parentModel;i&&(r=i.getShallow(e))}return r},e.prototype.getModel=function(t,n){var r=null!=t,i=r?this.parsePath(t):null;return new e(r?this._doGet(i):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),this.ecModel)},e.prototype.isEmpty=function(){return null==this.option},e.prototype.restoreData=function(){},e.prototype.clone=function(){return new(0,this.constructor)(O(this.option))},e.prototype.parsePath=function(e){return"string"==typeof e?e.split("."):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!d.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var r=0;r<e.length&&(!e[r]||null!=(n=n&&"object"==typeof n?n[e[r]]:null));r++);return null==n&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();ca(Fh),Ah=Fh,Ih=["__\0is_clz",da++].join("_"),Ah.prototype[Ih]=!0,"production"!==process.env.NODE_ENV&&me(!Ah.isInstance,'The method "is" can not be defined.'),Ah.isInstance=function(e){return!(!e||!e[Ih])},H(Fh,kh),H(Fh,Bh),H(Fh,ya),H(Fh,Ph);var Gh=Math.round(10*Math.random());function Hh(e){return[e||"",Gh++].join("_")}function Uh(e,t){return R(R({},e,!0),t,!0)}var Wh="ZH",jh="EN",Xh=jh,Yh={},Zh={},qh=d.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||Xh).toUpperCase().indexOf(Wh)>-1?Wh:Xh;function Kh(e,t){e=e.toUpperCase(),Zh[e]=new Fh(t),Yh[e]=t}function $h(e){return Zh[e]}Kh(jh,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Kh(Wh,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Jh=1e3,Qh=6e4,ed=36e5,td=864e5,nd=31536e6,rd={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},id="{yyyy}-{MM}-{dd}",od={year:"{yyyy}",month:"{yyyy}-{MM}",day:id,hour:id+" "+rd.hour,minute:id+" "+rd.minute,second:id+" "+rd.second,millisecond:rd.none},ad=["year","month","day","hour","minute","second","millisecond"],sd=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function ld(e,t){return"0000".substr(0,t-(e+="").length)+e}function ud(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function cd(e){return e===ud(e)}function hd(e,t,n,r){var i=fo(e),o=i[fd(n)](),a=i[gd(n)]()+1,s=Math.floor((a-1)/3)+1,l=i[md(n)](),u=i["get"+(n?"UTC":"")+"Day"](),c=i[vd(n)](),h=(c-1)%12+1,d=i[yd(n)](),p=i[_d(n)](),f=i[xd(n)](),g=c>=12?"pm":"am",m=g.toUpperCase(),v=(r instanceof Fh?r:$h(r||qh)||Zh[Xh]).getModel("time"),y=v.get("month"),_=v.get("monthAbbr"),x=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,ld(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,_[a-1]).replace(/{MM}/g,ld(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,ld(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,ld(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,ld(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,ld(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,ld(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,ld(f,3)).replace(/{S}/g,f+"")}function dd(e,t){var n=fo(e),r=n[gd(t)]()+1,i=n[md(t)](),o=n[vd(t)](),a=n[yd(t)](),s=n[_d(t)](),l=0===n[xd(t)](),u=l&&0===s,c=u&&0===a,h=c&&0===o,d=h&&1===i;return d&&1===r?"year":d?"month":h?"day":c?"hour":u?"minute":l?"second":"millisecond"}function pd(e,t,n){var r=ne(e)?fo(e):e;switch(t=t||dd(e,n)){case"year":return r[fd(n)]();case"half-year":return r[gd(n)]()>=6?1:0;case"quarter":return Math.floor((r[gd(n)]()+1)/4);case"month":return r[gd(n)]();case"day":return r[md(n)]();case"half-day":return r[vd(n)]()/24;case"hour":return r[vd(n)]();case"minute":return r[yd(n)]();case"second":return r[_d(n)]();case"millisecond":return r[xd(n)]()}}function fd(e){return e?"getUTCFullYear":"getFullYear"}function gd(e){return e?"getUTCMonth":"getMonth"}function md(e){return e?"getUTCDate":"getDate"}function vd(e){return e?"getUTCHours":"getHours"}function yd(e){return e?"getUTCMinutes":"getMinutes"}function _d(e){return e?"getUTCSeconds":"getSeconds"}function xd(e){return e?"getUTCMilliseconds":"getMilliseconds"}function bd(e){return e?"setUTCFullYear":"setFullYear"}function wd(e){return e?"setUTCMonth":"setMonth"}function Sd(e){return e?"setUTCDate":"setDate"}function Td(e){return e?"setUTCHours":"setHours"}function Md(e){return e?"setUTCMinutes":"setMinutes"}function Cd(e){return e?"setUTCSeconds":"setSeconds"}function Dd(e){return e?"setUTCMilliseconds":"setMilliseconds"}function Ad(e){if(!bo(e))return ee(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Id(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var Ed=ge;function Ld(e,t,n){function r(e){return e&&ve(e)?e:"-"}function i(e){return!(null==e||isNaN(e)||!isFinite(e))}var o="time"===t,a=e instanceof Date;if(o||a){var s=o?fo(e):e;if(!isNaN(+s))return hd(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===t)return te(e)?r(e):ne(e)&&i(e)?e+"":"-";var l=xo(e);return i(l)?Ad(l):te(e)?r(e):"boolean"==typeof e?e+"":"-"}var Nd=["a","b","c","d","e","f","g"],Pd=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Od(e,t,n){J(t)||(t=[t]);var r=t.length;if(!r)return"";for(var i=t[0].$vars||[],o=0;o<i.length;o++){var a=Nd[o];e=e.replace(Pd(a),Pd(a,0))}for(var s=0;s<r;s++)for(var l=0;l<i.length;l++){var u=t[s][i[l]];e=e.replace(Pd(Nd[l],s),n?dt(u):u)}return e}function Rd(e,t){var n=ee(e)?{color:e,extraCssText:t}:e||{},r=n.color,i=n.type;t=n.extraCssText;var o=n.renderMode||"html";return r?"html"===o?"subItem"===i?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+dt(r)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+dt(r)+";"+(t||"")+'"></span>':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:""}function kd(e,t,n){"production"!==process.env.NODE_ENV&&Lo("echarts.format.formatTime","echarts.time.format"),"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var r=fo(t),i=n?"getUTC":"get",o=r[i+"FullYear"](),a=r[i+"Month"]()+1,s=r[i+"Date"](),l=r[i+"Hours"](),u=r[i+"Minutes"](),c=r[i+"Seconds"](),h=r[i+"Milliseconds"]();return e=e.replace("MM",ld(a,2)).replace("M",a).replace("yyyy",o).replace("yy",ld(o%100+"",2)).replace("dd",ld(s,2)).replace("d",s).replace("hh",ld(l,2)).replace("h",l).replace("mm",ld(u,2)).replace("m",u).replace("ss",ld(c,2)).replace("s",c).replace("SSS",ld(h,3))}function zd(e,t){return t=t||"transparent",ee(e)?e:re(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function Vd(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var Bd=W,Fd=["left","right","top","bottom","width","height"],Gd=[["width","left","right"],["height","top","bottom"]];function Hd(e,t,n,r,i){var o=0,a=0;null==r&&(r=1/0),null==i&&(i=1/0);var s=0;t.eachChild((function(l,u){var c,h,d=l.getBoundingRect(),p=t.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===e){var g=d.width+(f?-f.x+d.x:0);(c=o+g)>r||l.newline?(o=0,c=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(h=a+m)>i||l.newline?(o+=s+n,a=0,h=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===e?o=c+n:a=h+n)}))}var Ud=Hd;function Wd(e,t,n){n=Ed(n||0);var r=t.width,i=t.height,o=to(e.left,r),a=to(e.top,i),s=to(e.right,r),l=to(e.bottom,i),u=to(e.width,r),c=to(e.height,i),h=n[2]+n[0],d=n[1]+n[3],p=e.aspect;switch(isNaN(u)&&(u=r-s-d-o),isNaN(c)&&(c=i-l-h-a),null!=p&&(isNaN(u)&&isNaN(c)&&(p>r/i?u=.8*r:c=.8*i),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(o)&&(o=r-s-u-d),isNaN(a)&&(a=i-l-c-h),e.left||e.right){case"center":o=r/2-u/2-n[3];break;case"right":o=r-u-d}switch(e.top||e.bottom){case"middle":case"center":a=i/2-c/2-n[0];break;case"bottom":a=i-c-h}o=o||0,a=a||0,isNaN(u)&&(u=r-d-o-(s||0)),isNaN(c)&&(c=i-h-a-(l||0));var f=new jt(o+n[3],a+n[0],u,c);return f.margin=n,f}function jd(e,t,n,r,i,o){var a,s=!i||!i.hv||i.hv[0],l=!i||!i.hv||i.hv[1],u=i&&i.boundingMode||"all";if((o=o||e).x=e.x,o.y=e.y,!s&&!l)return!1;if("raw"===u)a="group"===e.type?new jt(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(a=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(a=a.clone()).applyTransform(c)}var h=Wd(V({width:a.width,height:a.height},t),n,r),d=s?h.x-a.x:0,p=l?h.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===e&&e.markRedraw(),!0}function Xd(e){var t=e.layoutMode||e.constructor.layoutMode;return re(t)?t:t?{type:t}:null}function Yd(e,t,n){var r=n&&n.ignoreSize;!J(r)&&(r=[r,r]);var i=a(Gd[0],0),o=a(Gd[1],1);function a(n,i){var o={},a=0,u={},c=0;if(Bd(n,(function(t){u[t]=e[t]})),Bd(n,(function(e){s(t,e)&&(o[e]=u[e]=t[e]),l(o,e)&&a++,l(u,e)&&c++})),r[i])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2!==c&&a){if(a>=2)return o;for(var h=0;h<n.length;h++){var d=n[h];if(!s(o,d)&&s(e,d)){o[d]=e[d];break}}return o}return u}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,n){Bd(e,(function(e){t[e]=n[e]}))}u(Gd[0],e,i),u(Gd[1],e,o)}function Zd(e){return qd({},e)}function qd(e,t){return t&&e&&Bd(Fd,(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}$(Hd,"vertical"),$(Hd,"horizontal");var Kd=$o(),$d=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.uid=Hh("ec_cpt_model"),i}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Xd(this),r=n?Zd(e):{};R(e,t.getTheme().get(this.mainType)),R(e,this.getDefaultOption()),n&&Yd(e,r,n)},t.prototype.mergeOption=function(e,t){R(this.option,e,!0);var n=Xd(this);n&&Yd(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!function(e){return!(!e||!e[la])}(e))return e.defaultOption;var t=Kd(this);if(!t.defaultOption){for(var n=[],r=e;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var o={},a=n.length-1;a>=0;a--)o=R(o,n[a],!0);t.defaultOption=o}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",r=e+"Id";return ra(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Fh);ha($d,Fh),ga($d),function(e){var t={};e.registerSubTypeDefaulter=function(e,n){var r=ua(e);t[r.main]=n},e.determineSubType=function(n,r){var i=r.type;if(!i){var o=ua(n).main;e.hasSubTypes(n)&&t[o]&&(i=t[o](r))}return i}}($d),function(e,t){function n(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,r,i,o){if(e.length){var a=function(e){var r={},i=[];return W(e,(function(o){var a=n(r,o),s=function(e,t){var n=[];return W(e,(function(e){F(t,e)>=0&&n.push(e)})),n}(a.originalDeps=t(o),e);a.entryCount=s.length,0===a.entryCount&&i.push(o),W(s,(function(e){F(a.predecessor,e)<0&&a.predecessor.push(e);var t=n(r,e);F(t.successor,e)<0&&t.successor.push(o)}))})),{graph:r,noEntryList:i}}(r),s=a.graph,l=a.noEntryList,u={};for(W(e,(function(e){u[e]=!0}));l.length;){var c=l.pop(),h=s[c],d=!!u[c];d&&(i.call(o,c,h.originalDeps.slice()),delete u[c]),W(h.successor,d?f:p)}W(u,(function(){var t="";throw"production"!==process.env.NODE_ENV&&(t=No("Circular dependency may exists: ",u,e,r)),new Error(t)}))}function p(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,p(e)}}}($d,(function(e){var t=[];W($d.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=j(t,(function(e){return ua(e).main})),"dataset"!==e&&F(t,"dataset")<=0&&t.unshift("dataset");return t}));var Jd="";"undefined"!=typeof navigator&&(Jd=navigator.platform||"");var Qd="rgba(0, 0, 0, 0.2)",ep={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Qd,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Qd,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Qd,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Qd,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Qd,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Qd,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Jd.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},tp=Te(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),np="original",rp="arrayRows",ip="objectRows",op="keyedColumns",ap="typedArray",sp="unknown",lp="column",up="row",cp=1,hp=2,dp=3,pp=$o();function fp(e,t,n){var r={},i=mp(t);if(!i||!e)return r;var o,a,s=[],l=[],u=t.ecModel,c=pp(u).datasetMap,h=i.uid+"_"+n.seriesLayoutBy;W(e=e.slice(),(function(t,n){var i=re(t)?t:e[n]={name:t};"ordinal"===i.type&&null==o&&(o=n,a=f(i)),r[i.name]=[]}));var d=c.get(h)||c.set(h,{categoryWayDim:a,valueWayDim:0});function p(e,t,n){for(var r=0;r<n;r++)e.push(t+r)}function f(e){var t=e.dimsDef;return t?t.length:1}return W(e,(function(e,t){var n=e.name,i=f(e);if(null==o){var a=d.valueWayDim;p(r[n],a,i),p(l,a,i),d.valueWayDim+=i}else if(o===t)p(r[n],0,i),p(s,0,i);else{a=d.categoryWayDim;p(r[n],a,i),p(l,a,i),d.categoryWayDim+=i}})),s.length&&(r.itemName=s),l.length&&(r.seriesName=l),r}function gp(e,t,n){var r={};if(!mp(e))return r;var i,o=t.sourceFormat,a=t.dimensionsDefine;o!==ip&&o!==op||W(a,(function(e,t){"name"===(re(e)?e.name:e)&&(i=t)}));var s=function(){for(var e={},r={},s=[],l=0,u=Math.min(5,n);l<u;l++){var c=yp(t.data,o,t.seriesLayoutBy,a,t.startIndex,l);s.push(c);var h=c===dp;if(h&&null==e.v&&l!==i&&(e.v=l),(null==e.n||e.n===e.v||!h&&s[e.n]===dp)&&(e.n=l),d(e)&&s[e.n]!==dp)return e;h||(c===hp&&null==r.v&&l!==i&&(r.v=l),null!=r.n&&r.n!==r.v||(r.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(r)?r:null}();if(s){r.value=[s.v];var l=null!=i?i:s.n;r.itemName=[l],r.seriesName=[l]}return r}function mp(e){if(!e.get("data",!0))return ra(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},ta).models[0]}function vp(e,t){return yp(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function yp(e,t,n,r,i,o){var a,s,l;if(oe(e))return dp;if(r){var u=r[o];re(u)?(s=u.name,l=u.type):ee(u)&&(s=u)}if(null!=l)return"ordinal"===l?cp:dp;if(t===rp){var c=e;if(n===up){for(var h=c[o],d=0;d<(h||[]).length&&d<5;d++)if(null!=(a=y(h[i+d])))return a}else for(d=0;d<c.length&&d<5;d++){var p=c[i+d];if(p&&null!=(a=y(p[o])))return a}}else if(t===ip){var f=e;if(!s)return dp;for(d=0;d<f.length&&d<5;d++){if((m=f[d])&&null!=(a=y(m[s])))return a}}else if(t===op){if(!s)return dp;if(!(h=e[s])||oe(h))return dp;for(d=0;d<h.length&&d<5;d++)if(null!=(a=y(h[d])))return a}else if(t===np){var g=e;for(d=0;d<g.length&&d<5;d++){var m,v=Fo(m=g[d]);if(!J(v))return dp;if(null!=(a=y(v[o])))return a}}function y(e){var t=ee(e);return null!=e&&Number.isFinite(Number(e))&&""!==e?t?hp:dp:t&&"-"!==e?cp:void 0}return dp}var _p=Te();var xp,bp,wp,Sp=$o(),Tp=$o(),Mp=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=zo(this.get("color",!0)),i=this.get("colorLayer",!0);return Dp(this,Sp,r,i,e,t,n)},e.prototype.clearColorPalette=function(){!function(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}(this,Sp)},e}();function Cp(e,t,n,r){var i=zo(e.get(["aria","decal","decals"]));return Dp(e,Tp,i,null,t,n,r)}function Dp(e,t,n,r,i,o,a){var s=t(o=o||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=null!=a&&r?function(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r].length>t)return e[r];return e[n-1]}(r,a):n;if((c=c||n)&&c.length){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}var Ap="\0_ec_inner",Ip={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},Ep={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},Lp={};var Np=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.init=function(e,t,n,r,i,o){r=r||{},this.option=null,this._theme=new Fh(r),this._locale=new Fh(i),this._optionManager=o},t.prototype.setOption=function(e,t,n){"production"!==process.env.NODE_ENV&&(me(null!=e,"option is null/undefined"),me(1!==e[Ap],"please use chart.getOption()"));var r=Rp(t);this._optionManager.setOption(e,n,r),this._resetOption(null,r)},t.prototype.resetOption=function(e,t){return this._resetOption(e,Rp(t))},t.prototype._resetOption=function(e,t){var n=!1,r=this._optionManager;if(!e||"recreate"===e){var i=r.mountOption("recreate"===e);"production"!==process.env.NODE_ENV&&W(i,(function(e,t){if(!$d.hasClass(t)){var n=Ip[t];n&&!Lp[n]&&(Io("Component "+t+" is used but not imported.\nimport { "+n+" } from 'echarts/components';\necharts.use(["+n+"]);"),Lp[n]=!0)}})),this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(i,t)):wp(this,i),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var o=r.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,t))}if(!e||"recreate"===e||"media"===e){var a=r.getMediaOption(this);a.length&&W(a,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,r=this._componentsMap,i=this._componentsCount,o=[],a=Te(),s=t&&t.replaceMergeMainTypeMap;pp(this).datasetMap=Te(),W(e,(function(e,t){null!=e&&($d.hasClass(t)?t&&(o.push(t),a.set(t,!0)):n[t]=null==n[t]?O(e):R(n[t],e,!0))})),s&&s.each((function(e,t){$d.hasClass(t)&&!a.get(t)&&(o.push(t),a.set(t,!0))})),$d.topologicalTravel(o,$d.getAllClassMainTypes(),(function(t){var o=function(e,t,n){var r=_p.get(t);if(!r)return n;var i=r(e);if(!i)return n;if("production"!==process.env.NODE_ENV)for(var o=0;o<i.length;o++)me(qo(i[o]));return n.concat(i)}(this,t,zo(e[t])),a=r.get(t),l=a?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",u=Ho(a,o,l);(function(e,t,n){W(e,(function(e){var r=e.newOption;re(r)&&(e.keyInfo.mainType=t,e.keyInfo.subType=function(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}(t,r,e.existing,n))}))})(u,t,$d),n[t]=null,r.set(t,null),i.set(t,0);var c,h,d=[],p=[],f=0;W(u,(function(e,n){var r=e.existing,i=e.newOption;if(i){var o="series"===t,a=$d.getClass(t,e.keyInfo.subType,!o);if(!a){if("production"!==process.env.NODE_ENV){var s=e.keyInfo.subType,l=Ep[s];Lp[s]||(Lp[s]=!0,Io(l?"Series "+s+" is used but not imported.\nimport { "+l+" } from 'echarts/charts';\necharts.use(["+l+"]);":"Unknown series "+s))}return}if("tooltip"===t){if(c)return void("production"!==process.env.NODE_ENV&&(h||(Ao("Currently only one tooltip component is allowed."),h=!0)));c=!0}if(r&&r.constructor===a)r.name=e.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var u=z({componentIndex:n},e.keyInfo);z(r=new a(i,this,this,u),u),e.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}else r&&(r.mergeOption({},this),r.optionUpdated({},!1));r?(d.push(r.option),p.push(r),f++):(d.push(void 0),p.push(void 0))}),this),n[t]=d,r.set(t,p),i.set(t,f),"series"===t&&xp(this)}),this),this._seriesIndices||xp(this)},t.prototype.getOption=function(){var e=O(this.option);return W(e,(function(t,n){if($d.hasClass(n)){for(var r=zo(t),i=r.length,o=!1,a=i-1;a>=0;a--)r[a]&&!qo(r[a])?o=!0:(r[a]=null,!o&&i--);r.length=i,e[n]=r}})),delete e[Ap],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(null==t)for(var i=0;i<n.length;i++)if(n[i])return n[i]}},t.prototype.queryComponents=function(e){var t=e.mainType;if(!t)return[];var n,r=e.index,i=e.id,o=e.name,a=this._componentsMap.get(t);return a&&a.length?(null!=r?(n=[],W(zo(r),(function(e){a[e]&&n.push(a[e])}))):n=null!=i?Pp("id",i,a):null!=o?Pp("name",o,a):Y(a,(function(e){return!!e})),Op(n,e)):[]},t.prototype.findComponents=function(e){var t,n=e.query,r=e.mainType,i=function(e){var t=r+"Index",n=r+"Id",i=r+"Name";return!e||null==e[t]&&null==e[n]&&null==e[i]?null:{mainType:r,index:e[t],id:e[n],name:e[i]}}(n),o=i?this.queryComponents(i):Y(this._componentsMap.get(r),(function(e){return!!e}));return t=Op(o,e),e.filter?Y(t,e.filter):t},t.prototype.eachComponent=function(e,t,n){var r=this._componentsMap;if(Q(e)){var i=t,o=e;r.each((function(e,t){for(var n=0;e&&n<e.length;n++){var r=e[n];r&&o.call(i,t,r,r.componentIndex)}}))}else for(var a=ee(e)?r.get(e):re(e)?this.findComponents(e):null,s=0;a&&s<a.length;s++){var l=a[s];l&&t.call(n,l,l.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=jo(e,null);return Y(this._componentsMap.get("series"),(function(e){return!!e&&null!=t&&e.name===t}))},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get("series")[e]},t.prototype.getSeriesByType=function(e){return Y(this._componentsMap.get("series"),(function(t){return!!t&&t.subType===e}))},t.prototype.getSeries=function(){return Y(this._componentsMap.get("series"),(function(e){return!!e}))},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,t){bp(this),W(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];e.call(t,r,n)}),this)},t.prototype.eachRawSeries=function(e,t){W(this._componentsMap.get("series"),(function(n){n&&e.call(t,n,n.componentIndex)}))},t.prototype.eachSeriesByType=function(e,t,n){bp(this),W(this._seriesIndices,(function(r){var i=this._componentsMap.get("series")[r];i.subType===e&&t.call(n,i,r)}),this)},t.prototype.eachRawSeriesByType=function(e,t,n){return W(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return bp(this),null==this._seriesIndicesMap.get(e.componentIndex)},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){bp(this);var n=[];W(this._seriesIndices,(function(r){var i=this._componentsMap.get("series")[r];e.call(t,i,r)&&n.push(r)}),this),this._seriesIndices=n,this._seriesIndicesMap=Te(n)},t.prototype.restoreData=function(e){xp(this);var t=this._componentsMap,n=[];t.each((function(e,t){$d.hasClass(t)&&n.push(t)})),$d.topologicalTravel(n,$d.getAllClassMainTypes(),(function(n){W(t.get(n),(function(t){!t||"series"===n&&function(e,t){if(t){var n=t.seriesIndex,r=t.seriesId,i=t.seriesName;return null!=n&&e.componentIndex!==n||null!=r&&e.id!==r||null!=i&&e.name!==i}}(t,e)||t.restoreData()}))}))},t.internalField=(xp=function(e){var t=e._seriesIndices=[];W(e._componentsMap.get("series"),(function(e){e&&t.push(e.componentIndex)})),e._seriesIndicesMap=Te(t)},bp=function(e){if("production"!==process.env.NODE_ENV&&!e._seriesIndices)throw new Error("Option should contains series.")},void(wp=function(e,t){e.option={},e.option[Ap]=1,e._componentsMap=Te({series:[]}),e._componentsCount=Te();var n=t.aria;re(n)&&null==n.enabled&&(n.enabled=!0),function(e,t){var n=e.color&&!e.colorLayer;W(t,(function(t,r){"colorLayer"===r&&n||$d.hasClass(r)||("object"==typeof t?e[r]=e[r]?R(e[r],t,!1):O(t):null==e[r]&&(e[r]=t))}))}(t,e._theme.option),R(t,ep,!1),e._mergeOption(t,null)})),t}(Fh);function Pp(e,t,n){if(J(t)){var r=Te();return W(t,(function(e){null!=e&&(null!=jo(e,null)&&r.set(e,!0))})),Y(n,(function(t){return t&&r.get(t[e])}))}var i=jo(t,null);return Y(n,(function(t){return t&&null!=i&&t[e]===i}))}function Op(e,t){return t.hasOwnProperty("subType")?Y(e,(function(e){return e&&e.subType===t.subType})):e}function Rp(e){var t=Te();return e&&W(zo(e.replaceMerge),(function(e){"production"!==process.env.NODE_ENV&&me($d.hasClass(e),'"'+e+'" is not valid component main type in "replaceMerge"'),t.set(e,!0)})),{replaceMergeMainTypeMap:t}}H(Np,Mp);var kp=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],zp=function(e){W(kp,(function(t){this[t]=K(e[t],e)}),this)},Vp={},Bp=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];W(Vp,(function(r,i){var o=r.create(e,t);n=n.concat(o||[])})),this._coordinateSystems=n},e.prototype.update=function(e,t){W(this._coordinateSystems,(function(n){n.update&&n.update(e,t)}))},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){Vp[e]=t},e.get=function(e){return Vp[e]},e}(),Fp=/^(min|max)?(.+)$/,Gp=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(W(zo(e.series),(function(e){e&&e.data&&oe(e.data)&&_e(e.data)})),W(zo(e.dataset),(function(e){e&&e.source&&oe(e.source)&&_e(e.source)}))),e=O(e);var r=this._optionBackup,i=function(e,t,n){var r,i,o=[],a=e.baseOption,s=e.timeline,l=e.options,u=e.media,c=!!e.media,h=!!(l||s||a&&a.timeline);a?(i=a).timeline||(i.timeline=s):((h||c)&&(e.options=e.media=null),i=e);c&&(J(u)?W(u,(function(e){"production"!==process.env.NODE_ENV&&e&&!e.option&&re(e.query)&&re(e.query.option)&&Io("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),e&&e.option&&(e.query?o.push(e):r||(r=e))})):"production"!==process.env.NODE_ENV&&Io("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"));function d(e){W(t,(function(t){t(e,n)}))}return d(i),W(l,(function(e){return d(e)})),W(o,(function(e){return d(e.option)})),{baseOption:i,timelineOptions:l||[],mediaDefault:r,mediaList:o}}(e,t,!r);this._newBaseOption=i.baseOption,r?(i.timelineOptions.length&&(r.timelineOptions=i.timelineOptions),i.mediaList.length&&(r.mediaList=i.mediaList),i.mediaDefault&&(r.mediaDefault=i.mediaDefault)):this._optionBackup=i},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],O(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var r=e.getComponent("timeline");r&&(t=O(n[r.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t,n,r=this._api.getWidth(),i=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var u=0,c=o.length;u<c;u++)Hp(o[u].query,r,i)&&s.push(u);return!s.length&&a&&(s=[-1]),s.length&&(t=s,n=this._currentMediaIndices,t.join(",")!==n.join(","))&&(l=j(s,(function(e){return O(-1===e?a.option:o[e].option)}))),this._currentMediaIndices=s,l},e}();function Hp(e,t,n){var r={width:t,height:n,aspectratio:t/n},i=!0;return W(e,(function(e,t){var n=t.match(Fp);if(n&&n[1]&&n[2]){var o=n[1],a=n[2].toLowerCase();(function(e,t,n){return"min"===n?e>=t:"max"===n?e<=t:e===t})(r[a],e,o)||(i=!1)}})),i}var Up=W,Wp=re,jp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Xp(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=jp.length;n<r;n++){var i=jp[n],o=t.normal,a=t.emphasis;o&&o[i]&&("production"!==process.env.NODE_ENV&&Lo("itemStyle.normal."+i,i),e[i]=e[i]||{},e[i].normal?R(e[i].normal,o[i]):e[i].normal=o[i],o[i]=null),a&&a[i]&&("production"!==process.env.NODE_ENV&&Lo("itemStyle.emphasis."+i,"emphasis."+i),e[i]=e[i]||{},e[i].emphasis?R(e[i].emphasis,a[i]):e[i].emphasis=a[i],a[i]=null)}}function Yp(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var r=e[t].normal,i=e[t].emphasis;r&&("production"!==process.env.NODE_ENV&&Eo("'normal' hierarchy in "+t+" has been removed since 4.0. All style properties are configured in "+t+" directly now."),n?(e[t].normal=e[t].emphasis=null,V(e[t],r)):e[t]=r),i&&("production"!==process.env.NODE_ENV&&Eo(t+".emphasis has been changed to emphasis."+t+" since 4.0"),e.emphasis=e.emphasis||{},e.emphasis[t]=i,i.focus&&(e.emphasis.focus=i.focus),i.blurScope&&(e.emphasis.blurScope=i.blurScope))}}function Zp(e){Yp(e,"itemStyle"),Yp(e,"lineStyle"),Yp(e,"areaStyle"),Yp(e,"label"),Yp(e,"labelLine"),Yp(e,"upperLabel"),Yp(e,"edgeLabel")}function qp(e,t){var n=Wp(e)&&e[t],r=Wp(n)&&n.textStyle;if(r){"production"!==process.env.NODE_ENV&&Eo("textStyle hierarchy in "+t+" has been removed since 4.0. All textStyle properties are configured in "+t+" directly now.");for(var i=0,o=Bo.length;i<o;i++){var a=Bo[i];r.hasOwnProperty(a)&&(n[a]=r[a])}}}function Kp(e){e&&(Zp(e),qp(e,"label"),e.emphasis&&qp(e.emphasis,"label"))}function $p(e){return J(e)?e:e?[e]:[]}function Jp(e){return(J(e)?e[0]:e)||{}}function Qp(e,t){Up($p(e.series),(function(e){Wp(e)&&function(e){if(Wp(e)){Xp(e),Zp(e),qp(e,"label"),qp(e,"upperLabel"),qp(e,"edgeLabel"),e.emphasis&&(qp(e.emphasis,"label"),qp(e.emphasis,"upperLabel"),qp(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(Xp(t),Kp(t));var n=e.markLine;n&&(Xp(n),Kp(n));var r=e.markArea;r&&Kp(r);var i=e.data;if("graph"===e.type){i=i||e.nodes;var o=e.links||e.edges;if(o&&!oe(o))for(var a=0;a<o.length;a++)Kp(o[a]);W(e.categories,(function(e){Zp(e)}))}if(i&&!oe(i))for(a=0;a<i.length;a++)Kp(i[a]);if((t=e.markPoint)&&t.data){var s=t.data;for(a=0;a<s.length;a++)Kp(s[a])}if((n=e.markLine)&&n.data){var l=n.data;for(a=0;a<l.length;a++)J(l[a])?(Kp(l[a][0]),Kp(l[a][1])):Kp(l[a])}"gauge"===e.type?(qp(e,"axisLabel"),qp(e,"title"),qp(e,"detail")):"treemap"===e.type?(Yp(e.breadcrumb,"itemStyle"),W(e.levels,(function(e){Zp(e)}))):"tree"===e.type&&Zp(e.leaves)}}(e)}));var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),Up(n,(function(t){Up($p(e[t]),(function(e){e&&(qp(e,"axisLabel"),qp(e.axisPointer,"label"))}))})),Up($p(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;qp(t,"axisLabel"),qp(t&&t.axisPointer,"label")})),Up($p(e.calendar),(function(e){Yp(e,"itemStyle"),qp(e,"dayLabel"),qp(e,"monthLabel"),qp(e,"yearLabel")})),Up($p(e.radar),(function(e){qp(e,"name"),e.name&&null==e.axisName&&(e.axisName=e.name,delete e.name,"production"!==process.env.NODE_ENV&&Eo("name property in radar component has been changed to axisName")),null!=e.nameGap&&null==e.axisNameGap&&(e.axisNameGap=e.nameGap,delete e.nameGap,"production"!==process.env.NODE_ENV&&Eo("nameGap property in radar component has been changed to axisNameGap")),"production"!==process.env.NODE_ENV&&Up(e.indicator,(function(e){e.text&&Lo("text","name","radar.indicator")}))})),Up($p(e.geo),(function(e){Wp(e)&&(Kp(e),Up($p(e.regions),(function(e){Kp(e)})))})),Up($p(e.timeline),(function(e){Kp(e),Yp(e,"label"),Yp(e,"itemStyle"),Yp(e,"controlStyle",!0);var t=e.data;J(t)&&W(t,(function(e){re(e)&&(Yp(e,"label"),Yp(e,"itemStyle"))}))})),Up($p(e.toolbox),(function(e){Yp(e,"iconStyle"),Up(e.feature,(function(e){Yp(e,"iconStyle")}))})),qp(Jp(e.axisPointer),"label"),qp(Jp(e.tooltip).axisPointer,"label")}function ef(e){e&&W(tf,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var tf=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],nf=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],rf=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function of(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<rf.length;n++){var r=rf[n][1],i=rf[n][0];null!=t[r]&&(t[i]=t[r],"production"!==process.env.NODE_ENV&&Lo(r,i))}}function af(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&("production"!==process.env.NODE_ENV&&Lo("label.margin","label.edgeDistance","pie"),e.edgeDistance=e.margin)}function sf(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay,"production"!==process.env.NODE_ENV&&Lo("downplay","blur","sunburst"))}function lf(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&lf(e[n].children,t)}function uf(e,t){Qp(e,t),e.series=zo(e.series),W(e.series,(function(e){if(re(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow,"production"!==process.env.NODE_ENV&&Lo("clipOverflow","clip","line"));else if("pie"===t||"gauge"===t){if(null!=e.clockWise&&(e.clockwise=e.clockWise,"production"!==process.env.NODE_ENV&&Lo("clockWise","clockwise")),af(e.label),(i=e.data)&&!oe(i))for(var n=0;n<i.length;n++)af(i[n]);null!=e.hoverOffset&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&("production"!==process.env.NODE_ENV&&Lo("hoverOffset","emphasis.scaleSize"),e.emphasis.scaleSize=e.hoverOffset))}else if("gauge"===t){var r=function(e,t){for(var n=t.split(","),r=e,i=0;i<n.length&&null!=(r=r&&r[n[i]]);i++);return r}(e,"pointer.color");null!=r&&function(e,t,n){for(var r,i=t.split(","),o=e,a=0;a<i.length-1;a++)null==o[r=i[a]]&&(o[r]={}),o=o[r];null==o[i[a]]&&(o[i[a]]=n)}(e,"itemStyle.color",r)}else if("bar"===t){var i;if(of(e),of(e.backgroundStyle),of(e.emphasis),(i=e.data)&&!oe(i))for(n=0;n<i.length;n++)"object"==typeof i[n]&&(of(i[n]),of(i[n]&&i[n].emphasis))}else if("sunburst"===t){var o=e.highlightPolicy;o&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=o,"production"!==process.env.NODE_ENV&&Lo("highlightPolicy","emphasis.focus","sunburst"))),sf(e),lf(e.data,sf)}else"graph"===t||"sankey"===t?function(e){e&&null!=e.focusNodeAdjacency&&(e.emphasis=e.emphasis||{},null==e.emphasis.focus&&("production"!==process.env.NODE_ENV&&Lo("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),e.emphasis.focus="adjacency"))}(e):"map"===t&&(e.mapType&&!e.map&&("production"!==process.env.NODE_ENV&&Lo("mapType","map","map"),e.map=e.mapType),e.mapLocation&&("production"!==process.env.NODE_ENV&&Eo("`mapLocation` is not used anymore."),V(e,e.mapLocation)));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&("production"!==process.env.NODE_ENV&&Lo("hoverAnimation","emphasis.scale"),e.emphasis.scale=e.hoverAnimation)),ef(e)}})),e.dataRange&&(e.visualMap=e.dataRange),W(nf,(function(t){var n=e[t];n&&(J(n)||(n=[n]),W(n,(function(e){ef(e)})))}))}function cf(e){W(e,(function(t,n){var r=[],i=[NaN,NaN],o=[t.stackResultDimension,t.stackedOverDimension],a=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";a.modify(o,(function(o,u,c){var h,d,p=a.get(t.stackedDimension,c);if(isNaN(p))return i;s?d=a.getRawIndex(c):h=a.get(t.stackedByDimension,c);for(var f=NaN,g=n-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,h)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&p>=0&&v>0||"samesign"===l&&p<=0&&v<0){p=lo(p,v),f=v;break}}}return r[0]=p,r[1]=f,r}))}))}var hf,df,pf,ff,gf,mf=function(e){this.data=e.data||(e.sourceFormat===op?{}:[]),this.sourceFormat=e.sourceFormat||sp,this.seriesLayoutBy=e.seriesLayoutBy||lp,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var r=t[n];null==r.type&&vp(this,n)===cp&&(r.type="ordinal")}};function vf(e){return e instanceof mf}function yf(e,t,n){n=n||xf(e);var r=t.seriesLayoutBy,i=function(e,t,n,r,i){var o,a;if(!e)return{dimensionsDefine:bf(i),startIndex:a,dimensionsDetectedCount:o};if(t===rp){var s=e;"auto"===r||null==r?wf((function(e){null!=e&&"-"!==e&&(ee(e)?null==a&&(a=1):a=0)}),n,s,10):a=ne(r)?r:r?1:0,i||1!==a||(i=[],wf((function(e,t){i[t]=null!=e?e+"":""}),n,s,1/0)),o=i?i.length:n===up?s.length:s[0]?s[0].length:null}else if(t===ip)i||(i=function(e){var t,n=0;for(;n<e.length&&!(t=e[n++]););if(t)return q(t)}(e));else if(t===op)i||(i=[],W(e,(function(e,t){i.push(t)})));else if(t===np){var l=Fo(e[0]);o=J(l)&&l.length||1}else t===ap&&"production"!==process.env.NODE_ENV&&me(!!i,"dimensions must be given if data is TypedArray.");return{startIndex:a,dimensionsDefine:bf(i),dimensionsDetectedCount:o}}(e,n,r,t.sourceHeader,t.dimensions);return new mf({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:O(t)})}function _f(e){return new mf({data:e,sourceFormat:oe(e)?ap:np})}function xf(e){var t=sp;if(oe(e))t=ap;else if(J(e)){0===e.length&&(t=rp);for(var n=0,r=e.length;n<r;n++){var i=e[n];if(null!=i){if(J(i)||oe(i)){t=rp;break}if(re(i)){t=ip;break}}}}else if(re(e))for(var o in e)if(Ae(e,o)&&U(e[o])){t=op;break}return t}function bf(e){if(e){var t=Te();return j(e,(function(e,n){var r={name:(e=re(e)?e:{name:e}).name,displayName:e.displayName,type:e.type};if(null==r.name)return r;r.name+="",null==r.displayName&&(r.displayName=r.name);var i=t.get(r.name);return i?r.name+="-"+i.count++:t.set(r.name,{count:1}),r}))}}function wf(e,t,n,r){if(t===up)for(var i=0;i<n.length&&i<r;i++)e(n[i]?n[i][0]:null,i);else{var o=n[0]||[];for(i=0;i<o.length&&i<r;i++)e(o[i],i)}}function Sf(e){var t=e.sourceFormat;return t===ip||t===op}var Tf=function(){function e(e,t){var n=vf(e)?e:_f(e);this._source=n;var r=this._data=n.data;if(n.sourceFormat===ap){if("production"!==process.env.NODE_ENV&&null==t)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=t,this._data=r}gf(this,r,n)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(e,t){},e.prototype.appendData=function(e){},e.prototype.clean=function(){},e.protoInitialize=function(){var t=e.prototype;t.pure=!1,t.persistent=!0}(),e.internalField=function(){var e;gf=function(e,i,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine,c=ff[Of(a,s)];if("production"!==process.env.NODE_ENV&&me(c,"Invalide sourceFormat: "+a),z(e,c),a===ap)e.getItem=t,e.count=r,e.fillStorage=n;else{var h=Df(a,s);e.getItem=K(h,null,i,l,u);var d=Ef(a,s);e.count=K(d,null,i,l,u)}};var t=function(e,t){e-=this._offset,t=t||[];for(var n=this._data,r=this._dimSize,i=r*e,o=0;o<r;o++)t[o]=n[i+o];return t},n=function(e,t,n,r){for(var i=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=r[a],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],c=t-e,h=n[a],d=0;d<c;d++){var p=i[d*o+a];h[e+d]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},r=function(){return this._data?this._data.length/this._dimSize:0};function i(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}(e={})[rp+"_"+lp]={pure:!0,appendData:i},e[rp+"_"+up]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ip]={pure:!0,appendData:i},e[op]={pure:!0,appendData:function(e){var t=this._data;W(e,(function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])}))}},e[np]={appendData:i},e[ap]={persistent:!1,pure:!0,appendData:function(e){"production"!==process.env.NODE_ENV&&me(oe(e),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},ff=e}(),e}(),Mf=function(e,t,n,r){return e[r]},Cf=((hf={})[rp+"_"+lp]=function(e,t,n,r){return e[r+t]},hf[rp+"_"+up]=function(e,t,n,r,i){r+=t;for(var o=i||[],a=e,s=0;s<a.length;s++){var l=a[s];o[s]=l?l[r]:null}return o},hf[ip]=Mf,hf[op]=function(e,t,n,r,i){for(var o=i||[],a=0;a<n.length;a++){var s=n[a].name;if("production"!==process.env.NODE_ENV&&null==s)throw new Error;var l=e[s];o[a]=l?l[r]:null}return o},hf[np]=Mf,hf);function Df(e,t){var n=Cf[Of(e,t)];return"production"!==process.env.NODE_ENV&&me(n,'Do not support get item on "'+e+'", "'+t+'".'),n}var Af=function(e,t,n){return e.length},If=((df={})[rp+"_"+lp]=function(e,t,n){return Math.max(0,e.length-t)},df[rp+"_"+up]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},df[ip]=Af,df[op]=function(e,t,n){var r=n[0].name;if("production"!==process.env.NODE_ENV&&null==r)throw new Error;var i=e[r];return i?i.length:0},df[np]=Af,df);function Ef(e,t){var n=If[Of(e,t)];return"production"!==process.env.NODE_ENV&&me(n,'Do not support count on "'+e+'", "'+t+'".'),n}var Lf=function(e,t,n){return e[t]},Nf=((pf={})[rp]=Lf,pf[ip]=function(e,t,n){return e[n]},pf[op]=Lf,pf[np]=function(e,t,n){var r=Fo(e);return r instanceof Array?r[t]:r},pf[ap]=Lf,pf);function Pf(e){var t=Nf[e];return"production"!==process.env.NODE_ENV&&me(t,'Do not support get value on "'+e+'".'),t}function Of(e,t){return e===rp?e+"_"+t:e}function Rf(e,t,n){if(e){var r=e.getRawDataItem(t);if(null!=r){var i=e.getStore(),o=i.getSource().sourceFormat;if(null!=n){var a=e.getDimensionIndex(n),s=i.getDimensionProperty(a);return Pf(o)(r,a,s)}var l=r;return o===np&&(l=Fo(r)),l}}}var kf=/\{@(.+?)\}/g,zf=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),o=n.getName(e),a=n.getRawDataItem(e),s=n.getItemVisual(e,"style"),l=s&&s[n.getItemVisual(e,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,h="series"===c,d=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:a,dataType:t,value:r,color:l,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,o){t=t||"normal";var a=this.getData(n),s=this.getDataParams(e,n);(o&&(s.value=o.interpolatedValue),null!=r&&J(s.value)&&(s.value=s.value[r]),i)||(i=a.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"]));return Q(i)?(s.status=t,s.dimensionIndex=r,i(s)):ee(i)?Od(i,s).replace(kf,(function(t,n){var r=n.length,i=n;"["===i.charAt(0)&&"]"===i.charAt(r-1)&&(i=+i.slice(1,r-1),"production"!==process.env.NODE_ENV&&isNaN(i)&&Io("Invalide label formatter: @"+n+", only support @[0], @[1], @[2], ..."));var s=Rf(a,e,i);if(o&&J(o.interpolatedValue)){var l=a.getDimensionIndex(i);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""})):void 0},e.prototype.getRawValue=function(e,t){return Rf(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function Vf(e){var t,n;return re(e)?e.type?n=e:"production"!==process.env.NODE_ENV&&console.warn("The return type of `formatTooltip` is not supported: "+No(e)):t=e,{text:t,frag:n}}function Bf(e){return new Ff(e)}var Ff=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n=this._upstream,r=e&&e.skip;if(this._dirty&&n){var i=this.context;i.data=i.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!r&&(t=this._plan(this.context));var o,a=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;function c(e){return!(e>=1)&&(e=1),e}a===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,o=this._doReset(r)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(n?("production"!==process.env.NODE_ENV&&me(null!=n._outputDueEnd),this._dueEnd=n._outputDueEnd):("production"!==process.env.NODE_ENV&&me(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var d=this._dueIndex,p=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!r&&(o||d<p)){var f=this._progress;if(J(f))for(var g=0;g<f.length;g++)this._doProgress(f[g],d,p,l,u);else this._doProgress(f,d,p,l,u)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;"production"!==process.env.NODE_ENV&&me(m>=this._outputDueEnd),this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,r,i){Gf.reset(t,n,r,i),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:Gf.next},this.context)},e.prototype._doReset=function(e){var t,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!e&&this._reset&&((t=this._reset(this.context))&&t.progress&&(n=t.forceFirstProgress,t=t.progress),J(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){"production"!==process.env.NODE_ENV&&me(e&&!e._disposed&&e!==this),(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),Gf=function(){var e,t,n,r,i,o={reset:function(l,u,c,h){t=l,e=u,n=c,r=h,i=Math.ceil(r/n),o.next=n>1&&r>0?s:a}};return o;function a(){return t<e?t++:null}function s(){var o=t%i*n+Math.ceil(t/i),a=t>=e?null:o<r?o:t;return t++,a}}();function Hf(e,t){var n=t&&t.type;return"ordinal"===n?e:("time"!==n||ne(e)||null==e||"-"===e||(e=+fo(e)),null==e||""===e?NaN:Number(e))}var Uf=Te({number:function(e){return parseFloat(e)},time:function(e){return+fo(e)},trim:function(e){return ee(e)?ve(e):e}});function Wf(e){return Uf.get(e)}var jf={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},Xf=function(){function e(e,t){if(!ne(t)){var n="";"production"!==process.env.NODE_ENV&&(n='rvalue of "<", ">", "<=", ">=" can only be number in filter.'),Po(n)}this._opFn=jf[e],this._rvalFloat=xo(t)}return e.prototype.evaluate=function(e){return ne(e)?this._opFn(e,this._rvalFloat):this._opFn(xo(e),this._rvalFloat)},e}(),Yf=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=ne(e)?e:xo(e),r=ne(t)?t:xo(t),i=isNaN(n),o=isNaN(r);if(i&&(n=this._incomparable),o&&(r=this._incomparable),i&&o){var a=ee(e),s=ee(t);a&&(n=s?e:0),s&&(r=a?t:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},e}(),Zf=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=xo(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=xo(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function qf(e,t){return"eq"===e||"ne"===e?new Zf("eq"===e,t):Ae(jf,e)?new Xf(e,t):null}var Kf=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return Hf(e,t)},e}();function $f(e){var t=e.sourceFormat;if(!rg(t)){var n="";"production"!==process.env.NODE_ENV&&(n="`getRawData` is not supported in source format "+t),Po(n)}return e.data}function Jf(e){var t=e.sourceFormat,n=e.data;if(!rg(t)){var r="";"production"!==process.env.NODE_ENV&&(r="`cloneRawData` is not supported in source format "+t),Po(r)}if(t===rp){for(var i=[],o=0,a=n.length;o<a;o++)i.push(n[o].slice());return i}if(t===ip){for(i=[],o=0,a=n.length;o<a;o++)i.push(z({},n[o]));return i}}function Qf(e,t,n){if(null!=n)return ne(n)||!isNaN(n)&&!Ae(t,n)?e[n]:Ae(t,n)?t[n]:void 0}function eg(e){return O(e)}var tg=Te();function ng(e,t,n,r){var i="";t.length||("production"!==process.env.NODE_ENV&&(i="Must have at least one upstream dataset."),Po(i)),re(e)||("production"!==process.env.NODE_ENV&&(i="transform declaration must be an object rather than "+typeof e+"."),Po(i));var o=e.type,a=tg.get(o);a||("production"!==process.env.NODE_ENV&&(i='Can not find transform on type "'+o+'".'),Po(i));var s,l=j(t,(function(e){return function(e,t){var n=new Kf,r=e.data,i=n.sourceFormat=e.sourceFormat,o=e.startIndex,a="";e.seriesLayoutBy!==lp&&("production"!==process.env.NODE_ENV&&(a='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),Po(a));var s=[],l={},u=e.dimensionsDefine;if(u)W(u,(function(e,t){var n=e.name,r={index:t,name:n,displayName:e.displayName};if(s.push(r),null!=n){var i="";Ae(l,n)&&("production"!==process.env.NODE_ENV&&(i='dimension name "'+n+'" duplicated.'),Po(i)),l[n]=r}}));else for(var c=0;c<e.dimensionsDetectedCount;c++)s.push({index:c});var h=Df(i,lp);t.__isBuiltIn&&(n.getRawDataItem=function(e){return h(r,o,s,e)},n.getRawData=K($f,null,e)),n.cloneRawData=K(Jf,null,e);var d=Ef(i,lp);n.count=K(d,null,r,o,s);var p=Pf(i);n.retrieveValue=function(e,t){var n=h(r,o,s,e);return f(n,t)};var f=n.retrieveValueFromItem=function(e,t){if(null!=e){var n=s[t];return n?p(e,t,n.name):void 0}};return n.getDimensionInfo=K(Qf,null,s,l),n.cloneAllDimensionInfo=K(eg,null,s),n}(e,a)})),u=zo(a.transform({upstream:l[0],upstreamList:l,config:O(e.config)}));if("production"!==process.env.NODE_ENV&&e.print){var c=j(u,(function(e){var t=null!=r?" === pipe index: "+r:"";return["=== dataset index: "+n.datasetIndex+t+" ===","- transform result data:",No(e.data),"- transform result dimensions:",No(e.dimensions)].join("\n")})).join("\n");Do("log",c,s)}return j(u,(function(e,n){var r,i="";re(e)||("production"!==process.env.NODE_ENV&&(i="A transform should not return some empty results."),Po(i)),e.data||("production"!==process.env.NODE_ENV&&(i="Transform result data should be not be null or undefined"),Po(i)),rg(xf(e.data))||("production"!==process.env.NODE_ENV&&(i="Transform result data should be array rows or object rows."),Po(i));var o=t[0];if(o&&0===n&&!e.dimensions){var a=o.startIndex;a&&(e.data=o.data.slice(0,a).concat(e.data)),r={seriesLayoutBy:lp,sourceHeader:a,dimensions:o.metaRawOption.dimensions}}else r={seriesLayoutBy:lp,sourceHeader:0,dimensions:e.dimensions};return yf(e.data,r,null)}))}function rg(e){return e===rp||e===ip}var ig,og="undefined",ag=typeof Uint32Array===og?Array:Uint32Array,sg=typeof Uint16Array===og?Array:Uint16Array,lg=typeof Int32Array===og?Array:Int32Array,ug=typeof Float64Array===og?Array:Float64Array,cg={float:ug,int:lg,ordinal:Array,number:Array,time:ug};function hg(e){return e>65535?ag:sg}function dg(e,t,n,r,i){var o=cg[n||"float"];if(i){var a=e[t],s=a&&a.length;if(s!==r){for(var l=new o(r),u=0;u<s;u++)l[u]=a[u];e[t]=l}}else e[t]=new o(r)}var pg=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=Te()}return e.prototype.initData=function(e,t,n){"production"!==process.env.NODE_ENV&&me(Q(e.getItem)&&Q(e.count),"Invalid data provider."),this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),i=this.defaultDimValueGetter=ig[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[];var o=Sf(r);this._dimensions=j(t,(function(e){return"production"!==process.env.NODE_ENV&&o&&me(null!=e.property),{type:e.type,property:e.property}})),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(e);if(null!=i){if(r[i].type===t)return i}else i=r.length;return r[i]={type:t},n.set(e,i),this._chunks[i]=new cg[t||"float"](this._rawCount),this._rawExtent[i]=[1/0,-1/0],i},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],r=this._dimensions[e],i=this._rawExtent,o=r.ordinalOffset||0,a=n.length;0===o&&(i[e]=[1/0,-1/0]);for(var s=i[e],l=o;l<a;l++){var u=n[l]=t.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}r.ordinalMeta=t,r.ordinalOffset=a,r.type="ordinal"},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){"production"!==process.env.NODE_ENV&&me(!this._indices,"appendData can only be called on raw data.");var t=this._provider,n=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,r=this._dimensions,i=r.length,o=this._rawExtent,a=this.count(),s=a+Math.max(e.length,t||0),l=0;l<i;l++){dg(n,l,(p=r[l]).type,s,!0)}for(var u=[],c=a;c<s;c++)for(var h=c-a,d=0;d<i;d++){var p=r[d],f=ig.arrayRows.call(this,e[h]||u,p.property,h,d);n[d][c]=f;var g=o[d];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=j(o,(function(e){return e.property})),u=0;u<a;u++){var c=o[u];s[u]||(s[u]=[1/0,-1/0]),dg(i,u,c.type,t,n)}if(r.fillStorage)r.fillStorage(e,t,i,s);else for(var h=[],d=e;d<t;d++){h=r.getItem(d,h);for(var p=0;p<a;p++){var f=i[p],g=this._dimValueGetter(h,l[p],d,p);f[d]=g;var m=s[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],r=[];if(null==t){t=e,e=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=e;i=0;for(var o=r.length;i<o;i++)n.push(this.get(r[i],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=0;if(this._chunks[e])for(var n=0,r=this.count();n<r;n++){var i=this.get(e,n);isNaN(i)||(t+=i)}return t},e.prototype.getMedian=function(e){var t=[];this.each([e],(function(e){isNaN(e)||t.push(e)}));var n=t.sort((function(e,t){return e-t})),r=this.count();return 0===r?0:r%2==1?n[(r-1)/2]:(n[r/2]+n[r/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&n<this._count&&n===e)return e;for(var r=0,i=this._count-1;r<=i;){var o=(r+i)/2|0;if(t[o]<e)r=o+1;else{if(!(t[o]>e))return o;i=o-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var r=this._chunks[e],i=[];if(!r)return i;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=t-r[this.getRawIndex(l)],h=Math.abs(c);h<=n&&((h<o||h===o&&c>=0&&a<0)&&(o=h,a=c,s=0),c===a&&(i[s++]=l))}return i.length=s,i},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i<r;i++)e[i]=t[i]}else e=new n(t.buffer,0,r)}else{e=new(n=hg(this._rawCount))(this.count());for(i=0;i<e.length;i++)e[i]=i}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(hg(n._rawCount))(r),o=[],a=e.length,s=0,l=e[0],u=n._chunks,c=0;c<r;c++){var h=void 0,d=n.getRawIndex(c);if(0===a)h=t(c);else if(1===a){h=t(u[l][d],c)}else{for(var p=0;p<a;p++)o[p]=u[e[p]][d];o[p]=c,h=t.apply(null,o)}h&&(i[s++]=d)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var r=q(e),i=r.length;if(!i)return this;var o=t.count(),a=new(hg(t._rawCount))(o),s=0,l=r[0],u=e[l][0],c=e[l][1],h=t._chunks,d=!1;if(!t._indices){var p=0;if(1===i){for(var f=h[r[0]],g=0;g<n;g++){((_=f[g])>=u&&_<=c||isNaN(_))&&(a[s++]=p),p++}d=!0}else if(2===i){f=h[r[0]];var m=h[r[1]],v=e[r[1]][0],y=e[r[1]][1];for(g=0;g<n;g++){var _=f[g],x=m[g];(_>=u&&_<=c||isNaN(_))&&(x>=v&&x<=y||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===i)for(g=0;g<o;g++){var b=t.getRawIndex(g);((_=h[r[0]][b])>=u&&_<=c||isNaN(_))&&(a[s++]=b)}else for(g=0;g<o;g++){for(var w=!0,S=(b=t.getRawIndex(g),0);S<i;S++){var T=r[S];((_=h[T][b])<e[T][0]||_>e[T][1])&&(w=!1)}w&&(a[s++]=t.getRawIndex(g))}return s<o&&(t._indices=a),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var r=e._chunks,i=[],o=t.length,a=e.count(),s=[],l=e._rawExtent,u=0;u<t.length;u++)l[t[u]]=[1/0,-1/0];for(var c=0;c<a;c++){for(var h=e.getRawIndex(c),d=0;d<o;d++)s[d]=r[t[d]][h];s[o]=c;var p=n&&n.apply(null,s);if(null!=p){"object"!=typeof p&&(i[0]=p,p=i);for(u=0;u<p.length;u++){var f=t[u],g=p[u],m=l[f],v=r[f];v&&(v[h]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,r,i,o=this.clone([e],!0),a=o._chunks[e],s=this.count(),l=0,u=Math.floor(1/t),c=this.getRawIndex(0),h=new(hg(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));h[l++]=c;for(var d=1;d<s-1;d+=u){for(var p=Math.min(d+u,s-1),f=Math.min(d+2*u,s),g=(f+p)/2,m=0,v=p;v<f;v++){var y=a[M=this.getRawIndex(v)];isNaN(y)||(m+=y)}m/=f-p;var _=d,x=Math.min(d+u,s),b=d-1,w=a[c];n=-1,i=_;var S=-1,T=0;for(v=_;v<x;v++){var M;y=a[M=this.getRawIndex(v)];isNaN(y)?(T++,S<0&&(S=M)):(r=Math.abs((b-g)*(y-w)-(b-v)*(m-w)))>n&&(n=r,i=M)}T>0&&T<x-_&&(h[l++]=Math.min(S,i),i=Math.max(S,i)),h[l++]=i,c=i}return h[l++]=this.getRawIndex(s-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},e.prototype.minmaxDownSample=function(e,t){for(var n=this.clone([e],!0),r=n._chunks,i=Math.floor(1/t),o=r[e],a=this.count(),s=new(hg(this._rawCount))(2*Math.ceil(a/i)),l=0,u=0;u<a;u+=i){var c=u,h=o[this.getRawIndex(c)],d=u,p=o[this.getRawIndex(d)],f=i;u+i>a&&(f=a-u);for(var g=0;g<f;g++){var m=o[this.getRawIndex(u+g)];m<h&&(h=m,c=u+g),m>p&&(p=m,d=u+g)}var v=this.getRawIndex(c),y=this.getRawIndex(d);c<d?(s[l++]=v,s[l++]=y):(s[l++]=y,s[l++]=v)}return n._count=l,n._indices=s,n._updateGetRawIdx(),n},e.prototype.downSample=function(e,t,n,r){for(var i=this.clone([e],!0),o=i._chunks,a=[],s=Math.floor(1/t),l=o[e],u=this.count(),c=i._rawExtent[e]=[1/0,-1/0],h=new(hg(this._rawCount))(Math.ceil(u/s)),d=0,p=0;p<u;p+=s){s>u-p&&(s=u-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var m=n(a),v=this.getRawIndex(Math.min(p+r(a,m)||0,u-1));l[v]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),h[d++]=v}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,o=this.count();i<o;i++){var a=this.getRawIndex(i);switch(n){case 0:t(i);break;case 1:t(r[e[0]][a],i);break;case 2:t(r[e[0]][a],r[e[1]][a],i);break;default:for(var s=0,l=[];s<n;s++)l[s]=r[e[s]][a];l[s]=i,t.apply(null,l)}}},e.prototype.getDataExtent=function(e){var t=this._chunks[e],n=[1/0,-1/0];if(!t)return n;var r,i=this.count();if(!this._indices)return this._rawExtent[e].slice();if(r=this._extent[e])return r.slice();for(var o=(r=n)[0],a=r[1],s=0;s<i;s++){var l=t[this.getRawIndex(s)];l<o&&(o=l),l>a&&(a=l)}return r=[o,a],this._extent[e]=r,r},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][t]);return n},e.prototype.clone=function(t,n){var r,i,o=new e,a=this._chunks,s=t&&X(t,(function(e,t){return e[t]=!0,e}),{});if(s)for(var l=0;l<a.length;l++)o._chunks[l]=s[l]?(r=a[l],i=void 0,(i=r.constructor)===Array?r.slice():new i(r)):a[l];else o._chunks=a;return this._copyCommonProps(o),n||(o._indices=this._cloneIndices()),o._updateGetRawIdx(),o},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=O(this._extent),e._rawExtent=O(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var r=0;r<n;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return Hf(e[r],this._dimensions[r])}ig={arrayRows:e,objectRows:function(e,t,n,r){return Hf(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(null==e.value?e:e.value);return Hf(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),fg=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length;if(mg(n)){var o=n,a=void 0,s=void 0,l=void 0;if(i){var u=r[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,t=[u._getVersionSign()]}else s=oe(a=o.get("data",!0))?ap:np,t=[];var c=this._getSourceMetaRawOption()||{},h=l&&l.metaRawOption||{},d=de(c.seriesLayoutBy,h.seriesLayoutBy)||null,p=de(c.sourceHeader,h.sourceHeader),f=de(c.dimensions,h.dimensions);e=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||f?[yf(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(i){var m=this._applyTransform(r);e=m.sourceList,t=m.upstreamSignList}else{e=[yf(g.get("source",!0),this._getSourceMetaRawOption(),null)],t=[]}}"production"!==process.env.NODE_ENV&&me(e&&t),this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,r=n.get("transform",!0),i=n.get("fromTransformResult",!0);if("production"!==process.env.NODE_ENV&&me(null!=i||null!=r),null!=i){var o="";1!==e.length&&("production"!==process.env.NODE_ENV&&(o="When using `fromTransformResult`, there should be only one upstream dataset"),vg(o))}var a,s=[],l=[];return W(e,(function(e){e.prepareSource();var t=e.getSource(i||0),n="";null==i||t||("production"!==process.env.NODE_ENV&&(n="Can not retrieve result by `fromTransformResult`: "+i),vg(n)),s.push(t),l.push(e._getVersionSign())})),r?t=function(e,t,n){var r=zo(e),i=r.length,o="";i||("production"!==process.env.NODE_ENV&&(o="If `transform` declared, it should at least contain one transform."),Po(o));for(var a=0,s=i;a<s;a++)t=ng(r[a],t,n,1===i?null:a),a!==s-1&&(t.length=Math.max(t.length,1));return t}(r,s,{datasetIndex:n.componentIndex}):null!=i&&(t=[(a=s[0],new mf({data:a.data,sourceFormat:a.sourceFormat,seriesLayoutBy:a.seriesLayoutBy,dimensionsDefine:O(a.dimensionsDefine),startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount}))]),{sourceList:t,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){"production"!==process.env.NODE_ENV&&me(mg(this._sourceHost),"Can only call getDataStore on series source manager.");var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var r=this._storeList,i=r[0];i||(i=r[0]={});var o=i[n];if(!o){var a=this._getUpstreamSourceManagers()[0];mg(this._sourceHost)&&a?o=a._innerGetDataStore(e,t,n):(o=new pg).initData(new Tf(t,e.length),e),i[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(mg(e)){var t=mp(e);return t?[t.getSourceManager()]:[]}return j(function(e){return e.get("transform",!0)||e.get("fromTransformResult",!0)?ra(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},ta).models:[]}(e),(function(e){return e.getSourceManager()}))},e.prototype._getSourceMetaRawOption=function(){var e,t,n,r=this._sourceHost;if(mg(r))e=r.get("seriesLayoutBy",!0),t=r.get("sourceHeader",!0),n=r.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=r;e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)}return{seriesLayoutBy:e,sourceHeader:t,dimensions:n}},e}();function gg(e){e.option.transform&&_e(e.option.transform)}function mg(e){return"series"===e.mainType}function vg(e){throw new Error(e)}function yg(e){var t=e.lineHeight;return null==t?"line-height:1":"line-height:"+dt(t+"")+"px"}function _g(e,t){var n=e.color||"#6e7079",r=e.fontSize||12,i=e.fontWeight||"400",o=e.color||"#464646",a=e.fontSize||14,s=e.fontWeight||"900";return"html"===t?{nameStyle:"font-size:"+dt(r+"")+"px;color:"+dt(n)+";font-weight:"+dt(i+""),valueStyle:"font-size:"+dt(a+"")+"px;color:"+dt(o)+";font-weight:"+dt(s+"")}:{nameStyle:{fontSize:r,fill:n,fontWeight:i},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var xg=[0,10,20,30],bg=["","\n","\n\n","\n\n\n"];function wg(e,t){return t.type=e,t}function Sg(e){return"section"===e.type}function Tg(e){return Sg(e)?Cg:Dg}function Mg(e){if(Sg(e)){var t=0,n=e.blocks.length,r=n>1||n>0&&!e.noHeader;return W(e.blocks,(function(e){var n=Mg(e);n>=t&&(t=n+ +(r&&(!n||Sg(e)&&!e.noHeader)))})),t}return 0}function Cg(e,t,n,r){var i,o=t.noHeader,a=(i=Mg(t),{html:xg[i],richText:bg[i]}),s=[],l=t.blocks||[];me(!l||J(l)),l=l||[];var u=e.orderMode;if(t.sortBlocks&&u){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Ae(c,u)){var h=new Yf(c[u],null);l.sort((function(e,t){return h.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===u&&l.reverse()}W(l,(function(n,i){var o=t.valueFormatter,l=Tg(n)(o?z(z({},e),{valueFormatter:o}):e,n,i>0?a.html:0,r);null!=l&&s.push(l)}));var d="richText"===e.renderMode?s.join(a.richText):Ig(r,s.join(""),o?n:a.html);if(o)return d;var p=Ld(t.header,"ordinal",e.useUTC),f=_g(r,e.renderMode).nameStyle,g=yg(r);return"richText"===e.renderMode?Eg(e,p,f)+a.richText+d:Ig(r,'<div style="'+f+";"+g+';">'+dt(p)+"</div>"+d,n)}function Dg(e,t,n,r){var i=e.renderMode,o=t.noName,a=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return j(e=J(e)?e:[e],(function(e,t){return Ld(e,J(p)?p[t]:p,u)}))};if(!o||!a){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",i),d=o?"":Ld(l,"ordinal",u),p=t.valueType,f=a?[]:c(t.value,t.dataIndex),g=!s||!o,m=!s&&o,v=_g(r,i),y=v.nameStyle,_=v.valueStyle;return"richText"===i?(s?"":h)+(o?"":Eg(e,d,y))+(a?"":function(e,t,n,r,i){var o=[i],a=r?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(J(t)?t.join(" "):t,o)}(e,f,g,m,_)):Ig(r,(s?"":h)+(o?"":function(e,t,n){return'<span style="'+n+";"+(t?"margin-left:2px":"")+'">'+dt(e)+"</span>"}(d,!s,y))+(a?"":function(e,t,n,r){var i=n?"10px":"20px",o=t?"float:right;margin-left:"+i:"";return e=J(e)?e:[e],'<span style="'+o+";"+r+'">'+j(e,(function(e){return dt(e)})).join("&nbsp;&nbsp;")+"</span>"}(f,g,m,_)),n)}}function Ag(e,t,n,r,i,o){if(e)return Tg(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,o)}function Ig(e,t,n){return'<div style="'+("margin: "+n+"px 0 0")+";"+yg(e)+';">'+t+'<div style="clear:both"></div></div>'}function Eg(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function Lg(e,t){return zd(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function Ng(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var Pg=function(){function e(){this.richTextStyles={},this._nextStyleNameId=wo()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r="richText"===n?this._generateStyleName():null,i=Rd({color:t,type:e,renderMode:n,markerId:r});return ee(i)?i:("production"!==process.env.NODE_ENV&&me(r),this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};J(t)?W(t,(function(e){return z(n,e)})):z(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,"{"+r+"|"+e+"}"},e}();function Og(e){var t,n,r,i,o=e.series,a=e.dataIndex,s=e.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=o.getRawValue(a),d=J(h),p=Lg(o,a);if(c>1||d&&!c){var f=function(e,t,n,r,i){var o=t.getData(),a=X(e,(function(e,t,n){var r=o.getDimensionInfo(n);return e||r&&!1!==r.tooltip&&null!=r.displayName}),!1),s=[],l=[],u=[];function c(e,t){var n=o.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(a?u.push(wg("nameValue",{markerType:"subItem",markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return r.length?W(r,(function(e){c(Rf(o,n,e),e)})):W(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}(h,o,a,u,p);t=f.inlineValues,n=f.inlineValueTypes,r=f.blocks,i=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);i=t=Rf(l,a,u[0]),n=g.type}else i=t=d?h[0]:h;var m=Zo(o),v=m&&o.name||"",y=l.getName(a),_=s?v:y;return wg("section",{header:v,noHeader:s||!m,sortParam:i,blocks:[wg("nameValue",{markerType:"item",markerColor:p,name:_,noName:!ve(_),value:t,valueType:n,dataIndex:a})].concat(r||[])})}var Rg=$o();function kg(e,t){return e.getName(t)||e.getId(t)}var zg="__universalTransitionEnabled",Vg=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return l(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=Bf({count:Fg,reset:Gg}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(Rg(this).sourceManager=new fg(this)).prepareSource();var r=this.getInitialData(e,n);Ug(r,this),this.dataTask.context.data=r,"production"!==process.env.NODE_ENV&&me(r,"getInitialData returned invalid data."),Rg(this).dataBeforeProcessed=r,Bg(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Xd(this),r=n?Zd(e):{},i=this.subType;$d.hasClass(i)&&(i+="Series"),R(e,t.getTheme().get(this.subType)),R(e,this.getDefaultOption()),Vo(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&Yd(e,r,n)},t.prototype.mergeOption=function(e,t){e=R(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Xd(this);n&&Yd(this.option,e,n);var r=Rg(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);Ug(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,Rg(this).dataBeforeProcessed=i,Bg(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!oe(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&Vo(e[n],"label",t)},t.prototype.getInitialData=function(e,t){},t.prototype.appendData=function(e){this.getRawData().appendData(e.data)},t.prototype.getData=function(e){var t=jg(this);if(t){var n=t.context.data;return null!=e&&n.getLinkedData?n.getLinkedData(e):n}return Rg(this).data},t.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},t.prototype.setData=function(e){var t=jg(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}Rg(this).data=e},t.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return Te(e)},t.prototype.getSourceManager=function(){return Rg(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return Rg(this).dataBeforeProcessed},t.prototype.getColorBy=function(){return this.get("colorBy")||"series"},t.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.formatTooltip=function(e,t,n){return Og({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(d.node&&(!e||!e.ssr))return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=Mp.prototype.getColorFromPalette.call(this,e,t,n);return i||(i=r.getColorFromPalette(e,t,n)),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if("series"===r||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o<e.length;o++){var a=kg(i,e[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},t.prototype.toggleSelect=function(e,t){for(var n=[],r=0;r<e.length;r++)n[0]=e[r],this.isSelected(e[r],t)?this.unselect(n,t):this.select(n,t)},t.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=q(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];i>=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return("all"===n||n[kg(r,e)])&&!r.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[zg])return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,o=i.selectedMode,a=t.length;if(o&&a)if("series"===o)i.selectedMap="all";else if("multiple"===o){re(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,l=0;l<a;l++){var u=t[l];s[h=kg(e,u)]=!0,this._selectedDataIndicesMap[h]=e.getRawIndex(u)}}else if("single"===o||!0===o){var c=t[a-1],h=kg(e,c);i.selectedMap=((n={})[h]=!0,n),this._selectedDataIndicesMap=((r={})[h]=e.getRawIndex(c),r)}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each((function(n){var r=e.getRawDataItem(n);r&&r.selected&&t.push(n)})),t.length>0&&this._innerSelect(e,t)}},t.registerClass=function(e){return $d.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}($d);function Bg(e){var t=e.name;Zo(e)||(e.name=function(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),r=[];return W(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)})),r.join(" ")}(e)||t)}function Fg(e){return e.model.getRawData().count()}function Gg(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Hg}function Hg(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Ug(e,t){W(Me(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,$(Wg,t))}))}function Wg(e,t){var n=jg(e);return n&&n.setOutputEnd((t||this).count()),t}function jg(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}H(Vg,zf),H(Vg,Mp),ha(Vg,$d);var Xg=function(){function e(){this.group=new Wi,this.uid=Hh("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();function Yg(){var e=$o();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,o=!!n.progressiveRender,a=n.large=!(!r||!r.large),s=n.progressiveRender=!(!r||!r.progressiveRender);return!(i===a&&o===s)&&"reset"}}ca(Xg),ga(Xg);var Zg=$o(),qg=Yg(),Kg=function(){function e(){this.group=new Wi,this.uid=Hh("viewChart"),this.renderTask=Bf({plan:Qg,reset:em}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){if("production"!==process.env.NODE_ENV)throw new Error("render method must been implemented")},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i?Jg(i,r,"emphasis"):"production"!==process.env.NODE_ENV&&Io("Unknown dataType "+r.dataType)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i?Jg(i,r,"normal"):"production"!==process.env.NODE_ENV&&Io("Unknown dataType "+r.dataType)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateLayout=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){hh(this.group,e)},e.markUpdateMethod=function(e,t){Zg(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function $g(e,t,n){e&&du(e)&&("emphasis"===t?Xl:Yl)(e,n)}function Jg(e,t,n){var r=Ko(e,t),i=t&&null!=t.highlightKey?function(e){var t=xl[e];return null==t&&_l<=32&&(t=xl[e]=_l++),t}(t.highlightKey):null;null!=r?W(zo(r),(function(t){$g(e.getItemGraphicEl(t),n,i)})):e.eachItemGraphicEl((function(e){$g(e,n,i)}))}function Qg(e){return qg(e.model)}function em(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,o=t.pipelineContext.progressiveRender,a=e.view,s=i&&Zg(i).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](t,n,r,i),tm[l]}ca(Kg,["dispose"]),ga(Kg);var tm={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},nm="\0__throttleOriginMethod",rm="\0__throttleRate",im="\0__throttleType";function om(e,t,n){var r,i,o,a,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,e.apply(o,a||[])}t=t||0;var d=function(){for(var e=[],d=0;d<arguments.length;d++)e[d]=arguments[d];r=(new Date).getTime(),o=this,a=e;var p=s||t,f=s||n;s=null,i=r-(f?l:u)-p,clearTimeout(c),f?c=setTimeout(h,p):i>=0?h():c=setTimeout(h,-i),l=r};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(e){s=e},d}function am(e,t,n,r){var i=e[t];if(i){var o=i[nm]||i,a=i[im];if(i[rm]!==n||a!==r){if(null==n||!r)return e[t]=o;(i=e[t]=om(o,n,"debounce"===r))[nm]=o,i[im]=r,i[rm]=n}return i}}function sm(e,t){var n=e[t];n&&n[nm]&&(n.clear&&n.clear(),e[t]=n[nm])}var lm=$o(),um={itemStyle:ma(zh,!0),lineStyle:ma(Oh,!0)},cm={lineStyle:"stroke",itemStyle:"fill"};function hm(e,t){var n=e.visualStyleMapper||um[t];return n||(console.warn("Unknown style type '"+t+"'."),um.itemStyle)}function dm(e,t){var n=e.visualDrawType||cm[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var pm={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",i=e.getModel(r),o=hm(e,r)(i),a=i.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=dm(e,r),l=o[s],u=Q(l)?l:null,c="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||c){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[s]||(o[s]=h,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||Q(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||Q(o.stroke)?h:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=z({},o);i[s]=u(r),t.setItemVisual(n,"style",i)}}}},fm=new Fh,gm={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",i=hm(e,r),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){fm.option=n[r];var a=i(fm);z(e.ensureUniqueItemVisual(t,"style"),a),fm.option.decal&&(e.setItemVisual(t,"decal",fm.option.decal),fm.option.decal.dirty=!0),o in a&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},mm={performRawSeries:!0,overallReset:function(e){var t=Te();e.eachSeries((function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var r=e.type+"-"+n,i=t.get(r);i||(i={},t.set(r,i)),lm(e).scope=i}})),e.eachSeries((function(t){if(!t.isColorBySeries()&&!e.isSeriesFiltered(t)){var n=t.getRawData(),r={},i=t.getData(),o=lm(t).scope,a=t.visualStyleAccessPath||"itemStyle",s=dm(t,a);i.each((function(e){var t=i.getRawIndex(e);r[t]=e})),n.each((function(e){var a=r[e];if(i.getItemVisual(a,"colorFromPalette")){var l=i.ensureUniqueItemVisual(a,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,o,c)}}))}}))}},vm=Math.PI;var ym=function(){function e(e,t,n,r){this._stageTaskMap=Te(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,o=r&&r.modDataCount;return{step:i,modBy:null!=o?Math.ceil(o/i):null,modDataCount:o}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),r=e.getData().count(),i=n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,o=e.get("large")&&r>=e.get("largeThreshold"),a="mod"===e.get("progressiveChunkMode")?r:null;e.pipelineContext=n.context={progressiveRender:i,modDataCount:a,large:o}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=Te();e.eachSeries((function(e){var r=e.getProgressive(),i=e.uid;n.set(i,{id:i,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:r&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(r||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;W(this._allHandlers,(function(r){var i=e.get(r.uid)||e.set(r.uid,{}),o="";"production"!==process.env.NODE_ENV&&(o='"reset" and "overallReset" must not be both specified.'),me(!(r.reset&&r.overallReset),o),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)}),this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,o=i.context;o.model=t,o.ecModel=n,o.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r=r||{};var i=!1,o=this;function a(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}W(e,(function(e,s){if(!r.visualType||r.visualType===e.visualType){var l=o._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,d=c.agentStubMap;d.each((function(e){a(r,e)&&(e.dirty(),h=!0)})),h&&c.dirty(),o.updatePayload(c,n);var p=o.getPerformArgs(c,r.block);d.each((function(e){e.perform(p)})),c.perform(p)&&(i=!0)}else u&&u.each((function(s,l){a(r,s)&&s.dirty();var u=o.getPerformArgs(s,r.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(i=!0)}))}})),this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,o=t.seriesTaskMap,a=t.seriesTaskMap=Te(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=a.set(s,o&&o.get(s)||Bf({plan:Sm,reset:Tm,count:Dm}));l.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,r).each(u)},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,o=t.overallTask=t.overallTask||Bf({reset:_m});o.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var a=o.agentStubMap,s=o.agentStubMap=Te(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1,d="";function p(e){var t=e.uid,n=s.set(t,a&&a.get(t)||(h=!0,Bf({reset:xm,onDirty:wm})));n.context={model:e,overallProgress:c},n.agent=o,n.__block=c,i._pipe(e,n)}"production"!==process.env.NODE_ENV&&(d='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),me(!e.createOnAllSeries,d),l?n.eachRawSeriesByType(l,p):u?u(n,r).each(p):(c=!1,W(n.getSeries(),p)),h&&o.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return Q(e)&&(e={overallReset:e,seriesType:Am(e)}),e.uid=Hh("stageHandler"),t&&(e.visualType=t),e},e}();function _m(e){e.overallReset(e.ecModel,e.api,e.payload)}function xm(e){return e.overallProgress&&bm}function bm(){this.agent.dirty(),this.getDownstream().dirty()}function wm(){this.agent&&this.agent.dirty()}function Sm(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Tm(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=zo(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?j(t,(function(e,t){return Cm(t)})):Mm}var Mm=Cm(0);function Cm(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var o=t.start;o<t.end;o++)i.dataEach(r,o);else i&&i.progress&&i.progress(t,r)}}function Dm(e){return e.data.count()}function Am(e){Im=null;try{e(Em,Lm)}catch(e){}return Im}var Im,Em={},Lm={};function Nm(e,t){for(var n in t.prototype)e[n]=Ie}Nm(Em,Np),Nm(Lm,zp),Em.eachSeriesByType=Em.eachRawSeriesByType=function(e){Im=e},Em.eachComponent=function(e){"series"===e.mainType&&e.subType&&(Im=e.subType)};var Pm=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],Om={color:Pm,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],Pm]},Rm="#B9B8CE",km="#100C2A",zm=function(){return{axisLine:{lineStyle:{color:Rm}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},Vm=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],Bm={darkMode:!0,color:Vm,backgroundColor:km,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:Rm},pageTextStyle:{color:Rm}},textStyle:{color:Rm},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:Rm}},dataZoom:{borderColor:"#71708A",textStyle:{color:Rm},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:Rm}},timeline:{lineStyle:{color:Rm},label:{color:Rm},controlStyle:{color:Rm,borderColor:Rm}},calendar:{itemStyle:{color:km},dayLabel:{color:Rm},monthLabel:{color:Rm},yearLabel:{color:Rm}},timeAxis:zm(),logAxis:zm(),valueAxis:zm(),categoryAxis:zm(),line:{symbol:"circle"},graph:{color:Vm},gauge:{title:{color:Rm},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:Rm},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};Bm.categoryAxis.splitLine.show=!1;var Fm=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},r={};if(ee(e)){var i=ua(e);t.mainType=i.main||null,t.subType=i.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};W(e,(function(e,i){for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=i.lastIndexOf(u);if(c>0&&c===i.length-u.length){var h=i.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}a.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,i,"name")&&u(l,i,"dataIndex")&&u(l,i,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(e,t.otherQuery,r,i));function u(e,t,n,r){return null==e[n]||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),Gm=["symbol","symbolSize","symbolRotate","symbolOffset"],Hm=Gm.concat(["symbolKeepAspect"]),Um={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var r={},i={},o=!1,a=0;a<Gm.length;a++){var s=Gm[a],l=e.get(s);Q(l)?(o=!0,i[s]=l):r[s]=l}if(r.symbol=r.symbol||e.defaultSymbol,n.setVisual(z({legendIcon:e.legendIcon||r.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},r)),!t.isSeriesFiltered(e)){var u=q(i);return{dataEach:o?function(t,n){for(var r=e.getRawValue(n),o=e.getDataParams(n),a=0;a<u.length;a++){var s=u[a];t.setItemVisual(n,s,i[s](r,o))}}:null}}}}},Wm={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){for(var n=e.getItemModel(t),r=0;r<Hm.length;r++){var i=Hm[r],o=n.getShallow(i,!0);null!=o&&e.setItemVisual(t,i,o)}}:null}}};function jm(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+n)}}function Xm(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+t)}}function Ym(e,t,n,r){switch(n){case"color":e.ensureUniqueItemVisual(t,"style")[e.getVisual("drawType")]=r,e.setItemVisual(t,"colorFromPalette",!1);break;case"opacity":e.ensureUniqueItemVisual(t,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":e.setItemVisual(t,n,r);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+n)}}function Zm(e,t){function n(t,n){var r=[];return t.eachComponent({mainType:"series",subType:e,query:n},(function(e){r.push(e.seriesIndex)})),r}W([[e+"ToggleSelect","toggleSelect"],[e+"Select","select"],[e+"UnSelect","unselect"]],(function(e){t(e[0],(function(t,r,i){t=z({},t),"production"!==process.env.NODE_ENV&&Lo(t.type,e[1]),i.dispatchAction(z(t,{type:e[1],seriesIndex:n(r,t)}))}))}))}function qm(e,t,n,r,i){var o=e+t;n.isSilent(o)||("production"!==process.env.NODE_ENV&&Eo("event "+o+" is deprecated."),r.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,a=i.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===t){var l=e.getData(),u=Ko(l,i.fromActionPayload);n.trigger(o,{type:o,seriesId:e.id,name:J(u)?l.getName(u[0]):l.getName(u),selected:ee(r)?r:z({},r)})}})))}function Km(e,t,n){for(var r;e&&(!t(e)||(r=e,!n));)e=e.__hostTarget||e.parent;return r}var $m=Math.round(9*Math.random()),Jm="function"==typeof Object.defineProperty,Qm=function(){function e(){this._id="__ec_inner_"+$m++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return Jm?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return!!this.has(e)&&(delete this._guard(e)[this._id],!0)},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},e}(),ev=Us.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,o=t.height/2;e.moveTo(n,r-o),e.lineTo(n+i,r+o),e.lineTo(n-i,r+o),e.closePath()}}),tv=Us.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,o=t.height/2;e.moveTo(n,r-o),e.lineTo(n+i,r),e.lineTo(n,r+o),e.lineTo(n-i,r),e.closePath()}}),nv=Us.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,o=Math.max(i,t.height),a=i/2,s=a*a/(o-a),l=r-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),p=.6*a,f=.7*a;e.moveTo(n-c,l+s),e.arc(n,l,a,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(n+c-h*p,l+s+d*p,n,r-f,n,r),e.bezierCurveTo(n,r-f,n-c+h*p,l+s+d*p,n-c,l+s),e.closePath()}}),rv=Us.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,o=t.y,a=r/3*2;e.moveTo(i,o),e.lineTo(i+a,o+n),e.lineTo(i,o+n/4*3),e.lineTo(i-a,o+n),e.lineTo(i,o),e.closePath()}}),iv={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var o=Math.min(n,r);i.x=e,i.y=t,i.width=o,i.height=o},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},ov={};W({line:uc,rect:tl,roundRect:tl,square:tl,circle:ku,diamond:tv,pin:nv,arrow:rv,triangle:ev},(function(e,t){ov[t]=new e}));var av=Us.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=Pi(e,t,n),i=this.shape;return i&&"pin"===i.symbolType&&"inside"===t.position&&(r.y=n.y+.4*n.height),r},buildPath:function(e,t,n){var r=t.symbolType;if("none"!==r){var i=ov[r];i||(i=ov[r="rect"]),iv[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function sv(e,t){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=e:n.fill=e,this.markRedraw()}}function lv(e,t,n,r,i,o,a){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?Xc(e.slice(8),new jt(t,n,r,i),a?"center":"cover"):0===e.indexOf("path://")?jc(e.slice(7),{},new jt(t,n,r,i),a?"center":"cover"):new av({shape:{symbolType:e,x:t,y:n,width:r,height:i}})).__isEmptyBrush=l,s.setColor=sv,o&&s.setColor(o),s}function uv(e){return J(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function cv(e,t){if(null!=e)return J(e)||(e=[e,e]),[to(e[0],t[0])||0,to(de(e[1],e[0]),t[1])||0]}function hv(e){return isFinite(e)}function dv(e,t,n){for(var r="radial"===t.type?function(e,t,n){var r=n.width,i=n.height,o=Math.min(r,i),a=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(a=a*r+n.x,s=s*i+n.y,l*=o),a=hv(a)?a:.5,s=hv(s)?s:.5,l=l>=0&&hv(l)?l:.5,e.createRadialGradient(a,s,0,a,s,l)}(e,t,n):function(e,t,n){var r=null==t.x?0:t.x,i=null==t.x2?1:t.x2,o=null==t.y?0:t.y,a=null==t.y2?0:t.y2;return t.global||(r=r*n.width+n.x,i=i*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),r=hv(r)?r:0,i=hv(i)?i:1,o=hv(o)?o:0,a=hv(a)?a:0,e.createLinearGradient(r,o,i,a)}(e,t,n),i=t.colorStops,o=0;o<i.length;o++)r.addColorStop(i[o].offset,i[o].color);return r}function pv(e){return parseInt(e,10)}function fv(e,t,n){var r=["width","height"][t],i=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=n[r]&&"auto"!==n[r])return parseFloat(n[r]);var s=document.defaultView.getComputedStyle(e);return(e[i]||pv(s[r])||pv(e.style[r]))-(pv(s[o])||0)-(pv(s[a])||0)|0}function gv(e){var t,n,r=e.style,i=r.lineDash&&r.lineWidth>0&&(t=r.lineDash,n=r.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:ne(t)?[t]:J(t)?t:null:null),o=r.lineDashOffset;if(i){var a=r.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&1!==a&&(i=j(i,(function(e){return e/a})),o/=a)}return[i,o]}var mv=new Ss(!0);function vv(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function yv(e){return"string"==typeof e&&"none"!==e}function _v(e){var t=e.fill;return null!=t&&"none"!==t}function xv(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function bv(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function wv(e,t,n){var r=ba(t.image,t.__image,n);if(Sa(r)){var i=e.createPattern(r,t.repeat||"repeat");if("function"==typeof DOMMatrix&&i&&i.setTransform){var o=new DOMMatrix;o.translateSelf(t.x||0,t.y||0),o.rotateSelf(0,0,(t.rotation||0)*Ee),o.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(o)}return i}}var Sv=["shadowBlur","shadowOffsetX","shadowOffsetY"],Tv=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Mv(e,t,n,r,i){var o=!1;if(!r&&t===(n=n||{}))return!1;if(r||t.opacity!==n.opacity){Av(e,i),o=!0;var a=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(a)?za.opacity:a}(r||t.blend!==n.blend)&&(o||(Av(e,i),o=!0),e.globalCompositeOperation=t.blend||za.blend);for(var s=0;s<Sv.length;s++){var l=Sv[s];(r||t[l]!==n[l])&&(o||(Av(e,i),o=!0),e[l]=e.dpr*(t[l]||0))}return(r||t.shadowColor!==n.shadowColor)&&(o||(Av(e,i),o=!0),e.shadowColor=t.shadowColor||za.shadowColor),o}function Cv(e,t,n,r,i){var o=Iv(t,i.inHover),a=r?null:n&&Iv(n,i.inHover)||{};if(o===a)return!1;var s=Mv(e,o,a,r,i);if((r||o.fill!==a.fill)&&(s||(Av(e,i),s=!0),yv(o.fill)&&(e.fillStyle=o.fill)),(r||o.stroke!==a.stroke)&&(s||(Av(e,i),s=!0),yv(o.stroke)&&(e.strokeStyle=o.stroke)),(r||o.opacity!==a.opacity)&&(s||(Av(e,i),s=!0),e.globalAlpha=null==o.opacity?1:o.opacity),t.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==l&&(s||(Av(e,i),s=!0),e.lineWidth=l)}for(var u=0;u<Tv.length;u++){var c=Tv[u],h=c[0];(r||o[h]!==a[h])&&(s||(Av(e,i),s=!0),e[h]=o[h]||c[1])}return s}function Dv(e,t){var n=t.transform,r=e.dpr||1;n?e.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):e.setTransform(r,0,0,r,0,0)}function Av(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function Iv(e,t){return t&&e.__hoverStyle||e.style}function Ev(e,t){Lv(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function Lv(e,t,n,r){var i=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))return t.__dirty&=-2,void(t.__isRendered=!1);var o=t.__clipPaths,a=n.prevElClipPaths,s=!1,l=!1;if(a&&!function(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}(o,a)||(a&&a.length&&(Av(e,n),e.restore(),l=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),o&&o.length&&(Av(e,n),e.save(),function(e,t,n){for(var r=!1,i=0;i<e.length;i++){var o=e[i];r=r||o.isZeroArea(),Dv(t,o),t.beginPath(),o.buildPath(t,o.shape),t.clip()}n.allClipped=r}(o,e,n),s=!0),n.prevElClipPaths=o),n.allClipped)t.__isRendered=!1;else{t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var u=n.prevEl;u||(l=s=!0);var c,h,d=t instanceof Us&&t.autoBatch&&function(e){var t=_v(e),n=vv(e);return!(e.lineDash||!(+t^+n)||t&&"string"!=typeof e.fill||n&&"string"!=typeof e.stroke||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}(t.style);s||(c=i,h=u.transform,c&&h?c[0]!==h[0]||c[1]!==h[1]||c[2]!==h[2]||c[3]!==h[3]||c[4]!==h[4]||c[5]!==h[5]:c||h)?(Av(e,n),Dv(e,t)):d||Av(e,n);var p=Iv(t,n.inHover);t instanceof Us?(1!==n.lastDrawType&&(l=!0,n.lastDrawType=1),Cv(e,t,u,l,n),d&&(n.batchFill||n.batchStroke)||e.beginPath(),function(e,t,n,r){var i,o=vv(n),a=_v(n),s=n.strokePercent,l=s<1,u=!t.path;t.silent&&!l||!u||t.createPathProxy();var c=t.path||mv,h=t.__dirty;if(!r){var d=n.fill,p=n.stroke,f=a&&!!d.colorStops,g=o&&!!p.colorStops,m=a&&!!d.image,v=o&&!!p.image,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||g)&&(w=t.getBoundingRect()),f&&(y=h?dv(e,d,w):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(_=h?dv(e,p,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),m&&(x=h||!t.__canvasFillPattern?wv(e,d,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(b=h||!t.__canvasStrokePattern?wv(e,p,t):t.__canvasStrokePattern,t.__canvasStrokePattern=x),f?e.fillStyle=y:m&&(x?e.fillStyle=x:a=!1),g?e.strokeStyle=_:v&&(b?e.strokeStyle=b:o=!1)}var S,T,M=t.getGlobalScale();c.setScale(M[0],M[1],t.segmentIgnoreThreshold),e.setLineDash&&n.lineDash&&(S=(i=gv(t))[0],T=i[1]);var C=!0;(u||4&h)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),C=!1),c.reset(),t.buildPath(c,t.shape,r),c.toStatic(),t.pathUpdated()),C&&c.rebuildPath(e,l?s:1),S&&(e.setLineDash(S),e.lineDashOffset=T),r||(n.strokeFirst?(o&&bv(e,n),a&&xv(e,n)):(a&&xv(e,n),o&&bv(e,n))),S&&e.setLineDash([])}(e,t,p,d),d&&(n.batchFill=p.fill||"",n.batchStroke=p.stroke||"")):t instanceof js?(3!==n.lastDrawType&&(l=!0,n.lastDrawType=3),Cv(e,t,u,l,n),function(e,t,n){var r,i=n.text;if(null!=i&&(i+=""),i){e.font=n.font||f,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var o=void 0,a=void 0;e.setLineDash&&n.lineDash&&(o=(r=gv(t))[0],a=r[1]),o&&(e.setLineDash(o),e.lineDashOffset=a),n.strokeFirst?(vv(n)&&e.strokeText(i,n.x,n.y),_v(n)&&e.fillText(i,n.x,n.y)):(_v(n)&&e.fillText(i,n.x,n.y),vv(n)&&e.strokeText(i,n.x,n.y)),o&&e.setLineDash([])}}(e,t,p)):t instanceof Zs?(2!==n.lastDrawType&&(l=!0,n.lastDrawType=2),function(e,t,n,r,i){Mv(e,Iv(t,i.inHover),n&&Iv(n,i.inHover),r,i)}(e,t,u,l,n),function(e,t,n){var r=t.__image=ba(n.image,t.__image,t,t.onload);if(r&&Sa(r)){var i=n.x||0,o=n.y||0,a=t.getWidth(),s=t.getHeight(),l=r.width/r.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=r.width,s=r.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(r,u,c,n.sWidth,n.sHeight,i,o,a,s)}else if(n.sx&&n.sy){var h=a-(u=n.sx),d=s-(c=n.sy);e.drawImage(r,u,c,h,d,i,o,a,s)}else e.drawImage(r,i,o,a,s)}}(e,t,p)):t.getTemporalDisplayables&&(4!==n.lastDrawType&&(l=!0,n.lastDrawType=4),function(e,t,n){var r=t.getDisplayables(),i=t.getTemporalDisplayables();e.save();var o,a,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(o=t.getCursor(),a=r.length;o<a;o++){(c=r[o]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),Lv(e,c,s,o===a-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}for(var l=0,u=i.length;l<u;l++){var c;(c=i[l]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),Lv(e,c,s,l===u-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}(e,t,n)),d&&r&&Av(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}}var Nv=new Qm,Pv=new Un(100),Ov=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Rv(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),r=t.getZr(),i="svg"===r.painter.type;e.dirty&&Nv.delete(e);var o=Nv.get(e);if(o)return o;var a=V(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(e){for(var t,o=[n],s=!0,l=0;l<Ov.length;++l){var u=a[Ov[l]];if(null!=u&&!J(u)&&!ee(u)&&!ne(u)&&"boolean"!=typeof u){s=!1;break}o.push(u)}if(s){t=o.join(",")+(i?"-svg":"");var c=Pv.get(t);c&&(i?e.svgElement=c:e.image=c)}var h,d=zv(a.dashArrayX),p=function(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if(ne(e)){var t=Math.ceil(e);return[t,t]}var n=j(e,(function(e){return Math.ceil(e)}));return e.length%2?n.concat(n):n}(a.dashArrayY),f=kv(a.symbol),g=(b=d,j(b,(function(e){return Vv(e)}))),m=Vv(p),v=!i&&y.createCanvas(),_=i&&{tag:"g",attrs:{},key:"dcl",children:[]},x=function(){for(var e=1,t=0,n=g.length;t<n;++t)e=To(e,g[t]);var r=1;for(t=0,n=f.length;t<n;++t)r=To(r,f[t].length);e*=r;var i=m*g.length*f.length;if("production"!==process.env.NODE_ENV){var o=function(e){console.warn("Calculated decal size is greater than "+e+" due to decal option settings so "+e+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+e+" to be larger to avoid incontinuity.")};e>a.maxTileWidth&&o("maxTileWidth"),i>a.maxTileHeight&&o("maxTileHeight")}return{width:Math.max(1,Math.min(e,a.maxTileWidth)),height:Math.max(1,Math.min(i,a.maxTileHeight))}}();var b;v&&(v.width=x.width*n,v.height=x.height*n,h=v.getContext("2d"));(function(){h&&(h.clearRect(0,0,v.width,v.height),a.backgroundColor&&(h.fillStyle=a.backgroundColor,h.fillRect(0,0,v.width,v.height)));for(var e=0,t=0;t<p.length;++t)e+=p[t];if(e<=0)return;var o=-m,s=0,l=0,u=0;for(;o<x.height;){if(s%2==0){for(var c=l/2%f.length,g=0,y=0,b=0;g<2*x.width;){var w=0;for(t=0;t<d[u].length;++t)w+=d[u][t];if(w<=0)break;if(y%2==0){var S=.5*(1-a.symbolSize),T=g+d[u][y]*S,M=o+p[s]*S,C=d[u][y]*a.symbolSize,D=p[s]*a.symbolSize,A=b/2%f[c].length;I(T,M,C,D,f[c][A])}g+=d[u][y],++b,++y===d[u].length&&(y=0)}++u===d.length&&(u=0)}o+=p[s],++l,++s===p.length&&(s=0)}function I(e,t,o,s,l){var u=i?1:n,c=lv(l,e*u,t*u,o*u,s*u,a.color,a.symbolKeepAspect);if(i){var d=r.painter.renderOneToVNode(c);d&&_.children.push(d)}else Ev(h,c)}})(),s&&Pv.put(t,v||_);e.image=v,e.svgElement=_,e.svgWidth=x.width,e.svgHeight=x.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=i?1:1/n,Nv.set(e,s),e.dirty=!1,s}function kv(e){if(!e||0===e.length)return[["rect"]];if(ee(e))return[[e]];for(var t=!0,n=0;n<e.length;++n)if(!ee(e[n])){t=!1;break}if(t)return kv([e]);var r=[];for(n=0;n<e.length;++n)ee(e[n])?r.push([e[n]]):r.push(e[n]);return r}function zv(e){if(!e||0===e.length)return[[0,0]];if(ne(e))return[[i=Math.ceil(e),i]];for(var t=!0,n=0;n<e.length;++n)if(!ne(e[n])){t=!1;break}if(t)return zv([e]);var r=[];for(n=0;n<e.length;++n)if(ne(e[n])){var i=Math.ceil(e[n]);r.push([i,i])}else{(i=j(e[n],(function(e){return Math.ceil(e)}))).length%2==1?r.push(i.concat(i)):r.push(i)}return r}function Vv(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}var Bv=new nt,Fv={};function Gv(e){return"production"!==process.env.NODE_ENV&&(Fv[e]||Io("Implementation of "+e+" doesn't exists.")),Fv[e]}var Hv=2e3,Uv=4500,Wv={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:Hv,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:Uv,ARIA:6e3,DECAL:7e3}},jv="__flagInMainProcess",Xv="__pendingUpdate",Yv="__needsUpdateStatus",Zv=/^[a-zA-Z0-9_]+$/,qv="__connectUpdateStatus";function Kv(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!this.isDisposed())return Jv(this,e,t);wy(this.id)}}function $v(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Jv(this,e,t)}}function Jv(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),nt.prototype[t].apply(e,n)}var Qv,ey,ty,ny,ry,iy,oy,ay,sy,ly,uy,cy,hy,dy,py,fy,gy,my,vy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(nt),yy=vy.prototype;yy.on=$v("on"),yy.off=$v("off");var _y=function(e){function t(t,n,r){var i=e.call(this,new Fm)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],r=r||{},ee(n)&&(n=Ay[n]),i._dom=t;var o="canvas",a="auto",s=!1;if("production"!==process.env.NODE_ENV){var l=d.hasGlobalWindow?window:global;l&&(o=de(l.__ECHARTS__DEFAULT__RENDERER__,o),a=de(l.__ECHARTS__DEFAULT__COARSE_POINTER,a),s=de(l.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,s))}r.ssr&&Ji((function(e){var t=vl(e),n=t.dataIndex;if(null!=n){var r=Te();return r.set("series_index",t.seriesIndex),r.set("data_index",n),t.ssrType&&r.set("ssr_type",t.ssrType),r}}));var u=i._zr=qi(t,{renderer:r.renderer||o,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:de(r.useDirtyRect,s),useCoarsePointer:de(r.useCoarsePointer,a),pointerSize:r.pointerSize});i._ssr=r.ssr,i._throttledZrFlush=om(K(u.flush,u),17),(n=O(n))&&uf(n,!0),i._theme=n,i._locale=function(e){if(ee(e)){var t=Yh[e.toUpperCase()]||{};return e===Wh||e===jh?O(t):R(O(t),O(Yh[Xh]),!1)}return R(O(e),O(Yh[Xh]),!1)}(r.locale||qh),i._coordSysMgr=new Bp;var c=i._api=py(i);function h(e,t){return e.__prio-t.__prio}return ln(Dy,h),ln(My,h),i._scheduler=new ym(i,c,My,Dy),i._messageCenter=new vy,i._initEvents(),i.resize=K(i.resize,i),u.animation.on("frame",i._onframe,i),ly(u,i),uy(u,i),_e(i),i}return l(t,e),t.prototype._onframe=function(){if(!this._disposed){my(this);var e=this._scheduler;if(this[Xv]){var t=this[Xv].silent;this[jv]=!0;try{Qv(this),ny.update.call(this,null,this[Xv].updateParams)}catch(e){throw this[jv]=!1,this[Xv]=null,e}this._zr.flush(),this[jv]=!1,this[Xv]=null,ay.call(this,t),sy.call(this,t)}else if(e.unfinished){var n=1,r=this._model,i=this._api;e.unfinished=!1;do{var o=+new Date;e.performSeriesTasks(r),e.performDataProcessorTasks(r),iy(this,r),e.performVisualTasks(r),dy(this,this._model,i,"remain",{}),n-=+new Date-o}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(this[jv])"production"!==process.env.NODE_ENV&&Io("`setOption` should not be called during main process.");else if(this._disposed)wy(this.id);else{var r,i,o;if(re(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,o=t.transition,t=t.notMerge),this[jv]=!0,!this._model||t){var a=new Gp(this._api),s=this._theme,l=this._model=new Np;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(e,{replaceMerge:i},Cy);var u={seriesTransition:o,optionChanged:!0};if(n)this[Xv]={silent:r,updateParams:u},this[jv]=!1,this.getZr().wakeUp();else{try{Qv(this),ny.update.call(this,null,u)}catch(e){throw this[Xv]=null,this[jv]=!1,e}this._ssr||this._zr.flush(),this[Xv]=null,this[jv]=!1,ay.call(this,r),sy.call(this,r)}}},t.prototype.setTheme=function(){Eo("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||d.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return"production"!==process.env.NODE_ENV&&Lo("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var t=this._zr.painter;if("production"!==process.env.NODE_ENV&&"canvas"!==t.type)throw new Error("renderToCanvas can only be used in the canvas renderer.");return t.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var t=this._zr.painter;if("production"!==process.env.NODE_ENV&&"svg"!==t.type)throw new Error("renderToSVGString can only be used in the svg renderer.");return t.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(d.svgSupported){var e=this._zr;return W(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,r=[],i=this;W(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return W(r,(function(e){e.group.ignore=!1})),o}wy(this.id)},t.prototype.getConnectedDataURL=function(e){if(!this._disposed){var t="svg"===e.type,n=this.group,r=Math.min,i=Math.max,o=1/0;if(Ly[n]){var a=o,s=o,l=-1/0,u=-1/0,c=[],h=e&&e.pixelRatio||this.getDevicePixelRatio();W(Ey,(function(o,h){if(o.group===n){var d=t?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(O(e)),p=o.getDom().getBoundingClientRect();a=r(p.left,a),s=r(p.top,s),l=i(p.right,l),u=i(p.bottom,u),c.push({dom:d,left:p.left,top:p.top})}}));var d=(l*=h)-(a*=h),p=(u*=h)-(s*=h),f=y.createCanvas(),g=qi(f,{renderer:t?"svg":"canvas"});if(g.resize({width:d,height:p}),t){var m="";return W(c,(function(e){var t=e.left-a,n=e.top-s;m+='<g transform="translate('+t+","+n+')">'+e.dom+"</g>"})),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new tl({shape:{x:0,y:0,width:d,height:p},style:{fill:e.connectedBackgroundColor}})),W(c,(function(e){var t=new Zs({style:{x:e.left*h-a,y:e.top*h-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}wy(this.id)},t.prototype.convertToPixel=function(e,t){return ry(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return ry(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return W(Qo(this._model,e),(function(e,r){r.indexOf("Models")>=0&&W(e,(function(e){var i=e.coordinateSystem;if(i&&i.containPoint)n=n||!!i.containPoint(t);else if("seriesModels"===r){var o=this._chartsMap[e.__viewId];o&&o.containPoint?n=n||o.containPoint(t,e):"production"!==process.env.NODE_ENV&&Ao(r+": "+(o?"The found component do not support containPoint.":"No view mapping to the found component."))}else"production"!==process.env.NODE_ENV&&Ao(r+": containPoint is not supported")}),this)}),this),!!n;wy(this.id)},t.prototype.getVisual=function(e,t){var n=Qo(this._model,e,{defaultMainType:"series"}),r=n.seriesModel;"production"!==process.env.NODE_ENV&&(r||Ao("There is no specified series model"));var i=r.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?jm(i,o,t):Xm(i,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,r=this;W(by,(function(e){var t=function(t){var n,i=r.getModel(),o=t.target,a="globalout"===e;if(a?n={}:o&&Km(o,(function(e){var t=vl(e);if(t&&null!=t.dataIndex){var r=t.dataModel||i.getSeriesByIndex(t.seriesIndex);return n=r&&r.getDataParams(t.dataIndex,t.dataType,o)||{},!0}if(t.eventData)return n=z({},t.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&i.getComponent(s,l),c=u&&r["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];"production"!==process.env.NODE_ENV&&(a||u&&c||Ao("model or view can not be found by params")),n.event=t,n.type=e,r._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:u,view:c},r.trigger(e,n)}};t.zrEventfulCallAtLast=!0,r._zr.on(e,t,r)})),W(Ty,(function(e,t){r._messageCenter.on(t,(function(e){this.trigger(t,e)}),r)})),W(["selectchanged"],(function(e){r._messageCenter.on(e,(function(t){this.trigger(e,t)}),r)})),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",(function(e){var r=n.getModel();e.isFromClick?(qm("map","selectchanged",t,r,e),qm("pie","selectchanged",t,r,e)):"select"===e.fromAction?(qm("map","selected",t,r,e),qm("pie","selected",t,r,e)):"unselect"===e.fromAction&&(qm("map","unselected",t,r,e),qm("pie","unselected",t,r,e))}))},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?wy(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)wy(this.id);else{this._disposed=!0,this.getDom()&&ia(this.getDom(),Oy,"");var e=this,t=e._api,n=e._model;W(e._componentsViews,(function(e){e.dispose(n,t)})),W(e._chartsViews,(function(e){e.dispose(n,t)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete Ey[e.id]}},t.prototype.resize=function(e){if(this[jv])"production"!==process.env.NODE_ENV&&Io("`resize` should not be called during main process.");else if(this._disposed)wy(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),r=e&&e.silent;this[Xv]&&(null==r&&(r=this[Xv].silent),n=!0,this[Xv]=null),this[jv]=!0;try{n&&Qv(this),ny.update.call(this,{type:"resize",animation:z({duration:0},e&&e.animation)})}catch(e){throw this[jv]=!1,e}this[jv]=!1,ay.call(this,r),sy.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed)wy(this.id);else if(re(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),Iy[e]){var n=Iy[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}else"production"!==process.env.NODE_ENV&&Ao("Loading effects "+e+" not exists.")},t.prototype.hideLoading=function(){this._disposed?wy(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=z({},e);return t.type=Ty[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)wy(this.id);else if(re(t)||(t={silent:!!t}),Sy[e.type]&&this._model)if(this[jv])this._pendingActions.push(e);else{var n=t.silent;oy.call(this,e,n);var r=t.flush;r?this._zr.flush():!1!==r&&d.browser.weChat&&this._throttledZrFlush(),ay.call(this,n),sy.call(this,n)}},t.prototype.updateLabelLayout=function(){Bv.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)wy(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);"production"!==process.env.NODE_ENV&&me(e.data&&n),n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function t(e){for(var t=[],n=e.currentStates,r=0;r<n.length;r++){var i=n[r];"emphasis"!==i&&"blur"!==i&&"select"!==i&&t.push(i)}e.selected&&e.states.select&&t.push("select"),2===e.hoverState&&e.states.emphasis?t.push("emphasis"):1===e.hoverState&&e.states.blur&&t.push("blur"),e.useStates(t)}function n(e,t){if(!e.preventAutoZ){var n=e.get("z")||0,i=e.get("zlevel")||0;t.eachRendered((function(e){return r(e,n,i,-1/0),!0}))}}function r(e,t,n,i){var o=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var s=e.childrenRef(),l=0;l<s.length;l++)i=Math.max(r(s[l],t,n,i),i);else e.z=t,e.zlevel=n,i=Math.max(e.z2,i);if(o&&(o.z=t,o.zlevel=n,isFinite(i)&&(o.z2=i+2)),a){var u=e.textGuideLineConfig;a.z=t,a.zlevel=n,isFinite(i)&&(a.z2=i+(u&&u.showAbove?1:-1))}return i}function i(e,t){t.eachRendered((function(e){if(!Nc(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&(e.stateTransition=null),t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&(e.prevStates=null)}}))}function o(e,n){var r=e.getModel("stateAnimation"),i=e.isAnimationEnabled(),o=r.get("duration"),a=o>0?{duration:o,delay:r.get("delay"),easing:r.get("easing")}:null;n.eachRendered((function(e){if(e.states&&e.states.emphasis){if(Nc(e))return;if(e instanceof Us&&function(e){var t=bl(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(i){e.stateTransition=a;var r=e.getTextContent(),o=e.getTextGuideLine();r&&(r.stateTransition=a),o&&(o.stateTransition=a)}e.__dirty&&t(e)}}))}Qv=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),ey(e,!0),ey(e,!1),t.plan()},ey=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,o=t?e._componentsMap:e._chartsMap,a=e._zr,s=e._api,l=0;l<i.length;l++)i[l].__alive=!1;function u(e){var l=e.__requireNewView;e.__requireNewView=!1;var u="_ec_"+e.id+"_"+e.type,c=!l&&o[u];if(!c){var h=ua(e.type),d=t?Xg.getClass(h.main,h.sub):Kg.getClass(h.sub);"production"!==process.env.NODE_ENV&&me(d,h.sub+" does not exist."),(c=new d).init(n,s),o[u]=c,i.push(c),a.add(c.group)}e.__viewId=c.__id=u,c.__alive=!0,c.__model=e,c.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!t&&r.prepareView(c,e,n,s)}t?n.eachComponent((function(e,t){"series"!==e&&u(t)})):n.eachSeries(u);for(l=0;l<i.length;){var c=i[l];c.__alive?l++:(!t&&c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),i.splice(l,1),o[c.__id]===c&&delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}},ty=function(e,t,n,r,i){var o=e._model;if(o.setUpdatePayload(n),r){var a={};a[r+"Id"]=n[r+"Id"],a[r+"Index"]=n[r+"Index"],a[r+"Name"]=n[r+"Name"];var s={mainType:r,query:a};i&&(s.subType=i);var l,u=n.excludeSeriesId;null!=u&&(l=Te(),W(zo(u),(function(e){var t=jo(e,null);null!=t&&l.set(t,!0)}))),o&&o.eachComponent(s,(function(t){if(!(l&&null!=l.get(t.id)))if(fu(n))if(t instanceof Vg)n.type!==Cl||n.notBlur||t.get(["emphasis","disabled"])||function(e,t,n){var r=e.seriesIndex,i=e.getData(t.dataType);if(i){var o=Ko(i,t);o=(J(o)?o[0]:o)||0;var a=i.getItemGraphicEl(o);if(!a)for(var s=i.count(),l=0;!a&&l<s;)a=i.getItemGraphicEl(l++);if(a){var u=vl(a);eu(r,u.focus,u.blurScope,n)}else{var c=e.get(["emphasis","focus"]),h=e.get(["emphasis","blurScope"]);null!=c&&eu(r,c,h,n)}}else"production"!==process.env.NODE_ENV&&Io("Unknown dataType "+t.dataType)}(t,n,e._api);else{var r=nu(t.mainType,t.componentIndex,n.name,e._api),i=r.focusSelf,o=r.dispatchers;n.type===Cl&&i&&!n.notBlur&&tu(t.mainType,t.componentIndex,e._api),o&&W(o,(function(e){n.type===Cl?Xl(e):Yl(e)}))}else pu(n)&&t instanceof Vg&&(!function(e,t){if(pu(t)){var n=t.dataType,r=Ko(e.getData(n),t);J(r)||(r=[r]),e[t.type===El?"toggleSelect":t.type===Al?"select":"unselect"](r,n)}}(t,n,e._api),ru(t),gy(e))}),e),o&&o.eachComponent(s,(function(t){l&&null!=l.get(t.id)||c(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else W([].concat(e._componentsViews).concat(e._chartsViews),c);function c(r){r&&r.__alive&&r[t]&&r[t](r.__model,o,e._api,n)}},ny={prepareAndUpdate:function(e){Qv(this),ny.update.call(this,e,{optionChanged:null!=e.newOption})},update:function(t,n){var r=this._model,i=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(r){r.setUpdatePayload(t),s.restoreData(r,t),s.performSeriesTasks(r),a.create(r,i),s.performDataProcessorTasks(r,t),iy(this,r),a.update(r,i),e(r),s.performVisualTasks(r,t),cy(this,r,i,t,n);var l=r.get("backgroundColor")||"transparent",u=r.get("darkMode");o.setBackgroundColor(l),null!=u&&"auto"!==u&&o.setDarkMode(u),Bv.trigger("afterupdate",r,i)}},updateTransform:function(t){var n=this,r=this._model,i=this._api;if(r){r.setUpdatePayload(t);var o=[];r.eachComponent((function(e,a){if("series"!==e){var s=n.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,r,i,t);l&&l.update&&o.push(s)}else o.push(s)}}));var a=Te();r.eachSeries((function(e){var o=n._chartsMap[e.__viewId];if(o.updateTransform){var s=o.updateTransform(e,r,i,t);s&&s.update&&a.set(e.uid,1)}else a.set(e.uid,1)})),e(r),this._scheduler.performVisualTasks(r,t,{setDirty:!0,dirtyMap:a}),dy(this,r,i,t,{},a),Bv.trigger("afterupdate",r,i)}},updateView:function(t){var n=this._model;n&&(n.setUpdatePayload(t),Kg.markUpdateMethod(t,"updateView"),e(n),this._scheduler.performVisualTasks(n,t,{setDirty:!0}),cy(this,n,this._api,t,{}),Bv.trigger("afterupdate",n,this._api))},updateVisual:function(t){var n=this,r=this._model;r&&(r.setUpdatePayload(t),r.eachSeries((function(e){e.getData().clearAllVisual()})),Kg.markUpdateMethod(t,"updateVisual"),e(r),this._scheduler.performVisualTasks(r,t,{visualType:"visual",setDirty:!0}),r.eachComponent((function(e,i){if("series"!==e){var o=n.getViewOfComponentModel(i);o&&o.__alive&&o.updateVisual(i,r,n._api,t)}})),r.eachSeries((function(e){n._chartsMap[e.__viewId].updateVisual(e,r,n._api,t)})),Bv.trigger("afterupdate",r,this._api))},updateLayout:function(e){ny.update.call(this,e)}},ry=function(e,t,n,r){if(e._disposed)wy(e.id);else{for(var i,o=e._model,a=e._coordSysMgr.getCoordinateSystems(),s=Qo(o,n),l=0;l<a.length;l++){var u=a[l];if(u[t]&&null!=(i=u[t](o,s,r)))return i}"production"!==process.env.NODE_ENV&&Ao("No coordinate system that supports "+t+" found by the given finder.")}},iy=function(e,t){var n=e._chartsMap,r=e._scheduler;t.eachSeries((function(e){r.updateStreamModes(e,n[e.__viewId])}))},oy=function(e,t){var n=this,r=this.getModel(),i=e.type,o=e.escapeConnect,a=Sy[i],s=a.actionInfo,l=(s.update||"update").split(":"),u=l.pop(),c=null!=l[0]&&ua(l[0]);this[jv]=!0;var h=[e],d=!1;e.batch&&(d=!0,h=j(e.batch,(function(t){return(t=V(z({},t),e)).batch=null,t})));var p,f=[],g=pu(e),m=fu(e);if(m&&Ql(this._api),W(h,(function(t){if((p=(p=a.action(t,n._model,n._api))||z({},t)).type=s.event||p.type,f.push(p),m){var r=ea(e),i=r.queryOptionMap,o=r.mainTypeSpecified?i.keys()[0]:"series";ty(n,u,t,o),gy(n)}else g?(ty(n,u,t,"series"),gy(n)):c&&ty(n,u,t,c.main,c.sub)})),"none"!==u&&!m&&!g&&!c)try{this[Xv]?(Qv(this),ny.update.call(this,e),this[Xv]=null):ny[u].call(this,e)}catch(e){throw this[jv]=!1,e}if(p=d?{type:s.event||i,escapeConnect:o,batch:f}:f[0],this[jv]=!1,!t){var v=this._messageCenter;if(v.trigger(p.type,p),g){var y={type:"selectchanged",escapeConnect:o,selected:iu(r),isFromClick:e.isFromClick||!1,fromAction:e.type,fromActionPayload:e};v.trigger(y.type,y)}}},ay=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();oy.call(this,n,e)}},sy=function(e){!e&&this.trigger("updated")},ly=function(e,t){e.on("rendered",(function(n){t.trigger("rendered",n),!e.animation.isFinished()||t[Xv]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))},uy=function(e,t){e.on("mouseover",(function(e){var n=Km(e.target,du);n&&(!function(e,t,n){"production"===process.env.NODE_ENV||du(e)||Io("param should be highDownDispatcher");var r=vl(e),i=nu(r.componentMainType,r.componentIndex,r.componentHighDownName,n),o=i.dispatchers,a=i.focusSelf;o?(a&&tu(r.componentMainType,r.componentIndex,n),W(o,(function(e){return Wl(e,t)}))):(eu(r.seriesIndex,r.focus,r.blurScope,n),"self"===r.focus&&tu(r.componentMainType,r.componentIndex,n),Wl(e,t))}(n,e,t._api),gy(t))})).on("mouseout",(function(e){var n=Km(e.target,du);n&&(!function(e,t,n){"production"===process.env.NODE_ENV||du(e)||Io("param should be highDownDispatcher"),Ql(n);var r=vl(e),i=nu(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;i?W(i,(function(e){return jl(e,t)})):jl(e,t)}(n,e,t._api),gy(t))})).on("click",(function(e){var n=Km(e.target,(function(e){return null!=vl(e).dataIndex}),!0);if(n){var r=n.selected?"unselect":"select",i=vl(n);t._api.dispatchAction({type:r,dataType:i.dataType,dataIndexInside:i.dataIndex,seriesIndex:i.seriesIndex,isFromClick:!0})}}))},cy=function(e,t,n,r,i){!function(e){var t=[],n=[],r=!1;if(e.eachComponent((function(e,i){var o=i.get("zlevel")||0,a=i.get("z")||0,s=i.getZLevelKey();r=r||!!s,("series"===e?n:t).push({zlevel:o,z:a,idx:i.componentIndex,type:e,key:s})})),r){var i,o,a=t.concat(n);ln(a,(function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel})),W(a,(function(t){var n=e.getComponent(t.type,t.idx),r=t.zlevel,a=t.key;null!=i&&(r=Math.max(i,r)),a?(r===i&&a!==o&&r++,o=a):o&&(r===i&&r++,o=""),i=r,n.setZLevel(r)}))}}(t),hy(e,t,n,r,i),W(e._chartsViews,(function(e){e.__alive=!1})),dy(e,t,n,r,i),W(e._chartsViews,(function(e){e.__alive||e.remove(t,n)}))},hy=function(e,t,r,a,s,l){W(l||e._componentsViews,(function(e){var s=e.__model;i(s,e),e.render(s,t,r,a),n(s,e),o(s,e)}))},dy=function(e,t,r,a,s,l){var u=e._scheduler;s=z(s||{},{updatedSeries:t.getSeries()}),Bv.trigger("series:beforeupdate",t,r,s);var c=!1;t.eachSeries((function(t){var n=e._chartsMap[t.__viewId];n.__alive=!0;var r=n.renderTask;u.updatePayload(r,a),i(t,n),l&&l.get(t.uid)&&r.dirty(),r.perform(u.getPerformArgs(r))&&(c=!0),n.group.silent=!!t.get("silent"),function(e,t){var n=e.get("blendMode")||null;t.eachRendered((function(e){e.isGroup||(e.style.blend=n)}))}(t,n),ru(t)})),u.unfinished=c||u.unfinished,Bv.trigger("series:layoutlabels",t,r,s),Bv.trigger("series:transition",t,r,s),t.eachSeries((function(t){var r=e._chartsMap[t.__viewId];n(t,r),o(t,r)})),function(e,t){var n=e._zr,r=n.storage,i=0;r.traverse((function(e){e.isGroup||i++})),i>t.get("hoverLayerThreshold")&&!d.node&&!d.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,t),Bv.trigger("series:afterupdate",t,r,s)},gy=function(e){e[Yv]=!0,e.getZr().wakeUp()},my=function(e){e[Yv]&&(e.getZr().storage.traverse((function(e){Nc(e)||t(e)})),e[Yv]=!1)},py=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return l(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Xl(t,n),gy(e)},n.prototype.leaveEmphasis=function(t,n){Yl(t,n),gy(e)},n.prototype.enterBlur=function(t){Zl(t),gy(e)},n.prototype.leaveBlur=function(t){ql(t),gy(e)},n.prototype.enterSelect=function(t){Kl(t),gy(e)},n.prototype.leaveSelect=function(t){$l(t),gy(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(zp))(e)},fy=function(e){function t(e,t){for(var n=0;n<e.length;n++){e[n][qv]=t}}W(Ty,(function(n,r){e._messageCenter.on(r,(function(n){if(Ly[e.group]&&0!==e[qv]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),i=[];W(Ey,(function(t){t!==e&&t.group===e.group&&i.push(t)})),t(i,0),W(i,(function(e){1!==e[qv]&&e.dispatchAction(r)})),t(i,2)}}))}))}}(),t}(nt),xy=_y.prototype;xy.on=Kv("on"),xy.off=Kv("off"),xy.one=function(e,t,n){var r=this;Eo("ECharts#one is deprecated."),this.on.call(this,e,(function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];t&&t.apply&&t.apply(this,i),r.off(e,n)}),n)};var by=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function wy(e){"production"!==process.env.NODE_ENV&&Ao("Instance "+e+" has been disposed")}var Sy={},Ty={},My=[],Cy=[],Dy=[],Ay={},Iy={},Ey={},Ly={},Ny=+new Date-0,Py=+new Date-0,Oy="_echarts_instance_";function Ry(e,t,n){var r=!(n&&n.ssr);if(r){if("production"!==process.env.NODE_ENV&&!e)throw new Error("Initialize failed: invalid dom.");var i=Vy(e);if(i)return"production"!==process.env.NODE_ENV&&Ao("There is a chart instance already initialized on the dom."),i;"production"!==process.env.NODE_ENV&&(!ae(e)||"CANVAS"===e.nodeName.toUpperCase()||(e.clientWidth||n&&null!=n.width)&&(e.clientHeight||n&&null!=n.height)||Ao("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload."))}var o=new _y(e,t,n);return o.id="ec_"+Ny++,Ey[o.id]=o,r&&ia(e,Oy,o.id),fy(o),Bv.trigger("afterinit",o),o}function ky(e){Ly[e]=!1}var zy=ky;function Vy(e){return Ey[function(e,t){return e.getAttribute?e.getAttribute(t):e[t]}(e,Oy)]}function By(e,t){Ay[e]=t}function Fy(e){F(Cy,e)<0&&Cy.push(e)}function Gy(e,t){$y(My,e,t,2e3)}function Hy(e){Wy("afterinit",e)}function Uy(e){Wy("afterupdate",e)}function Wy(e,t){Bv.on(e,t)}function jy(e,t,n){Q(t)&&(n=t,t="");var r=re(e)?e.type:[e,e={event:t}][0];e.event=(e.event||r).toLowerCase(),t=e.event,Ty[t]||(me(Zv.test(r)&&Zv.test(t)),Sy[r]||(Sy[r]={action:n,actionInfo:e}),Ty[t]=r)}function Xy(e,t){Bp.register(e,t)}function Yy(e){var t=Bp.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()}function Zy(e,t){$y(Dy,e,t,1e3,"layout")}function qy(e,t){$y(Dy,e,t,3e3,"visual")}var Ky=[];function $y(e,t,n,r,i){if((Q(t)||re(t))&&(n=t,t=r),"production"!==process.env.NODE_ENV){if(isNaN(t)||null==t)throw new Error("Illegal priority");W(e,(function(e){me(e.__raw!==n)}))}if(!(F(Ky,n)>=0)){Ky.push(n);var o=ym.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function Jy(e,t){Iy[e]=t}function Qy(e,t,n){var r=Gv("registerMap");r&&r(e,t,n)}function e_(e){var t=Gv("getMap");return t&&t(e)}var t_=function(e){var t=(e=O(e)).type,n="";t||("production"!==process.env.NODE_ENV&&(n="Must have a `type` when `registerTransform`."),Po(n));var r=t.split(":");2!==r.length&&("production"!==process.env.NODE_ENV&&(n='Name must include namespace like "ns:regression".'),Po(n));var i=!1;"echarts"===r[0]&&(t=r[1],i=!0),e.__isBuiltIn=i,tg.set(t,e)};qy(Hv,pm),qy(Uv,gm),qy(Uv,mm),qy(Hv,Um),qy(Uv,Wm),qy(7e3,(function(e,t){e.eachRawSeries((function(n){if(!e.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each((function(e){var n=r.getItemVisual(e,"decal");n&&(r.ensureUniqueItemVisual(e,"style").decal=Rv(n,t))}));var i=r.getVisual("decal");if(i)r.getVisual("style").decal=Rv(i,t)}}))})),Fy(uf),Gy(900,(function(e){var t=Te();e.eachSeries((function(e){var n=e.get("stack");if(n){var r=t.get(n)||t.set(n,[]),i=e.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:e};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;r.length&&i.setCalculationInfo("stackedOnSeries",r[r.length-1].seriesModel),r.push(o)}})),t.each(cf)})),Jy("default",(function(e,t){V(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Wi,r=new tl({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i,o=new il({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new tl({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(a),t.showSpinner&&((i=new gc({shape:{startAngle:-vm/2,endAngle:-vm/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*vm/2}).start("circularInOut"),i.animateShape(!0).when(1e3,{startAngle:3*vm/2}).delay(300).start("circularInOut"),n.add(i)),n.resize=function(){var n=o.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),u=e.getHeight()/2;t.showSpinner&&i.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n})),jy({type:Cl,event:Cl,update:Cl},Ie),jy({type:Dl,event:Dl,update:Dl},Ie),jy({type:Al,event:Al,update:Al},Ie),jy({type:Il,event:Il,update:Il},Ie),jy({type:El,event:El,update:El},Ie),By("light",Om),By("dark",Bm);var n_=[],r_={registerPreprocessor:Fy,registerProcessor:Gy,registerPostInit:Hy,registerPostUpdate:Uy,registerUpdateLifecycle:Wy,registerAction:jy,registerCoordinateSystem:Xy,registerLayout:Zy,registerVisual:qy,registerTransform:t_,registerLoading:Jy,registerMap:Qy,registerImpl:function(e,t){"production"!==process.env.NODE_ENV&&Fv[e]&&Io("Already has an implementation of "+e+"."),Fv[e]=t},PRIORITY:Wv,ComponentModel:$d,ComponentView:Xg,SeriesModel:Vg,ChartView:Kg,registerComponentModel:function(e){$d.registerClass(e)},registerComponentView:function(e){Xg.registerClass(e)},registerSeriesModel:function(e){Vg.registerClass(e)},registerChartView:function(e){Kg.registerClass(e)},registerSubTypeDefaulter:function(e,t){$d.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Ki(e,t)}};function i_(e){J(e)?W(e,(function(e){i_(e)})):F(n_,e)>=0||(n_.push(e),Q(e)&&(e={install:e}),e.install(r_))}function o_(e){return null==e?0:e.length||1}function a_(e){return e}var s_=function(){function e(e,t,n,r,i,o){this._old=e,this._new=t,this._oldKeyGetter=n||a_,this._newKeyGetter=r||a_,this.context=i,this._diffModeMultiple="multiple"===o}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=new Array(e.length),i=new Array(t.length);this._initIndexMap(e,null,r,"_oldKeyGetter"),this._initIndexMap(t,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var a=r[o],s=n[a],l=o_(s);if(l>1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(t,r,o,"_newKeyGetter");for(var a=0;a<i.length;a++){var s=i[a],l=n[s],u=r[s],c=o_(l),h=o_(u);if(c>1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),r[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),r[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),r[s]=null;else if(c>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,l),r[s]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,r)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[r],o=o_(i);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(i[a]);else 1===o&&this._add&&this._add(i);t[r]=null}},e.prototype._initIndexMap=function(e,t,n,r){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var a="_ec_"+this[r](e[o],o);if(i||(n[o]=a),t){var s=t[a],l=o_(s);0===l?(t[a]=o,i&&n.push(a)):1===l?t[a]=[s,o]:s.push(o)}}},e}(),l_=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},e}();function u_(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function c_(e){return"category"===e?"ordinal":"time"===e?"time":"float"}var h_=function(e){this.otherDims={},null!=e&&z(this,e)},d_=$o(),p_={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},f_=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=v_(this.source)))},e.prototype.getSourceDimensionIndex=function(e){return de(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Sf(this.source),n=!y_(e),r="",i=[],o=0,a=0;o<e;o++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];if(c&&c.storeDimIndex===o)s=t?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var h=this.getSourceDimension(o);h&&(s=t?h.name:null,l=h.type)}i.push({property:s,type:l,ordinalMeta:u}),!t||null==s||c&&c.isCalculationCoord||(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+="$",r+=p_[l]||"f",u&&(r+=u.uid),r+="$"}var d=this.source;return{dimensions:i,hash:[d.seriesLayoutBy,d.startIndex,r].join("$$")}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===t)i.isCalculationCoord||(r=i.name),n++;else{var o=this.getSourceDimension(t);o&&(r=o.name)}e.push(r)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}();function g_(e){return e instanceof f_}function m_(e){for(var t=Te(),n=0;n<(e||[]).length;n++){var r=e[n],i=re(r)?r.name:r;null!=i&&null==t.get(i)&&t.set(i,n)}return t}function v_(e){var t=d_(e);return t.dimNameMap||(t.dimNameMap=m_(e.dimensionsDefine))}function y_(e){return e>30}var __,x_,b_,w_,S_,T_,M_,C_=re,D_=j,A_="undefined"==typeof Int32Array?Array:Int32Array,I_=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],E_=["_approximateExtent"],L_=function(){function e(e,t){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var r=!1;g_(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n=n||["x","y"];for(var i={},o=[],a={},s=!1,l={},u=0;u<n.length;u++){var c=n[u],h=ee(c)?new h_({name:c}):c instanceof h_?c:new h_(c),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,null!=l[d]&&(s=!0),h.createInvertedIndices&&(a[d]=[]),0===p.itemName&&(this._nameDimIdx=u),0===p.itemId&&(this._idDimIdx=u),"production"!==process.env.NODE_ENV&&me(r||h.storeDimIndex>=0),r&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=a,this._dimOmitted){var f=this._dimIdxToName=Te();W(o,(function(e){f.set(i[e].storeDimIndex,e)}))}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(null==t)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(null!=n)return n;var r=this._schema.getSourceDimension(t);return r?r.name:void 0},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(null!=t)return t;if(null==e)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(ne(e)||null!=e&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},e.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);if("production"!==process.env.NODE_ENV&&null==t)throw new Error("Unknown dimension "+e);return t},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(null==t)return n.encodeFirstDimNotExtra[e];var r=n.encode[e];return r?r[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var r,i=this;if(e instanceof pg&&(r=e),!r){var o=this.dimensions,a=vf(e)||U(e)?new Tf(e,o.length):e;r=new pg;var s=D_(o,(function(e){return{type:i._dimInfos[e].type,property:e}}));r.initData(a,s,n)}this._store=r,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,r.count()),this._dimSummary=function(e,t){var n={},r=n.encode={},i=Te(),o=[],a=[],s={};W(e.dimensions,(function(t){var n,l=e.getDimensionInfo(t),u=l.coordDim;if(u){"production"!==process.env.NODE_ENV&&me(null==tp.get(u));var c=l.coordDimIndex;u_(r,u)[c]=t,l.isExtraCoord||(i.set(u,1),"ordinal"!==(n=l.type)&&"time"!==n&&(o[0]=t),u_(s,u)[c]=e.getDimensionIndex(l.name)),l.defaultTooltip&&a.push(t)}tp.each((function(e,t){var n=u_(r,t),i=l.otherDims[t];null!=i&&!1!==i&&(n[i]=l.name)}))}));var l=[],u={};i.each((function(e,t){var n=r[t];u[t]=n[0],l=l.concat(n)})),n.dataDimsOnCoord=l,n.dataDimIndicesOnCoord=j(l,(function(t){return e.getDimensionInfo(t).storeDimIndex})),n.encodeFirstDimNotExtra=u;var c=r.label;c&&c.length&&(o=c.slice());var h=r.tooltip;return h&&h.length?a=h.slice():a.length||(a=o.slice()),r.defaultedLabel=o,r.defaultedTooltip=a,n.userOutput=new l_(s,t),n}(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t&&t.length),r=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var a=r;a<i;a++){var s=a-r;this._nameList[a]=t[s],o&&M_(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var r=this._dimInfos[t[n]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return null==this._idDimIdx&&e.getSource().sourceFormat!==ap&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===np&&!n.pure)for(var o=[],a=e;a<t;a++){var s=n.getItem(a,o);if(!this.hasItemOption&&Go(s)&&(this.hasItemOption=!0),s){var l=s.name;null==r[a]&&null!=l&&(r[a]=jo(l,null));var u=s.id;null==i[a]&&null!=u&&(i[a]=jo(u,null))}}if(this._shouldMakeIdFromName())for(a=e;a<t;a++)M_(this,a);__(this)}},e.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){C_(e)?z(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return null==n&&null!=this._nameDimIdx&&(n=b_(this,this._nameDimIdx,t)),null==n&&(n=""),n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[n]:n},e.prototype.getId=function(e){return x_(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.get(r.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.getByRawIndex(r.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,r=this._store;return J(e)?r.getValues(D_(e,(function(e){return n._getStoreDimIndex(e)})),t):r.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,r=t.length;n<r;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return-1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e];if("production"!==process.env.NODE_ENV&&!n)throw new Error("Do not supported yet");var r=n&&n[t];return null==r||isNaN(r)?-1:r},e.prototype.indicesOfNearest=function(e,t,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,n)},e.prototype.each=function(e,t,n){Q(e)&&(n=t,t=e,e=[]);var r=n||this,i=D_(w_(e),this._getStoreDimIndex,this);this._store.each(i,r?K(t,r):t)},e.prototype.filterSelf=function(e,t,n){Q(e)&&(n=t,t=e,e=[]);var r=n||this,i=D_(w_(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?K(t,r):t),this},e.prototype.selectRange=function(e){var t=this,n={};return W(q(e),(function(r){var i=t._getStoreDimIndex(r);n[i]=e[r]})),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){Q(e)&&(n=t,t=e,e=[]),n=n||this;var r=[];return this.each(e,(function(){r.push(t&&t.apply(this,arguments))}),n),r},e.prototype.map=function(e,t,n,r){var i=n||r||this,o=D_(w_(e),this._getStoreDimIndex,this),a=T_(this);return a._store=this._store.map(o,i?K(t,i):t),a},e.prototype.modify=function(e,t,n,r){var i=this,o=n||r||this;"production"!==process.env.NODE_ENV&&W(w_(e),(function(e){i.getDimensionInfo(e).isCalculationCoord||console.error("Danger: only stack dimension can be modified")}));var a=D_(w_(e),this._getStoreDimIndex,this);this._store.modify(a,o?K(t,o):t)},e.prototype.downSample=function(e,t,n,r){var i=T_(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),t,n,r),i},e.prototype.minmaxDownSample=function(e,t){var n=T_(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),t),n},e.prototype.lttbDownSample=function(e,t){var n=T_(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel,n=this.getRawDataItem(e);return new Fh(n,t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new s_(e?e.getStore().getIndices():[],this.getStore().getIndices(),(function(t){return x_(e,t)}),(function(e){return x_(t,e)}))},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},C_(e)?z(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],r=n&&n[t];return null==r?this.getVisual(t):r},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||(r=n[e]={});var i=r[t];return null==i&&(J(i=this.getVisual(t))?i=i.slice():C_(i)&&(i=z({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,C_(t)?z(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){C_(e)?z(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?z(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;yl(n,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){W(this._graphicEls,(function(n,r){n&&e&&e.call(t,n,r)}))},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:D_(this.dimensions,this._getDimInfo,this),this.hostModel)),S_(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];Q(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(fe(arguments)))})},e.internalField=(__=function(e){var t=e._invertedIndicesMap;W(t,(function(n,r){var i=e._dimInfos[r],o=i.ordinalMeta,a=e._store;if(o){n=t[r]=new A_(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)n[a.get(i.storeDimIndex,s)]=s}}))},b_=function(e,t,n){return jo(e._getCategory(t,n),null)},x_=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=b_(e,e._idDimIdx,t)),null==n&&(n="e\0\0"+t),n},w_=function(e){return J(e)||(e=null!=e?[e]:[]),e},T_=function(t){var n=new e(t._schema?t._schema:D_(t.dimensions,t._getDimInfo,t),t.hostModel);return S_(n,t),n},S_=function(e,t){W(I_.concat(t.__wrappedMethods||[]),(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e.__wrappedMethods=t.__wrappedMethods,W(E_,(function(n){e[n]=O(t[n])})),e._calculationInfo=z({},t._calculationInfo)},void(M_=function(e,t){var n=e._nameList,r=e._idList,i=e._nameDimIdx,o=e._idDimIdx,a=n[t],s=r[t];if(null==a&&null!=i&&(n[t]=a=b_(e,i,t)),null==s&&null!=o&&(r[t]=s=b_(e,o,t)),null==s&&null!=a){var l=e._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),r[t]=s}})),e}();function N_(e,t){return P_(e,t).dimensions}function P_(e,t){vf(e)||(e=_f(e));var n=(t=t||{}).coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=Te(),o=[],a=function(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return W(t,(function(e){var t;re(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))})),i}(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&y_(a),l=r===e.dimensionsDefine,u=l?v_(e):m_(r),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,a));for(var h=Te(c),d=new lg(a),p=0;p<d.length;p++)d[p]=-1;function f(e){var t=d[e];if(t<0){var n=r[e],i=re(n)?n:{name:n},a=new h_,s=i.name;null!=s&&null!=u.get(s)&&(a.name=a.displayName=s),null!=i.type&&(a.type=i.type),null!=i.displayName&&(a.displayName=i.displayName);var l=o.length;return d[e]=l,a.storeDimIndex=e,o.push(a),a}return o[t]}if(!s)for(p=0;p<a;p++)f(p);h.each((function(e,t){var n=zo(e).slice();if(1===n.length&&!ee(n[0])&&n[0]<0)h.set(t,!1);else{var r=h.set(t,[]);W(n,(function(e,n){var i=ee(e)?u.get(e):e;null!=i&&i<a&&(r[n]=i,m(f(i),t,n))}))}}));var g=0;function m(e,t,n){null!=tp.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,i.set(t,!0))}W(n,(function(e){var t,n,r,i;if(ee(e))t=e,i={};else{t=(i=e).name;var o=i.ordinalMeta;i.ordinalMeta=null,(i=z({},i)).ordinalMeta=o,n=i.dimsDef,r=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var s=h.get(t);if(!1!==s){if(!(s=zo(s)).length)for(var u=0;u<(n&&n.length||1);u++){for(;g<a&&null!=f(g).coordDim;)g++;g<a&&s.push(g++)}W(s,(function(e,o){var a=f(e);if(l&&null!=i.type&&(a.type=i.type),m(V(a,i),t,o),null==a.name&&n){var s=n[o];!re(s)&&(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}r&&V(a.otherDims,r)}))}}));var v=t.generateCoord,y=t.generateCoordCount,_=null!=y;y=v?y||1:0;var x=v||"value";function b(e){null==e.name&&(e.name=e.coordDim)}if(s)W(o,(function(e){b(e)})),o.sort((function(e,t){return e.storeDimIndex-t.storeDimIndex}));else for(var w=0;w<a;w++){var S=f(w);null==S.coordDim&&(S.coordDim=O_(x,i,_),S.coordDimIndex=0,(!v||y<=0)&&(S.isExtraCoord=!0),y--),b(S),null!=S.type||vp(e,w)!==cp&&(!S.isExtraCoord||null==S.otherDims.itemName&&null==S.otherDims.seriesName)||(S.type="ordinal")}return function(e){for(var t=Te(),n=0;n<e.length;n++){var r=e[n],i=r.name,o=t.get(i)||0;o>0&&(r.name=i+(o-1)),o++,t.set(i,o)}}(o),new f_({source:e,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function O_(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var R_=function(e){this.coordSysDims=[],this.axisMap=Te(),this.categoryAxisMap=Te(),this.coordSysName=e};var k_={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents("xAxis",ta).models[0],o=e.getReferringComponents("yAxis",ta).models[0];if("production"!==process.env.NODE_ENV){if(!i)throw new Error('xAxis "'+he(e.get("xAxisIndex"),e.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+he(e.get("xAxisIndex"),e.get("yAxisId"),0)+'" not found')}t.coordSysDims=["x","y"],n.set("x",i),n.set("y",o),z_(i)&&(r.set("x",i),t.firstCategoryDimIndex=0),z_(o)&&(r.set("y",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,r){var i=e.getReferringComponents("singleAxis",ta).models[0];if("production"!==process.env.NODE_ENV&&!i)throw new Error("singleAxis should be specified.");t.coordSysDims=["single"],n.set("single",i),z_(i)&&(r.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents("polar",ta).models[0],o=i.findAxisModel("radiusAxis"),a=i.findAxisModel("angleAxis");if("production"!==process.env.NODE_ENV){if(!a)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found")}t.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),z_(o)&&(r.set("radius",o),t.firstCategoryDimIndex=0),z_(a)&&(r.set("angle",a),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,r){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,r){var i=e.ecModel,o=i.getComponent("parallel",e.get("parallelIndex")),a=t.coordSysDims=o.dimensions.slice();W(o.parallelAxisIndex,(function(e,o){var s=i.getComponent("parallelAxis",e),l=a[o];n.set(l,s),z_(s)&&(r.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=o))}))}};function z_(e){return"category"===e.get("type")}function V_(e,t,n){var r,i,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(e){return!g_(e.schema)}(t)?(i=t.schema,r=i.dimensions,o=t.store):r=t;var l,u,c,h,d=!(!e||!e.get("stack"));if(W(r,(function(e,t){ee(e)&&(r[t]=e={name:e}),d&&!e.isExtraCoord&&(a||l||!e.ordinalMeta||(l=e),u||"ordinal"===e.type||"time"===e.type||s&&s!==e.coordDim||(u=e))})),!u||a||l||(a=!0),u){c="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,f=u.type,g=0;W(r,(function(e){e.coordDim===p&&g++}));var m={name:c,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length},v={name:h,coordDim:h,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length+1};i?(o&&(m.storeDimIndex=o.ensureCalculationDimension(h,f),v.storeDimIndex=o.ensureCalculationDimension(c,f)),i.appendCalculationDimension(m),i.appendCalculationDimension(v)):(r.push(m),r.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:h,stackResultDimension:c}}function B_(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function F_(e,t){return B_(e,t)?e.getCalculationInfo("stackResultDimension"):t}function G_(e,t,n){n=n||{};var r,i=t.getSourceManager(),o=!1;e?(o=!0,r=_f(e)):o=(r=i.getSource()).sourceFormat===np;var a=function(e){var t=e.get("coordinateSystem"),n=new R_(t),r=k_[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}(t),s=function(e,t){var n,r=e.get("coordinateSystem"),i=Bp.get(r);return t&&t.coordSysDims&&(n=j(t.coordSysDims,(function(e){var n={name:e},r=t.axisMap.get(e);if(r){var i=r.get("type");n.type=c_(i)}return n}))),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}(t,a),l=n.useEncodeDefaulter,u=Q(l)?l:l?$(fp,s,t):null,c=P_(r,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),h=function(e,t,n){var r,i;return n&&W(e,(function(e,o){var a=e.coordDim,s=n.categoryAxisMap.get(a);s&&(null==r&&(r=o),e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(i=!0)})),i||null==r||(e[r].otherDims.itemName=0),r}(c.dimensions,n.createInvertedIndices,a),d=o?null:i.getSharedDataStore(c),p=V_(t,{schema:c,store:d}),f=new L_(c,t);f.setCalculationInfo(p);var g=null!=h&&function(e){if(e.sourceFormat===np){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return!J(Fo(t))}}(r)?function(e,t,n,r){return r===h?n:this.defaultDimValueGetter(e,t,n,r)}:null;return f.hasItemOption=!1,f.initData(o?r:d,null,g),f}var H_=function(){function e(e){this._setting=e||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(e){return this._setting[e]},e.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();ga(H_);var U_=0,W_=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++U_}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&j(r,j_);return new e({categories:i,needCollect:!i,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!ee(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var r=this._getOrCreateMap();return null==(t=r.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=Te(this.categories))},e}();function j_(e){return re(e)&&null!=e.value?e.value:e+""}function X_(e){return"interval"===e.type||"log"===e.type}function Y_(e,t,n,r){var i={},o=e[1]-e[0],a=i.interval=vo(o/t,!0);null!=n&&a<n&&(a=i.interval=n),null!=r&&a>r&&(a=i.interval=r);var s=i.intervalPrecision=q_(a);return function(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),K_(e,0,t),K_(e,1,t),e[0]>e[1]&&(e[0]=e[1])}(i.niceTickExtent=[no(Math.ceil(e[0]/a)*a,s),no(Math.floor(e[1]/a)*a,s)],e),i}function Z_(e){var t=Math.pow(10,mo(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,no(n*t)}function q_(e){return io(e)+2}function K_(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function $_(e,t){return e>=t[0]&&e<=t[1]}function J_(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function Q_(e,t){return e*(t[1]-t[0])+t[0]}var ex=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var r=n.getSetting("ordinalMeta");return r||(r=new W_({})),J(r)&&(r=new W_({categories:j(r,(function(e){return re(e)?e.value:e}))})),n._ordinalMeta=r,n._extent=n.getSetting("extent")||[0,r.categories.length-1],n}return l(t,e),t.prototype.parse=function(e){return null==e?NaN:ee(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return $_(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return J_(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(Q_(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null!=e){for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,o=this._ordinalMeta.categories.length,a=Math.min(o,t.length);i<a;++i){var s=t[i];n[i]=s,r[s]=i}for(var l=0;i<o;++i){for(;null!=r[l];)l++;n.push(l),r[l]=i}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(H_);H_.registerClass(ex);var tx=no,nx=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return l(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return $_(e,this._extent)},t.prototype.normalize=function(e){return J_(e,this._extent)},t.prototype.scale=function(e){return Q_(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=q_(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,o=[];if(!t)return o;n[0]<r[0]&&(e?o.push({value:tx(r[0]-t,i)}):o.push({value:n[0]}));for(var a=r[0];a<=r[1]&&(o.push({value:a}),(a=tx(a+t,i))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:r[1];return n[1]>s&&(e?o.push({value:tx(s+t,i)}):o.push({value:n[1]})),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],r=this.getExtent(),i=1;i<t.length;i++){for(var o=t[i],a=t[i-1],s=0,l=[],u=(o.value-a.value)/e;s<e-1;){var c=tx(a.value+(s+1)*u);c>r[0]&&c<r[1]&&l.push(c),s++}n.push(l)}return n},t.prototype.getLabel=function(e,t){if(null==e)return"";var n=t&&t.precision;return null==n?n=io(e.value)||0:"auto"===n&&(n=this._intervalPrecision),Ad(tx(e.value,n,!0))},t.prototype.calcNiceTicks=function(e,t,n){e=e||5;var r=this._extent,i=r[1]-r[0];if(isFinite(i)){i<0&&(i=-i,r.reverse());var o=Y_(r,e,t,n);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var n=Math.abs(t[0]);e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;var r=t[1]-t[0];isFinite(r)||(t[0]=0,t[1]=1),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var i=this._interval;e.fixMin||(t[0]=tx(Math.floor(t[0]/i)*i)),e.fixMax||(t[1]=tx(Math.ceil(t[1]/i)*i))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(H_);H_.registerClass(nx);var rx="undefined"!=typeof Float32Array,ix=rx?Float32Array:Array;function ox(e){return J(e)?rx?new Float32Array(e):e:new ix(e)}var ax="__ec_stack_";function sx(e){return e.get("stack")||ax+e.seriesIndex}function lx(e){return e.dim+e.index}function ux(e,t){var n=[];return t.eachSeriesByType(e,(function(e){fx(e)&&n.push(e)})),n}function cx(e){var t=function(e){var t={};W(e,(function(e){var n=e.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var r=e.getData(),i=n.dim+"_"+n.index,o=r.getDimensionIndex(r.mapDimension(n.dim)),a=r.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(o,s);t[i]?t[i].push(u):t[i]=[u]}}));var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(i){i.sort((function(e,t){return e-t}));for(var o=null,a=1;a<i.length;++a){var s=i[a]-i[a-1];s>0&&(o=null===o?s:Math.min(o,s))}n[r]=o}}return n}(e),n=[];return W(e,(function(e){var r,i=e.coordinateSystem.getBaseAxis(),o=i.getExtent();if("category"===i.type)r=i.getBandWidth();else if("value"===i.type||"time"===i.type){var a=i.dim+"_"+i.index,s=t[a],l=Math.abs(o[1]-o[0]),u=i.scale.getExtent(),c=Math.abs(u[1]-u[0]);r=s?l/c*s:l}else{var h=e.getData();r=Math.abs(o[1]-o[0])/h.count()}var d=to(e.get("barWidth"),r),p=to(e.get("barMaxWidth"),r),f=to(e.get("barMinWidth")||(gx(e)?.5:1),r),g=e.get("barGap"),m=e.get("barCategoryGap");n.push({bandWidth:r,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:lx(i),stackId:sx(e)})})),hx(n)}function hx(e){var t={};W(e,(function(e,n){var r=e.axisKey,i=e.bandWidth,o=t[r]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;t[r]=o;var s=e.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=e.barMaxWidth;u&&(a[s].maxWidth=u);var c=e.barMinWidth;c&&(a[s].minWidth=c);var h=e.barGap;null!=h&&(o.gap=h);var d=e.barCategoryGap;null!=d&&(o.categoryGap=d)}));var n={};return W(t,(function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,o=e.categoryGap;if(null==o){var a=q(r).length;o=Math.max(35-4*a,15)+"%"}var s=to(o,i),l=to(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),W(r,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){r=e.width;t&&(r=Math.min(r,t)),n&&(r=Math.max(r,n)),e.width=r,u-=r+l*r,c--}else{var r=h;t&&t<r&&(r=Math.min(t,u)),n&&n>r&&(r=n),r!==h&&(e.width=r,u-=r+l*r,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var d,p=0;W(r,(function(e,t){e.width||(e.width=h),d=e,p+=e.width*(1+l)})),d&&(p-=d.width*l);var f=-p/2;W(r,(function(e,r){n[t][r]=n[t][r]||{bandWidth:i,offset:f,width:e.width},f+=e.width*(1+l)}))})),n}function dx(e,t){var n=ux(e,t),r=cx(n);W(n,(function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),i=sx(e),o=r[lx(n)][i],a=o.offset,s=o.width;t.setLayout({bandWidth:o.bandWidth,offset:a,size:s})}))}function px(e){return{seriesType:e,plan:Yg(),reset:function(e){if(fx(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),o=t.getDimensionIndex(t.mapDimension(i.dim)),a=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get("showBackground",!0),l=t.mapDimension(i.dim),u=t.getCalculationInfo("stackResultDimension"),c=B_(t,l)&&!!t.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=function(e,t){var n=t.model.get("startValue");n||(n=0);return t.toGlobalCoord(t.dataToCoord("log"===t.type?n>0?n:1:n))}(0,i),p=gx(e),f=e.get("barMinHeight")||0,g=u&&t.getDimensionIndex(u),m=t.getLayout("size"),v=t.getLayout("offset");return{progress:function(e,t){for(var r,i=e.count,l=p&&ox(3*i),u=p&&s&&ox(3*i),y=p&&ox(i),_=n.master.getRect(),x=h?_.width:_.height,b=t.getStore(),w=0;null!=(r=e.next());){var S=b.get(c?g:o,r),T=b.get(a,r),M=d,C=void 0;c&&(C=+S-b.get(o,r));var D=void 0,A=void 0,I=void 0,E=void 0;if(h){var L=n.dataToPoint([S,T]);if(c)M=n.dataToPoint([C,T])[0];D=M,A=L[1]+v,I=L[0]-M,E=m,Math.abs(I)<f&&(I=(I<0?-1:1)*f)}else{L=n.dataToPoint([T,S]);if(c)M=n.dataToPoint([T,C])[1];D=L[0]+v,A=M,I=m,E=L[1]-M,Math.abs(E)<f&&(E=(E<=0?-1:1)*f)}p?(l[w]=D,l[w+1]=A,l[w+2]=h?I:E,u&&(u[w]=h?_.x:D,u[w+1]=h?A:_.y,u[w+2]=x),y[r]=r):t.setItemLayout(r,{x:D,y:A,width:I,height:E}),w+=3}p&&t.setLayout({largePoints:l,largeDataIndices:y,largeBackgroundPoints:u,valueAxisHorizontal:h})}}}}}}function fx(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function gx(e){return e.pipelineContext&&e.pipelineContext.large}var mx=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return l(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return hd(e.value,od[function(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(ud(this._minLevelUnit))]||od.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var r=this.getSetting("useUTC");return function(e,t,n,r,i){var o=null;if(ee(n))o=n;else if(Q(n))o=n(e.value,t,{level:e.level});else{var a=z({},rd);if(e.level>0)for(var s=0;s<ad.length;++s)a[ad[s]]="{primary|"+a[ad[s]]+"}";var l=n?!1===n.inherit?n:V(n,a):a,u=dd(e.value,i);if(l[u])o=l[u];else if(l.inherit){for(s=sd.indexOf(u)-1;s>=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(J(o)){var c=null==e.level?0:e.level>=0?e.level:o.length+e.level;o=o[c=Math.min(c,o.length-1)]}}return hd(new Date(e.value),o,i,r)}(e,t,n,this.getSetting("locale"),r)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var r=this.getSetting("useUTC"),i=function(e,t,n,r){var i=1e4,o=sd,a=0;function s(e,t,n,i,o,a,s){for(var l=new Date(t),u=t,c=l[i]();u<n&&u<=r[1];)s.push({value:u}),c+=e,l[o](c),u=l.getTime();s.push({value:u,notAdd:!0})}function l(e,i,o){var a=[],l=!i.length;if(!function(e,t,n,r){var i=fo(t),o=fo(n),a=function(e){return pd(i,e,r)===pd(o,e,r)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},h=function(){return c()&&a("minute")},d=function(){return h()&&a("second")},p=function(){return d()&&a("millisecond")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return d();case"millisecond":return p()}}(ud(e),r[0],r[1],n)){l&&(i=[{value:Tx(new Date(r[0]),e,n)},{value:r[1]}]);for(var u=0;u<i.length-1;u++){var c=i[u].value,h=i[u+1].value;if(c!==h){var d=void 0,p=void 0,f=void 0,g=!1;switch(e){case"year":d=Math.max(1,Math.round(t/td/365)),p=fd(n),f=bd(n);break;case"half-year":case"quarter":case"month":d=_x(t),p=gd(n),f=wd(n);break;case"week":case"half-week":case"day":d=yx(t),p=md(n),f=Sd(n),g=!0;break;case"half-day":case"quarter-day":case"hour":d=xx(t),p=vd(n),f=Td(n);break;case"minute":d=bx(t,!0),p=yd(n),f=Md(n);break;case"second":d=bx(t,!1),p=_d(n),f=Cd(n);break;case"millisecond":d=Sx(t),p=xd(n),f=Dd(n)}s(d,c,h,p,f,g,a),"year"===e&&o.length>1&&0===u&&o.unshift({value:o[0].value-d})}}for(u=0;u<a.length;u++)o.push(a[u]);return a}}for(var u=[],c=[],h=0,d=0,p=0;p<o.length&&a++<i;++p){var f=ud(o[p]);if(cd(o[p]))if(l(o[p],u[u.length-1]||[],c),f!==(o[p+1]?ud(o[p+1]):null)){if(c.length){d=h,c.sort((function(e,t){return e.value-t.value}));for(var g=[],m=0;m<c.length;++m){var v=c[m].value;0!==m&&c[m-1].value===v||(g.push(c[m]),v>=r[0]&&v<=r[1]&&h++)}var y=(r[1]-r[0])/t;if(h>1.5*y&&d>y/1.5)break;if(u.push(g),h>y||e===o[p])break}c=[]}}"production"!==process.env.NODE_ENV&&a>=i&&Ao("Exceed safe limit.");var _=Y(j(u,(function(e){return Y(e,(function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd}))})),(function(e){return e.length>0})),x=[],b=_.length-1;for(p=0;p<_.length;++p)for(var w=_[p],S=0;S<w.length;++S)x.push({value:w[S].value,level:b-p});x.sort((function(e,t){return e.value-t.value}));var T=[];for(p=0;p<x.length;++p)0!==p&&x[p].value===x[p-1].value||T.push(x[p]);return T}(this._minLevelUnit,this._approxInterval,r,t);return(n=n.concat(i)).push({value:t[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=td,t[1]+=td),t[1]===-1/0&&t[0]===1/0){var n=new Date;t[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),t[0]=t[1]-td}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e=e||10;var r=this._extent,i=r[1]-r[0];this._approxInterval=i/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=vx.length,a=Math.min(function(e,t,n,r){for(;n<r;){var i=n+r>>>1;e[i][1]<t?n=i+1:r=i}return n}(vx,this._approxInterval,0,o),o-1);this._interval=vx[a][1],this._minLevelUnit=vx[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return ne(e)?e:+fo(e)},t.prototype.contain=function(e){return $_(this.parse(e),this._extent)},t.prototype.normalize=function(e){return J_(this.parse(e),this._extent)},t.prototype.scale=function(e){return Q_(e,this._extent)},t.type="time",t}(nx),vx=[["second",Jh],["minute",Qh],["hour",ed],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",nd/2],["year",nd]];function yx(e,t){return(e/=td)>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function _x(e){return(e/=2592e6)>6?6:e>3?3:e>2?2:1}function xx(e){return(e/=ed)>12?12:e>6?6:e>3.5?4:e>2?2:1}function bx(e,t){return(e/=t?Qh:Jh)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function Sx(e){return vo(e,!0)}function Tx(e,t,n){var r=new Date(e);switch(ud(t)){case"year":case"month":r[wd(n)](0);case"day":r[Sd(n)](1);case"hour":r[Td(n)](0);case"minute":r[Md(n)](0);case"second":r[Cd(n)](0),r[Dd(n)](0)}return r.getTime()}H_.registerClass(mx);var Mx=H_.prototype,Cx=nx.prototype,Dx=no,Ax=Math.floor,Ix=Math.ceil,Ex=Math.pow,Lx=Math.log,Nx=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new nx,t._interval=0,t}return l(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,r=t.getExtent();return j(Cx.getTicks.call(this,e),(function(e){var t=e.value,i=no(Ex(this.base,t));return i=t===n[0]&&this._fixMin?Ox(i,r[0]):i,{value:i=t===n[1]&&this._fixMax?Ox(i,r[1]):i}}),this)},t.prototype.setExtent=function(e,t){var n=Lx(this.base);e=Lx(Math.max(0,e))/n,t=Lx(Math.max(0,t))/n,Cx.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=Mx.getExtent.call(this);t[0]=Ex(e,t[0]),t[1]=Ex(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=Ox(t[0],n[0])),this._fixMax&&(t[1]=Ox(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=Lx(e[0])/Lx(t),e[1]=Lx(e[1])/Lx(t),Mx.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(!(n===1/0||n<=0)){var r=go(n);for(e/n*r<=.5&&(r*=10);!isNaN(r)&&Math.abs(r)<1&&Math.abs(r)>0;)r*=10;var i=[no(Ix(t[0]/r)*r),no(Ax(t[1]/r)*r)];this._interval=r,this._niceExtent=i}},t.prototype.calcNiceExtent=function(e){Cx.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return $_(e=Lx(e)/Lx(this.base),this._extent)},t.prototype.normalize=function(e){return J_(e=Lx(e)/Lx(this.base),this._extent)},t.prototype.scale=function(e){return e=Q_(e,this._extent),Ex(this.base,e)},t.type="log",t}(H_),Px=Nx.prototype;function Ox(e,t){return Dx(e,io(t))}Px.getMinorTicks=Cx.getMinorTicks,Px.getLabel=Cx.getLabel,H_.registerClass(Nx);var Rx=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var r=this._isOrdinal="ordinal"===e.type;this._needCrossZero="interval"===e.type&&t.getNeedCrossZero&&t.getNeedCrossZero();var i=t.get("min",!0);null==i&&(i=t.get("startValue",!0));var o=this._modelMinRaw=i;Q(o)?this._modelMinNum=Bx(e,o({min:n[0],max:n[1]})):"dataMin"!==o&&(this._modelMinNum=Bx(e,o));var a=this._modelMaxRaw=t.get("max",!0);if(Q(a)?this._modelMaxNum=Bx(e,a({min:n[0],max:n[1]})):"dataMax"!==a&&(this._modelMaxNum=Bx(e,a)),r)this._axisDataLen=t.getCategories().length;else{var s=t.get("boundaryGap"),l=J(s)?s:[s||0,s||0];"boolean"==typeof l[0]||"boolean"==typeof l[1]?("production"!==process.env.NODE_ENV&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),this._boundaryGapInner=[0,0]):this._boundaryGapInner=[Ni(l[0],1),Ni(l[1],1)]}},e.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,n=this._dataMax,r=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-t||Math.abs(t),a="dataMin"===this._modelMinRaw?t:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,u=null!=s;null==a&&(a=e?r?0:NaN:t-i[0]*o),null==s&&(s=e?r?r-1:NaN:n+i[1]*o),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN);var c=ce(a)||ce(s)||e&&!r;this._needCrossZero&&(a>0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var h=this._determinedMin,d=this._determinedMax;return null!=h&&(a=h,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){"production"!==process.env.NODE_ENV&&me(!this.frozen),this[zx[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=kx[e];"production"!==process.env.NODE_ENV&&me(!this.frozen&&null==this[n]),this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),kx={min:"_determinedMin",max:"_determinedMax"},zx={min:"_dataMin",max:"_dataMax"};function Vx(e,t,n){var r=e.rawExtentInfo;return r||(r=new Rx(e,t,n),e.rawExtentInfo=r,r)}function Bx(e,t){return null==t?null:ce(t)?NaN:e.parse(t)}function Fx(e,t){var n=e.type,r=Vx(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,o=r.max,a=t.ecModel;if(a&&"time"===n){var s=ux("bar",a),l=!1;if(W(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=cx(s),c=function(e,t,n,r){var i=n.axis.getExtent(),o=Math.abs(i[1]-i[0]),a=function(e,t){if(e&&t)return e[lx(t)]}(r,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;W(a,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;W(a,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,h=c/(1-(s+l)/o)-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}(i,o,t,u);i=c.min,o=c.max}}return{extent:[i,o],fixMin:r.minFixed,fixMax:r.maxFixed}}function Gx(e,t){var n=t,r=Fx(e,n),i=r.extent,o=n.get("splitNumber");e instanceof Nx&&(e.base=n.get("logBase"));var a=e.type,s=n.get("interval"),l="interval"===a||"time"===a;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:o,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&e.setInterval&&e.setInterval(s)}function Hx(e,t){if(t=t||e.get("type"))switch(t){case"category":return new ex({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new mx({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(H_.getClass(t)||nx)}}function Ux(e){var t,n,r=e.getLabelModel().get("formatter"),i="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=r,function(t,r){return e.scale.getFormattedLabel(t,r,n)}):ee(r)?function(t){return function(n){var r=e.scale.getLabel(n);return t.replace("{value}",null!=r?r:"")}}(r):Q(r)?(t=r,function(n,r){return null!=i&&(r=n.value-i),t(Wx(e,n),r,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function Wx(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function jx(e,t){var n=t*Math.PI/180,r=e.width,i=e.height,o=r*Math.abs(Math.cos(n))+Math.abs(i*Math.sin(n)),a=r*Math.abs(Math.sin(n))+Math.abs(i*Math.cos(n));return new jt(e.x,e.y,o,a)}function Xx(e){var t=e.get("interval");return null==t?"auto":t}function Yx(e){return"category"===e.type&&0===Xx(e.getLabelModel())}function Zx(e,t){var n={};return W(e.mapDimensionsAll(t),(function(t){n[F_(e,t)]=!0})),q(n)}var qx=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();function Kx(e){return G_(null,e)}var $x={isDimensionStacked:B_,enableDataStack:V_,getStackedDimension:F_};function Jx(e,t){var n=t;t instanceof Fh||(n=new Fh(t));var r=Hx(n);return r.setExtent(e[0],e[1]),Gx(r,n),r}function Qx(e){H(e,qx)}var eb=Object.freeze({__proto__:null,createDimensions:N_,createList:Kx,createScale:Jx,createSymbol:lv,createTextStyle:function(e,t){return yh(e,null,null,"normal"!==(t=t||{}).state)},dataStack:$x,enableHoverEmphasis:ou,getECData:vl,getLayoutRect:Wd,mixinAxisModelCommonMethods:Qx});function tb(e,t){return Math.abs(e-t)<1e-8}function nb(e,t,n){var r=0,i=e[0];if(!i)return!1;for(var o=1;o<e.length;o++){var a=e[o];r+=Ls(i[0],i[1],a[0],a[1],t,n),i=a}var s=e[0];return tb(i[0],s[0])&&tb(i[1],s[1])||(r+=Ls(i[0],i[1],s[0],s[1],t,n)),0!==r}var rb=[];function ib(e,t){for(var n=0;n<e.length;n++)Ke(e[n],e[n],t)}function ob(e,t,n,r){for(var i=0;i<e.length;i++){var o=e[i];r&&(o=r.project(o)),o&&isFinite(o[0])&&isFinite(o[1])&&($e(t,t,o),Je(n,n,o))}}var ab=function(){function e(e){this.name=e}return e.prototype.setCenter=function(e){this._center=e},e.prototype.getCenter=function(){var e=this._center;return e||(e=this._center=this.calcCenter()),e},e}(),sb=function(e,t){this.type="polygon",this.exterior=e,this.interiors=t},lb=function(e){this.type="linestring",this.points=e},ub=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="geoJSON",i.geometries=n,i._center=r&&[r[0],r[1]],i}return l(t,e),t.prototype.calcCenter=function(){for(var e,t=this.geometries,n=0,r=0;r<t.length;r++){var i=t[r],o=i.exterior,a=o&&o.length;a>n&&(e=i,n=a)}if(e)return function(e){for(var t=0,n=0,r=0,i=e.length,o=e[i-1][0],a=e[i-1][1],s=0;s<i;s++){var l=e[s][0],u=e[s][1],c=o*u-l*a;t+=c,n+=(o+l)*c,r+=(a+u)*c,o=l,a=u}return t?[n/t/3,r/t/3,t]:[e[0][0]||0,e[0][1]||0]}(e.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},t.prototype.getBoundingRect=function(e){var t=this._rect;if(t&&!e)return t;var n=[1/0,1/0],r=[-1/0,-1/0];return W(this.geometries,(function(t){"polygon"===t.type?ob(t.exterior,n,r,e):W(t.points,(function(t){ob(t,n,r,e)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),t=new jt(n[0],n[1],r[0]-n[0],r[1]-n[1]),e||(this._rect=t),t},t.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var r=0,i=n.length;r<i;r++){var o=n[r];if("polygon"===o.type){var a=o.exterior,s=o.interiors;if(nb(a,e[0],e[1])){for(var l=0;l<(s?s.length:0);l++)if(nb(s[l],e[0],e[1]))continue e;return!0}}}return!1},t.prototype.transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=i.width/i.height;n?r||(r=n/o):n=o*r;for(var a=new jt(e,t,n,r),s=i.calculateTransform(a),l=this.geometries,u=0;u<l.length;u++){var c=l[u];"polygon"===c.type?(ib(c.exterior,s),W(c.interiors,(function(e){ib(e,s)}))):W(c.points,(function(e){ib(e,s)}))}(i=this._rect).copy(a),this._center=[i.x+i.width/2,i.y+i.height/2]},t.prototype.cloneShallow=function(e){null==e&&(e=this.name);var n=new t(e,this.geometries,this._center);return n._rect=this._rect,n.transformTo=null,n},t}(ab),cb=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="geoSVG",r._elOnlyForCalculate=n,r}return l(t,e),t.prototype.calcCenter=function(){for(var e=this._elOnlyForCalculate,t=e.getBoundingRect(),n=[t.x+t.width/2,t.y+t.height/2],r=Dt(rb),i=e;i&&!i.isGeoSVGGraphicRoot;)It(r,i.getLocalTransform(),r),i=i.parent;return Pt(r,r),Ke(n,n,r),n},t}(ab);function hb(e,t,n){for(var r=0;r<e.length;r++)e[r]=db(e[r],t[r],n)}function db(e,t,n){for(var r=[],i=t[0],o=t[1],a=0;a<e.length;a+=2){var s=e.charCodeAt(a)-64,l=e.charCodeAt(a+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),i=s+=i,o=l+=o,r.push([s/n,l/n])}return r}function pb(e,t){return j(Y((e=function(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;return null==n&&(n=1024),W(t.features,(function(e){var t=e.geometry,r=t.encodeOffsets,i=t.coordinates;if(r)switch(t.type){case"LineString":t.coordinates=db(i,r,n);break;case"Polygon":case"MultiLineString":hb(i,r,n);break;case"MultiPolygon":W(i,(function(e,t){return hb(e,r[t],n)}))}})),t.UTF8Encoding=!1,t}(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,r=e.geometry,i=[];switch(r.type){case"Polygon":var o=r.coordinates;i.push(new sb(o[0],o.slice(1)));break;case"MultiPolygon":W(r.coordinates,(function(e){e[0]&&i.push(new sb(e[0],e.slice(1)))}));break;case"LineString":i.push(new lb([r.coordinates]));break;case"MultiLineString":i.push(new lb(r.coordinates))}var a=new ub(n[t||"name"],i,n.cp);return a.properties=n,a}))}var fb=Object.freeze({__proto__:null,MAX_SAFE_INTEGER:uo,asc:ro,getPercentWithPrecision:function(e,t,n){return e[t]&&so(e,n)[t]||0},getPixelPrecision:ao,getPrecision:io,getPrecisionSafe:oo,isNumeric:bo,isRadianAroundZero:ho,linearMap:eo,nice:vo,numericToNumber:xo,parseDate:fo,quantile:yo,quantity:go,quantityExponent:mo,reformIntervals:_o,remRadian:co,round:no}),gb=Object.freeze({__proto__:null,format:hd,parse:fo}),mb=Object.freeze({__proto__:null,Arc:gc,BezierCurve:pc,BoundingRect:jt,Circle:ku,CompoundPath:mc,Ellipse:Vu,Group:Wi,Image:Zs,IncrementalDisplayable:Cc,Line:uc,LinearGradient:yc,Polygon:ic,Polyline:ac,RadialGradient:_c,Rect:tl,Ring:tc,Sector:Qu,Text:il,clipPointsByRect:rh,clipRectByRect:ih,createIcon:oh,extendPath:Hc,extendShape:Fc,getShapeClass:Wc,getTransform:Jc,initProps:Lc,makeImage:Xc,makePath:jc,mergePath:Zc,registerShape:Uc,resizePath:qc,updateProps:Ec}),vb=Object.freeze({__proto__:null,addCommas:Ad,capitalFirst:function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},encodeHTML:dt,formatTime:kd,formatTpl:Od,getTextRect:function(e,t,n,r,i,o,a,s){return new il({style:{text:e,font:t,align:n,verticalAlign:r,padding:i,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:Rd,normalizeCssArray:Ed,toCamelCase:Id,truncateText:function(e,t,n,r,i){var o={};return Ma(o,e,t,n,r,i),o.text}}),yb=Object.freeze({__proto__:null,bind:K,clone:O,curry:$,defaults:V,each:W,extend:z,filter:Y,indexOf:F,inherits:G,isArray:J,isFunction:Q,isObject:re,isString:ee,map:j,merge:R,reduce:X}),_b=$o();function xb(e,t){var n=j(t,(function(t){return e.scale.parse(t)}));return"time"===e.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function bb(e){var t=e.getLabelModel().get("customValues");if(t){var n=Ux(e),r=e.scale.getExtent();return{labels:j(Y(xb(e,t),(function(e){return e>=r[0]&&e<=r[1]})),(function(t){var r={value:t};return{formattedLabel:n(r),rawLabel:e.scale.getLabel(r),tickValue:t}}))}}return"category"===e.type?function(e){var t=e.getLabelModel(),n=Sb(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(e):function(e){var t=e.scale.getTicks(),n=Ux(e);return{labels:j(t,(function(t,r){return{level:t.level,formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}(e)}function wb(e,t){var n=e.getTickModel().get("customValues");if(n){var r=e.scale.getExtent();return{ticks:Y(xb(e,n),(function(e){return e>=r[0]&&e<=r[1]}))}}return"category"===e.type?function(e,t){var n,r,i=Tb(e,"ticks"),o=Xx(t),a=Mb(i,o);if(a)return a;t.get("show")&&!e.scale.isBlank()||(n=[]);if(Q(o))n=Ab(e,o,!0);else if("auto"===o){var s=Sb(e,e.getLabelModel());r=s.labelCategoryInterval,n=j(s.labels,(function(e){return e.tickValue}))}else n=Db(e,r=o,!0);return Cb(i,o,{ticks:n,tickCategoryInterval:r})}(e,t):{ticks:j(e.scale.getTicks(),(function(e){return e.value}))}}function Sb(e,t){var n,r,i=Tb(e,"labels"),o=Xx(t),a=Mb(i,o);return a||(Q(o)?n=Ab(e,o):(r="auto"===o?function(e){var t=_b(e).autoInterval;return null!=t?t:_b(e).autoInterval=e.calculateCategoryInterval()}(e):o,n=Db(e,r)),Cb(i,o,{labels:n,labelCategoryInterval:r}))}function Tb(e,t){return _b(e)[t]||(_b(e)[t]=[])}function Mb(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function Cb(e,t,n){return e.push({key:t,value:n}),n}function Db(e,t,n){var r=Ux(e),i=e.scale,o=i.getExtent(),a=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=o[0],c=i.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=Yx(e),d=a.get("showMinLabel")||h,p=a.get("showMaxLabel")||h;d&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:r(t),rawLabel:i.getLabel(t),tickValue:e})}return p&&f-l!==o[1]&&g(o[1]),s}function Ab(e,t,n){var r=e.scale,i=Ux(e),o=[];return W(r.getTicks(),(function(e){var a=r.getLabel(e),s=e.value;t(e.value,a)&&o.push(n?s:{formattedLabel:i(e),rawLabel:a,tickValue:s})})),o}var Ib=[0,1],Eb=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return ao(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,r=this.scale;return e=r.normalize(e),this.onBand&&"ordinal"===r.type&&Lb(n=n.slice(),r.count()),eo(e,Ib,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&Lb(n=n.slice(),r.count());var i=eo(e,n,Ib,t);return this.scale.scale(i)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=j(wb(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}}),this);return function(e,t,n,r){var i=t.length;if(!e.onBand||n||!i)return;var o,a,s=e.getExtent();if(1===i)t[0].coord=s[0],o=t[1]={coord:s[1],tickValue:t[0].tickValue};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;W(t,(function(e){e.coord-=u/2}));var c=e.scale.getExtent();a=1+c[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*a,tickValue:c[1]+1},t.push(o)}var h=s[0]>s[1];d(t[0].coord,s[0])&&(r?t[0].coord=s[0]:t.shift());r&&d(s[0],t[0].coord)&&t.unshift({coord:s[0]});d(s[1],o.coord)&&(r?o.coord=s[1]:t.pop());r&&d(o.coord,s[1])&&t.push({coord:s[1]});function d(e,t){return e=no(e),t=no(t),h?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),j(this.scale.getMinorTicks(e),(function(e){return j(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return bb(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);0===n&&(n=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/n},e.prototype.calculateCategoryInterval=function(){return function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),n=Ux(e),r=(t.axisRotate-t.labelRotate)/180*Math.PI,i=e.scale,o=i.getExtent(),a=i.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(r)),h=Math.abs(u*Math.sin(r)),d=0,p=0;l<=o[1];l+=s){var f,g,m=Ai(n({value:l}),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var v=d/c,y=p/h;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(v,y))),x=_b(e.model),b=e.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-a)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}(this)},e}();function Lb(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var Nb=2*Math.PI,Pb=Ss.CMD,Ob=["top","right","bottom","left"];function Rb(e,t,n,r,i){var o=n.width,a=n.height;switch(e){case"top":r.set(n.x+o/2,n.y-t),i.set(0,-1);break;case"bottom":r.set(n.x+o/2,n.y+a+t),i.set(0,1);break;case"left":r.set(n.x-t,n.y+a/2),i.set(-1,0);break;case"right":r.set(n.x+o+t,n.y+a/2),i.set(1,0)}}function kb(e,t,n,r,i,o,a,s,l){a-=e,s-=t;var u=Math.sqrt(a*a+s*s),c=(a/=u)*n+e,h=(s/=u)*n+t;if(Math.abs(r-i)%Nb<1e-4)return l[0]=c,l[1]=h,u-n;if(o){var d=r;r=As(i),i=As(d)}else r=As(r),i=As(i);r>i&&(i+=Nb);var p=Math.atan2(s,a);if(p<0&&(p+=Nb),p>=r&&p<=i||p+Nb>=r&&p+Nb<=i)return l[0]=c,l[1]=h,u-n;var f=n*Math.cos(r)+e,g=n*Math.sin(r)+t,m=n*Math.cos(i)+e,v=n*Math.sin(i)+t,y=(f-a)*(f-a)+(g-s)*(g-s),_=(m-a)*(m-a)+(v-s)*(v-s);return y<_?(l[0]=f,l[1]=g,Math.sqrt(y)):(l[0]=m,l[1]=v,Math.sqrt(_))}function zb(e,t,n,r,i,o,a,s){var l=i-e,u=o-t,c=n-e,h=r-t,d=Math.sqrt(c*c+h*h),p=(l*(c/=d)+u*(h/=d))/d;s&&(p=Math.min(Math.max(p,0),1)),p*=d;var f=a[0]=e+p*c,g=a[1]=t+p*h;return Math.sqrt((f-i)*(f-i)+(g-o)*(g-o))}function Vb(e,t,n,r,i,o,a){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r);var s=e+n,l=t+r,u=a[0]=Math.min(Math.max(i,e),s),c=a[1]=Math.min(Math.max(o,t),l);return Math.sqrt((u-i)*(u-i)+(c-o)*(c-o))}var Bb=[];function Fb(e,t,n){var r=Vb(t.x,t.y,t.width,t.height,e.x,e.y,Bb);return n.set(Bb[0],Bb[1]),r}function Gb(e,t,n){for(var r,i,o=0,a=0,s=0,l=0,u=1/0,c=t.data,h=e.x,d=e.y,p=0;p<c.length;){var f=c[p++];1===p&&(s=o=c[p],l=a=c[p+1]);var g=u;switch(f){case Pb.M:o=s=c[p++],a=l=c[p++];break;case Pb.L:g=zb(o,a,c[p],c[p+1],h,d,Bb,!0),o=c[p++],a=c[p++];break;case Pb.C:g=En(o,a,c[p++],c[p++],c[p++],c[p++],c[p],c[p+1],h,d,Bb),o=c[p++],a=c[p++];break;case Pb.Q:g=kn(o,a,c[p++],c[p++],c[p],c[p+1],h,d,Bb),o=c[p++],a=c[p++];break;case Pb.A:var m=c[p++],v=c[p++],y=c[p++],_=c[p++],x=c[p++],b=c[p++];p+=1;var w=!!(1-c[p++]);r=Math.cos(x)*y+m,i=Math.sin(x)*_+v,p<=1&&(s=r,l=i),g=kb(m,v,_,x,x+b,w,(h-m)*_/y+m,d,Bb),o=Math.cos(x+b)*y+m,a=Math.sin(x+b)*_+v;break;case Pb.R:g=Vb(s=o=c[p++],l=a=c[p++],c[p++],c[p++],h,d,Bb);break;case Pb.Z:g=zb(o,a,s,l,h,d,Bb,!0),o=s,a=l}g<u&&(u=g,n.set(Bb[0],Bb[1]))}return u}var Hb=new kt,Ub=new kt,Wb=new kt,jb=new kt,Xb=new kt;function Yb(e,t){if(e){var n=e.getTextGuideLine(),r=e.getTextContent();if(r&&n){var i=e.textGuideLineConfig||{},o=[[0,0],[0,0],[0,0]],a=i.candidates||Ob,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var l=1/0,u=i.anchor,c=e.getComputedTransform(),h=c&&Pt([],c),d=t.get("length2")||0;u&&Wb.copy(u);for(var p=0;p<a.length;p++){Rb(a[p],0,s,Hb,jb),kt.scaleAndAdd(Ub,Hb,jb,d),Ub.transform(h);var f=e.getBoundingRect(),g=u?u.distance(Ub):e instanceof Us?Gb(Ub,e.path,Wb):Fb(Ub,f,Wb);g<l&&(l=g,Ub.transform(c),Wb.transform(c),Wb.toArray(o[0]),Ub.toArray(o[1]),Hb.toArray(o[2]))}Kb(o,t.get("minTurnAngle")),n.setShape({points:o})}}}var Zb=[],qb=new kt;function Kb(e,t){if(t<=180&&t>0){t=t/180*Math.PI,Hb.fromArray(e[0]),Ub.fromArray(e[1]),Wb.fromArray(e[2]),kt.sub(jb,Hb,Ub),kt.sub(Xb,Wb,Ub);var n=jb.len(),r=Xb.len();if(!(n<.001||r<.001)){jb.scale(1/n),Xb.scale(1/r);var i=jb.dot(Xb);if(Math.cos(t)<i){var o=zb(Ub.x,Ub.y,Wb.x,Wb.y,Hb.x,Hb.y,Zb,!1);qb.fromArray(Zb),qb.scaleAndAdd(Xb,o/Math.tan(Math.PI-t));var a=Wb.x!==Ub.x?(qb.x-Ub.x)/(Wb.x-Ub.x):(qb.y-Ub.y)/(Wb.y-Ub.y);if(isNaN(a))return;a<0?kt.copy(qb,Ub):a>1&&kt.copy(qb,Wb),qb.toArray(e[1])}}}}function $b(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,Hb.fromArray(e[0]),Ub.fromArray(e[1]),Wb.fromArray(e[2]),kt.sub(jb,Ub,Hb),kt.sub(Xb,Wb,Ub);var r=jb.len(),i=Xb.len();if(!(r<.001||i<.001))if(jb.scale(1/r),Xb.scale(1/i),jb.dot(t)<Math.cos(n)){var o=zb(Ub.x,Ub.y,Wb.x,Wb.y,Hb.x,Hb.y,Zb,!1);qb.fromArray(Zb);var a=Math.PI/2,s=a+Math.acos(Xb.dot(t))-n;if(s>=a)kt.copy(qb,Wb);else{qb.scaleAndAdd(Xb,o/Math.tan(Math.PI/2-s));var l=Wb.x!==Ub.x?(qb.x-Ub.x)/(Wb.x-Ub.x):(qb.y-Ub.y)/(Wb.y-Ub.y);if(isNaN(l))return;l<0?kt.copy(qb,Ub):l>1&&kt.copy(qb,Wb)}qb.toArray(e[1])}}}function Jb(e,t,n,r){var i="normal"===n,o=i?e:e.ensureState(n);o.ignore=t;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?e.useStyle(s):o.style=s}function Qb(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Xe(r[0],r[1]),o=Xe(r[1],r[2]);if(!i||!o)return e.lineTo(r[1][0],r[1][1]),void e.lineTo(r[2][0],r[2][1]);var a=Math.min(i,o)*n,s=qe([],r[1],r[0],a/i),l=qe([],r[1],r[2],a/o),u=qe([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)e.lineTo(r[c][0],r[c][1])}function ew(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(i){for(var o=t.normal,a=o.get("show"),s=i.ignore,l=0;l<Tl.length;l++){var u=Tl[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?s:de(i.states[u]&&i.states[u].ignore,s))||!de(d,a)){var p=h?r:r&&r.states[u];p&&(p.ignore=!0),r&&Jb(r,!0,u,c);continue}r||(r=new ac,e.setTextGuideLine(r),h||!s&&a||Jb(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),Jb(r,!1,u,c)}}if(r){V(r.style,n),r.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,r.buildPath=Qb}}else r&&e.removeTextGuideLine()}function tw(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<Sl.length;r++){var i=Sl[r];n[i]=e.getModel([i,t])}return n}function nw(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(!r.defaultAttr.ignore){var i=r.label,o=i.getComputedTransform(),a=i.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=i.style.margin||0,u=a.clone();u.applyTransform(o),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new Tc(a,o):null;t.push({label:i,labelLine:r.labelLine,rect:u,localRect:a,obb:c,priority:r.priority,defaultAttr:r.defaultAttr,layoutOption:r.computedLayoutOption,axisAligned:s,transform:o})}}return t}function rw(e,t,n,r,i,o){var a=e.length;if(!(a<2)){e.sort((function(e,n){return e.rect[t]-n.rect[t]}));for(var s,l=0,u=!1,c=0;c<a;c++){var h=e[c],d=h.rect;(s=d[t]-l)<0&&(d[t]-=s,h.label[t]-=s,u=!0),l=d[t]+d[n]}var p,f,g=e[0],m=e[a-1];return v(),p<0&&x(-p,.8),f<0&&x(f,.8),v(),y(p,f,1),y(f,p,-1),v(),p<0&&b(-p),f<0&&b(f),u}function v(){p=g.rect[t]-r,f=i-m.rect[t]-m.rect[n]}function y(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){_(r*n,0,a);var i=r+e;i<0&&x(-i*n,1)}else x(-e*n,1)}}function _(n,r,i){0!==n&&(u=!0);for(var o=r;o<i;o++){var a=e[o];a.rect[t]+=n,a.label[t]+=n}}function x(r,i){for(var o=[],s=0,l=1;l<a;l++){var u=e[l-1].rect,c=Math.max(e[l].rect[t]-u[t]-u[n],0);o.push(c),s+=c}if(s){var h=Math.min(Math.abs(r)/s,i);if(r>0)for(l=0;l<a-1;l++){_(o[l]*h,0,l+1)}else for(l=a-1;l>0;l--){_(-(o[l-1]*h),l,a)}}}function b(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r<a-1;r++)if(t>0?_(n,0,r+1):_(-n,a-r-1,a),(e-=n)<=0)return}}function iw(e,t,n,r){return rw(e,"y","height",t,n)}function ow(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new jt(0,0,0,0);function r(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var i=0;i<e.length;i++){var o=e[i],a=o.axisAligned,s=o.localRect,l=o.transform,u=o.label,c=o.labelLine;n.copy(o.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=o.obb,d=!1,p=0;p<t.length;p++){var f=t[p];if(n.intersect(f.rect)){if(a&&f.axisAligned){d=!0;break}if(f.obb||(f.obb=new Tc(f.localRect,f.transform)),h||(h=new Tc(s,l)),h.intersect(f.obb)){d=!0;break}}}d?(r(u),c&&r(c)):(u.attr("ignore",o.defaultAttr.ignore),c&&c.attr("ignore",o.defaultAttr.labelGuideIgnore),t.push(o))}}function aw(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function sw(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:aw(r&&r.shape.points)}}var lw=["align","verticalAlign","width","height","fontSize"],uw=new wi,cw=$o(),hw=$o();function dw(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];null!=t[i]&&(e[i]=t[i])}}var pw=["x","y","rotation"],fw=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var o=r.style,a=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),l=r.getBoundingRect().plain();jt.applyTransform(l,l,s),s?uw.setLocalTransform(s):(uw.x=uw.y=uw.rotation=uw.originX=uw.originY=0,uw.scaleX=uw.scaleY=1),uw.rotation=As(uw.rotation);var u,c=r.__hostTarget;if(c){u=c.getBoundingRect().plain();var h=c.getComputedTransform();jt.applyTransform(u,u,h)}var d=u&&c.getTextGuideLine();this._labelList.push({label:r,labelLine:d,seriesModel:n,dataIndex:e,dataType:t,layoutOption:i,computedLayoutOption:null,rect:l,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:d&&d.ignore,x:uw.x,y:uw.y,scaleX:uw.scaleX,scaleY:uw.scaleY,rotation:uw.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:r.cursor,attachedPos:a.position,attachedRot:a.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get("labelLayout");(Q(r)||q(r).length)&&e.group.traverse((function(e){if(e.ignore)return!0;var i=e.getTextContent(),o=vl(e);i&&!i.disableLabelLayout&&t._addLabel(o.dataIndex,o.dataType,n,i,r)}))},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){Yb(e,t)}}for(var i=0;i<this._labelList.length;i++){var o=this._labelList[i],a=o.label,s=a.__hostTarget,l=o.defaultAttr,u=void 0;u=(u=Q(o.layoutOption)?o.layoutOption(sw(o,s)):o.layoutOption)||{},o.computedLayoutOption=u;var c=Math.PI/180;s&&s.setTextConfig({local:!1,position:null!=u.x||null!=u.y?null:l.attachedPos,rotation:null!=u.rotate?u.rotate*c:l.attachedRot,offset:[u.dx||0,u.dy||0]});var h=!1;if(null!=u.x?(a.x=to(u.x,t),a.setStyle("x",0),h=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=u.y?(a.y=to(u.y,n),a.setStyle("y",0),h=!0):(a.y=l.y,a.setStyle("y",l.style.y)),u.labelLinePoints){var d=s.getTextGuideLine();d&&(d.setShape({points:u.labelLinePoints}),h=!1)}cw(a).needsUpdateLabelLine=h,a.rotation=null!=u.rotate?u.rotate*c:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<lw.length;p++){var f=lw[p];a.setStyle(f,null!=u[f]?u[f]:l.style[f])}if(u.draggable){if(a.draggable=!0,a.cursor="move",s){var g=o.seriesModel;if(null!=o.dataIndex)g=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex);a.on("drag",r(s,g.getModel("labelLine")))}}else a.off("drag"),a.cursor=l.cursor}},e.prototype.layout=function(e){var t=e.getWidth(),n=e.getHeight(),r=nw(this._labelList),i=Y(r,(function(e){return"shiftX"===e.layoutOption.moveOverlap})),o=Y(r,(function(e){return"shiftY"===e.layoutOption.moveOverlap}));rw(i,"x","width",0,t),iw(o,0,n),ow(Y(r,(function(e){return e.layoutOption.hideOverlap})))},e.prototype.processLabelsOverall=function(){var e=this;W(this._chartViewList,(function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse((function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var o=!r,a=t.getTextContent();!o&&a&&(o=cw(a).needsUpdateLabelLine),o&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)}))}))},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=vl(e),i=r.dataIndex;if(n&&null!=i){var o=t.getData(r.dataType),a=o.getItemModel(i),s={},l=o.getItemVisual(i,"style");if(l){var u=o.getVisual("drawType");s.stroke=l[u]}var c=a.getModel("labelLine");ew(e,tw(a),s),Yb(e,c)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!Nc(e))){var i=(p=cw(n)).oldLayout,o=vl(e),a=o.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(i){n.attr(i);var u=e.prevStates;u&&(F(u,"select")>=0&&n.attr(p.oldLayoutSelect),F(u,"emphasis")>=0&&n.attr(p.oldLayoutEmphasis)),Ec(n,s,t,a)}else if(n.attr(s),!Mh(n).valueAnimation){var c=de(n.style.opacity,1);n.style.opacity=0,Lc(n,{style:{opacity:c}},t,a)}if(p.oldLayout=s,n.states.select){var h=p.oldLayoutSelect={};dw(h,s,pw),dw(h,n.states.select,pw)}if(n.states.emphasis){var d=p.oldLayoutEmphasis={};dw(d,s,pw),dw(d,n.states.emphasis,pw)}Dh(n,a,l,t,t)}if(r&&!r.ignore&&!r.invisible){i=(p=hw(r)).oldLayout;var p,f={points:r.shape.points};i?(r.attr({shape:i}),Ec(r,{shape:f},t)):(r.setShape(f),r.style.strokePercent=0,Lc(r,{style:{strokePercent:1}},t)),p.oldLayout=f}},e}(),gw=$o();function mw(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){var r=gw(t).labelManager;r||(r=gw(t).labelManager=new fw),r.clearLabels()})),e.registerUpdateLifecycle("series:layoutlabels",(function(e,t,n){var r=gw(t).labelManager;n.updatedSeries.forEach((function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))})),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()}))}var vw=Math.sin,yw=Math.cos,_w=Math.PI,xw=2*Math.PI,bw=180/_w,ww=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},e.prototype.moveTo=function(e,t){this._add("M",e,t)},e.prototype.lineTo=function(e,t){this._add("L",e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,o){this._add("C",e,t,n,r,i,o)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add("Q",e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,o){this.ellipse(e,t,n,n,0,r,i,o)},e.prototype.ellipse=function(e,t,n,r,i,o,a,s){var l=a-o,u=!s,c=Math.abs(l),h=yr(c-xw)||(u?l>=xw:-l>=xw),d=l>0?l%xw:l%xw+xw,p=!1;p=!!h||!yr(c)&&d>=_w==!!u;var f=e+n*yw(o),g=t+r*vw(o);this._start&&this._add("M",f,g);var m=Math.round(i*bw);if(h){var v=1/this._p,y=(u?1:-1)*(xw-v);this._add("A",n,r,m,1,+u,e+n*yw(o+y),t+r*vw(o+y)),v>.01&&this._add("A",n,r,m,0,+u,f,g)}else{var _=e+n*yw(a),x=t+r*vw(a);this._add("A",n,r,m,+p,+u,_,x)}},e.prototype.rect=function(e,t,n,r){this._add("M",e,t),this._add("l",n,0),this._add("l",0,r),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,r,i,o,a,s,l){for(var u=[],c=this._p,h=1;h<arguments.length;h++){var d=arguments[h];if(isNaN(d))return void(this._invalid=!0);u.push(Math.round(d*c)/c)}this._d.push(e+u.join(" ")),this._start="Z"===e},e.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),Sw="none",Tw=Math.round;var Mw=["lineCap","miterLimit","lineJoin"],Cw=j(Mw,(function(e){return"stroke-"+e.toLowerCase()}));function Dw(e,t,n,r){var i=null==t.opacity?1:t.opacity;if(n instanceof Zs)e("opacity",i);else{if(function(e){var t=e.fill;return null!=t&&t!==Sw}(t)){var o=vr(t.fill);e("fill",o.color);var a=null!=t.fillOpacity?t.fillOpacity*o.opacity*i:o.opacity*i;a<1&&e("fill-opacity",a)}else e("fill",Sw);if(function(e){var t=e.stroke;return null!=t&&t!==Sw}(t)){var s=vr(t.stroke);e("stroke",s.color);var l=t.strokeNoScale?n.getLineScale():1,u=l?(t.lineWidth||0)/l:0,c=null!=t.strokeOpacity?t.strokeOpacity*s.opacity*i:s.opacity*i,h=t.strokeFirst;if(1!==u&&e("stroke-width",u),h&&e("paint-order",h?"stroke":"fill"),c<1&&e("stroke-opacity",c),t.lineDash){var d=gv(n),p=d[0],f=d[1];p&&(f=Tw(f||0),e("stroke-dasharray",p.join(",")),(f||r)&&e("stroke-dashoffset",f))}for(var g=0;g<Mw.length;g++){var m=Mw[g];if(t[m]!==Fs[m]){var v=t[m]||Fs[m];v&&e(Cw[g],v)}}}}}var Aw="http://www.w3.org/2000/svg",Iw="http://www.w3.org/1999/xlink",Ew="ecmeta_";function Lw(e){return document.createElementNS(Aw,e)}function Nw(e,t,n,r,i){return{tag:e,attrs:n||{},children:r,text:i,key:t}}function Pw(e,t){var n=(t=t||{}).newline?"\n":"";return function e(t){var r=t.children,i=t.tag,o=t.attrs,a=t.text;return function(e,t){var n=[];if(t)for(var r in t){var i=t[r],o=r;!1!==i&&(!0!==i&&null!=i&&(o+='="'+i+'"'),n.push(o))}return"<"+e+" "+n.join(" ")+">"}(i,o)+("style"!==i?dt(a):a||"")+(r?""+n+j(r,(function(t){return e(t)})).join(n)+n:"")+("</"+i+">")}(e)}function Ow(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Rw(e,t,n,r){return Nw("svg","root",{width:e,height:t,xmlns:Aw,"xmlns:xlink":Iw,version:"1.1",baseProfile:"full",viewBox:!!r&&"0 0 "+e+" "+t},n)}var kw=0;function zw(){return kw++}var Vw={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Bw="transform-origin";function Fw(e,t,n){var r=z({},e.shape);z(r,t),e.buildPath(n,r);var i=new ww;return i.reset(Ar(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function Gw(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[Bw]=n+"px "+r+"px")}var Hw={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Uw(e,t){var n=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function Ww(e){return ee(e)?Vw[e]?"cubic-bezier("+Vw[e]+")":Bn(e)?e:"":""}function jw(e,t,n,r){var i=e.animators,o=i.length,a=[];if(e instanceof mc){var s=function(e,t,n){var r,i,o=e.shape.paths,a={};if(W(o,(function(e){var t=Ow(n.zrId);t.animation=!0,jw(e,{},t,!0);var o=t.cssAnims,s=t.cssNodes,l=q(o),u=l.length;if(u){var c=o[i=l[u-1]];for(var h in c){var d=c[h];a[h]=a[h]||{d:""},a[h].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(i)>=0&&(r=f)}}})),r){t.d=!1;var s=Uw(a,n);return r.replace(i,s)}}(e,t,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u<o;u++){var c=i[u],h=[c.getMaxTime()/1e3+"s"],d=Ww(c.getClip().easing),p=c.getDelay();d?h.push(d):h.push("linear"),p&&h.push(p/1e3+"s"),c.getLoop()&&h.push("infinite");var f=h.join(" ");l[f]=l[f]||[f,[]],l[f][1].push(c)}function g(i){var o,a=i[1],s=a.length,l={},u={},c={},h="animation-timing-function";function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),o=0;o<r.length;o++){var a=r[o];if(a.needsAnimate()){var s=a.keyframes,l=a.propName;if(n&&(l=n(l)),l)for(var u=0;u<s.length;u++){var c=s[u],d=Math.round(c.time/i*100)+"%",p=Ww(c.easing),f=c.rawValue;(ee(f)||ne(f))&&(t[d]=t[d]||{},t[d][l]=c.rawValue,p&&(t[d][h]=p))}}}}for(var p=0;p<s;p++){(S=(w=a[p]).targetName)?"shape"===S&&d(w,u):!r&&d(w,l)}for(var f in l){var g={};Ti(g,e),z(g,l[f]);var m=Ir(g),v=l[f][h];c[f]=m?{transform:m}:{},Gw(c[f],g),v&&(c[f][h]=v)}var y=!0;for(var f in u){c[f]=c[f]||{};var _=!o;v=u[f][h];_&&(o=new Ss);var x=o.len();o.reset(),c[f].d=Fw(e,u[f],o);var b=o.len();if(!_&&x!==b){y=!1;break}v&&(c[f][h]=v)}if(!y)for(var f in c)delete c[f].d;if(!r)for(p=0;p<s;p++){var w,S;"style"===(S=(w=a[p]).targetName)&&d(w,c,(function(e){return Hw[e]}))}var T,M=q(c),C=!0;for(p=1;p<M.length;p++){var D=M[p-1],A=M[p];if(c[D][Bw]!==c[A][Bw]){C=!1;break}T=c[D][Bw]}if(C&&T){for(var f in c)c[f][Bw]&&delete c[f][Bw];t[Bw]=T}if(Y(M,(function(e){return q(c[e]).length>0})).length)return Uw(c,n)+" "+i[0]+" both"}for(var m in l){(s=g(l[m]))&&a.push(s)}if(a.length){var v=n.zrId+"-cls-"+zw();n.cssNodes["."+v]={animation:a.join(",")},t.class=v}}function Xw(e,t,n,r){var i=JSON.stringify(e),o=n.cssStyleCache[i];o||(o=n.zrId+"-cls-"+zw(),n.cssStyleCache[i]=o,n.cssNodes["."+o+":hover"]=e),t.class=t.class?t.class+" "+o:o}var Yw=Math.round;function Zw(e){return e&&ee(e.src)}function qw(e){return e&&Q(e.toDataURL)}function Kw(e,t,n,r){Dw((function(i,o){var a="fill"===i||"stroke"===i;a&&Cr(o)?sS(t,e,i,r):a&&Sr(o)?lS(n,e,i,r):e[i]=o,a&&r.ssr&&"none"===o&&(e["pointer-events"]="visible")}),t,n,!1),function(e,t,n){var r=e.style;if(function(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}(r)){var i=function(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(e),o=n.shadowCache,a=o[i];if(!a){var s=e.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var c=r.shadowOffsetX||0,h=r.shadowOffsetY||0,d=r.shadowBlur,p=vr(r.shadowColor),f=p.opacity,g=p.color,m=d/2/l+" "+d/2/u;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=Nw("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Nw("feDropShadow","",{dx:c/l,dy:h/u,stdDeviation:m,"flood-color":g,"flood-opacity":f})]),o[i]=a}t.filter=Dr(a)}}(n,e,r)}function $w(e,t){var n=$i(t);n&&(n.each((function(t,n){null!=t&&(e[(Ew+n).toLowerCase()]=t+"")})),t.isSilent()&&(e[Ew+"silent"]="true"))}function Jw(e){return yr(e[0]-1)&&yr(e[1])&&yr(e[2])&&yr(e[3]-1)}function Qw(e,t,n){if(t&&(!function(e){return yr(e[4])&&yr(e[5])}(t)||!Jw(t))){var r=1e4;e.transform=Jw(t)?"translate("+Yw(t[4]*r)/r+" "+Yw(t[5]*r)/r+")":function(e){return"matrix("+_r(e[0])+","+_r(e[1])+","+_r(e[2])+","+_r(e[3])+","+xr(e[4])+","+xr(e[5])+")"}(t)}}function eS(e,t,n){for(var r=e.points,i=[],o=0;o<r.length;o++)i.push(Yw(r[o][0]*n)/n),i.push(Yw(r[o][1]*n)/n);t.points=i.join(" ")}function tS(e){return!e.smooth}var nS,rS,iS={circle:[(nS=["cx","cy","r"],rS=j(nS,(function(e){return"string"==typeof e?[e,e]:e})),function(e,t,n){for(var r=0;r<rS.length;r++){var i=rS[r],o=e[i[0]];null!=o&&(t[i[1]]=Yw(o*n)/n)}})],polyline:[eS,tS],polygon:[eS,tS]};function oS(e,t){var n=e.style,r=e.shape,i=iS[e.type],o={},a=t.animation,s="path",l=e.style.strokePercent,u=t.compress&&Ar(e)||4;if(!i||t.willUpdate||i[1]&&!i[1](r)||a&&function(e){for(var t=e.animators,n=0;n<t.length;n++)if("shape"===t[n].targetName)return!0;return!1}(e)||l<1){var c=!e.path||e.shapeChanged();e.path||e.createPathProxy();var h=e.path;c&&(h.beginPath(),e.buildPath(h,e.shape),e.pathUpdated());var d=h.getVersion(),p=e,f=p.__svgPathBuilder;p.__svgPathVersion===d&&f&&l===p.__svgPathStrokePercent||(f||(f=p.__svgPathBuilder=new ww),f.reset(u),h.rebuildPath(f,l),f.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),o.d=f.getStr()}else{s=e.type;var g=Math.pow(10,u);i[0](r,o,g)}return Qw(o,e.transform),Kw(o,n,e,t),$w(o,e),t.animation&&jw(e,o,t),t.emphasis&&function(e,t,n){if(!e.ignore)if(e.isSilent())Xw(u={"pointer-events":"none"},t,n);else{var r=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},i=r.fill;if(!i){var o=e.style&&e.style.fill,a=e.states.select&&e.states.select.style&&e.states.select.style.fill,s=e.currentStates.indexOf("select")>=0&&a||o;s&&(i=fr(s))}var l=r.lineWidth;l&&(l/=!r.strokeNoScale&&e.transform?e.transform[0]:1);var u={cursor:"pointer"};i&&(u.fill=i),r.stroke&&(u.stroke=r.stroke),l&&(u["stroke-width"]=l),Xw(u,t,n)}}(e,o,t),Nw(s,e.id+"",o)}function aS(e,t){return e instanceof Us?oS(e,t):e instanceof Zs?function(e,t){var n=e.style,r=n.image;if(r&&!ee(r)&&(Zw(r)?r=r.src:qw(r)&&(r=r.toDataURL())),r){var i=n.x||0,o=n.y||0,a={href:r,width:n.width,height:n.height};return i&&(a.x=i),o&&(a.y=o),Qw(a,e.transform),Kw(a,n,e,t),$w(a,e),t.animation&&jw(e,a,t),Nw("image",e.id+"",a)}}(e,t):e instanceof js?function(e,t){var n=e.style,r=n.text;if(null!=r&&(r+=""),r&&!isNaN(n.x)&&!isNaN(n.y)){var i=n.font||f,o=n.x||0,a=function(e,t,n){return"top"===n?e+=t/2:"bottom"===n&&(e-=t/2),e}(n.y||0,Li(i),n.textBaseline),s={"dominant-baseline":"central","text-anchor":br[n.textAlign]||n.textAlign};if(cl(n)){var l="",u=n.fontStyle,c=ll(n.fontSize);if(!parseFloat(c))return;var h=n.fontFamily||p,d=n.fontWeight;l+="font-size:"+c+";font-family:"+h+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),d&&"normal"!==d&&(l+="font-weight:"+d+";"),s.style=l}else s.style="font: "+i;return r.match(/\s/)&&(s["xml:space"]="preserve"),o&&(s.x=o),a&&(s.y=a),Qw(s,e.transform),Kw(s,n,e,t),$w(s,e),t.animation&&jw(e,s,t),Nw("text",e.id+"",s,void 0,r)}}(e,t):void 0}function sS(e,t,n,r){var i,o=e[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(Tr(o))i="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!Mr(o))return void("production"!==process.env.NODE_ENV&&P("Illegal gradient type."));i="radialGradient",a.cx=de(o.x,.5),a.cy=de(o.y,.5),a.r=de(o.r,.5)}for(var s=o.colorStops,l=[],u=0,c=s.length;u<c;++u){var h=100*xr(s[u].offset)+"%",d=vr(s[u].color),p=d.color,f=d.opacity,g={offset:h};g["stop-color"]=p,f<1&&(g["stop-opacity"]=f),l.push(Nw("stop",u+"",g))}var m=Pw(Nw(i,"",a,l)),v=r.gradientCache,y=v[m];y||(y=r.zrId+"-g"+r.gradientIdx++,v[m]=y,a.id=y,r.defs[y]=Nw(i,y,a,l)),t[n]=Dr(y)}function lS(e,t,n,r){var i,o=e.style[n],a=e.getBoundingRect(),s={},l=o.repeat,u="no-repeat"===l,c="repeat-x"===l,h="repeat-y"===l;if(wr(o)){var d=o.imageWidth,p=o.imageHeight,f=void 0,g=o.image;if(ee(g)?f=g:Zw(g)?f=g.src:qw(g)&&(f=g.toDataURL()),"undefined"==typeof Image){var m="Image width/height must been given explictly in svg-ssr renderer.";me(d,m),me(p,m)}else if(null==d||null==p){var v=function(e,t){if(e){var n=e.elm,r=d||t.width,i=p||t.height;"pattern"===e.tag&&(c?(i=1,r/=a.width):h&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute("width",r),n.setAttribute("height",i))}},y=ba(f,null,e,(function(e){u||v(w,e),v(i,e)}));y&&y.width&&y.height&&(d=d||y.width,p=p||y.height)}i=Nw("image","img",{href:f,width:d,height:p}),s.width=d,s.height=p}else o.svgElement&&(i=O(o.svgElement),s.width=o.svgWidth,s.height=o.svgHeight);if(i){var _,x;u?_=x=1:c?(x=1,_=s.width/a.width):h?(_=1,x=s.height/a.height):s.patternUnits="userSpaceOnUse",null==_||isNaN(_)||(s.width=_),null==x||isNaN(x)||(s.height=x);var b=Ir(o);b&&(s.patternTransform=b);var w=Nw("pattern","",s,[i]),S=Pw(w),T=r.patternCache,M=T[S];M||(M=r.zrId+"-p"+r.patternIdx++,T[S]=M,s.id=M,w=r.defs[M]=Nw("pattern",M,s,[i])),t[n]=Dr(M)}}function uS(e,t,n){var r=n.clipPathCache,i=n.defs,o=r[e.id];if(!o){var a={id:o=n.zrId+"-c"+n.clipPathIdx++};r[e.id]=o,i[o]=Nw("clipPath",o,a,[oS(e,n)])}t["clip-path"]=Dr(o)}function cS(e){return document.createTextNode(e)}function hS(e,t,n){e.insertBefore(t,n)}function dS(e,t){e.removeChild(t)}function pS(e,t){e.appendChild(t)}function fS(e){return e.parentNode}function gS(e){return e.nextSibling}function mS(e,t){e.textContent=t}var vS=Nw("","");function yS(e){return void 0===e}function _S(e){return void 0!==e}function xS(e,t,n){for(var r={},i=t;i<=n;++i){var o=e[i].key;void 0!==o&&("production"!==process.env.NODE_ENV&&null!=r[o]&&console.error("Duplicate key "+o),r[o]=i)}return r}function bS(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function wS(e){var t,n=e.children,r=e.tag;if(_S(r)){var i=e.elm=Lw(r);if(MS(vS,e),J(n))for(t=0;t<n.length;++t){var o=n[t];null!=o&&pS(i,wS(o))}else _S(e.text)&&!re(e.text)&&pS(i,cS(e.text))}else e.elm=cS(e.text);return e.elm}function SS(e,t,n,r,i){for(;r<=i;++r){var o=n[r];null!=o&&hS(e,wS(o),t)}}function TS(e,t,n,r){for(;n<=r;++n){var i=t[n];if(null!=i)if(_S(i.tag))dS(fS(i.elm),i.elm);else dS(e,i.elm)}}function MS(e,t){var n,r=t.elm,i=e&&e.attrs||{},o=t.attrs||{};if(i!==o){for(n in o){var a=o[n];i[n]!==a&&(!0===a?r.setAttribute(n,""):!1===a?r.removeAttribute(n):"style"===n?r.style.cssText=a:120!==n.charCodeAt(0)?r.setAttribute(n,a):"xmlns:xlink"===n||"xmlns"===n?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,a):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,a):58===n.charCodeAt(5)?r.setAttributeNS(Iw,n,a):r.setAttribute(n,a))}for(n in i)n in o||r.removeAttribute(n)}}function CS(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(MS(e,t),yS(t.text)?_S(r)&&_S(i)?r!==i&&function(e,t,n){for(var r,i,o,a=0,s=0,l=t.length-1,u=t[0],c=t[l],h=n.length-1,d=n[0],p=n[h];a<=l&&s<=h;)null==u?u=t[++a]:null==c?c=t[--l]:null==d?d=n[++s]:null==p?p=n[--h]:bS(u,d)?(CS(u,d),u=t[++a],d=n[++s]):bS(c,p)?(CS(c,p),c=t[--l],p=n[--h]):bS(u,p)?(CS(u,p),hS(e,u.elm,gS(c.elm)),u=t[++a],p=n[--h]):bS(c,d)?(CS(c,d),hS(e,c.elm,u.elm),c=t[--l],d=n[++s]):(yS(r)&&(r=xS(t,a,l)),yS(i=r[d.key])||(o=t[i]).tag!==d.tag?hS(e,wS(d),u.elm):(CS(o,d),t[i]=void 0,hS(e,o.elm,u.elm)),d=n[++s]);(a<=l||s<=h)&&(a>l?SS(e,null==n[h+1]?null:n[h+1].elm,n,s,h):TS(e,t,a,l))}(n,r,i):_S(i)?(_S(e.text)&&mS(n,""),SS(n,null,i,0,i.length-1)):_S(r)?TS(n,r,0,r.length-1):_S(e.text)&&mS(n,""):e.text!==t.text&&(_S(r)&&TS(n,r,0,r.length-1),mS(n,t.text)))}var DS=0,AS=function(){function e(e,t,n){if(this.type="svg",this.refreshHover=IS("refreshHover"),this.configLayer=IS("configLayer"),this.storage=t,this._opts=n=z({},n),this.root=e,this._id="zr"+DS++,this._oldVNode=Rw(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement("div");r.style.cssText="position:relative;overflow:hidden";var i=this._svgDom=this._oldVNode.elm=Lw("svg");MS(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",function(e,t){if(bS(e,t))CS(e,t);else{var n=e.elm,r=fS(n);wS(t),null!==r&&(hS(r,t.elm,gS(n)),TS(r,[e],0,0))}}(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return aS(e,Ow(this._id))},e.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=Ow(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var o=[],a=this._bgVNode=function(e,t,n,r){var i;if(n&&"none"!==n)if(i=Nw("rect","bg",{width:e,height:t,x:"0",y:"0"}),Cr(n))sS({fill:n},i.attrs,"fill",r);else if(Sr(n))lS({style:{fill:n},dirty:Ie,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,"fill",r);else{var o=vr(n),a=o.color,s=o.opacity;i.attrs.fill=a,s<1&&(i.attrs["fill-opacity"]=s)}return i}(n,r,this._backgroundColor,i);a&&o.push(a);var s=e.compress?null:this._mainVNode=Nw("g","main",{},[]);this._paintList(t,i,s?s.children:o),s&&o.push(s);var l=j(q(i.defs),(function(e){return i.defs[e]}));if(l.length&&o.push(Nw("defs","defs",{},l)),e.animation){var u=function(e,t,n){var r=(n=n||{}).newline?"\n":"",i=" {"+r,o=r+"}",a=j(q(e),(function(t){return t+i+j(q(e[t]),(function(n){return n+":"+e[t][n]+";"})).join(r)+o})).join(r),s=j(q(t),(function(e){return"@keyframes "+e+i+j(q(t[e]),(function(n){return n+i+j(q(t[e][n]),(function(r){var i=t[e][n][r];return"d"===r&&(i='path("'+i+'")'),r+":"+i+";"})).join(r)+o})).join(r)+o})).join(r);return a||s?["<![CDATA[",a,s,"]]>"].join(r):""}(i.cssNodes,i.cssAnims,{newline:!0});if(u){var c=Nw("style","stl",{},[],u);o.push(c)}}return Rw(n,r,o,e.useViewBox)},e.prototype.renderToString=function(e){return e=e||{},Pw(this.renderToVNode({animation:de(e.cssAnimation,!0),emphasis:de(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:de(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r,i,o=e.length,a=[],s=0,l=0,u=0;u<o;u++){var c=e[u];if(!c.invisible){var h=c.__clipPaths,d=h&&h.length||0,p=i&&i.length||0,f=void 0;for(f=Math.max(d-1,p-1);f>=0&&(!h||!i||h[f]!==i[f]);f--);for(var g=p-1;g>f;g--)r=a[--s-1];for(var m=f+1;m<d;m++){var v={};uS(h[m],v,t);var y=Nw("g","clip-g-"+l++,v,[]);(r?r.children:n).push(y),a[s++]=y,r=y}i=h;var _=aS(c,t);_&&(r?r.children:n).push(_)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(null!=e&&(n.width=e),null!=t&&(n.height=t),r&&i&&(i.style.display="none",e=fv(r,0,n),t=fv(r,1,n),i.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var o=i.style;o.width=e+"px",o.height=t+"px"}if(Sr(this._backgroundColor))this.refresh();else{var a=this._svgDom;a&&(a.setAttribute("width",e),a.setAttribute("height",t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute("width",e),s.setAttribute("height",t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n="data:image/svg+xml;";return e?(t=Er(t))&&n+"base64,"+t:n+"charset=UTF-8,"+encodeURIComponent(t)},e}();function IS(e){return function(){"production"!==process.env.NODE_ENV&&P('In SVG mode painter not support method "'+e+'"')}}function ES(e,t,n){var r=y.createCanvas(),i=t.getWidth(),o=t.getHeight(),a=r.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=i+"px",a.height=o+"px",r.setAttribute("data-zr-dom-id",e)),r.width=i*n,r.height=o*n,r}var LS=function(e){function t(t,n,r){var i,o=e.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,r=r||pi,"string"==typeof t?i=ES(t,n,r):re(t)&&(t=(i=t).id),o.id=t,o.dom=i;var a=i.style;return a&&(De(i),i.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=r,o}return l(t,e),t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=ES("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i,o=[],a=this.maxRepaintRectCount,s=!1,l=new jt(0,0,0,0);function u(e){if(e.isFinite()&&!e.isZero())if(0===o.length){(t=new jt(0,0,0,0)).copy(e),o.push(t)}else{for(var t,n=!1,r=1/0,i=0,u=0;u<o.length;++u){var c=o[u];if(c.intersect(e)){var h=new jt(0,0,0,0);h.copy(c),h.union(e),o[u]=h,n=!0;break}if(s){l.copy(e),l.union(c);var d=e.width*e.height,p=c.width*c.height,f=l.width*l.height-d-p;f<r&&(r=f,i=u)}}if(s&&(o[i].union(e),n=!0),!n)(t=new jt(0,0,0,0)).copy(e),o.push(t);s||(s=o.length>=a)}}for(var c=this.__startIndex;c<this.__endIndex;++c){if(p=e[c]){var h=p.shouldBePainted(n,r,!0,!0);(f=p.__isRendered&&(1&p.__dirty||!h)?p.getPrevPaintRect():null)&&u(f);var d=h&&(1&p.__dirty||!p.__isRendered)?p.getPaintRect():null;d&&u(d)}}for(c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var p,f;h=(p=t[c])&&p.shouldBePainted(n,r,!0,!0);if(p&&(!h||!p.__zr)&&p.__isRendered)(f=p.getPrevPaintRect())&&u(f)}do{i=!1;for(c=0;c<o.length;)if(o[c].isZero())o.splice(c,1);else{for(var g=c+1;g<o.length;)o[c].intersect(o[g])?(i=!0,o[c].union(o[g]),o.splice(g,1)):g++;c++}}while(i);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,o=this.domBack;i&&(i.width=e+"px",i.height=t+"px"),r.width=e*n,r.height=t*n,o&&(o.width=e*n,o.height=t*n,1!==n&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,o=r.width,a=r.height;t=t||this.clearColor;var s=this.motionBlur&&!e,l=this.lastFrameAlpha,u=this.dpr,c=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(r,0,0,o/u,a/u));var h=this.domBack;function d(e,n,r,o){if(i.clearRect(e,n,r,o),t&&"transparent"!==t){var a=void 0;if(se(t))a=(t.global||t.__width===r&&t.__height===o)&&t.__canvasGradient||dv(i,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=a,t.__width=r,t.__height=o;else le(t)&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,a=wv(i,t,{dirty:function(){c.setUnpainted(),c.painter.refresh()}}));i.save(),i.fillStyle=a||t,i.fillRect(e,n,r,o),i.restore()}s&&(i.save(),i.globalAlpha=l,i.drawImage(h,e,n,r,o),i.restore())}!n||s?d(0,0,o,a):n.length&&W(n,(function(e){d(e.x*u,e.y*u,e.width*u,e.height*u)}))},t}(nt),NS=1e5,PS=314159,OS=.01;var RS=function(){function e(e,t,n,r){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=z({},n||{}),this.dpr=n.devicePixelRatio||pi,this._singleCanvas=i,this.root=e,e.style&&(De(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(i){var s=e,l=s.width,u=s.height;null!=n.width&&(l=n.width),null!=n.height&&(u=n.height),this.dpr=n.devicePixelRatio||1,s.width=l*this.dpr,s.height=u*this.dpr,this._width=l,this._height=u;var c=new LS(s,this,this.dpr);c.__builtin__=!0,c.initContext(),a[314159]=c,c.zlevel=PS,o.push(PS),this._domRoot=e}else{this._width=fv(e,0,n),this._height=fv(e,1,n);var h=this._domRoot=function(e,t){var n=document.createElement("div");return n.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}(this._width,this._height);e.appendChild(h)}}return e.prototype.getType=function(){return"canvas"},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var o=r[i],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===i?this._backgroundColor:null;a.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t=e.length,n=this._hoverlayer;if(n&&n.clear(),t){for(var r,i={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<t;o++){var a=e[o];a.__inHover&&(n||(n=this._hoverlayer=this.getLayer(NS)),r||(r=n.ctx).save(),Lv(r,a,i,o===t-1))}r&&r.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(NS)},e.prototype.paintOne=function(e,t){Ev(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),o=i.finished,a=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(e),o)this.eachLayer((function(e){e.afterBrush&&e.afterBrush()}));else{var s=this;dn((function(){s._paintList(e,t,n,r)}))}}},e.prototype._compositeManually=function(){var e=this.getLayer(PS).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer((function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)}))},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],o=this._opts.useDirtyRect,a=0;a<this._zlevelList.length;a++){var s=this._zlevelList[a],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&i.push(l)}for(var u=!0,c=!1,h=function(a){var s,l=i[a],h=l.ctx,d=o&&l.createRepaintRects(e,t,p._width,p._height),f=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),v=l.zlevel===p._zlevelList[0]?p._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,v,d);else if(f===l.__startIndex){var y=e[f];y.incremental&&y.notClear&&!n||l.clear(!1,v,d)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=l.__startIndex);var _=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(s=f;s<l.__endIndex;s++){var i=e[s];if(i.__inHover&&(c=!0),r._doPaintEl(i,l,o,t,n,s===l.__endIndex-1),g)if(Date.now()-m>15)break}n.prevElClipPaths&&h.restore()};if(d)if(0===d.length)s=l.__endIndex;else for(var x=p.dpr,b=0;b<d.length;++b){var w=d[b];h.save(),h.beginPath(),h.rect(w.x*x,w.y*x,w.width*x,w.height*x),h.clip(),_(w),h.restore()}else h.save(),_(),h.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(u=!1)},p=this,f=0;f<i.length;f++)h(f);return d.wxa&&W(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,r,i,o){var a=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&(Lv(a,e,i,o),e.setPrevPaintRect(s))}else Lv(a,e,i,o)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=PS);var n=this._layers[e];return n||((n=new LS("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?R(n,this._layerConfig[e],!0):this._layerConfig[e-OS]&&R(n,this._layerConfig[e-OS],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,r=this._zlevelList,i=r.length,o=this._domRoot,a=null,s=-1;if(n[e])"production"!==process.env.NODE_ENV&&P("ZLevel "+e+" has been used already");else if(function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(i>0&&e>r[0]){for(s=0;s<i-1&&!(r[s]<e&&r[s+1]>e);s++);a=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(t.dom,l.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}else"production"!==process.env.NODE_ENV&&P("Layer of zlevel "+e+" is not valid")},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__&&e.call(t,o,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__||e.call(t,o,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){function t(e){o&&(o.__endIndex!==e&&(o.__dirty=!0),o.__endIndex=e)}if(this.eachBuiltinLayer((function(e,t){e.__dirty=e.__used=!1})),this._singleCanvas)for(var n=1;n<e.length;n++){if((s=e[n]).zlevel!==e[n-1].zlevel||s.incremental){this._needsManuallyCompositing=!0;break}}var r,i,o=null,a=0;for(i=0;i<e.length;i++){var s,l=(s=e[i]).zlevel,u=void 0;r!==l&&(r=l,a=0),s.incremental?((u=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,a=1):u=this.getLayer(l+(a>0?OS:0),this._needsManuallyCompositing),u.__builtin__||P("ZLevel "+l+" has been used by unkown layer "+u.id),u!==o&&(u.__used=!0,u.__startIndex!==i&&(u.__dirty=!0),u.__startIndex=i,u.incremental?u.__drawIndex=-1:u.__drawIndex=i,t(i),o=u),1&s.__dirty&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,W(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?R(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+OS)R(this._layers[i],n[e],!0)}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(F(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var r=this._opts,i=this.root;if(null!=e&&(r.width=e),null!=t&&(r.height=t),e=fv(i,0,r),t=fv(i,1,r),n.style.display="",this._width!==e||t!==this._height){for(var o in n.style.width=e+"px",n.style.height=t+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(PS).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new LS("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;this.eachLayer((function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())}))}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++){var u=a[s];Lv(n,u,o,s===l-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function kS(e){e.registerPainter("canvas",RS)}var zS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.getInitialData=function(e){if("production"!==process.env.NODE_ENV){var t=e.coordinateSystem;if("polar"!==t&&"cartesian2d"!==t)throw new Error("Line not support coordinateSystem besides cartesian and polar")}return G_(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Wi,n=lv("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*e.itemHeight,s=lv(o,(e.itemWidth-a)/2,(e.itemHeight-a)/2,a,a,e.itemStyle.fill);t.add(s),s.setStyle(e.itemStyle);var l="inherit"===e.iconRotate?i:e.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Vg);function VS(e,t){var n=e.mapDimensionsAll("defaultedLabel"),r=n.length;if(1===r){var i=Rf(e,t,n[0]);return null!=i?i+"":null}if(r){for(var o=[],a=0;a<n.length;a++)o.push(Rf(e,t,n[a]));return o.join(" ")}}function BS(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!J(t))return t+"";for(var r=[],i=0;i<n.length;i++){var o=e.getDimensionIndex(n[i]);o>=0&&r.push(t[o])}return r.join(" ")}var FS=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.updateData(t,n,r,i),o}return l(t,e),t.prototype._createSymbol=function(e,t,n,r,i){this.removeAll();var o=lv(e,-1,-1,2,2,null,i);o.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=GS,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Xl(this.childAt(0))},t.prototype.downplay=function(){Yl(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var o=e.getItemVisual(n,"symbol")||"circle",a=e.hostModel,s=t.getSymbolSize(e,n),l=o!==this._symbolType,u=i&&i.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,e,n,s,c)}else{(d=this.childAt(0)).silent=!1;var h={scaleX:s[0]/2,scaleY:s[1]/2};u?d.attr(h):Ec(d,h,a,n),kc(d)}if(this._updateCommon(e,n,s,r,i),l){var d=this.childAt(0);if(!u){h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Lc(d,h,a,n)}}u&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,r,i){var o,a,s,l,u,c,h,d,p,f=this.childAt(0),g=e.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,u=r.blurScope,h=r.labelStatesModels,d=r.hoverScale,p=r.cursorStyle,c=r.emphasisDisabled),!r||e.hasItemOption){var m=r&&r.itemModel?r.itemModel:e.getItemModel(t),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),h=vh(m),d=v.getShallow("scale"),p=m.getShallow("cursor")}var y=e.getItemVisual(t,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var _=cv(e.getItemVisual(t,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=e.getItemVisual(t,"style"),b=x.fill;if(f instanceof Zs){var w=f.style;f.useStyle(z({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(z({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,i&&i.symbolInnerColor),f.style.strokeNoScale=!0;var S=e.getItemVisual(t,"liftZ"),T=this._z2;null!=S?null==T&&(this._z2=f.z2,f.z2+=S):null!=T&&(f.z2=T,this._z2=null);var M=i&&i.useNameLabel;mh(f,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):VS(e,t)},inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var C=f.ensureState("emphasis");C.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var D=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;C.scaleX=this._sizeX*D,C.scaleY=this._sizeY*D,this.setSymbolScale(1),au(this,l,u,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=vl(this).dataIndex,o=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var a=r.getTextContent();a&&Pc(a,{style:{opacity:0}},t,{dataIndex:i,removeOpt:o,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Pc(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return uv(e.getItemVisual(t,"symbolSize"))},t}(Wi);function GS(e,t){this.parent.drift(e,t)}function HS(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function US(e){return null==e||re(e)||(e={isIgnore:e}),e||{}}function WS(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:vh(t),cursorStyle:t.get("cursor")}}var jS=function(){function e(e){this.group=new Wi,this._SymbolCtor=e||FS}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=US(t);var n=this.group,r=e.hostModel,i=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=WS(e),l={disableAnimation:a},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add((function(r){var i=u(r);if(HS(e,i,r,t)){var a=new o(e,r,s,l);a.setPosition(i),e.setItemGraphicEl(r,a),n.add(a)}})).update((function(c,h){var d=i.getItemGraphicEl(h),p=u(c);if(HS(e,p,c,t)){var f=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new o(e,c,s,l)).setPosition(p);else{d.updateData(e,c,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Ec(d,m,r)}n.add(d),e.setItemGraphicEl(c,d)}else n.remove(d)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut((function(){n.remove(t)}),r)})).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl((function(t,n){var r=e._getSymbolPoint(n);t.setPosition(r),t.markRedraw()}))},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=WS(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function r(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=US(n);for(var i=e.start;i<e.end;i++){var o=t.getItemLayout(i);if(HS(t,o,i,n)){var a=new this._SymbolCtor(t,i,this._seriesScope);a.traverse(r),a.setPosition(o),this.group.add(a),t.setItemGraphicEl(i,a),this._progressiveEls.push(a)}}},e.prototype.eachRendered=function(e){hh(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}),n.hostModel)})):t.removeAll()},e}();function XS(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),o=function(e,t){var n=0,r=e.scale.getExtent();"start"===t?n=r[0]:"end"===t?n=r[1]:ne(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]);return n}(i,n),a=r.dim,s=i.dim,l=t.mapDimension(s),u=t.mapDimension(a),c="x"===s||"radius"===s?1:0,h=j(e.dimensions,(function(e){return t.mapDimension(e)})),d=!1,p=t.getCalculationInfo("stackResultDimension");return B_(t,h[0])&&(d=!0,h[0]=p),B_(t,h[1])&&(d=!0,h[1]=p),{dataDimsForPoint:h,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!d,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function YS(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,r),a[1-o]=i,t.dataToPoint(a)}var ZS=Math.min,qS=Math.max;function KS(e,t){return isNaN(e)||isNaN(t)}function $S(e,t,n,r,i,o,a,s,l){for(var u,c,h,d,p,f,g=n,m=0;m<r;m++){var v=t[2*g],y=t[2*g+1];if(g>=i||g<0)break;if(KS(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),h=v,d=y;else{var _=v-u,x=y-c;if(_*_+x*x<.5){g+=o;continue}if(a>0){for(var b=g+o,w=t[2*b],S=t[2*b+1];w===v&&S===y&&m<r;)m++,g+=o,w=t[2*(b+=o)],S=t[2*b+1],_=(v=t[2*g])-u,x=(y=t[2*g+1])-c;var T=m+1;if(l)for(;KS(w,S)&&T<r;)T++,w=t[2*(b+=o)],S=t[2*b+1];var M=.5,C=0,D=0,A=void 0,I=void 0;if(T>=r||KS(w,S))p=v,f=y;else{C=w-u,D=S-c;var E=v-u,L=w-v,N=y-c,P=S-y,O=void 0,R=void 0;if("x"===s){var k=C>0?1:-1;p=v-k*(O=Math.abs(E))*a,f=y,A=v+k*(R=Math.abs(L))*a,I=y}else if("y"===s){var z=D>0?1:-1;p=v,f=y-z*(O=Math.abs(N))*a,A=v,I=y+z*(R=Math.abs(P))*a}else O=Math.sqrt(E*E+N*N),p=v-C*a*(1-(M=(R=Math.sqrt(L*L+P*P))/(R+O))),f=y-D*a*(1-M),I=y+D*a*M,A=ZS(A=v+C*a*M,qS(w,v)),I=ZS(I,qS(S,y)),A=qS(A,ZS(w,v)),f=y-(D=(I=qS(I,ZS(S,y)))-y)*O/R,p=ZS(p=v-(C=A-v)*O/R,qS(u,v)),f=ZS(f,qS(c,y)),A=v+(C=v-(p=qS(p,ZS(u,v))))*R/O,I=y+(D=y-(f=qS(f,ZS(c,y))))*R/O}e.bezierCurveTo(h,d,p,f,v,y),h=A,d=I}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var JS=function(){this.smooth=0,this.smoothConstraint=!0},QS=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new JS},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&KS(n[2*i-2],n[2*i-1]);i--);for(;r<i&&KS(n[2*r],n[2*r+1]);r++);}for(;r<i;)r+=$S(e,n,r,i,i,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,r,i=this.path.data,o=Ss.CMD,a="x"===t,s=[],l=0;l<i.length;){var u=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,g=void 0;switch(i[l++]){case o.M:n=i[l++],r=i[l++];break;case o.L:if(u=i[l++],c=i[l++],(g=a?(e-n)/(u-n):(e-r)/(c-r))<=1&&g>=0){var m=a?(c-r)*g+r:(u-n)*g+n;return a?[e,m]:[m,e]}n=u,r=c;break;case o.C:u=i[l++],c=i[l++],h=i[l++],d=i[l++],p=i[l++],f=i[l++];var v=a?Dn(n,u,h,p,e,s):Dn(r,c,d,f,e,s);if(v>0)for(var y=0;y<v;y++){var _=s[y];if(_<=1&&_>=0){m=a?Mn(r,c,d,f,_):Mn(n,u,h,p,_);return a?[e,m]:[m,e]}}n=p,r=f}}},t}(Us),eT=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(JS),tT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return l(t,e),t.prototype.getDefaultShape=function(){return new eT},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&KS(n[2*o-2],n[2*o-1]);o--);for(;i<o&&KS(n[2*i],n[2*i+1]);i++);}for(;i<o;){var s=$S(e,n,i,o,o,1,t.smooth,a,t.connectNulls);$S(e,r,i+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),i+=s+1,e.closePath()}},t}(Us);function nT(e,t,n,r,i){var o=e.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=n.get(["lineStyle","width"])||0;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new tl({shape:{x:a,y:s,width:l,height:u}});if(t){var d=e.getBaseAxis(),p=d.isHorizontal(),f=d.inverse;p?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=u),h.shape.height=0);var g=Q(i)?function(e){i(e,h)}:null;Lc(h,{shape:{width:l,height:u,x:a,y:s}},n,null,r,g)}return h}function rT(e,t,n){var r=e.getArea(),i=no(r.r0,1),o=no(r.r,1),a=new Qu({shape:{cx:no(e.cx,1),cy:no(e.cy,1),r0:i,r:o,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});t&&("angle"===e.getBaseAxis().dim?a.shape.endAngle=r.startAngle:a.shape.r=i,Lc(a,{shape:{endAngle:r.endAngle,r:o}},n));return a}function iT(e,t,n,r,i){return e?"polar"===e.type?rT(e,t,n):"cartesian2d"===e.type?nT(e,t,n,r,i):null:null}function oT(e,t){return e.type===t}function aT(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function sT(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),r=Math.max(a,r)),isNaN(s)||(n=Math.min(s,n),i=Math.max(s,i))}return[[t,n],[r,i]]}function lT(e,t){var n=sT(e),r=n[0],i=n[1],o=sT(t),a=o[0],s=o[1];return Math.max(Math.abs(r[0]-a[0]),Math.abs(r[1]-a[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function uT(e){return ne(e)?e:e?.5:0}function cT(e,t,n,r,i){var o=n.getBaseAxis(),a="x"===o.dim||"radius"===o.dim?0:1,s=[],l=0,u=[],c=[],h=[],d=[];if(i){for(l=0;l<e.length;l+=2){var p=t||e;isNaN(p[l])||isNaN(p[l+1])||d.push(e[l],e[l+1])}e=d}for(l=0;l<e.length-2;l+=2)switch(h[0]=e[l+2],h[1]=e[l+3],c[0]=e[l],c[1]=e[l+1],s.push(c[0],c[1]),r){case"end":u[a]=h[a],u[1-a]=c[1-a],s.push(u[0],u[1]);break;case"middle":var f=(c[a]+h[a])/2,g=[];u[a]=g[a]=f,u[1-a]=c[1-a],g[1-a]=h[1-a],s.push(u[0],u[1]),s.push(g[0],g[1]);break;default:u[a]=c[a],u[1-a]=h[1-a],s.push(u[0],u[1])}return s.push(e[l++],e[l++]),s}function hT(e,t,n){var r=e.getVisual("visualMeta");if(r&&r.length&&e.count())if("cartesian2d"===t.type){for(var i,o,a=r.length-1;a>=0;a--){var s=e.getDimensionInfo(r[a].dimension);if("x"===(i=s&&s.coordDim)||"y"===i){o=r[a];break}}if(o){var l=t.getAxis(i),u=j(o.stops,(function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}})),c=u.length,h=o.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var d=function(e,t){var n,r,i=[],o=e.length;function a(e,t,n){var r=e.coord;return{coord:n,color:sr((n-r)/(t.coord-r),[e.color,t.color])}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else{if(u>t){r?i.push(a(r,l,t)):n&&i.push(a(n,l,0),a(n,l,t));break}n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}}return i}(u,"x"===i?n.getWidth():n.getHeight()),p=d.length;if(!p&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";W(d,(function(e){e.offset=(e.coord-f)/m})),d.push({offset:p?d[p-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:h[0]||"transparent"});var v=new yc(0,0,0,0,d,!0);return v[i]=f,v[i+"2"]=g,v}"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style only support x or y dimension.")}else"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style is only supported on cartesian2d.")}function dT(e,t,n){var r=e.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&(!i||!function(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),o=Math.max(1,Math.round(i/5)),a=0;a<i;a+=o)if(1.5*FS.getSymbolSize(t,a)[e.isHorizontal()?1:0]>r)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return W(o.getViewLabels(),(function(e){var t=o.scale.getRawOrdinalNumber(e.tickValue);s[t]=1})),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}function pT(e,t){return isNaN(e)||isNaN(t)}function fT(e,t){return[e[2*t],e[2*t+1]]}function gT(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<Sl.length;t++)if(e.get([Sl[t],"endLabel","show"]))return!0;return!1}function mT(e,t,n,r){if(oT(t,"cartesian2d")){var i=r.getModel("endLabel"),o=i.get("valueAnimation"),a=r.getData(),s={lastFrameIndex:0},l=gT(r)?function(n,r){e._endLabelOnDuring(n,r,a,s,o,i,t)}:null,u=t.getBaseAxis().isHorizontal(),c=nT(t,n,r,(function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})}),l);if(!r.get("clip",!0)){var h=c.shape,d=Math.max(h.width,h.height);u?(h.y-=d,h.height+=2*d):(h.x-=d,h.width+=2*d)}return l&&l(1,c),c}return"production"!==process.env.NODE_ENV&&r.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),rT(t,n,r)}var vT=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.init=function(){var e=new Wi,t=new jS;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e,this._changePolyState=K(this._changePolyState,this)},t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,o=e.getData(),a=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=o.getLayout("points")||[],u="polar"===r.type,c=this._coordSys,h=this._symbolDraw,d=this._polyline,p=this._polygon,f=this._lineGroup,g=!t.ssr&&e.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=XS(r,o,v),_=m&&function(e,t,n){if(!n.valueDim)return[];for(var r=t.count(),i=ox(2*r),o=0;o<r;o++){var a=YS(n,e,t,o);i[2*o]=a[0],i[2*o+1]=a[1]}return i}(r,o,y),x=e.get("showSymbol"),b=e.get("connectNulls"),w=x&&!u&&dT(e,o,r),S=this._data;S&&S.eachItemGraphicEl((function(e,t){e.__temp&&(i.remove(e),S.setItemGraphicEl(t,null))})),x||h.remove(),i.add(f);var T,M=!u&&e.get("step");r&&r.getArea&&e.get("clip",!0)&&(null!=(T=r.getArea()).width?(T.x-=.1,T.y-=.1,T.width+=.2,T.height+=.2):T.r0&&(T.r0-=.5,T.r+=.5)),this._clipShapeForSymbol=T;var C=hT(o,r,n)||o.getVisual("style")[o.getVisual("drawType")];if(d&&c.type===r.type&&M===this._step){m&&!p?p=this._newPolygon(l,_):p&&!m&&(f.remove(p),p=this._polygon=null),u||this._initOrUpdateEndLabel(e,r,zd(C));var D=f.getClipPath();if(D)Lc(D,{shape:mT(this,r,!1,e).shape},e);else f.setClipPath(mT(this,r,!0,e));x&&h.updateData(o,{isIgnore:w,clipShape:T,disableAnimation:!0,getSymbolPoint:function(e){return[l[2*e],l[2*e+1]]}}),aT(this._stackedOnPoints,_)&&aT(this._points,l)||(g?this._doUpdateAnimation(o,_,r,n,M,v,b):(M&&(_&&(_=cT(_,l,r,M,b)),l=cT(l,null,r,M,b)),d.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:_})))}else x&&h.updateData(o,{isIgnore:w,clipShape:T,disableAnimation:!0,getSymbolPoint:function(e){return[l[2*e],l[2*e+1]]}}),g&&this._initSymbolLabelAnimation(o,r,T),M&&(_&&(_=cT(_,l,r,M,b)),l=cT(l,null,r,M,b)),d=this._newPolyline(l),m?p=this._newPolygon(l,_):p&&(f.remove(p),p=this._polygon=null),u||this._initOrUpdateEndLabel(e,r,zd(C)),f.setClipPath(mT(this,r,!0,e));var A=e.getModel("emphasis"),I=A.get("focus"),E=A.get("blurScope"),L=A.get("disabled");(d.useStyle(V(a.getLineStyle(),{fill:"none",stroke:C,lineJoin:"bevel"})),cu(d,e,"lineStyle"),d.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=+d.style.lineWidth+1);vl(d).seriesIndex=e.seriesIndex,au(d,I,E,L);var N=uT(e.get("smooth")),P=e.get("smoothMonotone");if(d.setShape({smooth:N,smoothMonotone:P,connectNulls:b}),p){var O=o.getCalculationInfo("stackedOnSeries"),R=0;p.useStyle(V(s.getAreaStyle(),{fill:C,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),O&&(R=uT(O.get("smooth"))),p.setShape({smooth:N,stackedOnSmooth:R,smoothMonotone:P,connectNulls:b}),cu(p,e,"areaStyle"),vl(p).seriesIndex=e.seriesIndex,au(p,I,E,L)}var k=this._changePolyState;o.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=k)})),this._polyline.onHoverStateChange=k,this._data=o,this._coordSys=r,this._stackedOnPoints=_,this._points=l,this._step=M,this._valueOrigin=v,e.get("triggerLineEvent")&&(this.packEventData(e,d),p&&this.packEventData(e,p))},t.prototype.packEventData=function(e,t){vl(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),o=Ko(i,r);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=e.get("zlevel")||0,h=e.get("z")||0;(s=new FS(i,o)).x=l,s.y=u,s.setZ(c,h);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=h,d.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else Kg.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),o=Ko(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else Kg.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;Gl(this._polyline,e),t&&Gl(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new QS({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new tT({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(r=o.isHorizontal(),i=!1):"polar"===t.type&&(r="angle"===o.dim,i=!0);var s=e.hostModel,l=s.get("animationDuration");Q(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=Q(u)?u(null):u;e.eachItemGraphicEl((function(e,o){var s=e;if(s){var h=[e.x,e.y],d=void 0,p=void 0,f=void 0;if(n)if(i){var g=n,m=t.pointToCoord(h);r?(d=g.startAngle,p=g.endAngle,f=-m[1]/180*Math.PI):(d=g.r0,p=g.r,f=m[0])}else{var v=n;r?(d=v.x,p=v.x+v.width,f=e.x):(d=v.y+v.height,p=v.y,f=e.y)}var y=p===d?0:(f-d)/(p-d);a&&(y=1-y);var _=Q(u)?u(o):l*y+c,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel("endLabel");if(gT(e)){var i=e.getData(),o=this._polyline,a=i.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new il({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(e){for(var t=e.length/2;t>0&&pT(e[2*t-2],e[2*t-1]);t--);return t-1}(a);l>=0&&(mh(o,vh(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:l,defaultText:function(e,t,n){return null!=n?BS(i,n):VS(i,e)},enableTextSetter:!0},function(e,t){var n=t.getBaseAxis(),r=n.isHorizontal(),i=n.inverse,o=r?i?"right":"left":"center",a=r?"middle":i?"top":"bottom";return{normal:{align:e.get("align")||o,verticalAlign:e.get("verticalAlign")||a}}}(r,t)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=t.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,_=(g?p:0)*(m?-1:1),x=(g?0:-p)*(m?-1:1),b=g?"x":"y",w=function(e,t,n){for(var r,i,o=e.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u<o;u++)if(i=e[2*u+a],!isNaN(i)&&!isNaN(e[2*u+1-a]))if(0!==u){if(r<=t&&i>=t||r>=t&&i<=t){l=u;break}s=u,r=i}else r=i;return{range:[s,l],t:(t-r)/(i-r)}}(u,y,b),S=w.range,T=S[1]-S[0],M=void 0;if(T>=1){if(T>1&&!h){var C=fT(u,S[0]);s.attr({x:C[0]+_,y:C[1]+x}),i&&(M=c.getRawValue(S[0]))}else{(C=l.getPointOn(y,b))&&s.attr({x:C[0]+_,y:C[1]+x});var D=c.getRawValue(S[0]),A=c.getRawValue(S[1]);i&&(M=aa(n,d,D,A,w.t))}r.lastFrameIndex=S[0]}else{var I=1===e||r.lastFrameIndex>0?S[0]:0;C=fT(u,I);i&&(M=c.getRawValue(I)),s.attr({x:C[0]+_,y:C[1]+x})}if(i){var E=Mh(s);"function"==typeof E.setLabelText&&E.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,r,i,o,a){for(var s=function(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}(e,t),l=[],u=[],c=[],h=[],d=[],p=[],f=[],g=XS(i,t,a),m=e.getLayout("points")||[],v=t.getLayout("points")||[],y=0;y<s.length;y++){var _=s[y],x=!0,b=void 0,w=void 0;switch(_.cmd){case"=":b=2*_.idx,w=2*_.idx1;var S=m[b],T=m[b+1],M=v[w],C=v[w+1];(isNaN(S)||isNaN(T))&&(S=M,T=C),l.push(S,T),u.push(M,C),c.push(n[b],n[b+1]),h.push(r[w],r[w+1]),f.push(t.getRawIndex(_.idx1));break;case"+":var D=_.idx,A=g.dataDimsForPoint,I=i.dataToPoint([t.get(A[0],D),t.get(A[1],D)]);w=2*D,l.push(I[0],I[1]),u.push(v[w],v[w+1]);var E=YS(g,i,t,D);c.push(E[0],E[1]),h.push(r[w],r[w+1]),f.push(t.getRawIndex(D));break;case"-":x=!1}x&&(d.push(_),p.push(p.length))}p.sort((function(e,t){return f[e]-f[t]}));var L=l.length,N=ox(L),P=ox(L),O=ox(L),R=ox(L),k=[];for(y=0;y<p.length;y++){var z=p[y],V=2*y,B=2*z;N[V]=l[B],N[V+1]=l[B+1],P[V]=u[B],P[V+1]=u[B+1],O[V]=c[B],O[V+1]=c[B+1],R[V]=h[B],R[V+1]=h[B+1],k[y]=d[z]}return{current:N,next:P,stackedOnCurrent:O,stackedOnNext:R,status:k}}(this._data,e,this._stackedOnPoints,t,this._coordSys,0,this._valueOrigin),h=c.current,d=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;if(i&&(d=cT(c.stackedOnCurrent,c.current,n,i,a),h=cT(c.current,null,n,i,a),f=cT(c.stackedOnNext,c.next,n,i,a),p=cT(c.next,null,n,i,a)),lT(h,p)>3e3||l&&lT(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=c.current,s.shape.points=h;var g={shape:{points:p}};c.current!==h&&(g.shape.__points=c.next),s.stopAnimation(),Ec(s,g,u),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),Ec(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=c.status,y=0;y<v.length;y++){if("="===v[y].cmd){var _=e.getItemGraphicEl(v[y].idx1);_&&m.push({el:_,ptIdx:y})}}s.animators&&s.animators.length&&s.animators[0].during((function(){l&&l.dirtyShape();for(var e=s.shape.__points,t=0;t<m.length;t++){var n=m[t].el,r=2*m[t].ptIdx;n.x=e[r],n.y=e[r+1],n.markRedraw()}}))},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl((function(e,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(Kg);function yT(e,t){return{seriesType:e,plan:Yg(),reset:function(e){var n=e.getData(),r=e.coordinateSystem,i=e.pipelineContext,o=t||i.large;if(r){var a=j(r.dimensions,(function(e){return n.mapDimension(e)})).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");B_(n,a[0])&&(a[0]=l),B_(n,a[1])&&(a[1]=l);var u=n.getStore(),c=n.getDimensionIndex(a[0]),h=n.getDimensionIndex(a[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,i=o&&ox(n*s),a=[],l=[],d=e.start,p=0;d<e.end;d++){var f=void 0;if(1===s){var g=u.get(c,d);f=r.dataToPoint(g,null,l)}else a[0]=u.get(c,d),a[1]=u.get(h,d),f=r.dataToPoint(a,null,l);o?(i[p++]=f[0],i[p++]=f[1]):t.setItemLayout(d,f.slice())}o&&t.setLayout("points",i)}}}}}}var _T={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)isNaN(e[r])||(t+=e[r],n++);return 0===n?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},xT=function(e){return Math.round(e.length/2)};function bT(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,a=r.count();if(a>10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),d=Math.round(a/h);if(isFinite(d)&&d>1){"lttb"===i?e.setData(r.lttbDownSample(r.mapDimension(l.dim),1/d)):"minmax"===i&&e.setData(r.minmaxDownSample(r.mapDimension(l.dim),1/d));var p=void 0;ee(i)?p=_T[i]:Q(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(l.dim),1/d,p,xT))}}}}}var wT=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(e,t){return G_(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),o=r.dataToPoint(i);if(n)W(r.getAxes(),(function(e,n){if("category"===e.type&&null!=t){var r=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=i[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),r.length<2)return;if(2===r.length)return void(o[n]=e.toGlobalCoord(e.getExtent()[l?1:0]));for(var u=void 0,c=void 0,h=1,d=0;d<r.length;d++){var p=r[d].coord,f=d===r.length-1?r[d-1].tickValue+h:r[d].tickValue;if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===d&&(h=f-r[0].tickValue)}null==c&&(u?u&&(c=r[r.length-1].coord):c=r[0].coord),o[n]=e.toGlobalCoord(c)}}));else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=r.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(Vg);Vg.registerClass(wT);var ST=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(){return G_(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Uh(wT.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(wT),TT=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},MT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return l(t,e),t.prototype.getDefaultShape=function(){return new TT},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=.5*(o-i),s=i+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=2*Math.PI,d=c?u-l<h:l-u<h;d||(l=u-(c?h:-h));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(e.moveTo(p*i+n,f*i+r),e.arc(p*s+n,f*s+r,a,-Math.PI+l,l,!c)):e.moveTo(p*o+n,f*o+r),e.arc(n,r,o,l,u,!c),e.arc(g*s+n,m*s+r,a,u-2*Math.PI,u-Math.PI,!c),0!==i&&e.arc(n,r,i,u,l,c)},t}(Us);function CT(e,t,n){return t*Math.sin(e)*(n?-1:1)}function DT(e,t,n){return t*Math.cos(e)*(n?1:-1)}function AT(e,t,n){var r=e.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;J(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:j(r,(function(e){return Ni(e,i)}))}}var IT=Math.max,ET=Math.min;var LT=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return l(t,e),t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get("coordinateSystem");"cartesian2d"===i||"polar"===i?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r)):"production"!==process.env.NODE_ENV&&Ao("Only cartesian2d and polar supported for bar.")},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){hh(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,h=function(e,t){var n=e.get("realtimeSort",!0),r=t.getBaseAxis();"production"!==process.env.NODE_ENV&&n&&("category"!==r.type&&Ao("`realtimeSort` will not work because this bar series is not based on a category axis."),"cartesian2d"!==t.type&&Ao("`realtimeSort` will not work because this bar series is not on cartesian2d."));if(n&&"category"===r.type&&"cartesian2d"===t.type)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}(e,l);h&&this._enableRealtimeSort(h,a,n);var d=e.get("clip",!0)||h,p=function(e,t){var n=e.getArea&&e.getArea();if(oT(e,"cartesian2d")){var r=e.getBaseAxis();if("category"!==r.type||!r.onBand){var i=t.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}(l,a);o.removeClipPath();var f=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],_=this._backgroundEls,x=r&&r.isInitSort,b=r&&"changeAxisOrder"===r.type;function w(e){var t=BT[l.type](a,e),n=function(e,t,n){var r="polar"===e.type?Qu:tl;return new r({shape:XT(t,n,e),silent:!0,z2:0})}(l,i,t);return n.useStyle(m.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",v):n.setShape("cornerRadius",v),y[e]=n,n}a.diff(s).add((function(t){var n=a.getItemModel(t),r=BT[l.type](a,t,n);if(g&&w(t),a.hasValue(t)&&VT[l.type](r)){var s=!1;d&&(s=NT[l.type](p,r));var m=PT[l.type](e,a,t,r,i,c,u.model,!1,f);h&&(m.forceLabelAnimation=!0),GT(m,a,t,n,r,e,i,"polar"===l.type),x?m.attr({shape:r}):h?OT(h,c,m,r,t,i,!1,!1):Lc(m,{shape:r},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}})).update((function(t,n){var r=a.getItemModel(t),S=BT[l.type](a,t,r);if(g){var T=void 0;0===_.length?T=w(n):((T=_[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?T.setShape("r",v):T.setShape("cornerRadius",v),y[t]=T);var M=BT[l.type](a,t);Ec(T,{shape:XT(i,M,l)},c,t)}var C=s.getItemGraphicEl(n);if(a.hasValue(t)&&VT[l.type](S)){var D=!1;if(d&&(D=NT[l.type](p,S))&&o.remove(C),C?kc(C):C=PT[l.type](e,a,t,S,i,c,u.model,!!C,f),h&&(C.forceLabelAnimation=!0),b){var A=C.getTextContent();if(A){var I=Mh(A);null!=I.prevValue&&(I.prevValue=I.value)}}else GT(C,a,t,r,S,e,i,"polar"===l.type);x?C.attr({shape:S}):h?OT(h,c,C,S,t,i,!0,b):Ec(C,{shape:S},e,t,null),a.setItemGraphicEl(t,C),C.ignore=D,o.add(C)}else o.remove(C)})).remove((function(t){var n=s.getItemGraphicEl(t);n&&Rc(n,e,t)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Wi);S.removeAll();for(var T=0;T<y.length;++T)S.add(y[T]);o.add(S),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),WT(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),WT(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&iT(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),(function(e,t){var i=n(t);i=null==i?NaN:i,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})})),r.sort((function(e,t){return t.mappedValue-e.mappedValue})),{ordinalNumbers:j(r,(function(e){return e.ordinalNumber}))}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=r.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(i,r.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,(function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(t){Rc(t,e,vl(t).dataIndex)}))):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(Kg),NT={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,o=e.y+e.height,a=IT(t.x,e.x),s=ET(t.x+t.width,i),l=IT(t.y,e.y),u=ET(t.y+t.height,o),c=s<a,h=u<l;return t.x=c&&a>i?s:a,t.y=h&&l>o?u:l,t.width=c?0:s-a,t.height=h?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=ET(t.r,e.r),o=IT(t.r0,e.r0);t.r=i,t.r0=o;var a=i-o<0;if(n<0){r=t.r;t.r=t.r0,t.r0=r}return a}},PT={cartesian2d:function(e,t,n,r,i,o,a,s,l){var u=new tl({shape:z({},r),z2:1});(u.__dataIndex=n,u.name="item",o)&&(u.shape[i?"height":"width"]=0);return u},polar:function(e,t,n,r,i,o,a,s,l){var u=!i&&l?MT:Qu,c=new u({shape:r,z2:1});c.name="item";var h,d,p=FT(i);if(c.calculateTextPosition=(h=p,d=({isRoundCap:u===MT}||{}).isRoundCap,function(e,t,n){var r=t.position;if(!r||r instanceof Array)return Pi(e,t,n);var i=h(r),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,c=a.r0,p=(u+c)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=d?Math.abs(u-c)/2:0,y=Math.cos,_=Math.sin,x=s+u*y(f),b=l+u*_(f),w="left",S="top";switch(i){case"startArc":x=s+(c-o)*y(m),b=l+(c-o)*_(m),w="center",S="top";break;case"insideStartArc":x=s+(c+o)*y(m),b=l+(c+o)*_(m),w="center",S="bottom";break;case"startAngle":x=s+p*y(f)+CT(f,o+v,!1),b=l+p*_(f)+DT(f,o+v,!1),w="right",S="middle";break;case"insideStartAngle":x=s+p*y(f)+CT(f,-o+v,!1),b=l+p*_(f)+DT(f,-o+v,!1),w="left",S="middle";break;case"middle":x=s+p*y(m),b=l+p*_(m),w="center",S="middle";break;case"endArc":x=s+(u+o)*y(m),b=l+(u+o)*_(m),w="center",S="bottom";break;case"insideEndArc":x=s+(u-o)*y(m),b=l+(u-o)*_(m),w="center",S="top";break;case"endAngle":x=s+p*y(g)+CT(g,o+v,!0),b=l+p*_(g)+DT(g,o+v,!0),w="left",S="middle";break;case"insideEndAngle":x=s+p*y(g)+CT(g,-o+v,!0),b=l+p*_(g)+DT(g,-o+v,!0),w="right",S="middle";break;default:return Pi(e,t,n)}return(e=e||{}).x=x,e.y=b,e.align=w,e.verticalAlign=S,e}),o){var f=i?"r":"endAngle",g={};c.shape[f]=i?r.r0:r.startAngle,g[f]=r[f],(s?Ec:Lc)(c,{shape:g},o)}return c}};function OT(e,t,n,r,i,o,a,s){var l,u;o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?Ec:Lc)(n,{shape:l},t,i,null),(a?Ec:Lc)(n,{shape:u},t?e.baseAxis.model:null,i)}function RT(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var kT=["x","y","width","height"],zT=["cx","cy","r","startAngle","endAngle"],VT={cartesian2d:function(e){return!RT(e,kT)},polar:function(e){return!RT(e,zT)}},BT={cartesian2d:function(e,t,n){var r=e.getItemLayout(t),i=n?function(e,t){var n=e.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var r=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),o=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,o)}(n,r):0,o=r.width>0?1:-1,a=r.height>0?1:-1;return{x:r.x+o*i/2,y:r.y+a*i/2,width:r.width-o*i,height:r.height-a*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function FT(e){return function(e){var t=e?"Arc":"Angle";return function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}(e)}function GT(e,t,n,r,i,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape;z(u,AT(r.getModel("itemStyle"),u,!0)),e.setShape(u)}}else{var c=r.get(["itemStyle","borderRadius"])||0;e.setShape("r",c)}e.useStyle(l);var h=r.getShallow("cursor");h&&e.attr("cursor",h);var d=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=vh(r);mh(e,p,{labelFetcher:o,labelDataIndex:n,defaultText:VS(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var f=e.getTextContent();if(s&&f){var g=r.get(["label","position"]);e.textConfig.inside="middle"===g||null,function(e,t,n,r){if(ne(r))e.setTextConfig({rotation:r});else if(J(t))e.setTextConfig({rotation:0});else{var i,o=e.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(t);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=l;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:return void e.setTextConfig({rotation:0})}var c=1.5*Math.PI-i;"middle"===u&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),e.setTextConfig({rotation:c})}}(e,"outside"===g?d:g,FT(a),r.get(["label","rotate"]))}Ch(f,p,o.getRawValue(n),(function(e){return BS(t,e)}));var m=r.getModel(["emphasis"]);au(e,m.get("focus"),m.get("blurScope"),m.get("disabled")),cu(e,r),function(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}(i)&&(e.style.fill="none",e.style.stroke="none",W(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}var HT=function(){},UT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return l(t,e),t.prototype.getDefaultShape=function(){return new HT},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[r]=s,a[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],e.rect(o[0],o[1],a[0],a[1])},t}(Us);function WT(e,t,n,r){var i=e.getData(),o=i.getLayout("valueAxisHorizontal")?1:0,a=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=e.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new UT({shape:{points:u},incremental:!!r,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var h=new UT({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,t.add(h),h.useStyle(i.getVisual("style")),h.style.stroke=null,vl(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",jT),h.on("mousemove",jT)),n&&n.push(h)}var jT=om((function(e){var t=function(e,t,n){for(var r=e.baseDimIdx,i=1-r,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=o.length/3;c<h;c++){var d=3*c;if(l[r]=u,l[i]=o[d+2],s[r]=o[d+r],s[i]=o[d+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),t>=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return-1}(this,e.offsetX,e.offsetY);vl(this).dataIndex=t>=0?t:null}),30,!1);function XT(e,t,n){if(oT(n,"cartesian2d")){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var o=t;return{cx:(i=n.getArea()).cx,cy:i.cy,r0:e?i.r0:o.r0,r:e?i.r:o.r,startAngle:e?o.startAngle:0,endAngle:e?o.endAngle:2*Math.PI}}var YT=2*Math.PI,ZT=Math.PI/180;function qT(e,t){return Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function KT(e,t){var n=qT(e,t),r=e.get("center"),i=e.get("radius");J(i)||(i=[0,i]);var o,a,s=to(n.width,t.getWidth()),l=to(n.height,t.getHeight()),u=Math.min(s,l),c=to(i[0],u/2),h=to(i[1],u/2),d=e.coordinateSystem;if(d){var p=d.dataToPoint(r);o=p[0]||0,a=p[1]||0}else J(r)||(r=[r,r]),o=to(r[0],s)+n.x,a=to(r[1],l)+n.y;return{cx:o,cy:a,r0:c,r:h}}function $T(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),r=t.mapDimension("value"),i=qT(e,n),o=KT(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*ZT,h=e.get("endAngle"),d=e.get("padAngle")*ZT;h="auto"===h?c-YT:-h*ZT;var p=e.get("minAngle")*ZT+d,f=0;t.each(r,(function(e){!isNaN(e)&&f++}));var g=t.getSum(r),m=Math.PI/(g||f)*2,v=e.get("clockwise"),y=e.get("roseType"),_=e.get("stillShowZeroSum"),x=t.getDataExtent(r);x[0]=0;var b=v?1:-1,w=[c,h],S=b*d/2;ws(w,!v),c=w[0],h=w[1];var T=JT(e);T.startAngle=c,T.endAngle=h,T.clockwise=v;var M=Math.abs(h-c),C=M,D=0,A=c;if(t.setLayout({viewRect:i,r:l}),t.each(r,(function(e,n){var r;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:a,cy:s,r0:u,r:y?NaN:l});else{(r="area"!==y?0===g&&_?m:e*m:M/f)<p?(r=p,C-=p):D+=e;var i=A+b*r,o=0,c=0;d>r?c=o=A+b*r/2:(o=A+S,c=i-S),t.setItemLayout(n,{angle:r,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?eo(e,x,[u,l]):l}),A=i}})),C<YT&&f)if(C<=.001){var I=M/f;t.each(r,(function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=I;var i=0,o=0;I<d?o=i=c+b*(n+.5)*I:(i=c+b*n*I+S,o=c+b*(n+1)*I-S),r.startAngle=i,r.endAngle=o}}))}else m=C/D,A=c,t.each(r,(function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===p?p:e*m,o=0,a=0;i<d?a=o=A+b*i/2:(o=A+S,a=A+b*i-S),r.startAngle=o,r.endAngle=a,A+=b*i}}))}))}var JT=$o();function QT(e){return{seriesType:e,reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var r=e.getData();r.filterSelf((function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0}))}}}}var eM=Math.PI/180;function tM(e,t,n,r,i,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;h<c;h++)if("outer"===e[h].position&&"labelLine"===e[h].labelAlignTo){var d=e[h].label.x-u;e[h].linePoints[1][0]+=d,e[h].label.x=u}iw(e,l,l+a)&&function(e){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?a:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var h=l.label.x-t-l.len2*i,d=r+l.len,f=Math.abs(h)<d?Math.sqrt(c*c/(1-h*h/d/d)):d;u.rB=f,u.maxY=c}u.list.push(l)}p(o),p(a)}(e)}function p(e){for(var o=e.rB,a=o*o,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=r+l.len,h=c*c,d=Math.sqrt(Math.abs((1-u*u/a)*h)),p=t+(d+l.len2)*i,f=p-l.label.x;nM(l,l.targetTextWidth-f*i,!0),l.label.x=p}}}function nM(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var r=e.label,i=r.style,o=e.rect,a=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,c=o.width+(a?0:l);if(t<c||n){var h=o.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",t-l);var d=r.getBoundingRect();r.setStyle("width",Math.ceil(d.width)),r.setStyle("backgroundColor",a)}else{var p=t-l,f=t<c?p:n?p>e.unconstrainedWidth?null:p:null;r.setStyle("width",f)}var g=r.getBoundingRect();o.width=g.width;var m=(r.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function rM(e){return"center"===e.position}function iM(e){var t,n,r=e.getData(),i=[],o=!1,a=(e.get("minShowLabelAngle")||0)*eM,s=r.getLayout("viewRect"),l=r.getLayout("r"),u=s.width,c=s.x,h=s.y,d=s.height;function p(e){e.ignore=!0}r.each((function(e){var s=r.getItemGraphicEl(e),h=s.shape,d=s.getTextContent(),f=s.getTextGuideLine(),g=r.getItemModel(e),m=g.getModel("label"),v=m.get("position")||g.get(["emphasis","label","position"]),y=m.get("distanceToLabelLine"),_=m.get("alignTo"),x=to(m.get("edgeDistance"),u),b=m.get("bleedMargin"),w=g.getModel("labelLine"),S=w.get("length");S=to(S,u);var T=w.get("length2");if(T=to(T,u),Math.abs(h.endAngle-h.startAngle)<a)return W(d.states,p),d.ignore=!0,void(f&&(W(f.states,p),f.ignore=!0));if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(d)){var M,C,D,A,I=(h.startAngle+h.endAngle)/2,E=Math.cos(I),L=Math.sin(I);t=h.cx,n=h.cy;var N="inside"===v||"inner"===v;if("center"===v)M=h.cx,C=h.cy,A="center";else{var P=(N?(h.r+h.r0)/2*E:h.r*E)+t,O=(N?(h.r+h.r0)/2*L:h.r*L)+n;if(M=P+3*E,C=O+3*L,!N){var R=P+E*(S+l-h.r),k=O+L*(S+l-h.r),z=R+(E<0?-1:1)*T;M="edge"===_?E<0?c+x:c+u-x:z+(E<0?-y:y),C=k,D=[[P,O],[R,k],[z,k]]}A=N?"center":"edge"===_?E>0?"right":"left":E>0?"left":"right"}var V=Math.PI,B=0,F=m.get("rotate");if(ne(F))B=F*(V/180);else if("center"===v)B=0;else if("radial"===F||!0===F){B=E<0?-I+V:-I}else if("tangential"===F&&"outside"!==v&&"outer"!==v){var G=Math.atan2(E,L);G<0&&(G=2*V+G),L>0&&(G=V+G),B=G-V}if(o=!!B,d.x=M,d.y=C,d.rotation=B,d.setStyle({verticalAlign:"middle"}),N){d.setStyle({align:A});var H=d.states.select;H&&(H.x+=d.x,H.y+=d.y)}else{var U=d.getBoundingRect().clone();U.applyTransform(d.getComputedTransform());var j=(d.style.margin||0)+2.1;U.y-=j/2,U.height+=j,i.push({label:d,labelLine:f,position:v,len:S,len2:T,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new kt(E,L),linePoints:D,textAlign:A,labelDistance:y,labelAlignTo:_,edgeDistance:x,bleedMargin:b,rect:U,unconstrainedWidth:U.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:N})}})),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,r,i,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<e.length;d++){var p=e[d].label;rM(e[d])||(p.x<t?(c=Math.min(c,p.x),l.push(e[d])):(h=Math.max(h,p.x),u.push(e[d])))}for(d=0;d<e.length;d++)if(!rM(m=e[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;p=m.label;var f=m.linePoints,g=void 0;g="edge"===m.labelAlignTo?p.x<t?f[2][0]-m.labelDistance-a-m.edgeDistance:a+i-m.edgeDistance-f[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?p.x<t?c-a-m.bleedMargin:a+i-h-m.bleedMargin:p.x<t?p.x-a-m.bleedMargin:a+i-p.x-m.bleedMargin,m.targetTextWidth=g,nM(m,g)}for(tM(u,t,n,r,1,0,o,0,s,h),tM(l,t,n,r,-1,0,o,0,s,c),d=0;d<e.length;d++){var m;if(!rM(m=e[d])&&m.linePoints){p=m.label,f=m.linePoints;var v="edge"===m.labelAlignTo,y=p.style.padding,_=y?y[1]+y[3]:0,x=p.style.backgroundColor?0:_,b=m.rect.width+x,w=f[1][0]-f[2][0];v?p.x<t?f[2][0]=a+m.edgeDistance+b+m.labelDistance:f[2][0]=a+i-m.edgeDistance-b-m.labelDistance:(p.x<t?f[2][0]=p.x+m.labelDistance:f[2][0]=p.x-m.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=p.y}}}(i,t,n,l,u,d,c,h);for(var f=0;f<i.length;f++){var g=i[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&(W(m.states,p),m.ignore=!0);var _=m.states.select;_&&(_.x+=m.x,_.y+=m.y)}if(v){var x=g.linePoints;y||!x?(W(v.states,p),v.ignore=!0):(Kb(x,g.minTurnAngle),$b(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new kt(x[0][0],x[0][1])})}}}var oM=function(e){function t(t,n,r){var i=e.call(this)||this;i.z2=2;var o=new il;return i.setTextContent(o),i.updateData(t,n,r,!0),i}return l(t,e),t.prototype.updateData=function(e,t,n,r){var i=this,o=e.hostModel,a=e.getItemModel(t),s=a.getModel("emphasis"),l=e.getItemLayout(t),u=z(AT(a.getModel("itemStyle"),l,!0),l);if(isNaN(u.startAngle))i.setShape(u);else{if(r){i.setShape(u);var c=o.getShallow("animationType");o.ecModel.ssr?(Lc(i,{scaleX:0,scaleY:0},o,{dataIndex:t,isFrom:!0}),i.originX=u.cx,i.originY=u.cy):"scale"===c?(i.shape.r=l.r0,Lc(i,{shape:{r:l.r}},o,t)):null!=n?(i.setShape({startAngle:n,endAngle:n}),Lc(i,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},o,t)):(i.shape.endAngle=l.startAngle,Ec(i,{shape:{endAngle:l.endAngle}},o,t))}else kc(i),Ec(i,{shape:u},o,t);i.useStyle(e.getItemVisual(t,"style")),cu(i,a);var h=(l.startAngle+l.endAngle)/2,d=o.get("selectedOffset"),p=Math.cos(h)*d,f=Math.sin(h)*d,g=a.getShallow("cursor");g&&i.attr("cursor",g),this._updateLabel(o,e,t),i.ensureState("emphasis").shape=z({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},AT(s.getModel("itemStyle"),l)),z(i.ensureState("select"),{x:p,y:f,shape:AT(a.getModel(["select","itemStyle"]),l)}),z(i.ensureState("blur"),{shape:AT(a.getModel(["blur","itemStyle"]),l)});var m=i.getTextGuideLine(),v=i.getTextContent();m&&z(m.ensureState("select"),{x:p,y:f}),z(v.ensureState("select"),{x:p,y:f}),au(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},t.prototype._updateLabel=function(e,t,n){var r=this,i=t.getItemModel(n),o=i.getModel("labelLine"),a=t.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;mh(r,vh(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var u=r.getTextContent();r.setTextConfig({position:null,rotation:null}),u.attr({z2:10});var c=e.get(["label","position"]);if("outside"!==c&&"outer"!==c)r.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new ac,this.setTextGuideLine(h)),ew(this,tw(i),{stroke:s,opacity:pe(o.get(["lineStyle","opacity"]),l,1)})}},t}(Qu),aM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return l(t,e),t.prototype.render=function(e,t,n,r){var i,o=e.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(i=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=JT(e),h=new Qu({shape:z(KT(e,n),c)});h.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=h,s.add(h)}o.diff(a).add((function(e){var t=new oM(o,e,i);o.setItemGraphicEl(e,t),s.add(t)})).update((function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,i),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)})).remove((function(t){Rc(a.getItemGraphicEl(t),e,t)})).execute(),iM(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="pie",t}(Kg);function sM(e,t,n){t=J(t)&&{coordDimensions:t}||z({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=P_(r,t).dimensions,o=new L_(i,e);return o.initData(r,n),o}var lM=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),uM=$o(),cM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new lM(K(this.getData,this),K(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return sM(this,{coordDimensions:["value"],encodeDefaulter:$(gp,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=uM(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),(function(e){o.push(e)})),i=r.seats=so(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=i[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){Vo(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Vg);var hM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){return G_(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(Vg),dM=function(){},pM=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return l(t,e),t.prototype.getDefaultShape=function(){return new dM},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,r=t.points,i=t.size,o=this.symbolProxy,a=o.shape,s=e.getContext?e.getContext():e,l=s&&i[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<r.length;){var c=r[n++],h=r[n++];isNaN(c)||isNaN(h)||(u&&!u.contain(c,h)||(a.x=c-i[0]/2,a.y=h-i[1]/2,a.width=i[0],a.height=i[1],o.buildPath(e,a,!0)))}this.incremental&&(this._off=n,this.notClear=!0)}},t.prototype.afterBrush=function(){var e,t=this.shape,n=t.points,r=t.size,i=this._ctx,o=this.softClipShape;if(i){for(e=this._off;e<n.length;){var a=n[e++],s=n[e++];isNaN(a)||isNaN(s)||(o&&!o.contain(a,s)||i.fillRect(a-r[0]/2,s-r[1]/2,r[0],r[1]))}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,o=Math.max(i[0],4),a=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var l=2*s,u=r[l]-o/2,c=r[l+1]-a/2;if(e>=u&&t>=c&&e<=u+o&&t<=c+a)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],o=r[1],a=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var h=n[c++],d=n[c++];a=Math.min(h,a),l=Math.max(h,l),s=Math.min(d,s),u=Math.max(d,u)}e=this._rect=new jt(a-i/2,s-o/2,l-a+i,u-s+o)}return e},t}(Us),fM=function(){function e(){this.group=new Wi}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild((function(e){if(null!=e.startIndex){var n=2*(e.endIndex-e.startIndex),r=4*e.startIndex*2;t=new Float32Array(t.buffer,r,n)}e.setShape("points",t),e.reset()}))},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var r=this._newAdded[0],i=t.getLayout("points"),o=r&&r.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+i.length);s.set(o),s.set(i,a),r.endIndex=e.end,r.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:i}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new pM({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n=n||{};var i=t.getVisual("symbolSize");e.setShape("size",i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=lv(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("style"),s=a&&a.fill;s&&e.setColor(s);var l=vl(e);l.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){l.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(l.dataIndex=n+(e.startIndex||0))}))},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),gM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=yT("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new fM:new jS,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(Kg),mM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}($d),vM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ta).models[0]},t.type="cartesian2dAxis",t}($d);H(vM,qx);var yM={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},_M=R({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},yM),xM=R({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},yM),bM={category:_M,value:xM,time:R({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},xM),log:V({logBase:10},xM)},wM={value:1,category:1,time:1,log:1};function SM(e,t,n,r){W(wM,(function(i,o){var a=R(R({},bM[o],!0),r,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+o,n}return l(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=Xd(this),r=n?Zd(e):{};R(e,t.getTheme().get(o+"Axis")),R(e,this.getDefaultOption()),e.type=TM(e),n&&Yd(e,r,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=W_.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=t+"Axis."+o,n.defaultOption=a,n}(n);e.registerComponentModel(s)})),e.registerSubTypeDefaulter(t+"Axis",TM)}function TM(e){return e.type||(e.data?"category":"value")}var MM=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return j(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Y(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),CM=["x","y"];function DM(e){return"interval"===e.type||"time"===e.type}var AM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=CM,t}return l(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(DM(e)&&DM(t)){var n=e.getExtent(),r=t.getExtent(),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,u=(o[1]-i[1])/s,c=i[0]-n[0]*l,h=i[1]-r[0]*u,d=this._transform=[l,0,0,u,c,h];this._invTransform=Pt([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),o=new jt(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(o)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var r=e[0],i=e[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return Ke(n,e,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,t)),n[1]=a.toGlobalCoord(a.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(e[0]),s=r.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return Ke(n,e,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e,o=Math.max(t[0],t[1])-r+e,a=Math.max(n[0],n[1])-i+e;return new jt(r,i,o,a)},t}(MM),IM=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return l(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(Eb);function EM(e,t,n){n=n||{};var r=e.coordinateSystem,i=t.axis,o={},a=i.getAxesOnZeroOf()[0],s=i.position,l=a?"onZero":s,u=i.dim,c=r.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[h[2]-p,h[3]+p]:[h[0]-p,h[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[d[l]]:h[0],"x"===u?f[d[l]]:h[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),he(n.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=t.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function LM(e){return"cartesian2d"===e.get("coordinateSystem")}function NM(e){var t={xAxisModel:null,yAxisModel:null};return W(t,(function(n,r){var i=r.replace(/Model$/,""),o=e.getReferringComponents(i,ta).models[0];if("production"!==process.env.NODE_ENV&&!o)throw new Error(i+' "'+pe(e.get(i+"Index"),e.get(i+"Id"),0)+'" not found');t[r]=o})),t}var PM=Math.log;function OM(e,t,n){var r=nx.prototype,i=r.getTicks.call(n),o=r.getTicks.call(n,!0),a=i.length-1,s=r.getInterval.call(n),l=Fx(e,t),u=l.extent,c=l.fixMin,h=l.fixMax;if("log"===e.type){var d=PM(e.base);u=[PM(u[0])/d,PM(u[1])/d]}e.setExtent(u[0],u[1]),e.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:h});var p=r.getExtent.call(e);c&&(u[0]=p[0]),h&&(u[1]=p[1]);var f=r.getInterval.call(e),g=u[0],m=u[1];if(c&&h)f=(m-g)/a;else if(c)for(m=u[0]+f*a;m<u[1]&&isFinite(m)&&isFinite(u[1]);)f=Z_(f),m=u[0]+f*a;else if(h)for(g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=Z_(f),g=u[1]-f*a;else{e.getTicks().length-1>a&&(f=Z_(f));var v=f*a;(g=no((m=Math.ceil(u[1]/f)*f)-v))<0&&u[0]>=0?(g=0,m=no(v)):m>0&&u[1]<=0&&(m=0,g=-no(v))}var y=(i[0].value-o[0].value)/s,_=(i[a].value-o[a].value)/s;if(r.setExtent.call(e,g+f*y,m+f*_),r.setInterval.call(e,f),(y||_)&&r.setNiceExtent.call(e,g+f,m-f),"production"!==process.env.NODE_ENV){var x=r.getTicks.call(e);x[1]&&(!function(e){var t=Math.pow(10,mo(Math.abs(e))),n=Math.abs(e/t);return 0===n||1===n||2===n||3===n||5===n}(f)||oo(x[1].value)>oo(f))&&Ao("The ticks may be not readable when set min: "+t.get("min")+", max: "+t.get("max")+" and alignTicks: true")}}var RM=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=CM,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function r(e){var t,n=q(e),r=n.length;if(r){for(var i=[],o=r-1;o>=0;o--){var a=e[+n[o]],s=a.model,l=a.scale;X_(l)&&s.get("alignTicks")&&null==s.get("interval")?i.push(a):(Gx(l,s),X_(l)&&(t=a))}i.length&&(t||Gx((t=i.pop()).scale,t.model),W(i,(function(e){OM(e.scale,e.model,t.scale)})))}}this._updateScale(e,this.model),r(n.x),r(n.y);var i={};W(n.x,(function(e){zM(n,"y",e,i)})),W(n.y,(function(e){zM(n,"x",e,i)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=Wd(r,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){W(a,(function(e){var t=e.isHorizontal(),n=t?[0,o.width]:[0,o.height],r=e.inverse?1:0;e.setExtent(n[r],n[1-r]),function(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return r-e+t}}(e,t?o.x:o.y)}))}s(),i&&(W(a,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var r,i,o=n.getExtent();i=n instanceof ex?n.count():(r=n.getTicks()).length;var a,s=e.getLabelModel(),l=Ux(e),u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c<i;c+=u){var h=l(r?r[c]:{value:o[0]+c},c),d=jx(s.getTextRect(h),s.get("rotate")||0);a?a.union(d):a=d}return a}}(e);if(t){var n=e.isHorizontal()?"height":"width",r=e.model.get(["axisLabel","margin"]);o[n]-=t[n]+r,"top"===e.position?o.y+=t.height+r:"left"===e.position&&(o.x+=t.width+r)}}})),s()),W(this._coordsList,(function(e){e.calcAffineTransform()}))},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}re(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis("x").index===e||i[r].getAxis("y").index===t)return i[r]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,r=e.seriesModel,i=e.xAxisModel||r&&r.getReferringComponents("xAxis",ta).models[0],o=e.yAxisModel||r&&r.getReferringComponents("yAxis",ta).models[0],a=e.gridModel,s=this._coordsList;if(r)F(s,t=r.coordinateSystem)<0&&(t=null);else if(i&&o)t=this.getCartesian(i.componentIndex,o.componentIndex);else if(i)n=this.getAxis("x",i.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(a){a.coordinateSystem===this&&(t=this._coordsList[0])}return{cartesian:t,axis:n}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var r=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(t.eachComponent("xAxis",l("x"),this),t.eachComponent("yAxis",l("y"),this),!s.x||!s.y)return this._axesMap={},void(this._axesList=[]);function l(t){return function(n,r){if(kM(n,e)){var l=n.get("position");"x"===t?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var u=new IM(t,Hx(n),[0,0],n.get("type"),l),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),n.axis=u,u.model=n,u.grid=i,u.index=r,i._axesList.push(u),a[t][r]=u,s[t]++}}}this._axesMap=a,W(a.x,(function(t,n){W(a.y,(function(i,o){var a="x"+n+"y"+o,s=new AM(a);s.master=r,s.model=e,r._coordsMap[a]=s,r._coordsList.push(s),s.addAxis(t),s.addAxis(i)}))}))},e.prototype._updateScale=function(e,t){function n(e,t){W(Zx(e,t.dim),(function(n){t.scale.unionExtentFromData(e,n)}))}W(this._axesList,(function(e){if(e.scale.setExtent(1/0,-1/0),"category"===e.type){var t=e.model.get("categorySortInfo");e.scale.setSortInfo(t)}})),e.eachSeries((function(e){if(LM(e)){var r=NM(e),i=r.xAxisModel,o=r.yAxisModel;if(!kM(i,t)||!kM(o,t))return;var a=this.getCartesian(i.componentIndex,o.componentIndex),s=e.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}),this)},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return W(this.getCartesians(),(function(r){var i=null!=e&&"auto"!==e?r.getAxis(e):r.getBaseAxis(),o=r.getOtherAxis(i);F(t,i)<0&&t.push(i),F(n,o)<0&&n.push(o)})),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var r=[];return t.eachComponent("grid",(function(i,o){var a=new e(i,t,n);a.name="grid_"+o,a.resize(i,n,!0),i.coordinateSystem=a,r.push(a)})),t.eachSeries((function(e){if(LM(e)){var t=NM(e),n=t.xAxisModel,r=t.yAxisModel,i=n.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!i)throw new Error('Grid "'+pe(n.get("gridIndex"),n.get("gridId"),0)+'" not found');if(n.getCoordSysModel()!==r.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var o=i.coordinateSystem;e.coordinateSystem=o.getCartesian(n.componentIndex,r.componentIndex)}})),r},e.dimensions=CM,e}();function kM(e,t){return e.getCoordSysModel()===t}function zM(e,t,n,r){n.getAxesOnZeroOf=function(){return i?[i]:[]};var i,o=e[t],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)VM(o[l])&&(i=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&VM(o[u])&&!r[c(o[u])]){i=o[u];break}i&&(r[c(i)]=!0)}function c(e){return e.dim+"_"+e.index}}function VM(e){return e&&"category"!==e.type&&"time"!==e.type&&function(e){var t=e.scale.getExtent(),n=t[0],r=t[1];return!(n>0&&r>0||n<0&&r<0)}(e)}var BM=Math.PI,FM=function(){function e(e,t){this.group=new Wi,this.opt=t,this.axisModel=e,V(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Wi({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!GM[e]},e.prototype.add=function(e){GM[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var r,i,o=co(t-e);return ho(o)?(i=n>0?"top":"bottom",r="center"):ho(o-BM)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o<BM?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),GM={axisLine:function(e,t,n,r){var i=t.get(["axisLine","show"]);if("auto"===i&&e.handleAutoShown&&(i=e.handleAutoShown("axisLine")),i){var o=t.axis.getExtent(),a=r.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(Ke(s,s,a),Ke(l,l,a));var c=z({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new uc({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});Kc(h.shape,h.style.lineWidth),h.anid="line",n.add(h);var d=t.get(["axisLine","symbol"]);if(null!=d){var p=t.get(["axisLine","symbolSize"]);ee(d)&&(d=[d,d]),(ee(p)||ne(p))&&(p=[p,p]);var f=cv(t.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];W([{rotate:e.rotation+Math.PI/2,offset:f[0],r:0},{rotate:e.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,r){if("none"!==d[r]&&null!=d[r]){var i=lv(d[r],-g/2,-m/2,g,m,c.stroke,!0),o=t.r+t.offset,a=u?l:s;i.attr({rotation:t.rotate,x:a[0]+o*Math.cos(e.rotation),y:a[1]-o*Math.sin(e.rotation),silent:!0,z2:11}),n.add(i)}}))}}},axisTickLabel:function(e,t,n,r){var i=function(e,t,n,r){var i=n.axis,o=n.getModel("axisTick"),a=o.get("show");"auto"===a&&r.handleAutoShown&&(a=r.handleAutoShown("axisTick"));if(!a||i.scale.isBlank())return;for(var s=o.getModel("lineStyle"),l=r.tickDirection*o.get("length"),u=jM(i.getTicksCoords(),t.transform,l,V(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}(n,r,t,e),o=function(e,t,n,r){var i=n.axis,o=he(r.axisLabelShow,n.get(["axisLabel","show"]));if(!o||i.scale.isBlank())return;var a=n.getModel("axisLabel"),s=a.get("margin"),l=i.getViewLabels(),u=(he(r.labelRotate,a.get("rotate"))||0)*BM/180,c=FM.innerTextLayout(r.rotation,u,r.labelDirection),h=n.getCategories&&n.getCategories(!0),d=[],p=FM.isLabelSilent(n),f=n.get("triggerEvent");return W(l,(function(o,u){var g="ordinal"===i.scale.type?i.scale.getRawOrdinalNumber(o.tickValue):o.tickValue,m=o.formattedLabel,v=o.rawLabel,y=a;if(h&&h[g]){var _=h[g];re(_)&&_.textStyle&&(y=new Fh(_.textStyle,a,n.ecModel))}var x=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),b=i.dataToCoord(g),w=y.getShallow("align",!0)||c.textAlign,S=de(y.getShallow("alignMinLabel",!0),w),T=de(y.getShallow("alignMaxLabel",!0),w),M=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||c.textVerticalAlign,C=de(y.getShallow("verticalAlignMinLabel",!0),M),D=de(y.getShallow("verticalAlignMaxLabel",!0),M),A=new il({x:b,y:r.labelOffset+r.labelDirection*s,rotation:c.rotation,silent:p,z2:10+(o.level||0),style:yh(y,{text:m,align:0===u?S:u===l.length-1?T:w,verticalAlign:0===u?C:u===l.length-1?D:M,fill:Q(x)?x("category"===i.type?v:"value"===i.type?g+"":g,u):x})});if(A.anid="label_"+g,uh({el:A,componentModel:n,itemName:m,formatterParamsExtra:{isTruncated:function(){return A.isTruncated},value:v,tickIndex:u}}),f){var I=FM.makeAxisEventDataBase(n);I.targetType="axisLabel",I.value=v,I.tickIndex=u,"category"===i.type&&(I.dataIndex=g),vl(A).eventData=I}t.add(A),A.updateTransform(),d.push(A),e.add(A),A.decomposeTransform()})),d}(n,r,t,e);(function(e,t,n){if(Yx(e.axis))return;var r=e.get(["axisLabel","showMinLabel"]),i=e.get(["axisLabel","showMaxLabel"]);t=t||[],n=n||[];var o=t[0],a=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],d=n[n.length-2];!1===r?(HM(o),HM(u)):UM(o,a)&&(r?(HM(a),HM(c)):(HM(o),HM(u)));!1===i?(HM(s),HM(h)):UM(l,s)&&(i?(HM(l),HM(d)):(HM(s),HM(h)))}(t,o,i),function(e,t,n,r){var i=n.axis,o=n.getModel("minorTick");if(!o.get("show")||i.scale.isBlank())return;var a=i.getMinorTicksCoords();if(!a.length)return;for(var s=o.getModel("lineStyle"),l=r*o.get("length"),u=V(s.getLineStyle(),V(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var h=jM(a[c],t.transform,l,u,"minorticks_"+c),d=0;d<h.length;d++)e.add(h[d])}(n,r,t,e.tickDirection),t.get(["axisLabel","hideOverlap"]))&&ow(nw(j(o,(function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}}))))},axisName:function(e,t,n,r){var i=he(e.axisName,t.get("name"));if(i){var o,a,s=t.get("nameLocation"),l=e.nameDirection,u=t.getModel("nameTextStyle"),c=t.get("nameGap")||0,h=t.axis.getExtent(),d=h[0]>h[1]?-1:1,p=["start"===s?h[0]-d*c:"end"===s?h[1]+d*c:(h[0]+h[1])/2,WM(s)?e.labelOffset+l*c:0],f=t.get("nameRotate");null!=f&&(f=f*BM/180),WM(s)?o=FM.innerTextLayout(e.rotation,null!=f?f:e.rotation,l):(o=function(e,t,n,r){var i,o,a=co(n-e),s=r[0]>r[1],l="start"===t&&!s||"start"!==t&&s;ho(a-BM/2)?(o=l?"bottom":"top",i="center"):ho(a-1.5*BM)?(o=l?"top":"bottom",i="center"):(o="middle",i=a<1.5*BM&&a>BM/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:i,textVerticalAlign:o}}(e.rotation,s,f||0,h),null!=(a=e.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),m=t.get("nameTruncate",!0)||{},v=m.ellipsis,y=he(e.nameTruncateMaxWidth,m.maxWidth,a),_=new il({x:p[0],y:p[1],rotation:o.rotation,silent:FM.isLabelSilent(t),style:yh(u,{text:i,font:g,overflow:"truncate",width:y,ellipsis:v,fill:u.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(uh({el:_,componentModel:t,itemName:i}),_.__fullText=i,_.anid="name",t.get("triggerEvent")){var x=FM.makeAxisEventDataBase(t);x.targetType="axisName",x.name=i,vl(_).eventData=x}r.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function HM(e){e&&(e.ignore=!0)}function UM(e,t){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var i=Dt([]);return Lt(i,i,-e.rotation),n.applyTransform(It([],i,e.getLocalTransform())),r.applyTransform(It([],i,t.getLocalTransform())),n.intersect(r)}}function WM(e){return"middle"===e||"center"===e}function jM(e,t,n,r,i){for(var o=[],a=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,t&&(Ke(a,a,t),Ke(s,s,t));var c=new uc({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});Kc(c.shape,c.style.lineWidth),c.anid=i+"_"+e[l].tickValue,o.push(c)}return o}function XM(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,n){var r=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),o=i.get("link",!0)||[],a=[];W(n.getCoordinateSystems(),(function(n){if(n.axisPointerEnabled){var s=KM(n.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var u=n.model.getModel("tooltip",r);if(W(n.getAxes(),$(p,!1,null)),n.getTooltipAxes&&r&&u.get("show")){var c="axis"===u.get("trigger"),h="cross"===u.get(["axisPointer","type"]),d=n.getTooltipAxes(u.get(["axisPointer","axis"]));(c||h)&&W(d.baseAxes,$(p,!h||"cross",c)),h&&W(d.otherAxes,$(p,"cross",!1))}}function p(r,s,c){var h=c.model.getModel("axisPointer",i),d=h.get("show");if(d&&("auto"!==d||r||qM(h))){null==s&&(s=h.get("triggerTooltip")),h=r?function(e,t,n,r,i,o){var a=t.getModel("axisPointer"),s={};W(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=O(a.get(e))})),s.snap="category"!==e.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===i){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&V(l,c.textStyle)}}return e.model.getModel("axisPointer",new Fh(s,n,r))}(c,u,i,t,r,s):h;var p=h.get("snap"),f=h.get("triggerEmphasis"),g=KM(c.model),m=s||p||"category"===c.type,v=e.axesInfo[g]={key:g,axis:c,coordSys:n,axisPointerModel:h,triggerTooltip:s,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:qM(h),seriesModels:[],linkGroup:null};l[g]=v,e.seriesInvolved=e.seriesInvolved||m;var y=function(e,t){for(var n=t.model,r=t.dim,i=0;i<e.length;i++){var o=e[i]||{};if(YM(o[r+"AxisId"],n.id)||YM(o[r+"AxisIndex"],n.componentIndex)||YM(o[r+"AxisName"],n.name))return i}}(o,c);if(null!=y){var _=a[y]||(a[y]={axesInfo:{}});_.axesInfo[g]=v,_.mapper=o[y].mapper,v.linkGroup=_}}}}))}(n,e,t),n.seriesInvolved&&function(e,t){t.eachSeries((function(t){var n=t.coordinateSystem,r=t.get(["tooltip","trigger"],!0),i=t.get(["tooltip","show"],!0);n&&"none"!==r&&!1!==r&&"item"!==r&&!1!==i&&!1!==t.get(["axisPointer","show"],!0)&&W(e.coordSysAxesInfo[KM(n.model)],(function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}))}(n,e),n}function YM(e,t){return"all"===e||J(e)&&F(e,t)>=0||e===t}function ZM(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[KM(e)]}function qM(e){return!!e.get(["handle","show"])}function KM(e){return e.type+"||"+e.id}var $M={},JM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(t,n,r,i){this.axisPointerClass&&function(e){var t=ZM(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=qM(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),i.value=a,s&&(i.status=t.axis.scale.isBlank()?"hide":"show")}}(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},t.prototype.updateAxisPointer=function(e,t,n,r){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,r){var i=t.getAxisPointerClass(this.axisPointerClass);if(i){var o=function(e){var t=ZM(e);return t&&t.axisPointerModel}(e);o?(this._axisPointer||(this._axisPointer=new i)).render(e,o,n,r):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){if("production"!==process.env.NODE_ENV&&$M[e])throw new Error("axisPointer "+e+" exists");$M[e]=t},t.getAxisPointerClass=function(e){return e&&$M[e]},t.type="axis",t}(Xg),QM=$o();function eC(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:o,clamp:!0});if(u.length){var c=s.length,h=QM(e).splitAreaColors,d=Te(),p=0;if(h)for(var f=0;f<u.length;f++){var g=h.get(u[f].tickValue);if(null!=g){p=(g+(c-1)*f)%c;break}}var m=i.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=J(s)?s:[s];for(f=1;f<u.length;f++){var y=i.toGlobalCoord(u[f].coord),_=void 0,x=void 0,b=void 0,w=void 0;i.isHorizontal()?(_=m,x=l.y,b=y-_,w=l.height,m=_+b):(_=l.x,x=m,b=l.width,m=x+(w=y-x));var S=u[f-1].tickValue;null!=S&&d.set(S,p),t.add(new tl({anid:null!=S?"area_"+S:null,shape:{x:_,y:x,width:b,height:w},style:V({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}QM(e).splitAreaColors=d}}}function tC(e){QM(e).splitAreaColors=null}var nC=["axisLine","axisTickLabel","axisName"],rC=["splitArea","splitLine","minorSplitLine"],iC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return l(t,e),t.prototype.render=function(t,n,r,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Wi,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=EM(a,t),l=new FM(t,z({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),r=0;r<n.length;r++)if(X_(n[r].getOtherAxis(t.axis).scale))return!0;return!1}},s));W(nC,l.add,l),this._axisGroup.add(l.getGroup()),W(rC,(function(e){t.get([e,"show"])&&oC[e](this,this._axisGroup,t,a)}),this),i&&"changeAxisOrder"===i.type&&i.isInitSort||nh(o,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)}},t.prototype.remove=function(){tC(this)},t.type="cartesianAxis",t}(JM),oC={splitLine:function(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color"),l=!1!==o.get("showMinLine"),u=!1!==o.get("showMaxLine");s=J(s)?s:[s];for(var c=r.coordinateSystem.getRect(),h=i.isHorizontal(),d=0,p=i.getTicksCoords({tickModel:o}),f=[],g=[],m=a.getLineStyle(),v=0;v<p.length;v++){var y=i.toGlobalCoord(p[v].coord);if((0!==v||l)&&(v!==p.length-1||u)){var _=p[v].tickValue;h?(f[0]=y,f[1]=c.y,g[0]=y,g[1]=c.y+c.height):(f[0]=c.x,f[1]=y,g[0]=c.x+c.width,g[1]=y);var x=d++%s.length,b=new uc({anid:null!=_?"line_"+_:null,autoBatch:!0,shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},style:V({stroke:s[x]},m),silent:!0});Kc(b.shape,m.lineWidth),t.add(b)}}}},minorSplitLine:function(e,t,n,r){var i=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=r.coordinateSystem.getRect(),s=i.isHorizontal(),l=i.getMinorTicksCoords();if(l.length)for(var u=[],c=[],h=o.getLineStyle(),d=0;d<l.length;d++)for(var p=0;p<l[d].length;p++){var f=i.toGlobalCoord(l[d][p].coord);s?(u[0]=f,u[1]=a.y,c[0]=f,c[1]=a.y+a.height):(u[0]=a.x,u[1]=f,c[0]=a.x+a.width,c[1]=f);var g=new uc({anid:"minor_line_"+l[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:h,silent:!0});Kc(g.shape,h.lineWidth),t.add(g)}},splitArea:function(e,t,n,r){eC(e,t,n,r)}},aC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="xAxis",t}(iC),sC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=aC.type,t}return l(t,e),t.type="yAxis",t}(iC),lC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return l(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new tl({shape:e.coordinateSystem.getRect(),style:V({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(Xg),uC={offset:0};function cC(e){e.registerComponentView(lC),e.registerComponentModel(mM),e.registerCoordinateSystem("cartesian2d",RM),SM(e,"x",vM,uC),SM(e,"y",vM,uC),e.registerComponentView(aC),e.registerComponentView(sC),e.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})}))}function hC(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),n=[],r=e.coordinateSystem;if(r){var i=r.getIndicatorAxes();W(i,(function(e,o){t.each(t.mapDimension(i[o].dim),(function(e,t){n[t]=n[t]||[];var i=r.dataToPoint(e,o);n[t][o]=dC(i)?i:pC(r)}))})),t.each((function(e){var i=Z(n[e],(function(e){return dC(e)}))||pC(r);n[e].push(i.slice()),t.setItemLayout(e,n[e])}))}}))}function dC(e){return!isNaN(e[0])&&!isNaN(e[1])}function pC(e){return[e.cx,e.cy]}function fC(e){var t=e.polar;if(t){J(t)||(t=[t]);var n=[];W(t,(function(t,r){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],J(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):n.push(t)})),e.polar=n}W(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))}var gC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,o=e.getData(),a=this._data;function s(e,t){var n=e.getItemVisual(t,"symbol")||"circle";if("none"!==n){var r=uv(e.getItemVisual(t,"symbolSize")),i=lv(n,-1,-1,2,2),o=e.getItemVisual(t,"symbolRotate")||0;return i.attr({style:{strokeNoScale:!0},z2:100,scaleX:r[0]/2,scaleY:r[1]/2,rotation:o*Math.PI/180||0}),i}}function l(t,n,r,i,o,a){r.removeAll();for(var l=0;l<n.length-1;l++){var u=s(i,o);u&&(u.__dimIdx=l,t[l]?(u.setPosition(t[l]),dh[a?"initProps":"updateProps"](u,{x:n[l][0],y:n[l][1]},e,o)):u.setPosition(n[l]),r.add(u))}}function u(e){return j(e,(function(e){return[r.cx,r.cy]}))}o.diff(a).add((function(t){var n=o.getItemLayout(t);if(n){var r=new ic,i=new ac,a={shape:{points:n}};r.shape.points=u(n),i.shape.points=u(n),Lc(r,a,e,t),Lc(i,a,e,t);var s=new Wi,c=new Wi;s.add(i),s.add(r),s.add(c),l(i.shape.points,n,c,o,t,!0),o.setItemGraphicEl(t,s)}})).update((function(t,n){var r=a.getItemGraphicEl(n),i=r.childAt(0),s=r.childAt(1),u=r.childAt(2),c={shape:{points:o.getItemLayout(t)}};c.shape.points&&(l(i.shape.points,c.shape.points,u,o,t,!1),kc(s),kc(i),Ec(i,c,e),Ec(s,c,e),o.setItemGraphicEl(t,r))})).remove((function(e){i.remove(a.getItemGraphicEl(e))})).execute(),o.eachItemGraphicEl((function(e,t){var n=o.getItemModel(t),r=e.childAt(0),a=e.childAt(1),s=e.childAt(2),l=o.getItemVisual(t,"style"),u=l.fill;i.add(e),r.useStyle(V(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:u})),cu(r,n,"lineStyle"),cu(a,n,"areaStyle");var c=n.getModel("areaStyle"),h=c.isEmpty()&&c.parentModel.isEmpty();a.ignore=h,W(["emphasis","select","blur"],(function(e){var t=n.getModel([e,"areaStyle"]),r=t.isEmpty()&&t.parentModel.isEmpty();a.ensureState(e).ignore=r&&h})),a.useStyle(V(c.getAreaStyle(),{fill:u,opacity:.7,decal:l.decal}));var d=n.getModel("emphasis"),p=d.getModel("itemStyle").getItemStyle();s.eachChild((function(e){if(e instanceof Zs){var r=e.style;e.useStyle(z({image:r.image,x:r.x,y:r.y,width:r.width,height:r.height},l))}else e.useStyle(l),e.setColor(u),e.style.strokeNoScale=!0;e.ensureState("emphasis").style=O(p);var i=o.getStore().get(o.getDimensionIndex(e.__dimIdx),t);(null==i||isNaN(i))&&(i=""),mh(e,vh(n),{labelFetcher:o.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,inheritColor:u,defaultOpacity:l.opacity})})),au(e,d.get("focus"),d.get("blurScope"),d.get("disabled"))})),this._data=o},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type="radar",t}(Kg),mC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new lM(K(this.getData,this),K(this.getRawData,this))},t.prototype.getInitialData=function(e,t){return sM(this,{generateCoord:"indicator_",generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(e),a=""===o?this.name:o,s=Lg(this,e);return wg("section",{header:a,sortBlocks:!0,blocks:j(i,(function(t){var n=r.get(r.mapDimension(t.dim),e);return wg("nameValue",{markerType:"subItem",markerColor:s,name:t.name,value:n,sortParam:n})}))})},t.prototype.getTooltipPosition=function(e){if(null!=e)for(var t=this.getData(),n=this.coordinateSystem,r=t.getValues(j(n.dimensions,(function(e){return t.mapDimension(e)})),e),i=0,o=r.length;i<o;i++)if(!isNaN(r[i])){var a=n.getIndicatorAxes();return n.coordToPoint(a[i].dataToCoord(r[i]),i)}},t.type="series.radar",t.dependencies=["radar"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},t}(Vg),vC=bM.value;function yC(e,t){return V({show:t},e)}var _C=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),n=this.get("scale"),r=this.get("axisLine"),i=this.get("axisTick"),o=this.get("axisLabel"),a=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),u=this.get("axisNameGap"),c=this.get("triggerEvent"),h=j(this.get("indicator")||[],(function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var d=a;null!=h.color&&(d=V({color:h.color},a));var p=R(O(h),{boundaryGap:e,splitNumber:t,scale:n,axisLine:r,axisTick:i,axisLabel:o,name:h.text,showName:s,nameLocation:"end",nameGap:u,nameTextStyle:d,triggerEvent:c},!1);if(ee(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else Q(l)&&(p.name=l(p.name,p));var g=new Fh(p,null,this.ecModel);return H(g,qx.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=h},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:R({lineStyle:{color:"#bbb"}},vC.axisLine),axisLabel:yC(vC.axisLabel,!1),axisTick:yC(vC.axisTick,!1),splitLine:yC(vC.splitLine,!0),splitArea:yC(vC.splitArea,!0),indicator:[]},t}($d),xC=["axisLine","axisTickLabel","axisName"],bC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;W(j(t.getIndicatorAxes(),(function(e){var n=e.model.get("showName")?e.name:"";return new FM(e.model,{axisName:n,position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){W(xC,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var r=e.get("shape"),i=e.getModel("splitLine"),o=e.getModel("splitArea"),a=i.getModel("lineStyle"),s=o.getModel("areaStyle"),l=i.get("show"),u=o.get("show"),c=a.get("color"),h=s.get("color"),d=J(c)?c:[c],p=J(h)?h:[h],f=[],g=[];if("circle"===r)for(var m=n[0].getTicksCoords(),v=t.cx,y=t.cy,_=0;_<m.length;_++){if(l)f[D(f,d,_)].push(new ku({shape:{cx:v,cy:y,r:m[_].coord}}));if(u&&_<m.length-1)g[D(g,p,_)].push(new tc({shape:{cx:v,cy:y,r0:m[_].coord,r:m[_+1].coord}}))}else{var x,b=j(n,(function(e,n){var r=e.getTicksCoords();return x=null==x?r.length-1:Math.min(r.length-1,x),j(r,(function(e){return t.coordToPoint(e.coord,n)}))})),w=[];for(_=0;_<=x;_++){for(var S=[],T=0;T<n.length;T++)S.push(b[T][_]);if(S[0]?S.push(S[0].slice()):"production"!==process.env.NODE_ENV&&console.error("Can't draw value axis "+_),l)f[D(f,d,_)].push(new ac({shape:{points:S}}));if(u&&w)g[D(g,p,_-1)].push(new ic({shape:{points:S.concat(w)}}));w=S.slice().reverse()}}var M=a.getLineStyle(),C=s.getAreaStyle();W(g,(function(e,t){this.group.add(Zc(e,{style:V({stroke:"none",fill:p[t%p.length]},C),silent:!0}))}),this),W(f,(function(e,t){this.group.add(Zc(e,{style:V({fill:"none",stroke:d[t%d.length]},M),silent:!0}))}),this)}function D(e,t,n){var r=n%t.length;return e[r]=e[r]||[],r}},t.type="radar",t}(Xg),wC=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="value",i.angle=0,i.name="",i}return l(t,e),t}(Eb),SC=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=j(e.getIndicatorModels(),(function(e,t){var n="indicator_"+t,r=new wC(n,new nx);return r.name=e.get("name"),r.model=e,e.axis=r,this.dimensions.push(n),r}),this),this.resize(e,n)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(e,t){var n=this._indicatorAxes[t];return this.coordToPoint(n.dataToCoord(e),t)},e.prototype.coordToPoint=function(e,t){var n=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(n),this.cy-e*Math.sin(n)]},e.prototype.pointToData=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=Math.sqrt(t*t+n*n);t/=r,n/=r;for(var i,o=Math.atan2(-n,t),a=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(o-u.angle);c<a&&(i=u,s=l,a=c)}return[s,+(i&&i.coordToData(r))]},e.prototype.resize=function(e,t){var n=e.get("center"),r=t.getWidth(),i=t.getHeight(),o=Math.min(r,i)/2;this.cx=to(n[0],r),this.cy=to(n[1],i),this.startAngle=e.get("startAngle")*Math.PI/180;var a=e.get("radius");(ee(a)||ne(a))&&(a=[0,a]),this.r0=to(a[0],o),this.r=to(a[1],o),W(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var n=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),e.angle=n}),this)},e.prototype.update=function(e,t){var n=this._indicatorAxes,r=this._model;W(n,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,i){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===r){var o=t.getData();W(n,(function(e){e.scale.unionExtentFromData(o,o.mapDimension(e.dim))}))}}),this);var i=r.get("splitNumber"),o=new nx;o.setExtent(0,i),o.setInterval(1),W(n,(function(e,t){OM(e.scale,e.model,o)}))},e.prototype.convertToPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.convertFromPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.create=function(t,n){var r=[];return t.eachComponent("radar",(function(i){var o=new e(i,t,n);r.push(o),i.coordinateSystem=o})),t.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=r[e.get("radarIndex")||0])})),r},e.dimensions=[],e}();function TC(e){e.registerCoordinateSystem("radar",SC),e.registerComponentModel(_C),e.registerComponentView(bC),e.registerVisual({seriesType:"radar",reset:function(e){var t=e.getData();t.each((function(e){t.setItemVisual(e,"legendIcon","roundRect")})),t.setVisual("legendIcon","roundRect")}})}var MC="\0_ec_interaction_mutex";function CC(e,t){return!!DC(e)[t]}function DC(e){return e[MC]||(e[MC]={})}jy({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Ie);var AC=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var r=K(n._mousedownHandler,n),i=K(n._mousemoveHandler,n),o=K(n._mouseupHandler,n),a=K(n._mousewheelHandler,n),s=K(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=V(O(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(t.on("mousedown",r),t.on("mousemove",i),t.on("mouseup",o)),!0!==e&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",a),t.on("pinch",s))},n.disable=function(){t.off("mousedown",r),t.off("mousemove",i),t.off("mouseup",o),t.off("mousewheel",a),t.off("pinch",s)},n}return l(t,e),t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype.setPointerChecker=function(e){this.pointerChecker=e},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!wt(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(this._dragging&&LC("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!CC(this._zr,"globalPan")){var t=e.offsetX,n=e.offsetY,r=this._x,i=this._y,o=t-r,a=n-i;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&bt(e.event),EC(this,"pan","moveOnMouseMove",e,{dx:o,dy:a,oldX:r,oldY:i,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){wt(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=LC("zoomOnMouseWheel",e,this._opt),n=LC("moveOnMouseWheel",e,this._opt),r=e.wheelDelta,i=Math.abs(r),o=e.offsetX,a=e.offsetY;if(0!==r&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1;IC(this,"zoom","zoomOnMouseWheel",e,{scale:r>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(r);IC(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(r>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){CC(this._zr,"globalPan")||IC(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(nt);function IC(e,t,n,r,i){e.pointerChecker&&e.pointerChecker(r,i.originX,i.originY)&&(bt(r.event),EC(e,t,n,r,i))}function EC(e,t,n,r,i){i.isAvailableBehavior=K(LC,null,n,r),e.trigger(t,i)}function LC(e,t,n){var r=n[e];return!e||r&&(!ee(r)||t.event[r+"Key"])}function NC(e,t,n){var r=e.target;r.x+=t,r.y+=n,r.dirty()}function PC(e,t,n,r){var i=e.target,o=e.zoomLimit,a=e.zoom=e.zoom||1;if(a*=t,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/e.zoom;e.zoom=a,i.x-=(n-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var OC,RC={axisPointer:1,tooltip:1,brush:1};function kC(e,t,n){var r=t.getComponentByElement(e.topTarget),i=r&&r.coordinateSystem;return r&&r!==n&&!RC.hasOwnProperty(r.mainType)&&i&&i.model!==n}function zC(e){ee(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var VC={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},BC=q(VC),FC={"alignment-baseline":"textBaseline","stop-color":"stopColor"},GC=q(FC),HC=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t=t||{};var n=zC(e);if("production"!==process.env.NODE_ENV&&!n)throw new Error("Illegal svg");this._defsUsePending=[];var r=new Wi;this._root=r;var i=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||t.width),s=parseFloat(n.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),ZC(n,r,null,!0,!1);for(var l,u,c=n.firstChild;c;)this._parseNode(c,r,i,null,!1,!1),c=c.nextSibling;if(function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r[0].style[r[1]]=e[r[2]]}}(this._defs,this._defsUsePending),this._defsUsePending=[],o){var h=JC(o);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=s&&(u=rD(l,{x:0,y:0,width:a,height:s}),!t.ignoreViewBox)){var d=r;(r=new Wi).add(d),d.scaleX=d.scaleY=u.scale,d.x=u.x,d.y=u.y}return t.ignoreRootClip||null==a||null==s||r.setClipPath(new tl({shape:{x:0,y:0,width:a,height:s}})),{root:r,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},e.prototype._parseNode=function(e,t,n,r,i,o){var a,s=e.nodeName.toLowerCase(),l=r;if("defs"===s&&(i=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=t;else{if(!i){var u=OC[s];if(u&&Ae(OC,s)){a=u.call(this,e,t);var c=e.getAttribute("name");if(c){var h={name:c,namedFrom:null,svgNodeTagLower:s,el:a};n.push(h),"g"===s&&(l=h)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:s,el:a});t.add(a)}}var d=UC[s];if(d&&Ae(UC,s)){var p=d.call(this,e),f=e.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup)for(var g=e.firstChild;g;)1===g.nodeType?this._parseNode(g,a,n,l,i,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling},e.prototype._parseText=function(e,t){var n=new js({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),function(e,t){var n=t.__selfStyle;if(n){var r=n.textBaseline,i=r;r&&"auto"!==r?"baseline"===r?i="alphabetic":"before-edge"===r||"text-before-edge"===r?i="top":"after-edge"===r||"text-after-edge"===r?i="bottom":"central"!==r&&"mathematical"!==r||(i="middle"):i="alphabetic",e.style.textBaseline=i}var o=t.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),e.style.textAlign=s)}}(n,t);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9);var o=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+"px",r.fontFamily||"sans-serif"].join(" ");r.font=o;var a=n.getBoundingRect();return this._textX+=a.width,t.add(n),n},e.internalField=void(OC={g:function(e,t){var n=new Wi;return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new tl;return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new ku;return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new uc;return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new Vu;return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n,r=e.getAttribute("points");r&&(n=YC(r));var i=new ic({shape:{points:n||[]},silent:!0});return XC(t,i),ZC(e,i,this._defsUsePending,!1,!1),i},polyline:function(e,t){var n,r=e.getAttribute("points");r&&(n=YC(r));var i=new ac({shape:{points:n||[]},silent:!0});return XC(t,i),ZC(e,i,this._defsUsePending,!1,!1),i},image:function(e,t){var n=new Zs;return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",r=e.getAttribute("y")||"0",i=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(o);var a=new Wi;return XC(t,a),ZC(e,a,this._defsUsePending,!1,!0),a},tspan:function(e,t){var n=e.getAttribute("x"),r=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var i=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",a=new Wi;return XC(t,a),ZC(e,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(o),a},path:function(e,t){var n=Pu(e.getAttribute("d")||"");return XC(t,n),ZC(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),e}(),UC={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),r=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),o=new yc(t,n,r,i);return WC(e,o),jC(e,o),o},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),n=parseInt(e.getAttribute("cy")||"0",10),r=parseInt(e.getAttribute("r")||"0",10),i=new _c(t,n,r);return WC(e,i),jC(e,i),i}};function WC(e,t){"userSpaceOnUse"===e.getAttribute("gradientUnits")&&(t.global=!0)}function jC(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var r=n.getAttribute("offset"),i=void 0;i=r&&r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var o={};nD(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:i,color:a})}n=n.nextSibling}}function XC(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),V(t.__inheritedStyle,e.__inheritedStyle))}function YC(e){for(var t=JC(e),n=[],r=0;r<t.length;r+=2){var i=parseFloat(t[r]),o=parseFloat(t[r+1]);n.push([i,o])}return n}function ZC(e,t,n,r,i){var o=t,a=o.__inheritedStyle=o.__inheritedStyle||{},s={};1===e.nodeType&&(function(e,t){var n=e.getAttribute("transform");if(n){n=n.replace(/,/g," ");var r=[],i=null;n.replace(QC,(function(e,t,n){return r.push(t,n),""}));for(var o=r.length-1;o>0;o-=2){var a=r[o],s=r[o-1],l=JC(a);switch(i=i||[1,0,0,1,0,0],s){case"translate":Et(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Nt(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Lt(i,i,-parseFloat(l[0])*eD,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":It(i,[1,0,Math.tan(parseFloat(l[0])*eD),1,0,0],i);break;case"skewY":It(i,[1,Math.tan(parseFloat(l[0])*eD),0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5])}}t.setLocalTransform(i)}}(e,t),nD(e,a,s),r||function(e,t,n){for(var r=0;r<BC.length;r++){var i=BC[r];null!=(o=e.getAttribute(i))&&(t[VC[i]]=o)}for(r=0;r<GC.length;r++){var o;i=GC[r];null!=(o=e.getAttribute(i))&&(n[FC[i]]=o)}}(e,a,s)),o.style=o.style||{},null!=a.fill&&(o.style.fill=KC(o,"fill",a.fill,n)),null!=a.stroke&&(o.style.stroke=KC(o,"stroke",a.stroke,n)),W(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){null!=a[e]&&(o.style[e]=parseFloat(a[e]))})),W(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],(function(e){null!=a[e]&&(o.style[e]=a[e])})),i&&(o.__selfStyle=s),a.lineDash&&(o.style.lineDash=j(JC(a.lineDash),(function(e){return parseFloat(e)}))),"hidden"!==a.visibility&&"collapse"!==a.visibility||(o.invisible=!0),"none"===a.display&&(o.ignore=!0)}var qC=/^url\(\s*#(.*?)\)/;function KC(e,t,n,r){var i=n&&n.match(qC);if(!i)return"none"===n&&(n=null),n;var o=ve(i[1]);r.push([e,t,o])}var $C=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function JC(e){return e.match($C)||[]}var QC=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,eD=Math.PI/180;var tD=/([^\s:;]+)\s*:\s*([^:;]+)/g;function nD(e,t,n){var r,i=e.getAttribute("style");if(i)for(tD.lastIndex=0;null!=(r=tD.exec(i));){var o=r[1],a=Ae(VC,o)?VC[o]:null;a&&(t[a]=r[2]);var s=Ae(FC,o)?FC[o]:null;s&&(n[s]=r[2])}}function rD(e,t){var n=t.width/e.width,r=t.height/e.height,i=Math.min(n,r);return{scale:i,x:-(e.x+e.width/2)*i+(t.x+t.width/2),y:-(e.y+e.height/2)*i+(t.y+t.height/2)}}var iD=Te(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),oD=function(){function e(e,t){this.type="geoSVG",this._usedGraphicMap=Te(),this._freedGraphics=[],this._mapName=e,this._parsedXML=zC(t)}return e.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=function(e){var t=[],n=Te();return W(e,(function(e){if(null==e.namedFrom){var r=new cb(e.name,e.el);t.push(r),n.set(e.name,r)}})),{regions:t,regionsMap:n}}(e.named),n=t.regions,r=t.regionsMap;this._regions=n,this._regionsMap=r}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},e.prototype._buildGraphic=function(e){var t,n,r,i;try{me(null!=(n=(t=e&&(r=e,i={ignoreViewBox:!0,ignoreRootClip:!0},(new HC).parse(r,i))||{}).root))}catch(e){throw new Error("Invalid svg format\n"+e.message)}var o=new Wi;o.add(n),o.isGeoSVGGraphicRoot=!0;var a=t.width,s=t.height,l=t.viewBoxRect,u=this._boundingRect;if(!u){var c=void 0,h=void 0,d=void 0,p=void 0;if(null!=a?(c=0,d=a):l&&(c=l.x,d=l.width),null!=s?(h=0,p=s):l&&(h=l.y,p=l.height),null==c||null==h){var f=n.getBoundingRect();null==c&&(c=f.x,d=f.width),null==h&&(h=f.y,p=f.height)}u=this._boundingRect=new jt(c,h,d,p)}if(l){var g=rD(l,u);n.scaleX=n.scaleY=g.scale,n.x=g.x,n.y=g.y}o.setClipPath(new tl({shape:u.plain()}));var m=[];return W(t.named,(function(e){var t;null!=iD.get(e.svgNodeTagLower)&&(m.push(e),(t=e.el).silent=!1,t.isGroup&&t.traverse((function(e){e.silent=!1})))})),{root:o,boundingRect:u,named:m}},e.prototype.useGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,n),n)},e.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);n&&(t.removeKey(e),this._freedGraphics.push(n))},e}();for(var aD=[126,25],sD="南海诸岛",lD=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],uD=0;uD<lD.length;uD++)for(var cD=0;cD<lD[uD].length;cD++)lD[uD][cD][0]/=10.5,lD[uD][cD][1]/=-14,lD[uD][cD][0]+=aD[0],lD[uD][cD][1]+=aD[1];var hD={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};function dD(e,t){if("china"===e){var n=hD[t.name];if(n){var r=t.getCenter();r[0]+=n[0]/10.5,r[1]+=-n[1]/14,t.setCenter(r)}}}var pD=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var fD=function(){function e(e,t,n){var r;this.type="geoJSON",this._parsedMap=Te(),this._mapName=e,this._specialAreas=n,this._geoJSON=ee(r=t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}return e.prototype.load=function(e,t){t=t||"name";var n=this._parsedMap.get(t);if(!n){var r=this._parseToRegions(t);n=this._parsedMap.set(t,{regions:r,boundingRect:gD(r)})}var i=Te(),o=[];return W(n.regions,(function(t){var n=t.name;e&&Ae(e,n)&&(t=t.cloneShallow(n=e[n])),o.push(t),i.set(n,t)})),{regions:o,boundingRect:n.boundingRect||new jt(0,0,0,0),regionsMap:i}},e.prototype._parseToRegions=function(e){var t,n=this._mapName,r=this._geoJSON;try{t=r?pb(r,e):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return function(e,t){if("china"===e){for(var n=0;n<t.length;n++)if(t[n].name===sD)return;t.push(new ub(sD,j(lD,(function(e){return{type:"polygon",exterior:e}})),aD))}}(n,t),W(t,(function(e){var t=e.name;dD(n,e),function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:pD[0]})}(n,e);var r=this._specialAreas&&this._specialAreas[t];r&&e.transformTo(r.left,r.top,r.width,r.height)}),this),t},e.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},e}();function gD(e){for(var t,n=0;n<e.length;n++){var r=e[n].getBoundingRect();(t=t||r.clone()).union(r)}return t}var mD=Te(),vD=function(e,t,n){if(t.svg){var r=new oD(e,t.svg);mD.set(e,r)}else{var i=t.geoJson||t.geoJSON;i&&!t.features?n=t.specialAreas:i=t;r=new fD(e,i,n);mD.set(e,r)}},yD=function(e){return mD.get(e)},_D=function(e){var t=mD.get(e);return t&&"geoJSON"===t.type&&t.getMapForUser()},xD=function(e,t,n){var r=mD.get(e);if(r)return r.load(t,n);"production"!==process.env.NODE_ENV&&console.error("Map "+e+" not exists. The GeoJSON of the map must be provided.")},bD=["rect","circle","line","ellipse","polygon","polyline","path"],wD=Te(bD),SD=Te(bD.concat(["g"])),TD=Te(bD.concat(["g"])),MD=$o();function CD(e){var t=e.getItemStyle(),n=e.get("areaColor");return null!=n&&(t.fill=n),t}function DD(e){var t=e.style;t&&(t.stroke=t.stroke||t.fill,t.fill=null)}var AD=function(){function e(e){var t=new Wi;this.uid=Hh("ec_map_draw"),this._controller=new AC(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Wi),t.add(this._svgGroup=new Wi)}return e.prototype.draw=function(e,t,n,r,i){var o="geo"===e.mainType,a=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},(function(t){a||t.getHostGeoModel()!==e||(a=t.getData())}));var s=e.coordinateSystem,l=this._regionsGroup,u=this.group,c=s.getTransformInfo(),h=c.raw,d=c.roam;!l.childAt(0)||i?(u.x=d.x,u.y=d.y,u.scaleX=d.scaleX,u.scaleY=d.scaleY,u.dirty()):Ec(u,d,e);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,f={api:n,geo:s,mapOrGeoModel:e,data:a,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:h};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(e,t,n),this._updateMapSelectHandler(e,l,n,r)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=Te(),n=Te(),r=this._regionsGroup,i=e.transformInfoRaw,o=e.mapOrGeoModel,a=e.data,s=e.geo.projection,l=s&&s.stream;function u(e,t){return t&&(e=t(e)),e&&[e[0]*i.scaleX+i.x,e[1]*i.scaleY+i.y]}function c(e){for(var t=[],n=!l&&s&&s.project,r=0;r<e.length;++r){var i=u(e[r],n);i&&t.push(i)}return t}function h(e){return{shape:{points:c(e)}}}r.removeAll(),W(e.geo.regions,(function(i){var c=i.name,d=t.get(c),p=n.get(c)||{},f=p.dataIdx,g=p.regionModel;if(!d){d=t.set(c,new Wi),r.add(d),f=a?a.indexOfName(c):null;var m=(g=e.isGeo?o.getRegionModel(c):a?a.getItemModel(f):null).get("silent",!0);null!=m&&(d.silent=m),n.set(c,{dataIdx:f,regionModel:g})}var v=[],y=[];W(i.geometries,(function(e){if("polygon"===e.type){var t=[e.exterior].concat(e.interiors||[]);l&&(t=OD(t,l)),W(t,(function(e){v.push(new ic(h(e)))}))}else{var n=e.points;l&&(n=OD(n,l,!0)),W(n,(function(e){y.push(new ac(h(e)))}))}}));var _=u(i.getCenter(),s&&s.project);function x(t,n){if(t.length){var r=new mc({culling:!0,segmentIgnoreThreshold:1,shape:{paths:t}});d.add(r),ID(e,r,f,g),ED(e,r,c,g,o,f,_),n&&(DD(r),W(r.states,DD))}}x(v),x(y,!0)})),t.each((function(t,r){var i=n.get(r),a=i.dataIdx,s=i.regionModel;LD(e,t,r,s,o,a),ND(e,t,r,s,o),PD(e,t,r,s,o)}),this)},e.prototype._buildSVG=function(e){var t=e.geo.map,n=e.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var r=this._svgDispatcherMap=Te(),i=!1;W(this._svgGraphicRecord.named,(function(t){var n=t.name,o=e.mapOrGeoModel,a=e.data,s=t.svgNodeTagLower,l=t.el,u=a?a.indexOfName(n):null,c=o.getRegionModel(n);null!=wD.get(s)&&l instanceof Ga&&ID(e,l,u,c),l instanceof Ga&&(l.culling=!0);var h=c.get("silent",!0);(null!=h&&(l.silent=h),l.z2EmphasisLift=0,t.namedFrom)||(null!=TD.get(s)&&ED(e,l,n,c,o,u,null),LD(e,l,n,c,o,u),ND(e,l,n,c,o),null!=SD.get(s)&&("self"===PD(e,l,n,c,o)&&(i=!0),(r.get(n)||r.set(n,[])).push(l)))}),this),this._enableBlurEntireSVG(i,e)},e.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var n=t.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse((function(e){if(!e.isGroup){Ul(e);var t=e.ensureState("blur").style||{};null==t.opacity&&null!=n&&(t.opacity=n),e.ensureState("emphasis")}}))}},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},e.prototype.findHighDownDispatchers=function(e,t){if(null==e)return[];var n=t.coordinateSystem;if("geoJSON"===n.resourceType){var r=this._regionsGroupByName;if(r){var i=r.get(e);return i?[i]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},e.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},e.prototype._useSVG=function(e){var t=yD(e);if(t&&"geoSVG"===t.type){var n=t.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=e}},e.prototype._freeSVG=function(){var e=this._svgMapName;if(null!=e){var t=yD(e);t&&"geoSVG"===t.type&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},e.prototype._updateController=function(e,t,n){var r=e.coordinateSystem,i=this._controller,o=this._controllerHost;o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.enable(e.get("roam")||!1);var a=e.mainType;function s(){var t={type:"geoRoam",componentType:a};return t[a+"Id"]=e.id,t}i.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,NC(o,e.dx,e.dy),n.dispatchAction(z(s(),{dx:e.dx,dy:e.dy,animation:{duration:0}}))}),this),i.off("zoom").on("zoom",(function(e){this._mouseDownFlag=!1,PC(o,e.scale,e.originX,e.originY),n.dispatchAction(z(s(),{totalZoom:o.zoom,zoom:e.scale,originX:e.originX,originY:e.originY,animation:{duration:0}}))}),this),i.setPointerChecker((function(t,i,o){return r.containPoint([i,o])&&!kC(t,n,e)}))},e.prototype.resetForLabelLayout=function(){this.group.traverse((function(e){var t=e.getTextContent();t&&(t.ignore=MD(t).ignore)}))},e.prototype._updateMapSelectHandler=function(e,t,n,r){var i=this;t.off("mousedown"),t.off("click"),e.get("selectedMode")&&(t.on("mousedown",(function(){i._mouseDownFlag=!0})),t.on("click",(function(e){i._mouseDownFlag&&(i._mouseDownFlag=!1)})))},e}();function ID(e,t,n,r){var i=r.getModel("itemStyle"),o=r.getModel(["emphasis","itemStyle"]),a=r.getModel(["blur","itemStyle"]),s=r.getModel(["select","itemStyle"]),l=CD(i),u=CD(o),c=CD(s),h=CD(a),d=e.data;if(d){var p=d.getItemVisual(n,"style"),f=d.getItemVisual(n,"decal");e.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),f&&(l.decal=Rv(f,e.api))}t.setStyle(l),t.style.strokeNoScale=!0,t.ensureState("emphasis").style=u,t.ensureState("select").style=c,t.ensureState("blur").style=h,Ul(t)}function ED(e,t,n,r,i,o,a){var s=e.data,l=e.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),o)),c=s&&s.getItemLayout(o);if(l||u||c&&c.showLabel){var h=l?n:o,d=void 0;(!s||o>=0)&&(d=i);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;mh(t,vh(r),{labelFetcher:d,labelDataIndex:h,defaultText:n},p);var f=t.getTextContent();if(f&&(MD(f).ignore=f.ignore,t.textConfig&&a)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function LD(e,t,n,r,i,o){e.data?e.data.setItemGraphicEl(o,t):vl(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:n,region:r&&r.option||{}}}function ND(e,t,n,r,i){e.data||uh({el:t,componentModel:i,itemName:n,itemTooltipOption:r.get("tooltip")})}function PD(e,t,n,r,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var o=r.getModel("emphasis"),a=o.get("focus");return au(t,a,o.get("blurScope"),o.get("disabled")),e.isGeo&&function(e,t,n){var r=vl(e);r.componentMainType=t.mainType,r.componentIndex=t.componentIndex,r.componentHighDownName=n}(t,i,n),a}function OD(e,t,n){var r,i=[];function o(){r=[]}function a(){r.length&&(i.push(r),r=[])}var s=t({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(e,t){isFinite(e)&&isFinite(t)&&r.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),W(e,(function(e){s.lineStart();for(var t=0;t<e.length;t++)s.point(e[t][0],e[t][1]);s.lineEnd()})),!n&&s.polygonEnd(),i}var RD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){if(!r||"mapToggleSelect"!==r.type||r.from!==this.uid){var i=this.group;if(i.removeAll(),!e.getHostGeoModel()){if(this._mapDraw&&r&&"geoRoam"===r.type&&this._mapDraw.resetForLabelLayout(),r&&"geoRoam"===r.type&&"series"===r.componentType&&r.seriesId===e.id)(o=this._mapDraw)&&i.add(o.group);else if(e.needsDrawMap){var o=this._mapDraw||new AD(n);i.add(o.group),o.draw(e,t,n,this,r),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,n)}}},t.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(e,t,n){var r=e.originalData,i=this.group;r.each(r.mapDimension("value"),(function(t,n){if(!isNaN(t)){var o=r.getItemLayout(n);if(o&&o.point){var a=o.point,s=o.offset,l=new ku({style:{fill:e.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:11)});if(!s){var u=e.mainSeries.getData(),c=r.getName(n),h=u.indexOfName(c),d=r.getItemModel(n),p=d.getModel("label"),f=u.getItemGraphicEl(h);mh(l,vh(d),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(h,n)}},defaultText:c}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(e){Gl(l,e)}}i.add(l)}}}))},t.type="map",t}(Kg),kD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(e){if(null!=e){var t=this.getData().getName(e),n=this.coordinateSystem,r=n.getRegion(t);return r&&n.dataToPoint(r.getCenter())}},n}return l(t,e),t.prototype.getInitialData=function(e){for(var t=sM(this,{coordDimensions:["value"],encodeDefaulter:$(gp,this)}),n=Te(),r=[],i=0,o=t.count();i<o;i++){var a=t.getName(i);n.set(a,i)}return W(xD(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,(function(e){var i,o=e.name,a=n.get(o),s=e.properties&&e.properties.echartsStyle;null==a?(i={name:o},r.push(i)):i=t.getRawDataItem(a),s&&R(i,s)})),t.appendData(r),t},t.prototype.getHostGeoModel=function(){var e=this.option.geoIndex;return null!=e?this.ecModel.getComponent("geo",e):null},t.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},t.prototype.getRawValue=function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},t.prototype.getRegionModel=function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData(),i=this.getRawValue(e),o=r.getName(e),a=this.seriesGroup,s=[],l=0;l<a.length;l++){var u=a[l].originalData.indexOfName(o),c=r.mapDimension("value");isNaN(a[l].originalData.get(c,u))||s.push(a[l].name)}return wg("section",{header:s.join(", "),noHeader:!s.length,blocks:[wg("nameValue",{name:o,value:i})]})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.getLegendIcon=function(e){var t=e.icon||"roundRect",n=lv(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill);return n.setStyle(e.itemStyle),n.style.stroke="none",t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},t}(Vg);function zD(e){var t={};e.eachSeriesByType("map",(function(e){var n=e.getHostGeoModel(),r=n?"o"+n.id:"i"+e.getMapType();(t[r]=t[r]||[]).push(e)})),W(t,(function(e,t){for(var n,r,i,o=(n=j(e,(function(e){return e.getData()})),r=e[0].get("mapValueCalculation"),i={},W(n,(function(e){e.each(e.mapDimension("value"),(function(t,n){var r="ec-"+e.getName(n);i[r]=i[r]||[],isNaN(t)||i[r].push(t)}))})),n[0].map(n[0].mapDimension("value"),(function(e,t){for(var o="ec-"+n[0].getName(t),a=0,s=1/0,l=-1/0,u=i[o].length,c=0;c<u;c++)s=Math.min(s,i[o][c]),l=Math.max(l,i[o][c]),a+=i[o][c];return 0===u?NaN:"min"===r?s:"max"===r?l:"average"===r?a/u:a}))),a=0;a<e.length;a++)e[a].originalData=e[a].getData();for(a=0;a<e.length;a++)e[a].seriesGroup=e,e[a].needsDrawMap=0===a&&!e[a].getHostGeoModel(),e[a].setData(o.cloneShallow()),e[a].mainSeries=e[0]}))}function VD(e){var t={};e.eachSeriesByType("map",(function(n){var r=n.getMapType();if(!n.getHostGeoModel()&&!t[r]){var i={};W(n.seriesGroup,(function(t){var n=t.coordinateSystem,r=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&r.each(r.mapDimension("value"),(function(e,t){var o=r.getName(t),a=n.getRegion(o);if(a&&!isNaN(e)){var s=i[o]||0,l=n.dataToPoint(a.getCenter());i[o]=s+1,r.setItemLayout(t,{point:l,offset:s})}}))}));var o=n.getData();o.each((function(e){var t=o.getName(e),n=o.getItemLayout(e)||{};n.showLabel=!i[t],o.setItemLayout(e,n)})),t[r]=!0}}))}var BD=Ke,FD=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new wi,n._rawTransformable=new wi,n.name=t,n}return l(t,e),t.prototype.setBoundingRect=function(e,t,n,r){return this._rect=new jt(e,t,n,r),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,r){this._transformTo(e,t,n,r),this._viewRect=new jt(e,t,n,r)},t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=this._rawTransformable;o.transform=i.calculateTransform(new jt(e,t,n,r));var a=o.parent;o.parent=null,o.decomposeTransform(),o.parent=a,this._updateTransform()},t.prototype.setCenter=function(e,t){e&&(this._center=[to(e[0],t.getWidth()),to(e[1],t.getHeight())],this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),r=this.getCenter(),i=this.getZoom();r=Ke([],r,e),n=Ke([],n,e),t.originX=r[0],t.originY=r[1],t.x=n[0]-r[0],t.y=n[1]-r[1],t.scaleX=t.scaleY=i,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),At(this.transform||(this.transform=[]),t.transform||[1,0,0,1,0,0]),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],Pt(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._rawTransformable,t=this._roamTransformable,n=new wi;return n.transform=t.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY}}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var r=t?this._rawTransform:this.transform;return n=n||[],r?BD(n,e,r):Pe(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?BD([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var r=GD(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=GD(t);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(wi);function GD(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var HD={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},UD=["lng","lat"],WD=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.dimensions=UD,i.type="geo",i._nameCoordMap=Te(),i.map=n;var o,a=r.projection,s=xD(n,r.nameMap,r.nameProperty),l=yD(n),u=i.resourceType=l?l.type:null,c=i.regions=s.regions,h=HD[l.type];if(i._regionsMap=s.regionsMap,i.regions=s.regions,"production"!==process.env.NODE_ENV&&a&&("geoSVG"===u&&("production"!==process.env.NODE_ENV&&Ao("Map "+n+" with SVG source can't use projection. Only GeoJSON source supports projection."),a=null),a.project&&a.unproject||("production"!==process.env.NODE_ENV&&Ao("project and unproject must be both provided in the projeciton."),a=null)),i.projection=a,a)for(var d=0;d<c.length;d++){var p=c[d].getBoundingRect(a);(o=o||p.clone()).union(p)}else o=s.boundingRect;return i.setBoundingRect(o.x,o.y,o.width,o.height),i.aspectScale=a?1:de(r.aspectScale,h.aspectScale),i._invertLongitute=!a&&h.invertLongitute,i}return l(t,e),t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=this._invertLongitute;i=i.clone(),o&&(i.y=-i.y-i.height);var a=this._rawTransformable;a.transform=i.calculateTransform(new jt(e,t,n,r));var s=a.parent;a.parent=null,a.decomposeTransform(),a.parent=s,o&&(a.scaleY=-a.scaleY),this._updateTransform()},t.prototype.getRegion=function(e){return this._regionsMap.get(e)},t.prototype.getRegionByCoord=function(e){for(var t=this.regions,n=0;n<t.length;n++){var r=t[n];if("geoJSON"===r.type&&r.contain(e))return t[n]}},t.prototype.addGeoCoord=function(e,t){this._nameCoordMap.set(e,t)},t.prototype.getGeoCoord=function(e){var t=this._regionsMap.get(e);return this._nameCoordMap.get(e)||t&&t.getCenter()},t.prototype.dataToPoint=function(e,t,n){if(ee(e)&&(e=this.getGeoCoord(e)),e){var r=this.projection;return r&&(e=r.project(e)),e&&this.projectedToPoint(e,t,n)}},t.prototype.pointToData=function(e){var t=this.projection;return t&&(e=t.unproject(e)),e&&this.pointToProjected(e)},t.prototype.pointToProjected=function(t){return e.prototype.pointToData.call(this,t)},t.prototype.projectedToPoint=function(t,n,r){return e.prototype.dataToPoint.call(this,t,n,r)},t.prototype.convertToPixel=function(e,t,n){var r=jD(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=jD(t);return r===this?r.pointToData(n):null},t}(FD);function jD(e){var t=e.geoModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",ta).models[0]||{}).coordinateSystem:null}function XD(e,t){var n=e.get("boundingCoords");if(null!=n){var r=n[0],i=n[1];if(isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])){var o=this.projection;if(o){var a=r[0],s=r[1],l=i[0],u=i[1];r=[1/0,1/0],i=[-1/0,-1/0];var c=function(e,t,n,a){for(var s=n-e,l=a-t,u=0;u<=100;u++){var c=u/100,h=o.project([e+s*c,t+l*c]);$e(r,r,h),Je(i,i,h)}};c(a,s,l,s),c(l,s,l,u),c(l,u,a,u),c(a,u,l,s)}this.setBoundingRect(r[0],r[1],i[0]-r[0],i[1]-r[1])}else"production"!==process.env.NODE_ENV&&console.error("Invalid boundingCoords")}var h,d,p,f=this.getBoundingRect(),g=e.get("layoutCenter"),m=e.get("layoutSize"),v=t.getWidth(),y=t.getHeight(),_=f.width/f.height*this.aspectScale,x=!1;if(g&&m&&(h=[to(g[0],v),to(g[1],y)],d=to(m,Math.min(v,y)),isNaN(h[0])||isNaN(h[1])||isNaN(d)?"production"!==process.env.NODE_ENV&&console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."):x=!0),x)p={},_>1?(p.width=d,p.height=d/_):(p.height=d,p.width=d*_),p.y=h[1]-p.height/2,p.x=h[0]-p.width/2;else{var b=e.getBoxLayoutParams();b.aspect=_,p=Wd(b,{width:v,height:y})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(e.get("center"),t),this.setZoom(e.get("zoom"))}H(WD,FD);var YD=function(){function e(){this.dimensions=UD}return e.prototype.create=function(e,t){var n=[];function r(e){return{nameProperty:e.get("nameProperty"),aspectScale:e.get("aspectScale"),projection:e.get("projection")}}e.eachComponent("geo",(function(e,i){var o=e.get("map"),a=new WD(o+i,o,z({nameMap:e.get("nameMap")},r(e)));a.zoomLimit=e.get("scaleLimit"),n.push(a),e.coordinateSystem=a,a.model=e,a.resize=XD,a.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var i={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}})),W(i,(function(e,i){var o=j(e,(function(e){return e.get("nameMap")})),a=new WD(i,i,z({nameMap:k(o)},r(e[0])));a.zoomLimit=he.apply(null,j(e,(function(e){return e.get("scaleLimit")}))),n.push(a),a.resize=XD,a.resize(e[0],t),W(e,(function(e){e.coordinateSystem=a,function(e,t){W(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}(a,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n,r){for(var i=(e||[]).slice(),o=Te(),a=0;a<i.length;a++)o.set(i[a].name,i[a]);return W(xD(t,n,r).regions,(function(e){var t=e.name,n=o.get(t),r=e.properties&&e.properties.echartsStyle;n||(n={name:t},i.push(n)),r&&R(n,r)})),i},e}(),ZD=new YD,qD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t,n){var r=yD(e.map);if(r&&"geoJSON"===r.type){var i=e.itemStyle=e.itemStyle||{};"color"in i||(i.color="#eee")}this.mergeDefaultAndTheme(e,n),Vo(e,"label",["show"])},t.prototype.optionUpdated=function(){var e=this,t=this.option;t.regions=ZD.getFilledRegions(t.regions,t.map,t.nameMap,t.nameProperty);var n={};this._optionModelMap=X(t.regions||[],(function(t,r){var i=r.name;return i&&(t.set(i,new Fh(r,e,e.ecModel)),r.selected&&(n[i]=!0)),t}),Te()),t.selectedMap||(t.selectedMap=n)},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new Fh(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),r="normal"===t?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),i={name:e};return Q(r)?(i.status=t,r(i)):ee(r)?r.replace("{a}",null!=e?e:""):void 0},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.select=function(e){var t=this.option,n=t.selectedMode;n&&("multiple"!==n&&(t.selectedMap=null),(t.selectedMap||(t.selectedMap={}))[e]=!0)},t.prototype.unSelect=function(e){var t=this.option.selectedMap;t&&(t[e]=!1)},t.prototype.toggleSelected=function(e){this[this.isSelected(e)?"unSelect":"select"](e)},t.prototype.isSelected=function(e){var t=this.option.selectedMap;return!(!t||!t[e])},t.type="geo",t.layoutMode="box",t.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},t}($d);function KD(e,t){return e.pointToProjected?e.pointToProjected(t):e.pointToData(t)}function $D(e,t,n,r){var i=e.getZoom(),o=e.getCenter(),a=t.zoom,s=e.projectedToPoint?e.projectedToPoint(o):e.dataToPoint(o);if(null!=t.dx&&null!=t.dy&&(s[0]-=t.dx,s[1]-=t.dy,e.setCenter(KD(e,s),r)),null!=a){if(n){var l=n.min||0,u=n.max||1/0;a=Math.max(Math.min(i*a,u),l)/i}e.scaleX*=a,e.scaleY*=a;var c=(t.originX-e.x)*(a-1),h=(t.originY-e.y)*(a-1);e.x-=c,e.y-=h,e.updateTransform(),e.setCenter(KD(e,s),r),e.setZoom(a*i)}return{center:e.getCenter(),zoom:e.getZoom()}}var JD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.focusBlurEnabled=!0,n}return l(t,e),t.prototype.init=function(e,t){this._api=t},t.prototype.render=function(e,t,n,r){if(this._model=e,!e.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new AD(n));var i=this._mapDraw;i.draw(e,t,n,this,r),i.group.on("click",this._handleRegionClick,this),i.group.silent=e.get("silent"),this.group.add(i.group),this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){var t;Km(e.target,(function(e){return null!=(t=vl(e).eventData)}),!0),t&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var r=this;this._mapDraw.group.traverse((function(e){var t=vl(e).eventData;if(t)return r._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0}))},t.prototype.findHighDownDispatchers=function(e){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(e,this._model)},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type="geo",t}(Xg);function QD(e,t,n){vD(e,t,n)}function eA(e){function t(t,n){n.update="geo:updateSelectStatus",e.registerAction(n,(function(e,n){var r={},i=[];return n.eachComponent({mainType:"geo",query:e},(function(n){n[t](e.name),W(n.coordinateSystem.regions,(function(e){r[e.name]=n.isSelected(e.name)||!1}));var o=[];W(r,(function(e,t){r[t]&&o.push(t)})),i.push({geoIndex:n.componentIndex,name:o})})),{selected:r,allSelected:i,name:e.name}}))}e.registerCoordinateSystem("geo",ZD),e.registerComponentModel(qD),e.registerComponentView(JD),e.registerImpl("registerMap",QD),e.registerImpl("getMap",(function(e){return _D(e)})),t("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),t("select",{type:"geoSelect",event:"geoselected"}),t("unSelect",{type:"geoUnSelect",event:"geounselected"}),e.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t,n){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},(function(t){var i=t.coordinateSystem;if("geo"===i.type){var o=$D(i,e,t.get("scaleLimit"),n);t.setCenter&&t.setCenter(o.center),t.setZoom&&t.setZoom(o.zoom),"series"===r&&W(t.seriesGroup,(function(e){e.setCenter(o.center),e.setZoom(o.zoom)}))}}))}))}function tA(e,t){var n=e.isExpand?e.children:[],r=e.parentNode.children,i=e.hierNode.i?r[e.hierNode.i-1]:null;if(n.length){!function(e){var t=e.children,n=t.length,r=0,i=0;for(;--n>=0;){var o=t[n];o.hierNode.prelim+=r,o.hierNode.modifier+=r,i+=o.hierNode.change,r+=o.hierNode.shift+i}}(e);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-o):e.hierNode.prelim=o}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=function(e,t,n,r){if(t){for(var i=e,o=e,a=o.parentNode.children[0],s=t,l=i.hierNode.modifier,u=o.hierNode.modifier,c=a.hierNode.modifier,h=s.hierNode.modifier;s=oA(s),o=aA(o),s&&o;){i=oA(i),a=aA(a),i.hierNode.ancestor=e;var d=s.hierNode.prelim+h-o.hierNode.prelim-u+r(s,o);d>0&&(lA(sA(s,e,n),e,d),u+=d,l+=d),h+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=i.hierNode.modifier,c+=a.hierNode.modifier}s&&!oA(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),o&&!aA(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-c,n=e)}return n}(e,i,e.parentNode.hierNode.defaultAncestor||r[0],t)}function nA(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function rA(e){return arguments.length?e:uA}function iA(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function oA(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function aA(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function sA(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function lA(e,t,n){var r=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=r,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=r}function uA(e,t){return e.parentNode===t.parentNode?1:2}var cA=function(){this.parentPoint=[],this.childPoints=[]},hA=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new cA},t.prototype.buildPath=function(e,t){var n=t.childPoints,r=n.length,i=t.parentPoint,o=n[0],a=n[r-1];if(1===r)return e.moveTo(i[0],i[1]),void e.lineTo(o[0],o[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=to(t.forkPosition,1),h=[];h[l]=i[l],h[u]=i[u]+(a[u]-i[u])*c,e.moveTo(i[0],i[1]),e.lineTo(h[0],h[1]),e.moveTo(o[0],o[1]),h[l]=o[l],e.lineTo(h[0],h[1]),h[l]=a[l],e.lineTo(h[0],h[1]),e.lineTo(a[0],a[1]);for(var d=1;d<r-1;d++){var p=n[d];e.moveTo(p[0],p[1]),h[l]=p[l],e.lineTo(h[0],h[1])}},t}(Us),dA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._mainGroup=new Wi,n}return l(t,e),t.prototype.init=function(e,t){this._controller=new AC(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,t,n){var r=e.getData(),i=e.layoutInfo,o=this._mainGroup;"radial"===e.get("layout")?(o.x=i.x+i.width/2,o.y=i.y+i.height/2):(o.x=i.x,o.y=i.y),this._updateViewCoordSys(e,n),this._updateController(e,t,n);var a=this._data;r.diff(a).add((function(t){pA(r,t)&&fA(r,t,null,o,e)})).update((function(t,n){var i=a.getItemGraphicEl(n);pA(r,t)?fA(r,t,i,o,e):i&&vA(a,n,i,o,e)})).remove((function(t){var n=a.getItemGraphicEl(t);n&&vA(a,t,n,o,e)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===e.get("expandAndCollapse")&&r.eachItemGraphicEl((function(t,r){t.off("click").on("click",(function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:r})}))})),this._data=r},t.prototype._updateViewCoordSys=function(e,t){var n=e.getData(),r=[];n.each((function(e){var t=n.getItemLayout(e);!t||isNaN(t.x)||isNaN(t.y)||r.push([+t.x,+t.y])}));var i=[],o=[];Ja(r,i,o);var a=this._min,s=this._max;o[0]-i[0]==0&&(i[0]=a?a[0]:i[0]-1,o[0]=s?s[0]:o[0]+1),o[1]-i[1]==0&&(i[1]=a?a[1]:i[1]-1,o[1]=s?s[1]:o[1]+1);var l=e.coordinateSystem=new FD;l.zoomLimit=e.get("scaleLimit"),l.setBoundingRect(i[0],i[1],o[0]-i[0],o[1]-i[1]),l.setCenter(e.get("center"),t),l.setZoom(e.get("zoom")),this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=i,this._max=o},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,o=this._controllerHost,a=this.group;i.setPointerChecker((function(t,r,i){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(r,i)&&!kC(t,n,e)})),i.enable(e.get("roam")),o.zoomLimit=e.get("scaleLimit"),o.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",(function(t){NC(o,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){PC(o,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(e),n.updateLabelLayout()}))},t.prototype._updateNodeAndLinkScale=function(e){var t=e.getData(),n=this._getNodeGlobalScale(e);t.eachItemGraphicEl((function(e,t){e.setSymbolScale(n)}))},t.prototype._getNodeGlobalScale=function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=this._nodeScaleRatio,r=t.scaleX||1;return((t.getZoom()-1)*n+1)/r},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},t.type="tree",t}(Kg);function pA(e,t){var n=e.getItemLayout(t);return n&&!isNaN(n.x)&&!isNaN(n.y)}function fA(e,t,n,r,i){var o=!n,a=e.tree.getNodeByDataIndex(t),s=a.getModel(),l=a.getVisual("style").fill,u=!1===a.isExpand&&0!==a.children.length?l:"#fff",c=e.tree.root,h=a.parentNode===c?a:a.parentNode||a,d=e.getItemGraphicEl(h.dataIndex),p=h.getLayout(),f=d?{x:d.__oldX,y:d.__oldY,rawX:d.__radialOldRawX,rawY:d.__radialOldRawY}:p,g=a.getLayout();o?((n=new FS(e,t,null,{symbolInnerColor:u,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(e,t,null,{symbolInnerColor:u,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,r.add(n),e.setItemGraphicEl(t,n),n.__oldX=n.x,n.__oldY=n.y,Ec(n,{x:g.x,y:g.y},i);var m=n.getSymbolPath();if("radial"===i.get("layout")){var v=c.children[0],y=v.getLayout(),_=v.children.length,x=void 0,b=void 0;if(g.x===y.x&&!0===a.isExpand&&v.children.length){var w={x:(v.children[0].getLayout().x+v.children[_-1].getLayout().x)/2,y:(v.children[0].getLayout().y+v.children[_-1].getLayout().y)/2};(x=Math.atan2(w.y-y.y,w.x-y.x))<0&&(x=2*Math.PI+x),(b=w.x<y.x)&&(x-=Math.PI)}else(x=Math.atan2(g.y-y.y,g.x-y.x))<0&&(x=2*Math.PI+x),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<y.x)&&(x-=Math.PI):(b=g.x>y.x)||(x-=Math.PI);var S=b?"left":"right",T=s.getModel("label"),M=T.get("rotate"),C=M*(Math.PI/180),D=m.getTextContent();D&&(m.setTextConfig({position:T.get("position")||S,rotation:null==M?-x:C,origin:"center"}),D.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),I="relative"===A?Me(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;I&&(vl(n).focus=I),function(e,t,n,r,i,o,a,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),d=e.get(["lineStyle","curveness"]),p=e.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if("curve"===u)t.parentNode&&t.parentNode!==n&&(g||(g=r.__edge=new pc({shape:yA(c,h,d,i,i)})),Ec(g,{shape:yA(c,h,d,o,a)},e));else if("polyline"===u)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var m=t.children,v=[],y=0;y<m.length;y++){var _=m[y].getLayout();v.push([_.x,_.y])}g||(g=r.__edge=new hA({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:h,forkPosition:p}})),Ec(g,{shape:{parentPoint:[a.x,a.y],childPoints:v}},e)}}else if("production"!==process.env.NODE_ENV)throw new Error("The polyline edgeShape can only be used in orthogonal layout");g&&("polyline"!==u||t.isExpand)&&(g.useStyle(V({strokeNoScale:!0,fill:null},f)),cu(g,l,"lineStyle"),Ul(g),s.add(g))}(i,a,c,n,f,p,g,r),n.__edge&&(n.onHoverStateChange=function(t){if("blur"!==t){var r=a.parentNode&&e.getItemGraphicEl(a.parentNode.dataIndex);r&&1===r.hoverState||Gl(n.__edge,t)}})}function gA(e,t,n,r,i){var o=mA(t.tree.root,e),a=o.source,s=o.sourceLayout,l=t.getItemGraphicEl(e.dataIndex);if(l){var u=t.getItemGraphicEl(a.dataIndex).__edge,c=l.__edge||(!1===a.isExpand||1===a.children.length?u:void 0),h=r.get("edgeShape"),d=r.get("layout"),p=r.get("orient"),f=r.get(["lineStyle","curveness"]);c&&("curve"===h?Pc(c,{shape:yA(d,p,f,s,s),style:{opacity:0}},r,{cb:function(){n.remove(c)},removeOpt:i}):"polyline"===h&&"orthogonal"===r.get("layout")&&Pc(c,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},r,{cb:function(){n.remove(c)},removeOpt:i}))}}function mA(e,t){for(var n,r=t.parentNode===e?t:t.parentNode||t;null==(n=r.getLayout());)r=r.parentNode===e?r:r.parentNode||r;return{source:r,sourceLayout:n}}function vA(e,t,n,r,i){var o=e.tree.getNodeByDataIndex(t),a=mA(e.tree.root,o).sourceLayout,s={duration:i.get("animationDurationUpdate"),easing:i.get("animationEasingUpdate")};Pc(n,{x:a.x+1,y:a.y+1},i,{cb:function(){r.remove(n),e.setItemGraphicEl(t,null)},removeOpt:s}),n.fadeOut(null,e.hostModel,{fadeLabel:!0,animation:s}),o.children.forEach((function(t){gA(t,e,r,i,s)})),gA(o,e,r,i,s)}function yA(e,t,n,r,i){var o,a,s,l,u,c,h,d;if("radial"===e){u=r.rawX,h=r.rawY,c=i.rawX,d=i.rawY;var p=iA(u,h),f=iA(u,h+(d-h)*n),g=iA(c,d+(h-d)*n),m=iA(c,d);return{x1:p.x||0,y1:p.y||0,x2:m.x||0,y2:m.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return u=r.x,h=r.y,c=i.x,d=i.y,"LR"!==t&&"RL"!==t||(o=u+(c-u)*n,a=h,s=c+(u-c)*n,l=d),"TB"!==t&&"BT"!==t||(o=u,a=h+(d-h)*n,s=c,l=d+(h-d)*n),{x1:u,y1:h,x2:c,y2:d,cpx1:o,cpy1:a,cpx2:s,cpy2:l}}var _A=$o();function xA(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,CA(t,n,e),W(n,(function(n){W(t.TRANSFERABLE_METHODS,(function(t){n.wrapMethod(t,$(bA,e))}))})),t.wrapMethod("cloneShallow",$(SA,e)),W(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,$(wA,e))})),me(n[t.dataType]===t)}function bA(e,t){if(_A(r=this).mainData===r){var n=z({},_A(this).datas);n[this.dataType]=t,CA(t,n,e)}else DA(t,this.dataType,_A(this).mainData,e);var r;return t}function wA(e,t){return e.struct&&e.struct.update(),t}function SA(e,t){return W(_A(t).datas,(function(n,r){n!==t&&DA(n.cloneShallow(),r,t,e)})),t}function TA(e){var t=_A(this).mainData;return null==e||null==t?t:_A(t).datas[e]}function MA(){var e=_A(this).mainData;return null==e?[{data:e}]:j(q(_A(e).datas),(function(t){return{type:t,data:_A(e).datas[t]}}))}function CA(e,t,n){_A(e).datas={},W(t,(function(t,r){DA(t,r,e,n)}))}function DA(e,t,n,r){_A(n).datas[t]=e,_A(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=TA,e.getLinkedDataAll=MA}var AA=function(){function e(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=t}return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,t,n){Q(e)&&(n=t,t=e,e=null),ee(e=e||{})&&(e={order:e});var r,i=e.order||"preorder",o=this[e.attr||"children"];"preorder"===i&&(r=t.call(n,this));for(var a=0;!r&&a<o.length;a++)o[a].eachNode(e,t,n);"postorder"===i&&t.call(n,this)},e.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var n=0;n<this.children.length;n++){var r=this.children[n];r.updateDepthAndHeight(e+1),r.height>t&&(t=r.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].getNodeById(e);if(i)return i}},e.prototype.contains=function(e){if(e===this)return!0;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].contains(e);if(i)return i}},e.prototype.getAncestors=function(e){for(var t=[],n=e?this:this.parentNode;n;)t.push(n),n=n.parentNode;return t.reverse(),t},e.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},e.prototype.getDescendantIndices=function(){var e=[];return this.eachNode((function(t){e.push(t.dataIndex)})),e},e.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||"value"),this.dataIndex)},e.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),IA=function(){function e(e){this.type="tree",this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,r=t.length;n<r;n++)t[n].dataIndex=-1;for(n=0,r=e.count();n<r;n++)t[e.getRawIndex(n)].dataIndex=n},e.prototype.clearLayouts=function(){this.data.clearItemLayouts()},e.createTree=function(t,n,r){var i=new e(n),o=[],a=1;!function e(t,n){var r=t.value;a=Math.max(a,J(r)?r.length:1),o.push(t);var s=new AA(jo(t.name,""),i);n?function(e,t){var n=t.children;if(e.parentNode===t)return;n.push(e),e.parentNode=t}(s,n):i.root=s,i._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(t),i.root.updateDepthAndHeight(0);var s=P_(o,{coordDimensions:["value"],dimensionsCount:a}).dimensions,l=new L_(s,n);return l.initData(o),r&&r(l),xA({mainData:l,struct:i,structAttr:"tree"}),i.update(),i},e}();function EA(e,t,n){if(e&&F(t,e.type)>=0){var r=n.getData().tree.root,i=e.targetNode;if(ee(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var o=e.targetNodeId;if(null!=o&&(i=r.getNodeById(o)))return{node:i}}}function LA(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function NA(e,t){return F(LA(e),t)>=0}function PA(e,t){for(var n=[];e;){var r=e.dataIndex;n.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return n.reverse(),n}var OA=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return l(t,e),t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=e.leaves||{},r=new Fh(n,this,this.ecModel),i=IA.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=i.getNodeByDataIndex(t);return n&&n.children.length&&n.isExpand||(e.parentModel=r),e}))}));var o=0;i.eachNode("preorder",(function(e){e.depth>o&&(o=e.depth)}));var a=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:o;return i.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=a})),i.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData().tree,i=r.root.children[0],o=r.getNodeByDataIndex(e),a=o.getValue(),s=o.name;o&&o!==i;)s=o.parentNode.name+"."+s,o=o.parentNode;return wg("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=PA(r,this),n.collapsed=!r.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Vg);function RA(e,t){for(var n,r=[e];n=r.pop();)if(t(n),n.isExpand){var i=n.children;if(i.length)for(var o=i.length-1;o>=0;o--)r.push(i[o])}}function kA(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var n=function(e,t){return Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=n;var r=e.get("layout"),i=0,o=0,a=null;"radial"===r?(i=2*Math.PI,o=Math.min(n.height,n.width)/2,a=rA((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(i=n.width,o=n.height,a=rA());var s=e.getData().tree.root,l=s.children[0];if(l){!function(e){var t=e;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,r,i=[t];n=i.pop();)if(r=n.children,n.isExpand&&r.length)for(var o=r.length-1;o>=0;o--){var a=r[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},i.push(a)}}(s),function(e,t,n){for(var r,i=[e],o=[];r=i.pop();)if(o.push(r),r.isExpand){var a=r.children;if(a.length)for(var s=0;s<a.length;s++)i.push(a[s])}for(;r=o.pop();)t(r,n)}(l,tA,a),s.hierNode.modifier=-l.hierNode.prelim,RA(l,nA);var u=l,c=l,h=l;RA(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>c.getLayout().x&&(c=e),e.depth>h.depth&&(h=e)}));var d=u===c?1:a(u,c)/2,p=d-u.getLayout().x,f=0,g=0,m=0,v=0;if("radial"===r)f=i/(c.getLayout().x+d+p),g=o/(h.depth-1||1),RA(l,(function(e){m=(e.getLayout().x+p)*f,v=(e.depth-1)*g;var t=iA(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=o/(c.getLayout().x+d+p),f=i/(h.depth-1||1),RA(l,(function(e){v=(e.getLayout().x+p)*g,m="LR"===y?(e.depth-1)*f:i-(e.depth-1)*f,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(f=i/(c.getLayout().x+d+p),g=o/(h.depth-1||1),RA(l,(function(e){m=(e.getLayout().x+p)*f,v="TB"===y?(e.depth-1)*g:o-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))}function zA(e){e.eachSeriesByType("tree",(function(e){var t=e.getData();t.tree.eachNode((function(e){var n=e.getModel().getModel("itemStyle").getItemStyle();z(t.ensureUniqueItemVisual(e.dataIndex,"style"),n)}))}))}var VA=["treemapZoomToNode","treemapRender","treemapMove"];function BA(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var r=t;r&&r.depth>1;)r=r.parentNode;var i=Cp(e.ecModel,r.name||r.dataIndex+"",n);t.setVisual("decal",i)}))}var FA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};GA(n);var r=e.levels||[],i=this.designatedVisualItemStyle={},o=new Fh({itemStyle:i},this,t);r=e.levels=function(e,t){var n,r,i=zo(t.get("color")),o=zo(t.get(["aria","decal","decals"]));if(!i)return;e=e||[],W(e,(function(e){var t=new Fh(e),i=t.get("color"),o=t.get("decal");(t.get(["itemStyle","color"])||i&&"none"!==i)&&(n=!0),(t.get(["itemStyle","decal"])||o&&"none"!==o)&&(r=!0)}));var a=e[0]||(e[0]={});n||(a.color=i.slice());!r&&o&&(a.decal=o.slice());return e}(r,t);var a=j(r||[],(function(e){return new Fh(e,o,t)}),this),s=IA.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),r=n?a[n.depth]:null;return e.parentModel=r||o,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e);return wg("nameValue",{name:r.getName(e),value:i})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=PA(r,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},z(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=Te(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){BA(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(Vg);function GA(e){var t=0;W(e.children,(function(e){GA(e);var n=e.value;J(n)&&(n=n[0]),t+=n}));var n=e.value;J(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),J(e.value)?e.value[0]=n:e.value=n}var HA=function(){function e(e){this.group=new Wi,e.add(this.group)}return e.prototype.render=function(e,t,n,r){var i=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),i.get("show")&&n){var a=i.getModel("itemStyle"),s=i.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),c={pos:{left:i.get("left"),right:i.get("right"),top:i.get("top"),bottom:i.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:i.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(e,c,a,s,l,u,r),jd(o,c.pos,c.box)}},e.prototype._prepare=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=jo(r.getModel().get("name"),""),o=n.getTextRect(i),a=Math.max(o.width+16,t.emptyItemWidth);t.totalWidth+=a+8,t.renderList.push({node:r,text:i,width:a})}},e.prototype._renderContent=function(e,t,n,r,i,o,a){for(var s=0,l=t.emptyItemWidth,u=e.get(["breadcrumb","height"]),c=function(e,t,n){var r=t.width,i=t.height,o=to(e.left,r),a=to(e.top,i),s=to(e.right,r),l=to(e.bottom,i);return(isNaN(o)||isNaN(parseFloat(e.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=r),(isNaN(a)||isNaN(parseFloat(e.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(e.bottom)))&&(l=i),n=Ed(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}(t.pos,t.box),h=t.totalWidth,d=t.renderList,p=r.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],m=g.node,v=g.width,y=g.text;h>c.width&&(h-=v-l,v=l,y=null);var _=new ic({shape:{points:UA(s,0,v,u,f===d.length-1,0===f)},style:V(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new il({style:yh(i,{text:y})}),textConfig:{position:"inside"},z2:1e5,onclick:$(a,m)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=yh(o,{text:y}),_.ensureState("emphasis").style=p,au(_,r.get("focus"),r.get("blurScope"),r.get("disabled")),this.group.add(_),WA(_,e,m),s+=v+8}},e.prototype.remove=function(){this.group.removeAll()},e}();function UA(e,t,n,r,i,o){var a=[[i?e:e-5,t],[e+n,t],[e+n,t+r],[i?e:e-5,t+r]];return!o&&a.splice(2,0,[e+n+5,t+r/2]),!i&&a.push([e,t+r/2]),a}function WA(e,t,n){vl(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&PA(n,t)}}var jA=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,r,i){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:r,easing:i}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},r=0,i=this._storage.length;r<i;r++){var o=this._storage[r];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:n,aborted:n})}return this},e}();var XA=Wi,YA=tl,ZA="label",qA="upperLabel",KA=ma([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),$A=function(e){var t=KA(e);return t.stroke=t.fill=t.lineWidth=null,t},JA=$o(),QA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._state="ready",n._storage={nodeGroup:[],background:[],content:[]},n}return l(t,e),t.prototype.render=function(e,t,n,r){if(!(F(t.findComponents({mainType:"series",subType:"treemap",query:r}),e)<0)){this.seriesModel=e,this.api=n,this.ecModel=t;var i=EA(r,["treemapZoomToNode","treemapRootToNode"],e),o=r&&r.type,a=e.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===o&&i&&l?{rootNodeGroup:l.nodeGroup[i.node.getRawIndex()],direction:r.direction}:null,c=this._giveContainerGroup(a),h=e.get("animation"),d=this._doRender(c,e,u);!h||s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,u),this._resetController(n),this._renderBreadcrumb(e,n,i)}},t.prototype._giveContainerGroup=function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new XA,this._initEvents(t),this.group.add(t)),t.x=e.x,t.y=e.y,t},t.prototype._doRender=function(e,t,n){var r=t.getData().tree,i=this._oldTree,o={nodeGroup:[],background:[],content:[]},a={nodeGroup:[],background:[],content:[]},s=this._storage,l=[];function u(e,r,i,u){return function(e,t,n,r,i,o,a,s,l,u){if(!a)return;var c=a.getLayout(),h=e.getData(),d=a.getModel();if(h.setItemGraphicEl(a.dataIndex,null),!c||!c.isInView)return;var p=c.width,f=c.height,g=c.borderWidth,m=c.invisible,v=a.getRawIndex(),y=s&&s.getRawIndex(),_=a.viewChildren,x=c.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),T=d.getModel(["blur","itemStyle"]),M=d.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,D=H("nodeGroup",XA);if(!D)return;if(l.add(D),D.x=c.x||0,D.y=c.y||0,D.markRedraw(),JA(D).nodeWidth=p,JA(D).nodeHeight=f,c.isAboveViewRoot)return D;var A=H("background",YA,u,20);A&&k(D,A,b&&c.upperLabelHeight);var I=d.getModel("emphasis"),E=I.get("focus"),L=I.get("blurScope"),N=I.get("disabled"),P="ancestor"===E?a.getAncestorsIndices():"descendant"===E?a.getDescendantIndices():E;if(b)du(D)&&hu(D,!1),A&&(hu(A,!N),h.setItemGraphicEl(a.dataIndex,A),su(A,P,L));else{var O=H("content",YA,u,30);O&&V(D,O),A.disableMorphing=!0,A&&du(A)&&hu(A,!1),hu(D,!N),h.setItemGraphicEl(a.dataIndex,D);var R=d.getShallow("cursor");R&&O.attr("cursor",R),su(D,P,L)}return D;function k(t,n,r){var i=vl(n);if(i.dataIndex=a.dataIndex,i.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:C}),m)B(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=$A(w);l.fill=s;var u=KA(S);u.fill=S.get("borderColor");var c=KA(T);c.fill=T.get("borderColor");var h=KA(M);if(h.fill=M.get("borderColor"),r){var d=p-2*g;F(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,Ul(n)}t.add(n)}function V(t,n){var r=vl(n);r.dataIndex=a.dataIndex,r.seriesIndex=e.seriesIndex;var i=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:i,height:o,r:C}),m)B(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=$A(w);u.fill=l,u.decal=s.decal;var c=KA(S),h=KA(T),d=KA(M);F(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=d,Ul(n)}t.add(n)}function B(e){!e.invisible&&o.push(e)}function F(t,n,r,i){var o=d.getModel(i?qA:ZA),s=jo(d.get("name"),null),l=o.getShallow("show");mh(t,vh(d,i?qA:ZA),{defaultText:l?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:e,labelDataIndex:a.dataIndex});var u=t.getTextContent();if(u){var h=u.style,p=ge(h.padding||0);i&&(t.setTextConfig({layoutRect:i}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var e=Math.max((i?i.width:t.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:t.shape.height)-p[0]-p[2],0);h.width===e&&h.height===n||u.setStyle({width:e,height:n})},h.truncateMinChar=2,h.lineOverflow="truncate",G(h,i,c);var f=u.getState("emphasis");G(f?f.style:null,i,c)}}function G(t,n,r){var i=t?t.text:null;if(!n&&r.isLeafRoot&&null!=i){var o=e.get("drillDownIcon",!0);t.text=o?o+" "+i:i}}function H(e,r,o,a){var s=null!=y&&n[e][y],l=i[e];return s?(n[e][y]=null,U(l,s)):m||((s=new r)instanceof Ga&&(s.z2=function(e,t){return 100*e+t}(o,a)),W(l,s)),t[e][v]=s}function U(e,t){var n=e[v]={};t instanceof XA?(n.oldX=t.x,n.oldY=t.y):n.oldShape=z({},t.shape)}function W(e,t){var n=e[v]={},o=a.parentNode,s=t instanceof Wi;if(o&&(!r||"drillDown"===r.direction)){var l=0,u=0,c=i.background[o.getRawIndex()];!r&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}(t,a,s,n,o,l,e,r,i,u)}!function e(t,n,r,i,o){i?(n=t,W(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new s_(n,t,a,a).add(s).update(s).remove($(s,null)).execute();function a(e){return e.getId()}function s(a,s){var l=null!=a?t[a]:null,c=null!=s?n[s]:null,h=u(l,c,r,o);h&&e(l&&l.viewChildren||[],c&&c.viewChildren||[],h,i,o+1)}}(r.root?[r.root]:[],i&&i.root?[i.root]:[],e,r===i||!i,0);var c=function(e){var t={nodeGroup:[],background:[],content:[]};return e&&W(e,(function(e,n){var r=t[n];W(e,(function(e){e&&(r.push(e),JA(e).willDelete=!0)}))})),t}(s);if(this._oldTree=r,this._storage=a,this._controllerHost){var h=this.seriesModel.layoutInfo,d=r.root.getLayout();d.width===h.width&&d.height===h.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:o,willDeleteEls:c,renderFinally:function(){W(c,(function(e){W(e,(function(e){e.parent&&e.parent.remove(e)}))})),W(l,(function(e){e.invisible=!0,e.dirty()}))}}},t.prototype._doAnimation=function(e,t,n,r){var i=n.get("animationDurationUpdate"),o=n.get("animationEasing"),a=(Q(i)?0:i)||0,s=(Q(o)?null:o)||"cubicOut",l=new jA;W(t.willDeleteEls,(function(e,t){W(e,(function(e,n){if(!e.invisible){var i,o=e.parent,u=JA(o);if(r&&"drillDown"===r.direction)i=o===r.rootNodeGroup?{shape:{x:0,y:0,width:u.nodeWidth,height:u.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var c=0,h=0;u.willDelete||(c=u.nodeWidth/2,h=u.nodeHeight/2),i="nodeGroup"===t?{x:c,y:h,style:{opacity:0}}:{shape:{x:c,y:h,width:0,height:0},style:{opacity:0}}}i&&l.add(e,i,a,0,s)}}))})),W(this._storage,(function(e,n){W(e,(function(e,r){var i=t.lastsForAnimation[n][r],o={};i&&(e instanceof Wi?null!=i.oldX&&(o.x=e.x,o.y=e.y,e.x=i.oldX,e.y=i.oldY):(i.oldShape&&(o.shape=z({},e.shape),e.setShape(i.oldShape)),i.fadein?(e.setStyle("opacity",0),o.style={opacity:1}):1!==e.style.opacity&&(o.style={opacity:1})),l.add(e,o,a,0,s))}))}),this),this._state="animating",l.finished(K((function(){this._state="ready",t.renderFinally()}),this)).start()},t.prototype._resetController=function(e){var t=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),t||((t=this._controller=new AC(e.getZr())).enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),t.on("pan",K(this._onPan,this)),t.on("zoom",K(this._onZoom,this)));var r=new jt(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,n){return r.contain(t,n)}))},t.prototype._clearController=function(){var e=this._controller;this._controllerHost=null,e&&(e.dispose(),e=null)},t.prototype._onPan=function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY,r=e.scale;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var o=i.getLayout();if(!o)return;var a,s=new jt(o.x,o.y,o.width,o.height),l=this._controllerHost;a=l.zoomLimit;var u=l.zoom=l.zoom||1;if(u*=r,a){var c=a.min||0,h=a.max||1/0;u=Math.max(Math.min(h,u),c)}var d=u/l.zoom;l.zoom=u;var p=this.seriesModel.layoutInfo,f=[1,0,0,1,0,0];Et(f,f,[-(t-=p.x),-(n-=p.y)]),Nt(f,f,[d,d]),Et(f,f,[t,n]),s.applyTransform(f),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var r=t.findTarget(e.offsetX,e.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)t._rootToNode(r);else if("zoomToNode"===n)t._zoomToNode(r);else if("link"===n){var o=i.hostTree.data.getItemModel(i.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Vd(a,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var r=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new HA(this.group))).render(e,t,n.node,(function(t){"animating"!==r._state&&(NA(e.getViewRoot(),t)?r._rootToNode({node:t}):r._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(r){var i=this._storage.background[r.getRawIndex()];if(i){var o=i.transformCoordToLocal(e,t),a=i.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:r,offsetX:o[0],offsetY:o[1]}}}),this),n},t.type="treemap",t}(Kg);var eI=W,tI=re,nI=-1,rI=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=O(t);this.type=r,this.mappingMethod=n,this._normalizeData=pI[n];var o=e.visualHandlers[r];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(iI(i),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,W(t,(function(t,n){t.originIndex=n,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(i)):"category"===n?i.categories?function(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(eI(t,(function(e,t){n[e]=t})),!J(r)){var i=[];re(r)?eI(r,(function(e,t){var r=n[t];i[null!=r?r:nI]=e})):i[-1]=r,r=dI(e,i)}for(var o=t.length-1;o>=0;o--)null==r[o]&&(delete n[t[o]],t.pop())}(i):iI(i,!0):(me("linear"!==n||i.dataExtent),iI(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return K(this._normalizeData,this)},e.listVisualTypes=function(){return q(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){re(e)?W(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,o=J(t)?[]:re(t)?{}:(i=!0,null);return e.eachVisual(t,(function(e,t){var a=n.call(r,e,t);i?o=a:o[t]=a})),o},e.retrieveVisuals=function(t){var n,r={};return t&&eI(e.visualHandlers,(function(e,i){t.hasOwnProperty(i)&&(r[i]=t[i],n=!0)})),n?r:null},e.prepareVisualTypes=function(e){if(J(e))e=e.slice();else{if(!tI(e))return[];var t=[];eI(e,(function(e,n){t.push(n)})),e=t}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},e.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||ee(s)&&s===e+"")return o;n&&h(s,o)}}for(o=0,a=t.length;o<a;o++){var l=t[o],u=l.interval,c=l.close;if(u){if(u[0]===-1/0){if(fI(c[1],e,u[1]))return o}else if(u[1]===1/0){if(fI(c[0],u[0],e))return o}else if(fI(c[0],u[0],e)&&fI(c[1],e,u[1]))return o;n&&h(u[0],o),n&&h(u[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function h(t,n){var o=Math.abs(t-e);o<i&&(i=o,r=n)}},e.visualHandlers={color:{applyVisual:sI("color"),getColorMapper:function(){var e=this.option;return K("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),lI.call(this,e)}:function(t,n,r){var i=!!r;return!n&&(t=this._normalizeData(t)),r=or(t,e.parsedVisual,r),i?r:hr(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return hr(or(e,this.option.parsedVisual),"rgba")},category:lI,piecewise:function(e,t){var n=hI.call(this,t);return null==n&&(n=hr(or(e,this.option.parsedVisual),"rgba")),n},fixed:uI}},colorHue:oI((function(e,t){return ur(e,t)})),colorSaturation:oI((function(e,t){return ur(e,null,t)})),colorLightness:oI((function(e,t){return ur(e,null,null,t)})),colorAlpha:oI((function(e,t){return cr(e,t)})),decal:{applyVisual:sI("decal"),_normalizedToVisual:{linear:null,category:lI,piecewise:null,fixed:null}},opacity:{applyVisual:sI("opacity"),_normalizedToVisual:cI([0,1])},liftZ:{applyVisual:sI("liftZ"),_normalizedToVisual:{linear:uI,category:uI,piecewise:uI,fixed:uI}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:aI,category:lI,piecewise:function(e,t){var n=hI.call(this,t);return null==n&&(n=aI.call(this,e)),n},fixed:uI}},symbolSize:{applyVisual:sI("symbolSize"),_normalizedToVisual:cI([0,1])}},e}();function iI(e,t){var n=e.visual,r=[];re(n)?eI(n,(function(e){r.push(e)})):null!=n&&r.push(n);t||1!==r.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(r[1]=r[0]),dI(e,r)}function oI(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r("color",e(n("color"),i))},_normalizedToVisual:cI([0,1])}}function aI(e){var t=this.option.visual;return t[Math.round(eo(e,[0,1],[0,t.length-1],!0))]||{}}function sI(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function lI(e){var t=this.option.visual;return t[this.option.loop&&e!==nI?e%t.length:e]}function uI(){return this.option.visual[0]}function cI(e){return{linear:function(t){return eo(t,e,this.option.visual,!0)},category:lI,piecewise:function(t,n){var r=hI.call(this,n);return null==r&&(r=eo(t,e,this.option.visual,!0)),r},fixed:uI}}function hI(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[rI.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function dI(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=j(t,(function(e){var t=nr(e);return t||"production"===process.env.NODE_ENV||Ao("'"+e+"' is an illegal color, fallback to '#000000'",!0),t||[0,0,0,1]}))),t}var pI={linear:function(e){return eo(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=rI.findPieceIndex(e,t,!0);if(null!=n)return eo(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?nI:t},fixed:Ie};function fI(e,t,n){return e?t<=n:t<n}var gI=$o(),mI={seriesType:"treemap",reset:function(e){var t=e.getData().tree.root;t.isRemoved()||vI(t,{},e.getViewRoot().getAncestors(),e)}};function vI(e,t,n,r){var i=e.getModel(),o=e.getLayout(),a=e.hostTree.data;if(o&&!o.invisible&&o.isInView){var s,l=i.getModel("itemStyle"),u=function(e,t,n){var r=z({},t),i=n.designatedVisualItemStyle;return W(["color","colorAlpha","colorSaturation"],(function(n){i[n]=t[n];var o=e.get(n);i[n]=null,null!=o&&(r[n]=o)})),r}(l,t,r),c=a.ensureUniqueItemVisual(e.dataIndex,"style"),h=l.get("borderColor"),d=l.get("borderColorSaturation");null!=d&&(h=function(e,t){return null!=t?ur(t,null,null,e):null}(d,s=yI(u))),c.stroke=h;var p=e.viewChildren;if(p&&p.length){var f=function(e,t,n,r,i,o){if(!o||!o.length)return;var a=xI(t,"color")||null!=i.color&&"none"!==i.color&&(xI(t,"colorAlpha")||xI(t,"colorSaturation"));if(!a)return;var s=t.get("visualMin"),l=t.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:a.name,dataExtent:u,visual:a.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var d=new rI(h);return gI(d).drColorMappingBy=c,d}(0,i,o,0,u,p);W(p,(function(e,t){if(e.depth>=n.length||e===n[e.depth]){var o=function(e,t,n,r,i,o){var a=z({},t);if(i){var s=i.type,l="color"===s&&gI(i).drColorMappingBy,u="index"===l?r:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(e.get("visualDimension"));a[s]=i.mapValueToVisual(u)}return a}(i,u,e,t,f,r);vI(e,o,n,r)}}))}else s=yI(u),c.fill=s}}function yI(e){var t=_I(e,"color");if(t){var n=_I(e,"colorAlpha"),r=_I(e,"colorSaturation");return r&&(t=ur(t,null,null,r)),n&&(t=cr(t,n)),t}}function _I(e,t){var n=e[t];if(null!=n&&"none"!==n)return n}function xI(e,t){var n=e.get(t);return J(n)&&n.length?{name:t,range:n}:null}var bI=Math.max,wI=Math.min,SI=he,TI=W,MI=["itemStyle","borderWidth"],CI=["itemStyle","gapWidth"],DI=["upperLabel","show"],AI=["upperLabel","height"],II={seriesType:"treemap",reset:function(e,t,n,r){var i=n.getWidth(),o=n.getHeight(),a=e.option,s=Wd(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=to(SI(s.width,l[0]),i),c=to(SI(s.height,l[1]),o),h=r&&r.type,d=EA(r,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===h||"treemapMove"===h?r.rootRect:null,f=e.getViewRoot(),g=LA(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?function(e,t,n,r,i){var o,a=(t||{}).node,s=[r,i];if(!a||a===n)return s;var l=r*i,u=l*e.option.zoomToNodeRatio;for(;o=a.parentNode;){for(var c=0,h=o.children,d=0,p=h.length;d<p;d++)c+=h[d].getValue();var f=a.getValue();if(0===f)return s;u*=c/f;var g=o.getModel(),m=g.get(MI);(u+=4*m*m+(3*m+Math.max(m,OI(g)))*Math.pow(u,.5))>uo&&(u=uo),a=o}u<l&&(u=l);var v=Math.pow(u/l,.5);return[r*v,i*v]}(e,d,f,u,c):p?[p.width,p.height]:[u,c],v=a.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:a.squareRatio,sort:v,leafDepth:a.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),EI(f,y,!1,0),_=f.getLayout(),TI(g,(function(e,t){var n=(g[t+1]||f).getValue();e.setLayout(z({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(function(e,t,n){if(t)return{x:t.x,y:t.y};var r={x:0,y:0};if(!n)return r;var i=n.node,o=i.getLayout();if(!o)return r;var a=[o.width/2,o.height/2],s=i;for(;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:e.width/2-a[0],y:e.height/2-a[1]}}(s,p,d),!0),e.setLayoutInfo(s),PI(x,new jt(-s.x,-s.y,i,o),g,f,0)}};function EI(e,t,n,r){var i,o;if(!e.isRemoved()){var a=e.getLayout();i=a.width,o=a.height;var s=e.getModel(),l=s.get(MI),u=s.get(CI)/2,c=OI(s),h=Math.max(l,c),d=l-u,p=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0);var f=(i=bI(i-2*d,0))*(o=bI(o-d-p,0)),g=function(e,t,n,r,i,o){var a=e.children||[],s=r.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=r.leafDepth&&r.leafDepth<=o;if(i&&!l)return e.viewChildren=[];a=Y(a,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,n){var r="asc"===t?e.getValue()-n.getValue():n.getValue()-e.getValue();return 0===r?"asc"===t?e.dataIndex-n.dataIndex:n.dataIndex-e.dataIndex:r}))}(a,s);var u=function(e,t,n){for(var r=0,i=0,o=t.length;i<o;i++)r+=t[i].getValue();var a,s=e.get("visualDimension");t&&t.length?"value"===s&&n?(a=[t[t.length-1].getValue(),t[0].getValue()],"asc"===n&&a.reverse()):(a=[1/0,-1/0],TI(t,(function(e){var t=e.getValue(s);t<a[0]&&(a[0]=t),t>a[1]&&(a[1]=t)}))):a=[NaN,NaN];return{sum:r,dataExtent:a}}(t,a,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,n,r,i){if(!r)return n;for(var o=e.get("visibleMin"),a=i.length,s=a,l=a-1;l>=0;l--){var u=i["asc"===r?a-l-1:l].getValue();u/n*t<o&&(s=l,n-=u)}return"asc"===r?i.splice(0,a-s):i.splice(s,a-s),n}(t,n,u.sum,s,a),0===u.sum)return e.viewChildren=[];for(var c=0,h=a.length;c<h;c++){var d=a[c].getValue()/u.sum*n;a[c].setLayout({area:d})}l&&(a.length&&e.setLayout({isLeafRoot:!0},!0),a.length=0);return e.viewChildren=a,e.setLayout({dataExtent:u.dataExtent},!0),a}(e,s,f,t,n,r);if(g.length){var m={x:d,y:p,width:i,height:o},v=wI(i,o),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var w=g[x];_.push(w),_.area+=w.getLayout().area;var S=LI(_,v,t.squareRatio);S<=y?(x++,y=S):(_.area-=_.pop().getLayout().area,NI(_,v,m,u,!1),v=wI(m.width,m.height),_.length=_.area=0,y=1/0)}if(_.length&&NI(_,v,m,u,!0),!n){var T=s.get("childrenVisibleMin");null!=T&&f<T&&(n=!0)}for(x=0,b=g.length;x<b;x++)EI(g[x],t,n,r+1)}}}function LI(e,t,n){for(var r=0,i=1/0,o=0,a=void 0,s=e.length;o<s;o++)(a=e[o].getLayout().area)&&(a<i&&(i=a),a>r&&(r=a));var l=e.area*e.area,u=t*t*n;return l?bI(u*r/l,l/(u*i)):1/0}function NI(e,t,n,r,i){var o=t===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],c=t?e.area/t:0;(i||c>n[l[a]])&&(c=n[l[a]]);for(var h=0,d=e.length;h<d;h++){var p=e[h],f={},g=c?p.getLayout().area/c:0,m=f[l[a]]=bI(c-2*r,0),v=n[s[o]]+n[l[o]]-u,y=h===d-1||v<g?v:g,_=f[l[o]]=bI(y-2*r,0);f[s[a]]=n[s[a]]+wI(r,m/2),f[s[o]]=u+wI(r,_/2),u+=y,p.setLayout(f,!0)}n[s[a]]+=c,n[l[a]]-=c}function PI(e,t,n,r,i){var o=e.getLayout(),a=n[i],s=a&&a===e;if(!(a&&!s||i===n.length&&e!==r)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(o),isAboveViewRoot:s},!0);var l=new jt(t.x-o.x,t.y-o.y,t.width,t.height);TI(e.viewChildren||[],(function(e){PI(e,l,n,r,i+1)}))}}function OI(e){return e.get(DI)?e.get(AI):0}function RI(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),r=e.getGraph().data,i=n.mapArray(n.getName);r.filterSelf((function(e){var n=r.getItemModel(e).getShallow("category");if(null!=n){ne(n)&&(n=i[n]);for(var o=0;o<t.length;o++)if(!t[o].isSelected(n))return!1}return!0}))}))}function kI(e){var t={};e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each((function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),n.setItemVisual(r,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=a.getShallow(l[u],!0);null!=c&&n.setItemVisual(r,l[u],c)}})),n.count()&&r.each((function(e){var t=r.getItemModel(e).getShallow("category");if(null!=t){ee(t)&&(t=i["ec-"+t]);var o=n.getItemVisual(t,"style");z(r.ensureUniqueItemVisual(e,"style"),o);for(var a=["symbol","symbolSize","symbolKeepAspect"],s=0;s<a.length;s++)r.setItemVisual(e,a[s],n.getItemVisual(t,a[s]))}}))}))}function zI(e){return e instanceof Array||(e=[e,e]),e}function VI(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),n=e.getEdgeData(),r=zI(e.get("edgeSymbol")),i=zI(e.get("edgeSymbolSize"));n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),o=zI(r.getShallow("symbol",!0)),a=zI(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(z(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])}))}))}var BI="--\x3e",FI=function(e){return e.get("autoCurveness")||null},GI=function(e,t){var n=FI(e),r=20,i=[];if(ne(n))r=n;else if(J(n))return void(e.__curvenessList=n);t>r&&(r=t);var o=r%2?r+2:r+3;i=[];for(var a=0;a<o;a++)i.push((a%2?a+1:a)/10*(a%2?-1:1));e.__curvenessList=i},HI=function(e,t,n){var r=[e.id,e.dataIndex].join("."),i=[t.id,t.dataIndex].join(".");return[n.uid,r,i].join(BI)},UI=function(e){var t=e.split(BI);return[t[0],t[2],t[1]].join(BI)},WI=function(e,t){var n=t.__edgeMap;return n[e]?n[e].length:0};function jI(e,t,n,r){var i=FI(t),o=J(i);if(!i)return null;var a=function(e,t){var n=HI(e.node1,e.node2,t);return t.__edgeMap[n]}(e,t);if(!a)return null;for(var s=-1,l=0;l<a.length;l++)if(a[l]===n){s=l;break}var u=function(e,t){return WI(HI(e.node1,e.node2,t),t)+WI(HI(e.node2,e.node1,t),t)}(e,t);GI(t,u),e.lineStyle=e.lineStyle||{};var c=HI(e.node1,e.node2,t),h=t.__curvenessList,d=o||u%2?0:1;if(a.isForward)return h[d+s];var p=UI(c),f=WI(p,t),g=h[s+f+d];return r?o?i&&0===i[0]?(f+d)%2?g:-g:((f%2?0:1)+d)%2?g:-g:(f+d)%2?g:-g:h[s+f+d]}function XI(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var n=e.getGraph();n.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),YI(n,e)}}function YI(e,t){e.eachEdge((function(e,n){var r=pe(e.getModel().get(["lineStyle","curveness"]),-jI(e,t,n,!0),0),i=Oe(e.node1.getLayout()),o=Oe(e.node2.getLayout()),a=[i,o];+r&&a.push([(i[0]+o[0])/2-(i[1]-o[1])*r,(i[1]+o[1])/2-(o[0]-i[0])*r]),e.setLayout(a)}))}function ZI(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),n=e.coordinateSystem;if(n&&"view"!==n.type){var r=e.getData(),i=[];W(n.dimensions,(function(e){i=i.concat(r.mapDimensionsAll(e))}));for(var o=0;o<r.count();o++){for(var a=[],s=!1,l=0;l<i.length;l++){var u=r.get(i[l],o);isNaN(u)||(s=!0),a.push(u)}s?r.setItemLayout(o,n.dataToPoint(a)):r.setItemLayout(o,[NaN,NaN])}YI(r.graph,e)}else t&&"none"!==t||XI(e)}))}function qI(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=e.option.nodeScaleRatio,r=t.scaleX;return((t.getZoom()-1)*n+1)/r}function KI(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var $I=Math.PI,JI=[];function QI(e,t,n,r){var i=e.coordinateSystem;if(!i||"view"===i.type){var o=i.getBoundingRect(),a=e.getData(),s=a.graph,l=o.width/2+o.x,u=o.height/2+o.y,c=Math.min(o.width,o.height)/2,h=a.count();if(a.setLayout({cx:l,cy:u}),h){if(n){var d=i.pointToData(r),p=d[0],f=d[1],g=[p-l,f-u];We(g,g),Ue(g,g,c),n.setLayout([l+g[0],u+g[1]],!0),tE(n,e.get(["circular","rotateLabel"]),l,u)}eE[t](e,s,a,c,l,u,h),s.eachEdge((function(t,n){var r,i=pe(t.getModel().get(["lineStyle","curveness"]),jI(t,e,n),0),o=Oe(t.node1.getLayout()),a=Oe(t.node2.getLayout()),s=(o[0]+a[0])/2,c=(o[1]+a[1])/2;+i&&(r=[l*(i*=3)+s*(1-i),u*i+c*(1-i)]),t.setLayout([o,a,r])}))}}}var eE={value:function(e,t,n,r,i,o,a){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||a);t.eachNode((function(e){var t=e.getValue("value"),n=u*(l?t:1)/2;s+=n,e.setLayout([r*Math.cos(s)+i,r*Math.sin(s)+o]),s+=n}))},symbolSize:function(e,t,n,r,i,o,a){var s=0;JI.length=a;var l=qI(e);t.eachNode((function(e){var t=KI(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var n=Math.asin(t/2/r);isNaN(n)&&(n=$I/2),JI[e.dataIndex]=n,s+=2*n}));var u=(2*$I-s)/a/2,c=0;t.eachNode((function(e){var t=u+JI[e.dataIndex];c+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([r*Math.cos(c)+i,r*Math.sin(c)+o]),c+=t}))}};function tE(e,t,n,r){var i=e.getGraphicEl();if(i){var o=e.getModel().get(["label","rotate"])||0,a=i.getSymbolPath();if(t){var s=e.getLayout(),l=Math.atan2(s[1]-r,s[0]-n);l<0&&(l=2*Math.PI+l);var u=s[0]<n;u&&(l-=Math.PI);var c=u?"left":"right";a.setTextConfig({rotation:-l,position:c,origin:"center"});var h=a.ensureState("emphasis");z(h.textConfig||(h.textConfig={}),{position:c})}else a.setTextConfig({rotation:o*=Math.PI/180})}}function nE(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&QI(e,"symbolSize")}))}var rE=ze;function iE(e){e.eachSeriesByType("graph",(function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var n=e.preservedPoints||{},r=e.getGraph(),i=r.data,o=r.edgeData,a=e.getModel("force"),s=a.get("initLayout");e.preservedPoints?i.each((function(e){var t=i.getId(e);i.setItemLayout(e,n[t]||[NaN,NaN])})):s&&"none"!==s?"circular"===s&&QI(e,"value"):XI(e);var l=i.getDataExtent("value"),u=o.getDataExtent("value"),c=a.get("repulsion"),h=a.get("edgeLength"),d=J(c)?c:[c,c],p=J(h)?h:[h,h];p=[p[1],p[0]];var f=i.mapArray("value",(function(e,t){var n=i.getItemLayout(t),r=eo(e,l,d);return isNaN(r)&&(r=(d[0]+d[1])/2),{w:r,rep:r,fixed:i.getItemModel(t).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}})),g=o.mapArray("value",(function(t,n){var i=r.getEdgeByIndex(n),o=eo(t,u,p);isNaN(o)&&(o=(p[0]+p[1])/2);var a=i.getModel(),s=pe(i.getModel().get(["lineStyle","curveness"]),-jI(i,e,n,!0),0);return{n1:f[i.node1.dataIndex],n2:f[i.node2.dataIndex],d:o,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}})),m=t.getBoundingRect(),v=function(e,t,n){for(var r=e,i=t,o=n.rect,a=o.width,s=o.height,l=[o.x+a/2,o.y+s/2],u=null==n.gravity?.1:n.gravity,c=0;c<r.length;c++){var h=r[c];h.p||(h.p=Ne(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=Oe(h.p),h.edges=null}var d,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(e){r[e].fixed=!0},setUnfixed:function(e){r[e].fixed=!1},beforeStep:function(e){d=e},afterStep:function(e){p=e},step:function(e){d&&d(r,i);for(var t=[],n=r.length,o=0;o<i.length;o++){var a=i[o];if(!a.ignoreForceLayout){var s=a.n1;Ve(t,(m=a.n2).p,s.p);var c=Be(t)-a.d,h=m.w/(s.w+m.w);isNaN(h)&&(h=0),We(t,t),!s.fixed&&rE(s.p,s.p,t,h*c*g),!m.fixed&&rE(m.p,m.p,t,-(1-h)*c*g)}}for(o=0;o<n;o++)(_=r[o]).fixed||(Ve(t,l,_.p),rE(_.p,_.p,t,u*g));for(o=0;o<n;o++){s=r[o];for(var f=o+1;f<n;f++){var m;Ve(t,(m=r[f]).p,s.p),0===(c=Be(t))&&(Re(t,Math.random()-.5,Math.random()-.5),c=1);var v=(s.rep+m.rep)/c/c;!s.fixed&&rE(s.pp,s.pp,t,v),!m.fixed&&rE(m.pp,m.pp,t,-v)}}var y=[];for(o=0;o<n;o++){var _;(_=r[o]).fixed||(Ve(y,_.p,_.pp),rE(_.p,_.p,y,g),Pe(_.pp,_.p))}var x=(g*=.992)<.01;p&&p(r,i,x),e&&e(x)}}}(f,g,{rect:m,gravity:a.get("gravity"),friction:a.get("friction")});v.beforeStep((function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].fixed&&Pe(e[n].p,r.getNodeByIndex(n).getLayout())})),v.afterStep((function(e,t,o){for(var a=0,s=e.length;a<s;a++)e[a].fixed||r.getNodeByIndex(a).setLayout(e[a].p),n[i.getId(a)]=e[a].p;for(a=0,s=t.length;a<s;a++){var l=t[a],u=r.getEdgeByIndex(a),c=l.n1.p,h=l.n2.p,d=u.getLayout();(d=d?d.slice():[])[0]=d[0]||[],d[1]=d[1]||[],Pe(d[0],c),Pe(d[1],h),+l.curveness&&(d[2]=[(c[0]+h[0])/2-(c[1]-h[1])*l.curveness,(c[1]+h[1])/2-(h[0]-c[0])*l.curveness]),u.setLayout(d)}})),e.forceLayout=v,e.preservedPoints=n,v.step()}else e.forceLayout=null}))}function oE(e,t){var n=[];return e.eachSeriesByType("graph",(function(e){var r=e.get("coordinateSystem");if(!r||"view"===r){var i=e.getData(),o=[],a=[];Ja(i.mapArray((function(e){var t=i.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o,a),a[0]-o[0]==0&&(a[0]+=1,o[0]-=1),a[1]-o[1]==0&&(a[1]+=1,o[1]-=1);var s=(a[0]-o[0])/(a[1]-o[1]),l=function(e,t,n){return Wd(z(e.getBoxLayoutParams(),{aspect:n}),{width:t.getWidth(),height:t.getHeight()})}(e,t,s);isNaN(s)&&(o=[l.x,l.y],a=[l.x+l.width,l.y+l.height]);var u=a[0]-o[0],c=a[1]-o[1],h=l.width,d=l.height,p=e.coordinateSystem=new FD;p.zoomLimit=e.get("scaleLimit"),p.setBoundingRect(o[0],o[1],u,c),p.setViewRect(l.x,l.y,h,d),p.setCenter(e.get("center"),t),p.setZoom(e.get("zoom")),n.push(p)}})),n}var aE=uc.prototype,sE=pc.prototype,lE=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function uE(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}l(t,e)}(lE);var cE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new lE},t.prototype.buildPath=function(e,t){uE(t)?aE.buildPath.call(this,e,t):sE.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return uE(this.shape)?aE.pointAt.call(this,e):sE.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=uE(t)?[t.x2-t.x1,t.y2-t.y1]:sE.tangentAt.call(this,e);return We(n,n)},t}(Us),hE=["fromSymbol","toSymbol"];function dE(e){return"_"+e+"Type"}function pE(e,t,n){var r=t.getItemVisual(n,e);if(!r||"none"===r)return r;var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=uv(i);return r+l+cv(a||0,l)+(o||"")+(s||"")}function fE(e,t,n){var r=t.getItemVisual(n,e);if(r&&"none"!==r){var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=uv(i),u=cv(a||0,l),c=lv(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,c.name=e,c}}function gE(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var mE=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return l(t,e),t.prototype._createLine=function(e,t,n){var r=e.hostModel,i=function(e){var t=new cE({name:"line",subPixelOptimize:!0});return gE(t.shape,e),t}(e.getItemLayout(t));i.shape.percent=0,Lc(i,{shape:{percent:1}},r,t),this.add(i),W(hE,(function(n){var r=fE(n,e,t);this.add(r),this[dE(n)]=pE(n,e,t)}),this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};gE(a.shape,o),Ec(i,a,r,t),W(hE,(function(n){var r=pE(n,e,t),i=dE(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=fE(n,e,t);this.add(o)}this[i]=r}),this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,h=n&&n.blurScope;if(!n||e.hasItemOption){var d=e.getItemModel(t),p=d.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),c=p.get("focus"),h=p.get("blurScope"),l=vh(d)}var f=e.getItemVisual(t,"style"),g=f.stroke;i.useStyle(f),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=a,i.ensureState("select").style=s,W(hE,(function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<Sl.length;n++){var r=Sl[n],o=i.getState(r);if(o){var a=o.style||{},s=t.ensureState(r),l=s.style||(s.style={});null!=a.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}t.markRedraw()}}),this);var m=r.getRawValue(t);mh(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?no(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var _=y.get("distance");J(_)||(_=[_,_]),v.__labelDistance=_}this.setTextConfig({position:null,local:!0,inside:!1}),au(this,c,h,u)},t.prototype.highlight=function(){Xl(this)},t.prototype.downplay=function(){Yl(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");gE(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),n=e.childOfName("toSymbol"),r=e.getTextContent();if(t||n||r&&!r.ignore){for(var i=1,o=this.parent;o;)o.scaleX&&(i/=o.scaleX),o=o.parent;var a=e.childOfName("line");if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),c=Ve([],u,l);if(We(c,c),t&&(t.setPosition(l),S(t,0),t.scaleX=t.scaleY=i*s,t.markRedraw()),n&&(n.setPosition(u),S(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var h=void 0,d=void 0,p=r.__labelDistance,f=p[0]*i,g=p[1]*i,m=s/2,v=a.tangentAt(m),y=[v[1],-v[0]],_=a.pointAt(m);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if("start"!==r.__position&&"end"!==r.__position){var b=-Math.atan2(v[1],v[0]);u[0]<l[0]&&(b=Math.PI+b),r.rotation=b}var w=void 0;switch(r.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-g,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=g,d="top";break;default:w=0,d="middle"}switch(r.__position){case"end":r.x=c[0]*f+u[0],r.y=c[1]*g+u[1],h=c[0]>.8?"left":c[0]<-.8?"right":"center",d=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":r.x=-c[0]*f+l[0],r.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",d=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":r.x=f*x+l[0],r.y=l[1]+w,h=v[0]<0?"right":"left",r.originX=-f*x,r.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":r.x=_[0],r.y=_[1]+w,h="center",r.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":r.x=-f*x+u[0],r.y=u[1]+w,h=v[0]>=0?"right":"left",r.originX=f*x,r.originY=-w}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||d,align:r.__align||h})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var r=a.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr("rotation",n)}},t}(Wi),vE=function(){function e(e){this.group=new Wi,this._LineCtor=e||mE}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var o=yE(e);e.diff(i).add((function(n){t._doAdd(e,n,o)})).update((function(n,r){t._doUpdate(i,e,r,n,o)})).remove((function(e){r.remove(i.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=yE(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var r=e.start;r<e.end;r++){if(xE(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){hh(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(xE(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var o=e.getItemGraphicEl(n);xE(t.getItemLayout(r))?(o?o.updateData(t,r,i):o=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,o),this.group.add(o)):this.group.remove(o)},e}();function yE(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:vh(t)}}function _E(e){return isNaN(e[0])||isNaN(e[1])}function xE(e){return e&&!_E(e[0])&&!_E(e[1])}var bE=[],wE=[],SE=[],TE=Nn,ME=Ze,CE=Math.abs;function DE(e,t,n){for(var r,i=e[0],o=e[1],a=e[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){bE[0]=TE(i[0],o[0],a[0],c),bE[1]=TE(i[1],o[1],a[1],c),(p=CE(ME(bE,t)-l))<s&&(s=p,r=c)}for(var h=0;h<32;h++){var d=r+u;wE[0]=TE(i[0],o[0],a[0],r),wE[1]=TE(i[1],o[1],a[1],r),SE[0]=TE(i[0],o[0],a[0],d),SE[1]=TE(i[1],o[1],a[1],d);var p=ME(wE,t)-l;if(CE(p)<.01)break;var f=ME(SE,t)-l;u/=2,p<0?f>=0?r+=u:r-=u:f>=0?r-=u:r+=u}return r}function AE(e,t){var n=[],r=Rn,i=[[],[],[]],o=[[],[]],a=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[Oe(l[0]),Oe(l[1])],l[2]&&l.__original.push(Oe(l[2])));var h=l.__original;if(null!=l[2]){if(Pe(i[0],h[0]),Pe(i[1],h[2]),Pe(i[2],h[1]),u&&"none"!==u){var d=KI(e.node1),p=DE(i,h[0],d*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(c&&"none"!==c){d=KI(e.node2),p=DE(i,h[1],d*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}Pe(l[0],i[0]),Pe(l[1],i[2]),Pe(l[2],i[1])}else{if(Pe(o[0],h[0]),Pe(o[1],h[1]),Ve(a,o[1],o[0]),We(a,a),u&&"none"!==u){d=KI(e.node1);ze(o[0],o[0],a,d*t)}if(c&&"none"!==c){d=KI(e.node2);ze(o[1],o[1],a,-d*t)}Pe(l[0],o[0]),Pe(l[1],o[1])}}))}function IE(e){return"view"===e.type}var EE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){var n=new jS,r=new vE,i=this.group;this._controller=new AC(t.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(r.group),this._symbolDraw=n,this._lineDraw=r,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem;this._model=e;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(IE(i)){var l={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(l):Ec(s,l,e)}AE(e.getGraph(),qI(e));var u=e.getData();o.updateData(u);var c=e.getEdgeData();a.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var h=e.forceLayout,d=e.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,d);var p=e.get("layout");u.graph.eachNode((function(t){var n=t.dataIndex,i=t.getGraphicEl(),o=t.getModel();if(i){i.off("drag").off("dragend");var a=o.get("draggable");a&&i.on("drag",(function(o){switch(p){case"force":h.warmUp(),!r._layouting&&r._startForceLayoutIteration(h,d),h.setFixed(n),u.setItemLayout(n,[i.x,i.y]);break;case"circular":u.setItemLayout(n,[i.x,i.y]),t.setLayout({fixed:!0},!0),QI(e,"symbolSize",t,[o.offsetX,o.offsetY]),r.updateLayout(e);break;default:u.setItemLayout(n,[i.x,i.y]),YI(e.getGraph(),e),r.updateLayout(e)}})).on("dragend",(function(){h&&h.setUnfixed(n)})),i.setDraggable(a,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(vl(i).focus=t.getAdjacentDataIndices())}})),u.graph.eachEdge((function(e){var t=e.getGraphicEl(),n=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===n&&(vl(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var f="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),g=u.getLayout("cx"),m=u.getLayout("cy");u.graph.eachNode((function(e){tE(e,f,g,m)})),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;!function r(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(r,16):r())}))}()},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,o=this._controllerHost,a=this.group;i.setPointerChecker((function(t,r,i){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(r,i)&&!kC(t,n,e)})),IE(e.coordinateSystem)?(i.enable(e.get("roam")),o.zoomLimit=e.get("scaleLimit"),o.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",(function(t){NC(o,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){PC(o,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(),AE(e.getGraph(),qI(e)),r._lineDraw.updateLayout(),n.updateLabelLayout()}))):i.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=qI(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){AE(e.getGraph(),qI(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(Kg);function LE(e){return"_EC_"+e}var NE=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var n=this._nodesMap;if(!n[LE(e)]){var r=new PE(e,t);return r.hostGraph=this,this.nodes.push(r),n[LE(e)]=r,r}"production"!==process.env.NODE_ENV&&console.error("Graph nodes have duplicate name or id")},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[LE(e)]},e.prototype.addEdge=function(e,t,n){var r=this._nodesMap,i=this._edgesMap;if(ne(e)&&(e=this.nodes[e]),ne(t)&&(t=this.nodes[t]),e instanceof PE||(e=r[LE(e)]),t instanceof PE||(t=r[LE(t)]),e&&t){var o=e.id+"-"+t.id,a=new OE(e,t,n);return a.hostGraph=this,this._directed&&(e.outEdges.push(a),t.inEdges.push(a)),e.edges.push(a),e!==t&&t.edges.push(a),this.edges.push(a),i[o]=a,a}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof PE&&(e=e.id),t instanceof PE&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof PE||(t=this._nodesMap[LE(t)]),t){for(var i="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(r,t,null))for(var a=[t];a.length;){var s=a.shift(),l=s[i];for(o=0;o<l.length;o++){var u=l[o],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(e.call(r,c,s))return;a.push(c),c.__visited=!0}}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,r=this.edges,i=0,o=n.length;i<o;i++)n[i].dataIndex=-1;for(i=0,o=e.count();i<o;i++)n[e.getRawIndex(i)].dataIndex=i;t.filterSelf((function(e){var n=r[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}));for(i=0,o=r.length;i<o;i++)r[i].dataIndex=-1;for(i=0,o=t.count();i<o;i++)r[t.getRawIndex(i)].dataIndex=i},e.prototype.clone=function(){for(var t=new e(this._directed),n=this.nodes,r=this.edges,i=0;i<n.length;i++)t.addNode(n[i].id,n[i].dataIndex);for(i=0;i<r.length;i++){var o=r[i];t.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return t},e}(),PE=function(){function e(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==e?"":e,this.dataIndex=null==t?-1:t}return e.prototype.degree=function(){return this.edges.length},e.prototype.inDegree=function(){return this.inEdges.length},e.prototype.outDegree=function(){return this.outEdges.length},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var n=this.edges[t];n.dataIndex<0||(e.edge.push(n.dataIndex),e.node.push(n.node1.dataIndex,n.node2.dataIndex))}return e},e.prototype.getTrajectoryDataIndices=function(){for(var e=Te(),t=Te(),n=0;n<this.edges.length;n++){var r=this.edges[n];if(!(r.dataIndex<0)){e.set(r.dataIndex,!0);for(var i=[r.node1],o=[r.node2],a=0;a<i.length;){var s=i[a];a++,t.set(s.dataIndex,!0);for(var l=0;l<s.inEdges.length;l++)e.set(s.inEdges[l].dataIndex,!0),i.push(s.inEdges[l].node1)}for(a=0;a<o.length;){var u=o[a];a++,t.set(u.dataIndex,!0);for(l=0;l<u.outEdges.length;l++)e.set(u.outEdges[l].dataIndex,!0),o.push(u.outEdges[l].node2)}}}return{edge:e.keys(),node:t.keys()}},e}(),OE=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=null==n?-1:n}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=Te(),t=Te();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i<n.length;){var o=n[i];i++,t.set(o.dataIndex,!0);for(var a=0;a<o.inEdges.length;a++)e.set(o.inEdges[a].dataIndex,!0),n.push(o.inEdges[a].node1)}for(i=0;i<r.length;){var s=r[i];i++,t.set(s.dataIndex,!0);for(a=0;a<s.outEdges.length;a++)e.set(s.outEdges[a].dataIndex,!0),r.push(s.outEdges[a].node2)}return{edge:e.keys(),node:t.keys()}},e}();function RE(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function kE(e,t,n,r,i){for(var o=new NE(r),a=0;a<e.length;a++)o.addNode(he(e[a].id,e[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<t.length;a++){var c=t[a],h=c.source,d=c.target;o.addEdge(h,d,u)&&(l.push(c),s.push(he(jo(c.id,null),h+" > "+d)),u++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=G_(e,n);else{var g=Bp.get(f),m=g&&g.dimensions||[];F(m,"value")<0&&m.concat(["value"]);var v=P_(e,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(p=new L_(v,n)).initData(e)}var y=new L_(["value"],n);return y.initData(l,s),i&&i(p,y),xA({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}H(PE,RE("hostGraph","data")),H(OE,RE("hostGraph","edgeData"));var zE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new lM(r,r),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),Vo(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=this;FI(o=this)&&(o.__curvenessList=[],o.__edgeMap={},GI(o));var o,a=kE(r,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=i._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=Fh.prototype.getModel;function r(e,t){var r=n.call(this,e,t);return r.resolveParentPath=o,r}function o(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=o,e.getModel=r,e}))}));return W(a.edges,(function(e){!function(e,t,n,r){if(FI(n)){var i=HI(e,t,n),o=n.__edgeMap,a=o[UI(i)];o[i]&&!a?o[i].isForward=!0:a&&o[i]&&(a.isForward=!0,o[i].isForward=!1),o[i]=o[i]||[],o[i].push(r)}}(e.node1,e.node2,this,e.dataIndex)}),this),a.data},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(e,n),o=r.graph.getEdgeByIndex(e),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),wg("nameValue",{name:l.join(" > "),value:i.value,noValue:null==i.value})}return Og({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=j(this.option.categories||[],(function(e){return null!=e.value?e:z({value:0},e)})),t=new L_(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(Vg),VE={type:"graphRoam",event:"graphRoam",update:"none"};var BE=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},FE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return l(t,e),t.prototype.getDefaultShape=function(){return new BE},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=i/3?1:2),l=t.y-r(a)*o*(o>=i/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+r(a)*o),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(a)*o,t.y-r(a)*o),e.lineTo(s,l)},t}(Us);function GE(e,t){var n=null==e?"":e+"";return t&&(ee(t)?n=t.replace("{value}",n):Q(t)&&(n=t(e))),n}var HE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var r=e.get(["axisLine","lineStyle","color"]),i=function(e,t){var n=e.get("center"),r=t.getWidth(),i=t.getHeight(),o=Math.min(r,i);return{cx:to(n[0],t.getWidth()),cy:to(n[1],t.getHeight()),r:to(e.get("radius"),o/2)}}(e,n);this._renderMain(e,t,n,r,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var o=this.group,a=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?MT:Qu,h=u.get("show"),d=u.getModel("lineStyle"),p=d.get("width"),f=[s,l];ws(f,!a);for(var g=(l=f[1])-(s=f[0]),m=s,v=[],y=0;h&&y<r.length;y++){var _=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:a,r0:i.r-p,r:i.r},silent:!0});_.setStyle({fill:r[y][1]}),_.setStyle(d.getLineStyle(["color","width"])),v.push(_),m=l}v.reverse(),W(v,(function(e){return o.add(e)}));var x=function(e){if(e<=0)return r[0][1];var t;for(t=0;t<r.length;t++)if(r[t][0]>=e&&(0===t?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,x,i,s,l,a,p),this._renderTitleAndDetail(e,t,n,x,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,x,i,s,l,a,p)},t.prototype._renderTicks=function(e,t,n,r,i,o,a,s,l){for(var u,c,h=this.group,d=i.cx,p=i.cy,f=i.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),_=e.getModel("axisLabel"),x=e.get("splitNumber"),b=y.get("splitNumber"),w=to(v.get("length"),f),S=to(y.get("length"),f),T=o,M=(a-o)/x,C=M/b,D=v.getModel("lineStyle").getLineStyle(),A=y.getModel("lineStyle").getLineStyle(),I=v.get("distance"),E=0;E<=x;E++){if(u=Math.cos(T),c=Math.sin(T),v.get("show")){var L=new uc({shape:{x1:u*(f-(N=I?I+l:l))+d,y1:c*(f-N)+p,x2:u*(f-w-N)+d,y2:c*(f-w-N)+p},style:D,silent:!0});"auto"===D.stroke&&L.setStyle({stroke:r(E/x)}),h.add(L)}if(_.get("show")){var N=_.get("distance")+I,P=GE(no(E/x*(m-g)+g),_.get("formatter")),O=r(E/x),R=u*(f-w-N)+d,k=c*(f-w-N)+p,z=_.get("rotate"),V=0;"radial"===z?(V=-T+2*Math.PI)>Math.PI/2&&(V+=Math.PI):"tangential"===z?V=-T-Math.PI/2:ne(z)&&(V=z*Math.PI/180),0===V?h.add(new il({style:yh(_,{text:P,x:R,y:k,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0})):h.add(new il({style:yh(_,{text:P,x:R,y:k,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:R,originY:k,rotation:V}))}if(y.get("show")&&E!==x){N=(N=y.get("distance"))?N+l:l;for(var B=0;B<=b;B++){u=Math.cos(T),c=Math.sin(T);var F=new uc({shape:{x1:u*(f-N)+d,y1:c*(f-N)+p,x2:u*(f-S-N)+d,y2:c*(f-S-N)+p},silent:!0,style:A});"auto"===A.stroke&&F.setStyle({stroke:r((E+B/b)/x)}),h.add(F),T+=C}T-=C}else T+=M}},t.prototype._renderPointer=function(e,t,n,r,i,o,a,s,l){var u=this.group,c=this._data,h=this._progressEls,d=[],p=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),_=+e.get("max"),x=[y,_],b=[o,a];function w(t,n){var r,o=m.getItemModel(t).getModel("pointer"),a=to(o.get("width"),i.r),s=to(o.get("length"),i.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=to(u[0],i.r),h=to(u[1],i.r),d=o.get("keepAspect");return(r=l?lv(l,c-a/2,h-s,a,s,null,d):new FE({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:h}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function S(e,t){var n=f.get("roundCap")?MT:Qu,r=f.get("overlap"),a=r?f.get("width"):l/m.count(),u=r?i.r-a:i.r-(e+1)*a,c=r?i.r:i.r-e*a,h=new n({shape:{startAngle:o,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:u,r:c}});return r&&(h.z2=eo(m.get(v,e),[y,_],[100,0],!0)),h}(g||p)&&(m.diff(c).add((function(t){var n=m.get(v,t);if(p){var r=w(t,o);Lc(r,{rotation:-((isNaN(+n)?b[0]:eo(n,x,b,!0))+Math.PI/2)},e),u.add(r),m.setItemGraphicEl(t,r)}if(g){var i=S(t,o),a=f.get("clip");Lc(i,{shape:{endAngle:eo(n,x,b,a)}},e),u.add(i),yl(e.seriesIndex,m.dataType,t,i),d[t]=i}})).update((function(t,n){var r=m.get(v,t);if(p){var i=c.getItemGraphicEl(n),a=i?i.rotation:o,s=w(t,a);s.rotation=a,Ec(s,{rotation:-((isNaN(+r)?b[0]:eo(r,x,b,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=h[n],y=S(t,l?l.shape.endAngle:o),_=f.get("clip");Ec(y,{shape:{endAngle:eo(r,x,b,_)}},e),u.add(y),yl(e.seriesIndex,m.dataType,t,y),d[t]=y}})).execute(),m.each((function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),i=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(s instanceof Zs){var c=s.style;s.useStyle(z({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",r(eo(m.get(v,e),x,[0,1],!0))),s.z2EmphasisLift=0,cu(s,t),au(s,i,o,a)}if(g){var h=d[e];h.useStyle(m.getItemVisual(e,"style")),h.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,cu(h,t),au(h,i,o,a)}})),this._progressEls=d)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=lv(i,t.cx-r/2+to(o[0],t.r),t.cy-r/2+to(o[1],t.r),r,r,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new Wi,h=[],d=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add((function(e){h[e]=new il({silent:!0}),d[e]=new il({silent:!0})})).update((function(e,t){h[e]=o._titleEls[t],d[e]=o._detailEls[t]})).execute(),a.each((function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new Wi,m=r(eo(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),_=i.cx+to(y[0],i.r),x=i.cy+to(y[1],i.r);(A=h[t]).attr({z2:f?0:2,style:yh(v,{x:_,y:x,text:a.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(A)}var b=n.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),S=i.cx+to(w[0],i.r),T=i.cy+to(w[1],i.r),M=to(b.get("width"),i.r),C=to(b.get("height"),i.r),D=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,A=d[t],I=b.get("formatter");A.attr({z2:f?0:2,style:yh(b,{x:S,y:T,text:GE(o,I),width:isNaN(M)?null:M,height:isNaN(C)?null:C,align:"center",verticalAlign:"middle"},{inheritColor:D})}),Ch(A,{normal:b},o,(function(e){return GE(e,I)})),p&&Dh(A,t,a,e,{getFormattedLabel:function(e,t,n,r,i,a){return GE(a?a.interpolatedValue:o,I)}}),g.add(A)}c.add(g)})),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(Kg),UE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return l(t,e),t.prototype.getInitialData=function(e,t){return sM(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Vg);var WE=["itemStyle","opacity"],jE=function(e){function t(t,n){var r=e.call(this)||this,i=r,o=new ac,a=new il;return i.setTextContent(a),r.setTextGuideLine(o),r.updateData(t,n,!0),r}return l(t,e),t.prototype.updateData=function(e,t,n){var r=this,i=e.hostModel,o=e.getItemModel(t),a=e.getItemLayout(t),s=o.getModel("emphasis"),l=o.get(WE);l=null==l?1:l,n||kc(r),r.useStyle(e.getItemVisual(t,"style")),r.style.lineJoin="round",n?(r.setShape({points:a.points}),r.style.opacity=0,Lc(r,{style:{opacity:l}},i,t)):Ec(r,{style:{opacity:l},shape:{points:a.points}},i,t),cu(r,o),this._updateLabel(e,t),au(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,t){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),o=e.hostModel,a=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),u=l.fill;mh(i,vh(a),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var c=s.linePoints;r.setShape({points:c}),n.textGuideLineConfig={anchor:c?new kt(c[0][0],c[0][1]):null},Ec(i,{style:{x:s.x,y:s.y}},o,t),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),ew(n,tw(a),{stroke:u})},t}(ic),XE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,o=this.group;r.diff(i).add((function(e){var t=new jE(r,e);r.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var n=i.getItemGraphicEl(t);n.updateData(r,e),o.add(n),r.setItemGraphicEl(e,n)})).remove((function(t){Rc(i.getItemGraphicEl(t),e,t)})).execute(),this._data=r},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(Kg),YE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new lM(K(this.getData,this),K(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return sM(this,{coordDimensions:["value"],encodeDefaulter:$(gp,this)})},t.prototype._defaultLabelLine=function(e){Vo(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),r=e.prototype.getDataParams.call(this,t),i=n.mapDimension("value"),o=n.getSum(i);return r.percent=o?+(n.get(i,t)/o*100).toFixed(2):0,r.$vars.push("percent"),r},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(Vg);function ZE(e,t){e.eachSeriesByType("funnel",(function(e){var n=e.getData(),r=n.mapDimension("value"),i=e.get("sort"),o=function(e,t){return Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),a=e.get("orient"),s=o.width,l=o.height,u=function(e,t){for(var n=e.mapDimension("value"),r=e.mapArray(n,(function(e){return e})),i=[],o="ascending"===t,a=0,s=e.count();a<s;a++)i[a]=a;return Q(t)?i.sort(t):"none"!==t&&i.sort((function(e,t){return o?r[e]-r[t]:r[t]-r[e]})),i}(n,i),c=o.x,h=o.y,d="horizontal"===a?[to(e.get("minSize"),l),to(e.get("maxSize"),l)]:[to(e.get("minSize"),s),to(e.get("maxSize"),s)],p=n.getDataExtent(r),f=e.get("min"),g=e.get("max");null==f&&(f=Math.min(p[0],0)),null==g&&(g=p[1]);var m=e.get("funnelAlign"),v=e.get("gap"),y=(("horizontal"===a?s:l)-v*(n.count()-1))/n.count(),_=function(e,t){if("horizontal"===a){var i=eo(n.get(r,e)||0,[f,g],d,!0),o=void 0;switch(m){case"top":o=h;break;case"center":o=h+(l-i)/2;break;case"bottom":o=h+(l-i)}return[[t,o],[t,o+i]]}var u,p=eo(n.get(r,e)||0,[f,g],d,!0);switch(m){case"left":u=c;break;case"center":u=c+(s-p)/2;break;case"right":u=c+s-p}return[[u,t],[u+p,t]]};"ascending"===i&&(y=-y,v=-v,"horizontal"===a?c+=s:h+=l,u=u.reverse());for(var x=0;x<u.length;x++){var b=u[x],w=u[x+1],S=n.getItemModel(b);if("horizontal"===a){var T=S.get(["itemStyle","width"]);null==T?T=y:(T=to(T,s),"ascending"===i&&(T=-T));var M=_(b,c),C=_(w,c+T);c+=T+v,n.setItemLayout(b,{points:M.concat(C.slice().reverse())})}else{var D=S.get(["itemStyle","height"]);null==D?D=y:(D=to(D,l),"ascending"===i&&(D=-D));M=_(b,h),C=_(w,h+D);h+=D+v,n.setItemLayout(b,{points:M.concat(C.slice().reverse())})}}!function(e){var t=e.hostModel.get("orient");e.each((function(n){var r,i,o,a,s=e.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),c=e.getItemLayout(n),h=c.points,d="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(d)"insideLeft"===l?(i=(h[0][0]+h[3][0])/2+5,o=(h[0][1]+h[3][1])/2,r="left"):"insideRight"===l?(i=(h[1][0]+h[2][0])/2-5,o=(h[1][1]+h[2][1])/2,r="right"):(i=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,o=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,r="center"),a=[[i,o],[i,o]];else{var p=void 0,f=void 0,g=void 0,m=void 0,v=u.get("length");"production"!==process.env.NODE_ENV&&("vertical"===t&&["top","bottom"].indexOf(l)>-1&&(l="left",console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")),"horizontal"===t&&["left","right"].indexOf(l)>-1&&(l="bottom",console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))),"left"===l?(p=(h[3][0]+h[0][0])/2,f=(h[3][1]+h[0][1])/2,i=(g=p-v)-5,r="right"):"right"===l?(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,i=(g=p+v)+5,r="left"):"top"===l?(p=(h[3][0]+h[0][0])/2,o=(m=(f=(h[3][1]+h[0][1])/2)-v)-5,r="center"):"bottom"===l?(p=(h[1][0]+h[2][0])/2,o=(m=(f=(h[1][1]+h[2][1])/2)+v)+5,r="center"):"rightTop"===l?(p="horizontal"===t?h[3][0]:h[1][0],f="horizontal"===t?h[3][1]:h[1][1],"horizontal"===t?(o=(m=f-v)-5,r="center"):(i=(g=p+v)+5,r="top")):"rightBottom"===l?(p=h[2][0],f=h[2][1],"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="bottom")):"leftTop"===l?(p=h[0][0],f="horizontal"===t?h[0][1]:h[1][1],"horizontal"===t?(o=(m=f-v)-5,r="center"):(i=(g=p-v)-5,r="right")):"leftBottom"===l?(p="horizontal"===t?h[1][0]:h[3][0],f="horizontal"===t?h[1][1]:h[2][1],"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p-v)-5,r="right")):(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="left")),"horizontal"===t?i=g=p:o=m=f,a=[[p,f],[g,m]]}c.label={linePoints:a,x:i,y:o,verticalAlign:"middle",textAlign:r,inside:d}}))}(n)}))}var qE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Wi,n._initialized=!1,n}return l(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._dataGroup,o=e.getData(),a=this._data,s=e.coordinateSystem,l=s.dimensions,u=JE(e);if(o.diff(a).add((function(e){var t=$E(o,i,e,l,s);QE(t,o,e,u)})).update((function(t,n){var r=a.getItemGraphicEl(n),i=KE(o,t,l,s);o.setItemGraphicEl(t,r),Ec(r,{shape:{points:i}},e,t),kc(r),QE(r,o,t,u)})).remove((function(e){var t=a.getItemGraphicEl(e);i.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=function(e,t,n){var r=e.model,i=e.getRect(),o=new tl({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),a="horizontal"===r.get("layout")?"width":"height";return o.setShape(a,0),Lc(o,{shape:{width:i.width,height:i.height}},t,n),o}(s,e,(function(){setTimeout((function(){i.removeClipPath()}))}));i.setClipPath(c)}this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var r=t.getData(),i=t.coordinateSystem,o=i.dimensions,a=JE(t),s=this._progressiveEls=[],l=e.start;l<e.end;l++){var u=$E(r,this._dataGroup,l,o,i);u.incremental=!0,QE(u,r,l,a),s.push(u)}},t.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},t.type="parallel",t}(Kg);function KE(e,t,n,r){for(var i,o=[],a=0;a<n.length;a++){var s=n[a],l=e.get(e.mapDimension(s),t);i=l,("category"===r.getAxis(s).type?null==i:null==i||isNaN(i))||o.push(r.dataToPoint(l,s))}return o}function $E(e,t,n,r,i){var o=KE(e,n,r,i),a=new ac({shape:{points:o},z2:10});return t.add(a),e.setItemGraphicEl(n,a),a}function JE(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),ce(t=xo(t))&&(t=0),{smooth:t}}function QE(e,t,n,r){e.useStyle(t.getItemVisual(n,"style")),e.style.fill=null,e.setShape("smooth",r.smooth);var i=t.getItemModel(n),o=i.getModel("emphasis");cu(e,i,"lineStyle"),au(e,o.get("focus"),o.get("blurScope"),o.get("disabled"))}var eL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return l(t,e),t.prototype.getInitialData=function(e,t){return G_(null,this,{useEncodeDefaulter:K(tL,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),r=[];return t.eachActiveState(n,(function(t,i){e===t&&r.push(n.getRawIndex(i))})),r},t.type="series.parallel",t.dependencies=["parallel"],t.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},t}(Vg);function tL(e){var t=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(t){var n={};return W(t.dimensions,(function(e){var t=+e.replace("dim","");n[e]=t})),n}}var nL=["lineStyle","opacity"],rL={seriesType:"parallel",reset:function(e,t){var n=e.coordinateSystem,r={normal:e.get(["lineStyle","opacity"]),active:e.get("activeOpacity"),inactive:e.get("inactiveOpacity")};return{progress:function(e,t){n.eachActiveState(t,(function(e,n){var i=r[e];if("normal"===e&&t.hasItemOption){var o=t.getItemModel(n).get(nL,!0);null!=o&&(i=o)}t.ensureUniqueItemVisual(n,"style").opacity=i}),e.start,e.end)}}}};function iL(e){!function(e){if(e.parallel)return;var t=!1;W(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=zo(e.parallelAxis);W(t,(function(t){if(re(t)){var n=t.parallelIndex||0,r=zo(e.parallel)[n];r&&r.parallelAxisDefault&&R(t,r.parallelAxisDefault,!1)}}))}(e)}var oL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},W(aL,(function(e,t){n.getZr().on(t,this._handlers[t]=K(e,this))}),this)),am(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},t.prototype.dispose=function(e,t){sm(this,"_throttledDispatchExpand"),W(this._handlers,(function(e,n){t.getZr().off(n,e)})),this._handlers=null},t.prototype._throttledDispatchExpand=function(e){this._dispatchExpand(e)},t.prototype._dispatchExpand=function(e){e&&this._api.dispatchAction(z({type:"parallelAxisExpand"},e))},t.type="parallel",t}(Xg),aL={mousedown:function(e){sL(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(sL(this,"click")&&t){var n=[e.offsetX,e.offsetY];if(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)>5)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&sL(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),r=n.behavior;"jump"===r&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===r?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===r?null:{duration:0}})}}};function sL(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}var lL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&R(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get("parallelIndex");return null!=n&&t.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){W(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];W(Y(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this),(function(n){e.push("dim"+n.get("dim")),t.push(n.componentIndex)}))},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}($d),uL=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.type=i||"value",a.axisIndex=o,a}return l(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(Eb);function cL(e,t,n,r,i,o){e=e||0;var a=n[1]-n[0];if(null!=i&&(i=dL(i,[0,a])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var s=Math.abs(t[1]-t[0]);s=dL(s,[0,a]),i=o=dL(s,[i,o]),r=0}t[0]=dL(t[0],n),t[1]=dL(t[1],n);var l=hL(t,r);t[r]+=e;var u,c=i||0,h=n.slice();return l.sign<0?h[0]+=c:h[1]-=c,t[r]=dL(t[r],h),u=hL(t,r),null!=i&&(u.sign!==l.sign||u.span<i)&&(t[1-r]=t[r]+l.sign*i),u=hL(t,r),null!=o&&u.span>o&&(t[1-r]=t[r]+u.sign*o),t}function hL(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function dL(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var pL=W,fL=Math.min,gL=Math.max,mL=Math.floor,vL=Math.ceil,yL=no,_L=Math.PI,xL=function(){function e(e,t,n){this.type="parallel",this._axesMap=Te(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=e.dimensions,i=e.parallelAxisIndex;pL(r,(function(e,n){var r=i[n],o=t.getComponent("parallelAxis",r),a=this._axesMap.set(e,new uL(e,Hx(o),[0,0],o.get("type"),r)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,r=t.layoutBase,i=t.pixelDimIndex,o=e[1-i],a=e[i];return o>=n&&o<=n+t.axisLength&&a>=r&&a<=r+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var r=n.getData();pL(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(r,r.mapDimension(e)),Gx(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,r=["x","y"],i=["width","height"],o=t.get("layout"),a="horizontal"===o?0:1,s=n[i[a]],l=[0,s],u=this.dimensions.length,c=bL(t.get("axisExpandWidth"),l),h=bL(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,p=t.get("axisExpandWindow");p?(e=bL(p[1]-p[0],l),p[1]=p[0]+e):(e=bL(c*(h-1),l),(p=[c*(t.get("axisExpandCenter")||mL(u/2))-e/2])[1]=p[0]+e);var f=(s-e)/(u-h);f<3&&(f=0);var g=[mL(yL(p[0]/c,1))+1,vL(yL(p[1]/c,1))-1],m=f/c*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[r[a]],layoutLength:s,axisBase:n[r[1-a]],axisLength:n[i[1-a]],axisExpandable:d,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;t.each((function(e){var t=[0,r.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),pL(n,(function(t,n){var o=(r.axisExpandable?SL:wL)(n,r),a={horizontal:{x:o.position,y:r.axisLength},vertical:{x:0,y:o.position}},s={horizontal:_L/2,vertical:0},l=[a[i].x+e.x,a[i].y+e.y],u=s[i],c=[1,0,0,1,0,0];Lt(c,c,u),Et(c,c,l),this._axesLayout[t]={position:l,rotation:u,transform:c,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,r){null==n&&(n=0),null==r&&(r=e.count());var i=this._axesMap,o=this.dimensions,a=[],s=[];W(o,(function(t){a.push(e.mapDimension(t)),s.push(i.get(t).model)}));for(var l=this.hasAxisBrushed(),u=n;u<r;u++){var c=void 0;if(l){c="active";for(var h=e.getValues(a,u),d=0,p=o.length;d<p;d++){if("inactive"===s[d].getActiveState(h[d])){c="inactive";break}}}else c="normal";t(c,u)}},e.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,n=!1,r=0,i=e.length;r<i;r++)"normal"!==t.get(e[r]).model.getActiveState()&&(n=!0);return n},e.prototype.axisCoordToPoint=function(e,t){return Qc([e,0],this._axesLayout[t].transform)},e.prototype.getAxisLayout=function(e){return O(this._axesLayout[e])},e.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),n=t.pixelDimIndex,r=t.axisExpandWindow.slice(),i=r[1]-r[0],o=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:r};var a,s=e[n]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),h=null!=c[0];if(u)h&&u&&s<i*c[0]?(l="jump",a=s-i*c[2]):h&&u&&s>i*(1-c[0])?(l="jump",a=s-i*(1-c[2])):(a=s-i*c[1])>=0&&(a=s-i*(1-c[1]))<=0&&(a=0),(a*=t.axisExpandWidth/u)?cL(a,r,o,"all"):l="none";else{var d=r[1]-r[0];(r=[gL(0,o[1]*s/d-d/2)])[1]=fL(o[1],r[0]+d),r[0]=r[1]-d}return{axisExpandWindow:r,behavior:l}},e}();function bL(e,t){return fL(gL(e,t[0]),t[1])}function wL(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function SL(e,t){var n,r,i=t.layoutLength,o=t.axisExpandWidth,a=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,c=!1;return e<l[0]?(n=e*s,r=s):e<=l[1]?(n=t.axisExpandWindow0Pos+e*o-t.axisExpandWindow[0],u=o,c=!0):(n=i-(a-1-e)*s,r=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:r}}var TL={create:function(e,t){var n=[];return e.eachComponent("parallel",(function(r,i){var o=new xL(r,e,t);o.name="parallel_"+i,o.resize(r,t),r.coordinateSystem=o,o.model=r,n.push(o)})),e.eachSeries((function(e){if("parallel"===e.get("coordinateSystem")){var t=e.getReferringComponents("parallel",ta).models[0];e.coordinateSystem=t.coordinateSystem}})),n}},ML=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.activeIntervals=[],n}return l(t,e),t.prototype.getAreaSelectStyle=function(){return ma([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},t.prototype.setActiveIntervals=function(e){var t=this.activeIntervals=O(e);if(t)for(var n=t.length-1;n>=0;n--)ro(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var r=0,i=t.length;r<i;r++)if(t[r][0]<=e&&e<=t[r][1])return"active";return"inactive"},t}($d);H(ML,qx);var CL=!0,DL=Math.min,AL=Math.max,IL=Math.pow,EL="globalPan",LL={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},NL={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},PL={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},OL=0,RL=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},"production"!==process.env.NODE_ENV&&me(t),n._zr=t,n.group=new Wi,n._uid="brushController_"+OL++,W(lN,(function(e,t){this._handlers[t]=K(e,this)}),n),n}return l(t,e),t.prototype.enableBrush=function(e){return"production"!==process.env.NODE_ENV&&me(this._mounted),this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||function(e,t,n){DC(e)[t]=n}(t,EL,this._uid),W(this._handlers,(function(e,n){t.on(n,e)})),this._brushType=e.brushType,this._brushOption=R(O(PL),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;!function(e,t,n){var r=DC(e);r[t]===n&&(r[t]=null)}(e,EL,this._uid),W(this._handlers,(function(t,n){e.off(n,t)})),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};W(e,(function(e){t[e.panelId]=O(e)}))}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},"production"!==process.env.NODE_ENV&&(this._mounted=!0),this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){"production"!==process.env.NODE_ENV&&me(this._mounted),e=j(e,(function(e){return R(O(PL),e,!0)}));var t=this._covers,n=this._covers=[],r=this,i=this._creatingCover;return new s_(t,e,(function(e,t){return o(e.__brushOption,t)}),o).add(a).update(a).remove((function(e){t[e]!==i&&r.group.remove(t[e])})).execute(),this;function o(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function a(o,a){var s=e[o];if(null!=a&&t[a]===i)n[o]=t[a];else{var l=n[o]=null!=a?(t[a].__brushOption=s,t[a]):zL(r,kL(r,s));FL(r,l)}}},t.prototype.unmount=function(){if("production"===process.env.NODE_ENV||this._mounted)return this.enableBrush(!1),WL(this),this._zr.remove(this.group),"production"!==process.env.NODE_ENV&&(this._mounted=!1),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(nt);function kL(e,t){var n=cN[t.brushType].createCover(e,t);return n.__brushOption=t,BL(n,t),e.group.add(n),n}function zL(e,t){var n=GL(t);return n.endCreating&&(n.endCreating(e,t),BL(t,t.__brushOption)),t}function VL(e,t){var n=t.__brushOption;GL(t).updateCoverShape(e,t,n.range,n)}function BL(e,t){var n=t.z;null==n&&(n=1e4),e.traverse((function(e){e.z=n,e.z2=n}))}function FL(e,t){GL(t).updateCommon(e,t),VL(e,t)}function GL(e){return cN[e.__brushOption.brushType]}function HL(e,t,n){var r,i=e._panels;if(!i)return CL;var o=e._transform;return W(i,(function(e){e.isTargetByCursor(t,n,o)&&(r=e)})),r}function UL(e,t){var n=e._panels;if(!n)return CL;var r=t.__brushOption.panelId;return null!=r?n[r]:CL}function WL(e){var t=e._covers,n=t.length;return W(t,(function(t){e.group.remove(t)}),e),t.length=0,!!n}function jL(e,t){var n=j(e._covers,(function(e){var t=e.__brushOption,n=O(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}}));e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function XL(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function YL(e,t,n,r){var i=new Wi;return i.add(new tl({name:"main",style:$L(n),silent:!0,draggable:!0,cursor:"move",drift:$(eN,e,t,i,["n","s","w","e"]),ondragend:$(jL,t,{isEnd:!0})})),W(r,(function(n){i.add(new tl({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:$(eN,e,t,i,n),ondragend:$(jL,t,{isEnd:!0})}))})),i}function ZL(e,t,n,r){var i=r.brushStyle.lineWidth||0,o=AL(i,6),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,c=n[0][1],h=n[1][1],d=c-o+i/2,p=h-o+i/2,f=c-a,g=h-s,m=f+i,v=g+i;KL(e,t,"main",a,s,f,g),r.transformable&&(KL(e,t,"w",l,u,o,v),KL(e,t,"e",d,u,o,v),KL(e,t,"n",l,u,m,o),KL(e,t,"s",l,p,m,o),KL(e,t,"nw",l,u,o,o),KL(e,t,"ne",d,u,o,o),KL(e,t,"sw",l,p,o,o),KL(e,t,"se",d,p,o,o))}function qL(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle($L(n)),i.attr({silent:!r,cursor:r?"move":"default"}),W([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var i=t.childOfName(n.join("")),o=1===n.length?QL(e,n[0]):function(e,t){var n=[QL(e,t[0]),QL(e,t[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?NL[o]+"-resize":null})}))}function KL(e,t,n,r,i,o,a){var s=t.childOfName(n);s&&s.setShape(function(e){var t=DL(e[0][0],e[1][0]),n=DL(e[0][1],e[1][1]),r=AL(e[0][0],e[1][0]),i=AL(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}(rN(e,t,[[r,i],[r+o,i+a]])))}function $L(e){return V({strokeNoScale:!0},e.brushStyle)}function JL(e,t,n,r){var i=[DL(e,n),DL(t,r)],o=[AL(e,n),AL(t,r)];return[[i[0],o[0]],[i[1],o[1]]]}function QL(e,t){var n=eh({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return Jc(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function eN(e,t,n,r,i,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=nN(t,i,o);W(r,(function(e){var t=LL[e];s[t[0]][t[1]]+=l[t[0]]})),a.range=e.fromRectRange(JL(s[0][0],s[1][0],s[0][1],s[1][1])),FL(t,n),jL(t,{isEnd:!1})}function tN(e,t,n,r){var i=t.__brushOption.range,o=nN(e,n,r);W(i,(function(e){e[0]+=o[0],e[1]+=o[1]})),FL(e,t),jL(e,{isEnd:!1})}function nN(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function rN(e,t,n){var r=UL(e,t);return r&&r!==CL?r.clipPath(n,e._transform):O(n)}function iN(e){var t=e.event;t.preventDefault&&t.preventDefault()}function oN(e,t,n){return e.childOfName("main").contain(t,n)}function aN(e,t,n,r){var i,o=e._creatingCover,a=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],o=n[1]-r[1];return IL(i*i+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&WL(e);var l=O(s);l.brushType=sN(l.brushType,a),l.panelId=a===CL?null:a.panelId,o=e._creatingCover=kL(e,l),e._covers.push(o)}if(o){var u=cN[sN(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(rN(e,o,e._track)),r&&(zL(e,o),u.updateCommon(e,o)),VL(e,o),i={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&HL(e,t,n)&&WL(e)&&(i={isEnd:r,removeOnClick:!0});return i}function sN(e,t){return"auto"===e?("production"!==process.env.NODE_ENV&&me(t&&t.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),t.defaultBrushType):e}var lN={mousedown:function(e){if(this._dragging)uN(this,e);else if(!e.target||!e.target.draggable){iN(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=HL(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(function(e,t,n){if(e._brushType&&!function(e,t,n){var r=e._zr;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}(e,t.offsetX,t.offsetY)){var r=e._zr,i=e._covers,o=HL(e,t,n);if(!e._dragging)for(var a=0;a<i.length;a++){var s=i[a].__brushOption;if(o&&(o===CL||s.panelId===o.panelId)&&cN[s.brushType].contain(i[a],n[0],n[1]))return}o&&r.setCursorStyle("crosshair")}}(this,e,r),this._dragging){iN(e);var i=aN(this,e,r,!1);i&&jL(this,i)}},mouseup:function(e){uN(this,e)}};function uN(e,t){if(e._dragging){iN(t);var n=t.offsetX,r=t.offsetY,i=e.group.transformCoordToLocal(n,r),o=aN(e,t,i,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&jL(e,o)}}var cN={lineX:hN(0),lineY:hN(1),rect:{createCover:function(e,t){function n(e){return e}return YL({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=XL(e);return JL(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){ZL(e,t,n,r)},updateCommon:qL,contain:oN},polygon:{createCover:function(e,t){var n=new Wi;return n.add(new ac({name:"main",style:$L(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new ic({name:"main",draggable:!0,drift:$(tN,e,t),ondragend:$(jL,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:rN(e,t,n)})},updateCommon:qL,contain:oN}};function hN(e){return{createCover:function(t,n){return YL({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=XL(t);return[DL(n[0][e],n[1][e]),AL(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var o,a=UL(t,n);if(a!==CL&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(e);else{var s=t._zr;o=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[r,o];e&&l.reverse(),ZL(t,n,l,i)},updateCommon:qL,contain:oN}}function dN(e){return e=gN(e),function(t){return rh(t,e)}}function pN(e,t){return e=gN(e),function(n){var r=null!=t?t:n,i=r?e.width:e.height,o=r?e.x:e.y;return[o,o+(i||0)]}}function fN(e,t,n){var r=gN(e);return function(e,i){return r.contain(i[0],i[1])&&!kC(e,t,n)}}function gN(e){return jt.create(e)}var mN=["axisLine","axisTickLabel","axisName"],vN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new RL(n.getZr())).on("brush",K(this._onBrush,this))},t.prototype.render=function(e,t,n,r){if(!function(e,t,n){return n&&"axisAreaSelect"===n.type&&t.findComponents({mainType:"parallelAxis",query:n})[0]===e}(e,t,r)){this.axisModel=e,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new Wi,this.group.add(this._axisGroup),e.get("show")){var o=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),a=o.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,c=z({strokeContainThreshold:l},a.getAxisLayout(u)),h=new FM(e,c);W(mN,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,e,o,l,n),nh(i,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,r,i,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=jt.create({x:a[0],y:-i/2,width:s,height:i});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:"pl",clipPath:dN(u),isTargetByCursor:fN(u,o,r),getLinearBrushOtherExtent:pN(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return j(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,r=n.axis,i=j(t,(function(e){return[r.coordToData(e.range[0],!0),r.coordToData(e.range[1],!0)]}));(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:i})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(Xg);var yN={type:"axisAreaSelect",event:"axisAreaSelected"};var _N={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function xN(e){e.registerComponentView(oL),e.registerComponentModel(lL),e.registerCoordinateSystem("parallel",TL),e.registerPreprocessor(iL),e.registerComponentModel(ML),e.registerComponentView(vN),SM(e,"parallel",ML,_N),function(e){e.registerAction(yN,(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),e.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}))}(e)}var bN=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},wN=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new bN},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){Xl(this)},t.prototype.downplay=function(){Yl(this)},t}(Us),SN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return l(t,e),t.prototype.render=function(e,t,n){var r=this,i=e.getGraph(),o=this.group,a=e.layoutInfo,s=a.width,l=a.height,u=e.getData(),c=e.getData("edge"),h=e.get("orient");this._model=e,o.removeAll(),o.x=a.x,o.y=a.y,i.eachEdge((function(t){var n=new wN,r=vl(n);r.dataIndex=t.dataIndex,r.seriesIndex=e.seriesIndex,r.dataType="edge";var i,a,u,d,p,f,g,m,v=t.getModel(),y=v.getModel("lineStyle"),_=y.get("curveness"),x=t.node1.getLayout(),b=t.node1.getModel(),w=b.get("localX"),S=b.get("localY"),T=t.node2.getLayout(),M=t.node2.getModel(),C=M.get("localX"),D=M.get("localY"),A=t.getLayout();n.shape.extent=Math.max(1,A.dy),n.shape.orient=h,"vertical"===h?(i=(null!=w?w*s:x.x)+A.sy,a=(null!=S?S*l:x.y)+x.dy,u=(null!=C?C*s:T.x)+A.ty,p=i,f=a*(1-_)+(d=null!=D?D*l:T.y)*_,g=u,m=a*_+d*(1-_)):(i=(null!=w?w*s:x.x)+x.dx,a=(null!=S?S*l:x.y)+A.sy,p=i*(1-_)+(u=null!=C?C*s:T.x)*_,f=a,g=i*_+u*(1-_),m=d=(null!=D?D*l:T.y)+A.ty),n.setShape({x1:i,y1:a,x2:u,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(y.getItemStyle()),TN(n.style,h,t);var I=""+v.get("value"),E=vh(v,"edgeLabel");mh(n,E,{labelFetcher:{getFormattedLabel:function(t,n,r,i,o,a){return e.getFormattedLabel(t,n,"edge",i,pe(o,E.normal&&E.normal.get("formatter"),I),a)}},labelDataIndex:t.dataIndex,defaultText:I}),n.setTextConfig({position:"inside"});var L=v.getModel("emphasis");cu(n,v,"lineStyle",(function(e){var n=e.getItemStyle();return TN(n,h,t),n})),o.add(n),c.setItemGraphicEl(t.dataIndex,n);var N=L.get("focus");au(n,"adjacency"===N?t.getAdjacentDataIndices():"trajectory"===N?t.getTrajectoryDataIndices():N,L.get("blurScope"),L.get("disabled"))})),i.eachNode((function(t){var n=t.getLayout(),r=t.getModel(),i=r.get("localX"),a=r.get("localY"),c=r.getModel("emphasis"),h=r.get(["itemStyle","borderRadius"])||0,d=new tl({shape:{x:null!=i?i*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy,r:h},style:r.getModel("itemStyle").getItemStyle(),z2:10});mh(d,vh(r),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(t,n,"node")}},labelDataIndex:t.dataIndex,defaultText:t.id}),d.disableLabelAnimation=!0,d.setStyle("fill",t.getVisual("color")),d.setStyle("decal",t.getVisual("style").decal),cu(d,r),o.add(d),u.setItemGraphicEl(t.dataIndex,d),vl(d).dataType="node";var p=c.get("focus");au(d,"adjacency"===p?t.getAdjacentDataIndices():"trajectory"===p?t.getTrajectoryDataIndices():p,c.get("blurScope"),c.get("disabled"))})),u.eachItemGraphicEl((function(t,i){u.getItemModel(i).get("draggable")&&(t.drift=function(t,o){r._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(i),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){r._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&o.setClipPath(function(e,t,n){var r=new tl({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Lc(r,{shape:{width:e.width+20}},t,n),r}(o.getBoundingRect(),e,(function(){o.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(Kg);function TN(e,t,n){switch(e.fill){case"source":e.fill=n.node1.getVisual("color"),e.decal=n.node1.getVisual("style").decal;break;case"target":e.fill=n.node2.getVisual("color"),e.decal=n.node2.getVisual("style").decal;break;case"gradient":var r=n.node1.getVisual("color"),i=n.node2.getVisual("color");ee(r)&&ee(i)&&(e.fill=new yc(0,0,+("horizontal"===t),+("vertical"===t),[{color:r,offset:0},{color:i,offset:1}]))}}var MN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=e.levels||[];this.levelModels=[];for(var o=this.levelModels,a=0;a<i.length;a++)if(null!=i[a].depth&&i[a].depth>=0)o[i[a].depth]=new Fh(i[a],this,t);else if("production"!==process.env.NODE_ENV)throw new Error("levels[i].depth is mandatory and should be natural number");var s=kE(r,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,r=n.getData().getItemLayout(t);if(r){var i=r.depth,o=n.levelModels[i];o&&(e.parentModel=o)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,r=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(r){var i=r.depth,o=n.levelModels[i];o&&(e.parentModel=o)}return e}))}));return s.data},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function r(e){return isNaN(e)||null==e}if("edge"===n){var i=this.getDataParams(e,n),o=i.data,a=i.value;return wg("nameValue",{name:o.source+" -- "+o.target,value:a,noValue:r(a)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,l=this.getDataParams(e,n).data.name;return wg("nameValue",{name:null!=l?l+"":null,value:s,noValue:r(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);if(null==r.value&&"node"===n){var i=this.getGraph().getNodeByIndex(t).getLayout().value;r.value=i}return r},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(Vg);function CN(e,t){e.eachSeriesByType("sankey",(function(e){var n=e.get("nodeWidth"),r=e.get("nodeGap"),i=function(e,t){return Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=i;var o=i.width,a=i.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){W(e,(function(e){var t=kN(e.outEdges,RN),n=kN(e.inEdges,RN),r=e.getValue()||0,i=Math.max(t,n,r);e.setLayout({value:i},!0)}))}(l);var c=Y(l,(function(e){return 0===e.getLayout().value}));!function(e,t,n,r,i,o,a,s,l){(function(e,t,n,r,i,o,a){for(var s=[],l=[],u=[],c=[],h=0,d=0;d<t.length;d++)s[d]=1;for(d=0;d<e.length;d++)l[d]=e[d].inEdges.length,0===l[d]&&u.push(e[d]);var p=-1;for(;u.length;){for(var f=0;f<u.length;f++){var g=u[f],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:h},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var y=0;y<g.outEdges.length;y++){var _=g.outEdges[y];s[t.indexOf(_)]=0;var x=_.node2;0==--l[e.indexOf(x)]&&c.indexOf(x)<0&&c.push(x)}}++h,u=c,c=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var b=p>h-1?p:h-1;a&&"left"!==a&&function(e,t,n,r){if("right"===t){for(var i=[],o=e,a=0;o.length;){for(var s=0;s<o.length;s++){var l=o[s];l.setLayout({skNodeHeight:a},!0);for(var u=0;u<l.inEdges.length;u++){var c=l.inEdges[u];i.indexOf(c.node1)<0&&i.push(c.node1)}}o=i,i=[],++a}W(e,(function(e){DN(e)||e.setLayout({depth:Math.max(0,r-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){W(e,(function(e){DN(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,r)}(e,a,0,b);var w="vertical"===o?(i-n)/b:(r-n)/b;!function(e,t,n){W(e,(function(e){var r=e.getLayout().depth*t;"vertical"===n?e.setLayout({y:r},!0):e.setLayout({x:r},!0)}))}(e,w,o)})(e,t,n,i,o,s,l),function(e,t,n,r,i,o,a){var s=function(e,t){var n=[],r="vertical"===t?"y":"x",i=oa(e,(function(e){return e.getLayout()[r]}));return i.keys.sort((function(e,t){return e-t})),W(i.keys,(function(e){n.push(i.buckets.get(e))})),n}(e,a);(function(e,t,n,r,i,o){var a=1/0;W(e,(function(e){var t=e.length,s=0;W(e,(function(e){s+=e.getLayout().value}));var l="vertical"===o?(r-(t-1)*i)/s:(n-(t-1)*i)/s;l<a&&(a=l)})),W(e,(function(e){W(e,(function(e,t){var n=e.getLayout().value*a;"vertical"===o?(e.setLayout({x:t},!0),e.setLayout({dx:n},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:n},!0))}))})),W(t,(function(e){var t=+e.getValue()*a;e.setLayout({dy:t},!0)}))})(s,t,n,r,i,a),AN(s,i,n,r,a);for(var l=1;o>0;o--)IN(s,l*=.99,a),AN(s,i,n,r,a),zN(s,l,a),AN(s,i,n,r,a)}(e,t,o,i,r,a,s),function(e,t){var n="vertical"===t?"x":"y";W(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[n]-t.node2.getLayout()[n]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[n]-t.node1.getLayout()[n]}))})),W(e,(function(e){var t=0,n=0;W(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),W(e.inEdges,(function(e){e.setLayout({ty:n},!0),n+=e.getLayout().dy}))}))}(e,s)}(l,u,n,r,o,a,0!==c.length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function DN(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function AN(e,t,n,r,i){var o="vertical"===i?"x":"y";W(e,(function(e){var a,s,l;e.sort((function(e,t){return e.getLayout()[o]-t.getLayout()[o]}));for(var u=0,c=e.length,h="vertical"===i?"dx":"dy",d=0;d<c;d++)(l=u-(s=e[d]).getLayout()[o])>0&&(a=s.getLayout()[o]+l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[h]+t;if((l=u-t-("vertical"===i?r:n))>0){a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(d=c-2;d>=0;--d)(l=(s=e[d]).getLayout()[o]+s.getLayout()[h]+t-u)>0&&(a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function IN(e,t,n){W(e.slice().reverse(),(function(e){W(e,(function(e){if(e.outEdges.length){var r=kN(e.outEdges,EN,n)/kN(e.outEdges,RN);if(isNaN(r)){var i=e.outEdges.length;r=i?kN(e.outEdges,LN,n)/i:0}if("vertical"===n){var o=e.getLayout().x+(r-ON(e,n))*t;e.setLayout({x:o},!0)}else{var a=e.getLayout().y+(r-ON(e,n))*t;e.setLayout({y:a},!0)}}}))}))}function EN(e,t){return ON(e.node2,t)*e.getValue()}function LN(e,t){return ON(e.node2,t)}function NN(e,t){return ON(e.node1,t)*e.getValue()}function PN(e,t){return ON(e.node1,t)}function ON(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function RN(e){return e.getValue()}function kN(e,t,n){for(var r=0,i=e.length,o=-1;++o<i;){var a=+t(e[o],n);isNaN(a)||(r+=a)}return r}function zN(e,t,n){W(e,(function(e){W(e,(function(e){if(e.inEdges.length){var r=kN(e.inEdges,NN,n)/kN(e.inEdges,RN);if(isNaN(r)){var i=e.inEdges.length;r=i?kN(e.inEdges,PN,n)/i:0}if("vertical"===n){var o=e.getLayout().x+(r-ON(e,n))*t;e.setLayout({x:o},!0)}else{var a=e.getLayout().y+(r-ON(e,n))*t;e.setLayout({y:a},!0)}}}))}))}function VN(e){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph(),n=t.nodes,r=t.edges;if(n.length){var i=1/0,o=-1/0;W(n,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>o&&(o=t)})),W(n,(function(t){var n=new rI({type:"color",mappingMethod:"linear",dataExtent:[i,o],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),r=t.getModel().get(["itemStyle","color"]);null!=r?(t.setVisual("color",r),t.setVisual("style",{fill:r})):(t.setVisual("color",n),t.setVisual("style",{fill:n}))}))}r.length&&W(r,(function(e){var t=e.getModel().get("lineStyle");e.setVisual("style",t)}))}))}var BN=function(){function e(){}return e.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&null!=t.get(e)},e.prototype.getInitialData=function(e,t){var n,r,i=t.getComponent("xAxis",this.get("xAxisIndex")),o=t.getComponent("yAxis",this.get("yAxisIndex")),a=i.get("type"),s=o.get("type");"category"===a?(e.layout="horizontal",n=i.getOrdinalMeta(),r=!this._hasEncodeRule("x")):"category"===s?(e.layout="vertical",n=o.getOrdinalMeta(),r=!this._hasEncodeRule("y")):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],d=[i,o],p=d[u].get("type"),f=d[1-u].get("type"),g=e.data;if(g&&r){var m=[];W(g,(function(e,t){var n;J(e)?(n=e.slice(),e.unshift(t)):J(e.value)?((n=z({},e)).value=n.value.slice(),e.value.unshift(t)):n=e,m.push(n)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:c,type:c_(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:c_(f),dimsDef:v.slice()}];return sM(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:$(fp,y,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),FN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return l(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(Vg);H(FN,BN,!0);var GN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this.group,o=this._data;this._data||i.removeAll();var a="horizontal"===e.get("layout")?1:0;r.diff(o).add((function(e){if(r.hasValue(e)){var t=WN(r.getItemLayout(e),r,e,a,!0);r.setItemGraphicEl(e,t),i.add(t)}})).update((function(e,t){var n=o.getItemGraphicEl(t);if(r.hasValue(e)){var s=r.getItemLayout(e);n?(kc(n),jN(s,n,r,e)):n=WN(s,r,e,a),i.add(n),r.setItemGraphicEl(e,n)}else i.remove(n)})).remove((function(e){var t=o.getItemGraphicEl(e);t&&i.remove(t)})).execute(),this._data=r},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot",t}(Kg),HN=function(){},UN=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return l(t,e),t.prototype.getDefaultShape=function(){return new HN},t.prototype.buildPath=function(e,t){var n=t.points,r=0;for(e.moveTo(n[r][0],n[r][1]),r++;r<4;r++)e.lineTo(n[r][0],n[r][1]);for(e.closePath();r<n.length;r++)e.moveTo(n[r][0],n[r][1]),r++,e.lineTo(n[r][0],n[r][1])},t}(Us);function WN(e,t,n,r,i){var o=e.ends,a=new UN({shape:{points:i?XN(o,r,e):o}});return jN(e,a,t,n,i),a}function jN(e,t,n,r,i){var o=n.hostModel;(0,dh[i?"initProps":"updateProps"])(t,{shape:{points:e.ends}},o,r),t.useStyle(n.getItemVisual(r,"style")),t.style.strokeNoScale=!0,t.z2=100;var a=n.getItemModel(r),s=a.getModel("emphasis");cu(t,a),au(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function XN(e,t,n){return j(e,(function(e){return(e=e.slice())[t]=n.initBaseline,e}))}var YN=W;function ZN(e){var t=function(e){var t=[],n=[];return e.eachSeriesByType("boxplot",(function(e){var r=e.getBaseAxis(),i=F(n,r);i<0&&(i=n.length,n[i]=r,t[i]={axis:r,seriesModels:[]}),t[i].seriesModels.push(e)})),t}(e);YN(t,(function(e){var t=e.seriesModels;t.length&&(!function(e){var t,n=e.axis,r=e.seriesModels,i=r.length,o=e.boxWidthList=[],a=e.boxOffsetList=[],s=[];if("category"===n.type)t=n.getBandWidth();else{var l=0;YN(r,(function(e){l=Math.max(l,e.getData().count())}));var u=n.getExtent();t=Math.abs(u[1]-u[0])/l}YN(r,(function(e){var n=e.get("boxWidth");J(n)||(n=[n,n]),s.push([to(n[0],t)||0,to(n[1],t)||0])}));var c=.8*t-2,h=c/i*.3,d=(c-h*(i-1))/i,p=d/2-c/2;YN(r,(function(e,t){a.push(p),p+=h+d,o.push(Math.min(Math.max(d,s[t][0]),s[t][1]))}))}(e),YN(t,(function(t,n){!function(e,t,n){var r=e.coordinateSystem,i=e.getData(),o=n/2,a="horizontal"===e.get("layout")?0:1,s=1-a,l=["x","y"],u=i.mapDimension(l[a]),c=i.mapDimensionsAll(l[s]);if(null==u||c.length<5)return;for(var h=0;h<i.count();h++){var d=i.get(u,h),p=_(d,c[2],h),f=_(d,c[0],h),g=_(d,c[1],h),m=_(d,c[3],h),v=_(d,c[4],h),y=[];x(y,g,!1),x(y,m,!0),y.push(f,g,v,m),b(y,f),b(y,v),b(y,p),i.setItemLayout(h,{initBaseline:p[s],ends:y})}function _(e,n,o){var l,u=i.get(n,o),c=[];return c[a]=e,c[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=r.dataToPoint(c))[a]+=t,l}function x(e,t,n){var r=t.slice(),i=t.slice();r[a]+=o,i[a]-=o,n?e.push(r,i):e.push(i,r)}function b(e,t){var n=t.slice(),r=t.slice();n[a]-=o,r[a]+=o,e.push(n,r)}}(t,e.boxOffsetList[n],e.boxWidthList[n])})))}))}var qN={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==rp){var n="";"production"!==process.env.NODE_ENV&&(n=No("source data is not applicable for this boxplot transform. Expect number[][].")),Po(n)}var r=function(e,t){for(var n=[],r=[],i=(t=t||{}).boundIQR,o="none"===i||0===i,a=0;a<e.length;a++){var s=ro(e[a].slice()),l=yo(s,.25),u=yo(s,.5),c=yo(s,.75),h=s[0],d=s[s.length-1],p=(null==i?1.5:i)*(c-l),f=o?h:Math.max(h,l-p),g=o?d:Math.min(d,c+p),m=t.itemNameFormatter,v=Q(m)?m({value:a}):ee(m)?m.replace("{value}",a+""):a+"";n.push([v,f,l,u,c,g]);for(var y=0;y<s.length;y++){var _=s[y];if(_<f||_>g){var x=[v,_];r.push(x)}}}return{boxData:n,outliers:r}}(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:r.boxData},{data:r.outliers}]}};var KN=["itemStyle","borderColor"],$N=["itemStyle","borderColor0"],JN=["itemStyle","borderColorDoji"],QN=["itemStyle","color"],eP=["itemStyle","color0"];function tP(e,t){return t.get(e>0?QN:eP)}function nP(e,t){return t.get(0===e?JN:e>0?KN:$N)}var rP={seriesType:"candlestick",plan:Yg(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var n;null!=(n=e.next());){var r=t.getItemModel(n),i=t.getItemLayout(n).sign,o=r.getItemStyle();o.fill=tP(i,r),o.stroke=nP(i,r)||o.fill,z(t.ensureUniqueItemVisual(n,"style"),o)}}}}},iP=["color","borderColor"],oP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,r){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype.eachRendered=function(e){hh(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,r=this.group,i=t.getLayout("isSimpleBox"),o=e.get("clip",!0),a=e.coordinateSystem,s=a.getArea&&a.getArea();this._data||r.removeAll(),t.diff(n).add((function(n){if(t.hasValue(n)){var a=t.getItemLayout(n);if(o&&uP(s,a))return;var l=lP(a,n,!0);Lc(l,{shape:{points:a.ends}},e,n),cP(l,t,n,i),r.add(l),t.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(t.hasValue(a)){var c=t.getItemLayout(a);o&&uP(s,c)?r.remove(u):(u?(Ec(u,{shape:{points:c.ends}},e,a),kc(u)):u=lP(c),cP(u,t,a,i),r.add(u),t.setItemGraphicEl(a,u))}else r.remove(u)})).remove((function(e){var t=n.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),fP(e,this.group);var t=e.get("clip",!0)?iT(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n,r=t.getData(),i=r.getLayout("isSimpleBox");null!=(n=e.next());){var o=lP(r.getItemLayout(n));cP(o,r,n,i),o.incremental=!0,this.group.add(o),this._progressiveEls.push(o)}},t.prototype._incrementalRenderLarge=function(e,t){fP(t,this.group,this._progressiveEls,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(Kg),aP=function(){},sP=function(e){function t(t){var n=e.call(this,t)||this;return n.type="normalCandlestickBox",n}return l(t,e),t.prototype.getDefaultShape=function(){return new aP},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(Us);function lP(e,t,n){var r=e.ends;return new sP({shape:{points:n?hP(r,e):r},z2:100})}function uP(e,t){for(var n=!0,r=0;r<t.ends.length;r++)if(e.contain(t.ends[r][0],t.ends[r][1])){n=!1;break}return n}function cP(e,t,n,r){var i=t.getItemModel(n);e.useStyle(t.getItemVisual(n,"style")),e.style.strokeNoScale=!0,e.__simpleBox=r,cu(e,i);var o=t.getItemLayout(n).sign;W(e.states,(function(e,t){var n=i.getModel(t),r=tP(o,n),a=nP(o,n)||r,s=e.style||(e.style={});r&&(s.fill=r),a&&(s.stroke=a)}));var a=i.getModel("emphasis");au(e,a.get("focus"),a.get("blurScope"),a.get("disabled"))}function hP(e,t){return j(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var dP=function(){},pP=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeCandlestickBox",n}return l(t,e),t.prototype.getDefaultShape=function(){return new dP},t.prototype.buildPath=function(e,t){for(var n=t.points,r=0;r<n.length;)if(this.__sign===n[r++]){var i=n[r++];e.moveTo(i,n[r++]),e.lineTo(i,n[r++])}else r+=3},t}(Us);function fP(e,t,n,r){var i=e.getData().getLayout("largePoints"),o=new pP({shape:{points:i},__sign:1,ignoreCoarsePointer:!0});t.add(o);var a=new pP({shape:{points:i},__sign:-1,ignoreCoarsePointer:!0});t.add(a);var s=new pP({shape:{points:i},__sign:0,ignoreCoarsePointer:!0});t.add(s),gP(1,o,e),gP(-1,a,e),gP(0,s,e),r&&(o.incremental=!0,a.incremental=!0),n&&n.push(o,a)}function gP(e,t,n,r){var i=nP(e,n)||tP(e,n),o=n.getModel("itemStyle").getItemStyle(iP);t.useStyle(o),t.style.fill=null,t.style.stroke=i}var mP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return l(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var r=t.getItemLayout(e);return r&&n.rect(r.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(Vg);function vP(e){e&&J(e.series)&&W(e.series,(function(e){re(e)&&"k"===e.type&&(e.type="candlestick")}))}H(mP,BN,!0);var yP={seriesType:"candlestick",plan:Yg(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),r=function(e,t){var n,r=e.getBaseAxis(),i="category"===r.type?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/t.count()),o=to(de(e.get("barMaxWidth"),i),i),a=to(de(e.get("barMinWidth"),1),i),s=e.get("barWidth");return null!=s?to(s,i):Math.max(Math.min(i/2,o),a)}(e,n),i=["x","y"],o=n.getDimensionIndex(n.mapDimension(i[0])),a=j(n.mapDimensionsAll(i[1]),n.getDimensionIndex,n),s=a[0],l=a[1],u=a[2],c=a[3];if(n.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),!(o<0||a.length<4))return{progress:e.pipelineContext.large?function(n,r){var i,a,h=ox(4*n.count),d=0,p=[],f=[],g=r.getStore(),m=!!e.get(["itemStyle","borderColorDoji"]);for(;null!=(a=n.next());){var v=g.get(o,a),y=g.get(s,a),_=g.get(l,a),x=g.get(u,a),b=g.get(c,a);isNaN(v)||isNaN(x)||isNaN(b)?(h[d++]=NaN,d+=3):(h[d++]=_P(g,a,y,_,l,m),p[0]=v,p[1]=x,i=t.dataToPoint(p,null,f),h[d++]=i?i[0]:NaN,h[d++]=i?i[1]:NaN,p[1]=b,i=t.dataToPoint(p,null,f),h[d++]=i?i[1]:NaN)}r.setLayout("largePoints",h)}:function(e,n){var i,a=n.getStore();for(;null!=(i=e.next());){var h=a.get(o,i),d=a.get(s,i),p=a.get(l,i),f=a.get(u,i),g=a.get(c,i),m=Math.min(d,p),v=Math.max(d,p),y=T(m,h),_=T(v,h),x=T(f,h),b=T(g,h),w=[];M(w,_,0),M(w,y,1),w.push(D(b),D(_),D(x),D(y));var S=!!n.getItemModel(i).get(["itemStyle","borderColorDoji"]);n.setItemLayout(i,{sign:_P(a,i,d,p,l,S),initBaseline:d>p?_[1]:y[1],ends:w,brushRect:C(f,g,h)})}function T(e,n){var r=[];return r[0]=n,r[1]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(r)}function M(e,t,n){var i=t.slice(),o=t.slice();i[0]=$c(i[0]+r/2,1,!1),o[0]=$c(o[0]-r/2,1,!0),n?e.push(i,o):e.push(o,i)}function C(e,t,n){var i=T(e,n),o=T(t,n);return i[0]-=r/2,o[0]-=r/2,{x:i[0],y:i[1],width:r,height:o[1]-i[1]}}function D(e){return e[0]=$c(e[0],1),e}}}}};function _P(e,t,n,r,i,o){return n>r?-1:n<r?1:o?0:t>0?e.get(i,t-1)<=r?1:-1:1}function xP(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var bP=function(e){function t(t,n){var r=e.call(this)||this,i=new FS(t,n),o=new Wi;return r.add(i),r.add(o),r.updateData(t,n),r}return l(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,r=e.rippleNumber,i=this.childAt(1),o=0;o<r;o++){var a=lv(t,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-o/r*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scaleX:e.rippleScale/2,scaleY:e.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(s).start(),i.add(a)}xP(i,e)},t.prototype.updateEffectAnimation=function(e){for(var t=this._effectCfg,n=this.childAt(1),r=["symbolType","period","rippleScale","rippleNumber"],i=0;i<r.length;i++){var o=r[i];if(t[o]!==e[o])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}xP(n,e)},t.prototype.highlight=function(){Xl(this)},t.prototype.downplay=function(){Yl(this)},t.prototype.getSymbolType=function(){var e=this.childAt(0);return e&&e.getSymbolType()},t.prototype.updateData=function(e,t){var n=this,r=e.hostModel;this.childAt(0).updateData(e,t);var i=this.childAt(1),o=e.getItemModel(t),a=e.getItemVisual(t,"symbol"),s=uv(e.getItemVisual(t,"symbolSize")),l=e.getItemVisual(t,"style"),u=l&&l.fill,c=o.getModel("emphasis");i.setScale(s),i.traverse((function(e){e.setStyle("fill",u)}));var h=cv(e.getItemVisual(t,"symbolOffset"),s);h&&(i.x=h[0],i.y=h[1]);var d=e.getItemVisual(t,"symbolRotate");i.rotation=(d||0)*Math.PI/180||0;var p={};p.showEffectOn=r.get("showEffectOn"),p.rippleScale=o.get(["rippleEffect","scale"]),p.brushType=o.get(["rippleEffect","brushType"]),p.period=1e3*o.get(["rippleEffect","period"]),p.effectOffset=t/e.count(),p.z=r.getShallow("z")||0,p.zlevel=r.getShallow("zlevel")||0,p.symbolType=a,p.color=u,p.rippleEffectColor=o.get(["rippleEffect","color"]),p.rippleNumber=o.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(e){"emphasis"===e?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===e&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,au(this,c.get("focus"),c.get("blurScope"),c.get("disabled"))},t.prototype.fadeOut=function(e){e&&e()},t}(Wi),wP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){this._symbolDraw=new jS(bP)},t.prototype.render=function(e,t,n){var r=e.getData(),i=this._symbolDraw;i.updateData(r,{clipShape:this._getClipShape(e)}),this.group.add(i.group)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get("clip",!0)?n:null},t.prototype.updateTransform=function(e,t,n){var r=e.getData();this.group.dirty();var i=yT("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout()},t.prototype._updateGroupTransform=function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=Ot(t.getRoamTransform()),this.group.decomposeTransform())},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0)},t.type="effectScatter",t}(Kg),SP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){return G_(null,this,{useEncodeDefaulter:!0})},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.type="series.effectScatter",t.dependencies=["grid","polar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},t}(Vg);var TP=function(e){function t(t,n,r){var i=e.call(this)||this;return i.add(i.createLine(t,n,r)),i._updateEffectSymbol(t,n),i}return l(t,e),t.prototype.createLine=function(e,t,n){return new mE(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel("effect"),r=n.get("symbolSize"),i=n.get("symbol");J(r)||(r=[r,r]);var o=e.getItemVisual(t,"style"),a=n.get("color")||o&&o.stroke,s=this.childAt(1);this._symbolType!==i&&(this.remove(s),(s=lv(i,-.5,-.5,1,1,a)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",a),s.setStyle(n.getItemStyle(["color"])),s.scaleX=r[0],s.scaleY=r[1],s.setColor(a),this._symbolType=i,this._symbolScale=r,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var r=this.childAt(1);if(r){var i=e.getItemLayout(n),o=1e3*t.get("period"),a=t.get("loop"),s=t.get("roundTrip"),l=t.get("constantSpeed"),u=he(t.get("delay"),(function(t){return t/e.count()*o/3}));if(r.ignore=!0,this._updateAnimationPoints(r,i),l>0&&(o=this._getLineLength(r)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){r.stopAnimation();var c=void 0;c=Q(u)?u(n):u,r.__t>0&&(c=-o*r.__t),this._animateSymbol(r,o,c,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,r,i){if(t>0){e.__t=0;var o=this,a=e.animate("",r).when(i?2*t:t,{__t:i?2:1}).delay(n).during((function(){o._updateSymbolPosition(e)}));r||a.done((function(){o.remove(e)})),a.start()}},t.prototype._getLineLength=function(e){return Xe(e.__p1,e.__cp1)+Xe(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,r=e.__cp1,i=e.__t<1?e.__t:2-e.__t,o=[e.x,e.y],a=o.slice(),s=Nn,l=Pn;o[0]=s(t[0],r[0],n[0],i),o[1]=s(t[1],r[1],n[1],i);var u=e.__t<1?l(t[0],r[0],n[0],i):l(n[0],r[0],t[0],1-i),c=e.__t<1?l(t[1],r[1],n[1],i):l(n[1],r[1],t[1],1-i);e.rotation=-Math.atan2(c,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT<e.__t?(e.scaleY=1.05*Xe(a,o),1===i&&(o[0]=a[0]+(o[0]-a[0])/2,o[1]=a[1]+(o[1]-a[1])/2)):1===e.__lastT?e.scaleY=2*Xe(t,o):e.scaleY=this._symbolScale[1]),e.__lastT=e.__t,e.ignore=!1,e.x=o[0],e.y=o[1]},t.prototype.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var n=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,n,t)},t}(Wi),MP=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createPolyline(t,n,r),i}return l(t,e),t.prototype._createPolyline=function(e,t,n){var r=e.getItemLayout(t),i=new ac({shape:{points:r}});this.add(i),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel;Ec(this.childAt(0),{shape:{points:e.getItemLayout(t)}},r,t),this._updateCommonStl(e,t,n)},t.prototype._updateCommonStl=function(e,t,n){var r=this.childAt(0),i=e.getItemModel(t),o=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||e.hasItemOption){var u=i.getModel("emphasis");o=u.getModel("lineStyle").getLineStyle(),l=u.get("disabled"),a=u.get("focus"),s=u.get("blurScope")}r.useStyle(e.getItemVisual(t,"style")),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,au(this,a,s,l)},t.prototype.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},t}(Wi),CP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return l(t,e),t.prototype.createLine=function(e,t,n){return new MP(e,t,n)},t.prototype._updateAnimationPoints=function(e,t){this._points=t;for(var n=[0],r=0,i=1;i<t.length;i++){var o=t[i-1],a=t[i];r+=Xe(o,a),n.push(r)}if(0!==r){for(i=0;i<n.length;i++)n[i]/=r;this._offsets=n,this._length=r}else this._length=0},t.prototype._getLineLength=function(){return this._length},t.prototype._updateSymbolPosition=function(e){var t=e.__t<1?e.__t:2-e.__t,n=this._points,r=this._offsets,i=n.length;if(r){var o,a=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(a+1,i-1);o>=0&&!(r[o]<=t);o--);o=Math.min(o,i-2)}else{for(o=a;o<i&&!(r[o]>t);o++);o=Math.min(o-1,i-2)}var s=(t-r[o])/(r[o+1]-r[o]),l=n[o],u=n[o+1];e.x=l[0]*(1-s)+s*u[0],e.y=l[1]*(1-s)+s*u[1];var c=e.__t<1?u[0]-l[0]:l[0]-u[0],h=e.__t<1?u[1]-l[1]:l[1]-u[1];e.rotation=-Math.atan2(h,c)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},t}(TP),DP=function(){this.polyline=!1,this.curveness=0,this.segs=[]},AP=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return l(t,e),t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new DP},t.prototype.buildPath=function(e,t){var n,r=t.segs,i=t.curveness;if(t.polyline)for(n=this._off;n<r.length;){var o=r[n++];if(o>0){e.moveTo(r[n++],r[n++]);for(var a=1;a<o;a++)e.lineTo(r[n++],r[n++])}}else for(n=this._off;n<r.length;){var s=r[n++],l=r[n++],u=r[n++],c=r[n++];if(e.moveTo(s,l),i>0){var h=(s+u)/2-(l-c)*i,d=(l+c)/2-(u-s)*i;e.quadraticCurveTo(h,d,u,c)}else e.lineTo(u,c)}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,r=n.segs,i=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<r.length;){var l=r[s++];if(l>0)for(var u=r[s++],c=r[s++],h=1;h<l;h++){if(Ts(u,c,d=r[s++],p=r[s++],o,e,t))return a}a++}else for(a=0,s=0;s<r.length;){u=r[s++],c=r[s++];var d=r[s++],p=r[s++];if(i>0){if(Cs(u,c,(u+d)/2-(c-p)*i,(c+p)/2-(d-u)*i,d,p,o,e,t))return a}else if(Ts(u,c,d,p,o,e,t))return a;a++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<t.length;){var s=t[a++],l=t[a++];n=Math.min(s,n),i=Math.max(s,i),r=Math.min(l,r),o=Math.max(l,o)}e=this._rect=new jt(n,r,i,o)}return e},t}(Us),IP=function(){function e(){this.group=new Wi}return e.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e)},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},e.prototype.incrementalUpdate=function(e,t){var n=this._newAdded[0],r=t.getLayout("linesPoints"),i=n&&n.shape.segs;if(i&&i.length<2e4){var o=i.length,a=new Float32Array(o+r.length);a.set(i),a.set(r,o),n.setShape({segs:a})}else{this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:r}),this._setCommon(s,t),s.__startIndex=e.start}},e.prototype.remove=function(){this._clear()},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new AP({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;e.setShape({polyline:r.get("polyline"),curveness:r.get(["lineStyle","curveness"])}),e.useStyle(r.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var i=t.getVisual("style");i&&i.stroke&&e.setStyle("stroke",i.stroke),e.setStyle("fill",null);var o=vl(e);o.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){o.dataIndex=null;var n=e.hoverDataIdx;n>0&&(o.dataIndex=n+e.__startIndex)}))},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),EP={seriesType:"lines",plan:Yg(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get("polyline"),r=e.pipelineContext.large;return{progress:function(i,o){var a=[];if(r){var s=void 0,l=i.end-i.start;if(n){for(var u=0,c=i.start;c<i.end;c++)u+=e.getLineCoordsCount(c);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var h=0,d=[];for(c=i.start;c<i.end;c++){var p=e.getLineCoords(c,a);n&&(s[h++]=p);for(var f=0;f<p;f++)d=t.dataToPoint(a[f],!1,d),s[h++]=d[0],s[h++]=d[1]}o.setLayout("linesPoints",s)}else for(c=i.start;c<i.end;c++){var g=o.getItemModel(c),m=(p=e.getLineCoords(c,a),[]);if(n)for(var v=0;v<p;v++)m.push(t.dataToPoint(a[v]));else{m[0]=t.dataToPoint(a[0]),m[1]=t.dataToPoint(a[1]);var y=g.get(["lineStyle","curveness"]);+y&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*y,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*y])}o.setItemLayout(c,m)}}}}"production"!==process.env.NODE_ENV&&Io("The lines series must have a coordinate system.")}},LP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this._updateLineDraw(r,e),o=e.get("zlevel"),a=e.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&a>0&&(l?"production"!==process.env.NODE_ENV&&console.warn("SVG render mode doesn't support lines with trail effect"):s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),i.updateData(r);var u=e.get("clip",!0)&&iT(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateLineDraw(r,e).incrementalPrepareUpdate(r),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var r=e.getData(),i=e.pipelineContext;if(!this._finished||i.large||i.progressiveRender)return{update:!0};var o=EP.reset(e,t,n);o.progress&&o.progress({start:0,end:r.count(),count:r.count()},r),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,r=this._showEffect(t),i=!!t.get("polyline"),o=t.pipelineContext.large;return"production"!==process.env.NODE_ENV&&r&&o&&console.warn("Large lines not support effect"),n&&r===this._hasEffet&&i===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new IP:new vE(i?r?CP:MP:r?TP:mE),this._hasEffet=r,this._isPolyline=i,this._isLargeDraw=o),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get(["effect","show"])},t.prototype._clearLayer=function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type="lines",t}(Kg),NP="undefined"==typeof Uint32Array?Array:Uint32Array,PP="undefined"==typeof Float64Array?Array:Float64Array;function OP(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&("production"!==process.env.NODE_ENV&&console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),e.data=j(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),k([t,e[0],e[1]])})))}var RP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return l(t,e),t.prototype.init=function(t){t.data=t.data||[],OP(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(OP(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Me(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Me(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+2*i],t[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(e);for(i=0;i<o.length;i++)t[i]=t[i]||[],t[i][0]=o[i][0],t[i][1]=o[i][1];return o.length},t.prototype._processFlatCoordsArray=function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),ne(e[0])){for(var n=e.length,r=new NP(n),i=new PP(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=e[l++];r[a++]=o+t,r[a++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(i[o++]=h,i[o++]=d,l>n&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},t.prototype.getInitialData=function(e,t){if("production"!==process.env.NODE_ENV&&!Bp.get(e.coordinateSystem))throw new Error("Unknown coordinate system "+e.coordinateSystem);var n=new L_(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},t.prototype.formatTooltip=function(e,t,n){var r=this.getData().getItemModel(e),i=r.get("name");if(i)return i;var o=r.get("fromName"),a=r.get("toName"),s=[];return null!=o&&s.push(o),null!=a&&s.push(a),wg("nameValue",{name:s.join(" > ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.prototype.getZLevelKey=function(){var e=this.getModel("effect"),t=e.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get("show")&&t>0?t+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(Vg);function kP(e){return e instanceof Array||(e=[e,e]),e}var zP={seriesType:"lines",reset:function(e){var t=kP(e.get("symbol")),n=kP(e.get("symbolSize")),r=e.getData();return r.setVisual("fromSymbol",t&&t[0]),r.setVisual("toSymbol",t&&t[1]),r.setVisual("fromSymbolSize",n&&n[0]),r.setVisual("toSymbolSize",n&&n[1]),{dataEach:r.hasItemOption?function(e,t){var n=e.getItemModel(t),r=kP(n.getShallow("symbol",!0)),i=kP(n.getShallow("symbolSize",!0));r[0]&&e.setItemVisual(t,"fromSymbol",r[0]),r[1]&&e.setItemVisual(t,"toSymbol",r[1]),i[0]&&e.setItemVisual(t,"fromSymbolSize",i[0]),i[1]&&e.setItemVisual(t,"toSymbolSize",i[1])}:null}}};var VP=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=y.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=e.length;c.width=t,c.height=n;for(var p=0;p<d;++p){var f=e[p],g=f[0],m=f[1],v=r(f[2]);h.globalAlpha=v,h.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),_=y.data,x=0,b=_.length,w=this.minOpacity,S=this.maxOpacity-w;x<b;){v=_[x+3]/256;var T=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*S+w),_[x++]=M[T],_[x++]=M[T+1],_[x++]=M[T+2],_[x++]=M[T+3]*v*256}else x+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=y.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var r=e.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-t,t,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},e}();function BP(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var FP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r;if(t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(r=t)}))})),"production"!==process.env.NODE_ENV&&!r)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):BP(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(BP(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){hh(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var o,a,s,l,u=e.coordinateSystem,c=oT(u,"cartesian2d");if(c){var h=u.getAxis("x"),d=u.getAxis("y");if("production"!==process.env.NODE_ENV){if("category"!==h.type||"category"!==d.type)throw new Error("Heatmap on cartesian must have two category axes");if(!h.onBand||!d.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}o=h.getBandWidth()+.5,a=d.getBandWidth()+.5,s=h.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),_=vh(e),x=e.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),S=x.get("disabled"),T=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],M=n;M<r;M++){var C=void 0,D=f.getItemVisual(M,"style");if(c){var A=f.get(T[0],M),I=f.get(T[1],M);if(isNaN(f.get(T[2],M))||isNaN(A)||isNaN(I)||A<s[0]||A>s[1]||I<l[0]||I>l[1])continue;var E=u.dataToPoint([A,I]);C=new tl({shape:{x:E[0]-o/2,y:E[1]-a/2,width:o,height:a},style:D})}else{if(isNaN(f.get(T[1],M)))continue;C=new tl({z2:1,shape:u.dataToRect([f.get(T[0],M)]).contentShape,style:D})}if(f.hasItemOption){var L=f.getItemModel(M),N=L.getModel("emphasis");g=N.getModel("itemStyle").getItemStyle(),m=L.getModel(["blur","itemStyle"]).getItemStyle(),v=L.getModel(["select","itemStyle"]).getItemStyle(),y=L.get(["itemStyle","borderRadius"]),b=N.get("focus"),w=N.get("blurScope"),S=N.get("disabled"),_=vh(L)}C.shape.r=y;var P=e.getRawValue(M),O="-";P&&null!=P[2]&&(O=P[2]+""),mh(C,_,{labelFetcher:e,labelDataIndex:M,defaultOpacity:D.opacity,defaultText:O}),C.ensureState("emphasis").style=g,C.ensureState("blur").style=m,C.ensureState("select").style=v,au(C,b,w,S),C.incremental=i,i&&(C.states.emphasis.hoverLayer=!0),p.add(C),f.setItemGraphicEl(M,C),this._progressiveEls&&this._progressiveEls.push(C)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=t.getData(),s=this._hmLayer||this._hmLayer||new VP;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),d=Math.min(l.width+l.x,r.getWidth()),p=Math.min(l.height+l.y,r.getHeight()),f=d-c,g=p-h,m=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],v=a.mapArray(m,(function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=c,i[1]-=h,i.push(r),i})),y=n.getExtent(),_="visualMap.continuous"===n.type?function(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}(y,n.option.range):function(e,t,n){var r=e[1]-e[0],i=(t=j(t,(function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}}))).length,o=0;return function(e){var r;for(r=o;r<i;r++)if((a=t[r].interval)[0]<=e&&e<=a[1]){o=r;break}if(r===i)for(r=o-1;r>=0;r--){var a;if((a=t[r].interval)[0]<=e&&e<=a[1]){o=r;break}}return r>=0&&r<i&&n[r]}}(y,n.getPieceList(),n.option.selected);s.update(v,f,g,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new Zs({style:{width:f,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(x)},t.type="heatmap",t}(Kg),GP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(e,t){return G_(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=Bp.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(Vg);var HP=["itemStyle","borderWidth"],UP=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],WP=new ku,jP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=this.group,i=e.getData(),o=this._data,a=e.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:UP[+s],categoryDim:UP[1-+s]};i.diff(o).add((function(e){if(i.hasValue(e)){var t=QP(i,e),n=XP(i,e,t,u),o=nO(i,u,n);i.setItemGraphicEl(e,o),r.add(o),sO(o,u,n)}})).update((function(e,t){var n=o.getItemGraphicEl(t);if(i.hasValue(e)){var a=QP(i,e),s=XP(i,e,a,u),l=iO(i,s);n&&l!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(e,null),n=null),n?function(e,t,n){var r=n.animationModel,i=n.dataIndex,o=e.__pictorialBundle;Ec(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?qP(e,t,n,!0):KP(e,t,n,!0);$P(e,n,!0),JP(e,t,n,!0)}(n,u,s):n=nO(i,u,s,!0),i.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=s,r.add(n),sO(n,u,s)}else r.remove(n)})).remove((function(e){var t=o.getItemGraphicEl(e);t&&rO(o,e,t.__pictorialSymbolMeta.animationModel,t)})).execute();var c=e.get("clip",!0)?iT(e.coordinateSystem,!1,e):null;return c?r.setClipPath(c):r.removeClipPath(),this._data=i,this.group},t.prototype.remove=function(e,t){var n=this.group,r=this._data;e.get("animation")?r&&r.eachItemGraphicEl((function(t){rO(r,vl(t).dataIndex,e,t)})):n.removeAll()},t.type="pictorialBar",t}(Kg);function XP(e,t,n,r){var i=e.getItemLayout(t),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),h={dataIndex:t,layout:i,itemModel:n,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!function(e,t,n,r,i){var o,a=r.valueDim,s=e.get("symbolBoundingData"),l=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[a.wh]<=0);if(J(s)){var h=[YP(l,s[0])-u,YP(l,s[1])-u];h[1]<h[0]&&h.reverse(),o=h[c]}else o=null!=s?YP(l,s)-u:t?r.coordSysExtent[a.index][c]-u:n[a.wh];i.boundingLength=o,t&&(i.repeatCutLength=n[a.wh]);var d="x"===a.xy,p=l.inverse;i.pxSign=d&&!p||!d&&p?o>=0?1:-1:o>0?1:-1}(n,o,i,r,h),function(e,t,n,r,i,o,a,s,l,u){var c,h=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=e.getItemVisual(t,"symbolSize");c=J(f)?f.slice():null==f?["100%","100%"]:[f,f];c[d.index]=to(c[d.index],p),c[h.index]=to(c[h.index],r?p:Math.abs(o)),u.symbolSize=c;var g=u.symbolScale=[c[0]/s,c[1]/s];g[h.index]*=(l.isHorizontal?-1:1)*a}(e,t,i,o,0,h.boundingLength,h.pxSign,u,r,h),function(e,t,n,r,i){var o=e.get(HP)||0;o&&(WP.attr({scaleX:t[0],scaleY:t[1],rotation:n}),WP.updateTransform(),o/=WP.getLineScale(),o*=t[r.valueDim.index]);i.valueLineWidth=o||0}(n,h.symbolScale,l,r,h);var d=h.symbolSize,p=cv(n.get("symbolOffset"),d);return function(e,t,n,r,i,o,a,s,l,u,c,h){var d=c.categoryDim,p=c.valueDim,f=h.pxSign,g=Math.max(t[p.index]+s,0),m=g;if(r){var v=Math.abs(l),y=he(e.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=to(y,t[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=bo(r),T=S?r:lO((v+w)/b);b=g+2*(x=(v-T*g)/2/(_?T:Math.max(T-1,1))),w=_?0:2*x,S||"fixed"===r||(T=u?lO((Math.abs(u)+w)/b):0),m=T*b-w,h.repeatTimes=T,h.symbolMargin=x}var M=f*(m/2),C=h.pathPosition=[];C[d.index]=n[d.wh]/2,C[p.index]="start"===a?M:"end"===a?l-M:l/2,o&&(C[0]+=o[0],C[1]+=o[1]);var D=h.bundlePosition=[];D[d.index]=n[d.xy],D[p.index]=n[p.xy];var A=h.barRectShape=z({},n);A[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(C[p.index]+M)),A[d.wh]=n[d.wh];var I=h.clipShape={};I[d.xy]=-n[d.xy],I[d.wh]=c.ecSize[d.wh],I[p.xy]=0,I[p.wh]=n[p.wh]}(n,d,i,o,0,p,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,r,h),h}function YP(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function ZP(e){var t=e.symbolPatternSize,n=lv(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function qP(e,t,n,r){var i=e.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,u=n.repeatTimes||0,c=0,h=o[t.valueDim.index]+a+2*n.symbolMargin;for(oO(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=u,c<u?aO(e,null,f(c),n,r):aO(e,null,{scaleX:0,scaleY:0},n,r,(function(){i.remove(e)})),c++}));c<u;c++){var d=ZP(n);d.__pictorialAnimationIndex=c,d.__pictorialRepeatTimes=u,i.add(d);var p=f(c);aO(d,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,r)}function f(e){var t=s.slice(),r=n.pxSign,i=e;return("start"===n.symbolRepeatDirection?r>0:r<0)&&(i=u-1-e),t[l.index]=h*(i-u/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function KP(e,t,n,r){var i=e.__pictorialBundle,o=e.__pictorialMainPath;o?aO(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(o=e.__pictorialMainPath=ZP(n),i.add(o),aO(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function $P(e,t,n){var r=z({},t.barRectShape),i=e.__pictorialBarRect;i?aO(i,null,{shape:r},t,n):((i=e.__pictorialBarRect=new tl({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,e.add(i))}function JP(e,t,n,r){if(n.symbolClip){var i=e.__pictorialClipPath,o=z({},n.clipShape),a=t.valueDim,s=n.animationModel,l=n.dataIndex;if(i)Ec(i,{shape:o},s,l);else{o[a.wh]=0,i=new tl({shape:o}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[a.wh]=n.clipShape[a.wh],dh[r?"updateProps":"initProps"](i,{shape:u},s,l)}}}function QP(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=eO,n.isAnimationEnabled=tO,n}function eO(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function tO(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function nO(e,t,n,r){var i=new Wi,o=new Wi;return i.add(o),i.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?qP(i,t,n):KP(i,0,n),$P(i,n,r),JP(i,t,n,r),i.__pictorialShapeStr=iO(e,n),i.__pictorialSymbolMeta=n,i}function rO(e,t,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var o=[];oO(r,(function(e){o.push(e)})),r.__pictorialMainPath&&o.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),W(o,(function(e){Pc(e,{scaleX:0,scaleY:0},n,t,(function(){r.parent&&r.parent.remove(r)}))})),e.setItemGraphicEl(t,null)}function iO(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function oO(e,t,n){W(e.__pictorialBundle.children(),(function(r){r!==e.__pictorialBarRect&&t.call(n,r)}))}function aO(e,t,n,r,i,o){t&&e.attr(t),r.symbolClip&&!i?n&&e.attr(n):n&&dh[i?"updateProps":"initProps"](e,n,r.animationModel,r.dataIndex,o)}function sO(e,t,n){var r=n.dataIndex,i=n.itemModel,o=i.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=o.get("focus"),h=o.get("blurScope"),d=o.get("scale");oO(e,(function(e){if(e instanceof Zs){var t=e.style;e.useStyle(z({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var r=e.ensureState("emphasis");r.style=a,d&&(r.scaleX=1.1*e.scaleX,r.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,u&&(e.cursor=u),e.z2=n.z2}));var p=t.valueDim.posDesc[+(n.boundingLength>0)],f=e.__pictorialBarRect;f.ignoreClip=!0,mh(f,vh(i),{labelFetcher:t.seriesModel,labelDataIndex:r,defaultText:VS(t.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),au(e,c,h,o.get("disabled"))}function lO(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var uO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return l(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=Uh(wT.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(wT);var cO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this,o=this.group,a=e.getLayerSeries(),s=r.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(e){return e.name}o.x=0,o.y=l.y+u[0];var h=new s_(this._layersSeries||[],a,c,c),d=[];function p(t,n,s){var l=i._layers;if("remove"!==t){for(var u,c,h=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var m=r.getItemLayout(f[g]),v=m.x,y=m.y0,_=m.y;h.push(v,y),p.push(v,y+_),u=r.getItemVisual(f[g],"style")}var x=r.getItemLayout(f[0]),b=e.getModel("label").get("margin"),w=e.getModel("emphasis");if("add"===t){var S=d[n]=new Wi;c=new tT({shape:{points:h,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),S.add(c),o.add(S),e.isAnimationEnabled()&&c.setClipPath(function(e,t,n){var r=new tl({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Lc(r,{shape:{x:e.x-50,width:e.width+100,height:e.height+20}},t,n),r}(c.getBoundingRect(),e,(function(){c.removeClipPath()})))}else{S=l[s];c=S.childAt(0),o.add(S),d[n]=S,Ec(c,{shape:{points:h,stackedOnPoints:p}},e),kc(c)}mh(c,vh(e),{labelDataIndex:f[g-1],defaultText:r.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),c.setTextConfig({position:null,local:!0});var T=c.getTextContent();T&&(T.x=x.x-b,T.y=x.y0+x.y/2),c.useStyle(u),r.setItemGraphicEl(n,c),cu(c,e),au(c,w.get("focus"),w.get("blurScope"),w.get("disabled"))}else o.remove(l[n])}h.add(K(p,this,"add")).update(K(p,this,"update")).remove(K(p,this,"remove")).execute(),this._layersSeries=a,this._layers=d},t.type="themeRiver",t}(Kg);var hO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new lM(K(this.getData,this),K(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},r=oa(e,(function(e){return n.hasOwnProperty(e[0]+"")||(n[e[0]+""]=-1),e[2]})),i=[];r.buckets.each((function(e,t){i.push({name:t,dataList:e})}));for(var o=i.length,a=0;a<o;++a){for(var s=i[a].name,l=0;l<i[a].dataList.length;++l){var u=i[a].dataList[l][0]+"";n[u]=a}for(var u in n)n.hasOwnProperty(u)&&n[u]!==a&&(n[u]=a,e[t]=[u,0,s],t++)}return e},t.prototype.getInitialData=function(e,t){for(var n=this.getReferringComponents("singleAxis",ta).models[0].get("type"),r=Y(e.data,(function(e){return void 0!==e[2]})),i=this.fixData(r||[]),o=[],a=this.nameMap=Te(),s=0,l=0;l<i.length;++l)o.push(i[l][2]),a.get(i[l][2])||(a.set(i[l][2],s),s++);var u=P_(i,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:c_(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,c=new L_(u,this);return c.initData(i),c},t.prototype.getLayerSeries=function(){for(var e=this.getData(),t=e.count(),n=[],r=0;r<t;++r)n[r]=r;var i=e.mapDimension("single"),o=oa(n,(function(t){return e.get("name",t)})),a=[];return o.buckets.each((function(t,n){t.sort((function(t,n){return e.get(i,t)-e.get(i,n)})),a.push({name:n,indices:t})})),a},t.prototype.getAxisTooltipData=function(e,t,n){J(e)||(e=e?[e]:[]);for(var r,i=this.getData(),o=this.getLayerSeries(),a=[],s=o.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,c=-1,h=o[l].indices.length,d=0;d<h;++d){var p=i.get(e[0],o[l].indices[d]),f=Math.abs(p-t);f<=u&&(r=p,u=f,c=o[l].indices[d])}a.push(c)}return{dataIndices:a,nestestValue:r}},t.prototype.formatTooltip=function(e,t,n){var r=this.getData();return wg("nameValue",{name:r.getName(e),value:r.get(r.mapDimension("value"),e)})},t.type="series.themeRiver",t.dependencies=["singleAxis"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},t}(Vg);function dO(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),n=e.coordinateSystem,r={},i=n.getRect();r.rect=i;var o=e.get("boundaryGap"),a=n.getAxis();(r.boundaryGap=o,"horizontal"===a.orient)?(o[0]=to(o[0],i.height),o[1]=to(o[1],i.height),pO(t,e,i.height-o[0]-o[1])):(o[0]=to(o[0],i.width),o[1]=to(o[1],i.width),pO(t,e,i.width-o[0]-o[1]));t.setLayout("layoutInfo",r)}))}function pO(e,t,n){if(e.count())for(var r,i=t.coordinateSystem,o=t.getLayerSeries(),a=e.mapDimension("single"),s=e.mapDimension("value"),l=j(o,(function(t){return j(t.indices,(function(t){var n=i.dataToPoint(e.get(a,t));return n[1]=e.get(s,t),n}))})),u=function(e){for(var t=e.length,n=e[0].length,r=[],i=[],o=0,a=0;a<n;++a){for(var s=0,l=0;l<t;++l)s+=e[l][a][1];s>o&&(o=s),r.push(s)}for(var u=0;u<n;++u)i[u]=(o-r[u])/2;o=0;for(var c=0;c<n;++c){var h=r[c]+i[c];h>o&&(o=h)}return{y0:i,max:o}}(l),c=u.y0,h=n/u.max,d=o.length,p=o[0].indices.length,f=0;f<p;++f){r=c[f]*h,e.setItemLayout(o[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:r,y:l[0][f][1]*h});for(var g=1;g<d;++g)r+=l[g-1][f][1]*h,e.setItemLayout(o[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:r,y:l[g][f][1]*h})}}var fO=function(e){function t(t,n,r,i){var o=e.call(this)||this;o.z2=2,o.textConfig={inside:!0},vl(o).seriesIndex=n.seriesIndex;var a=new il({z2:4,silent:t.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,t,n,r,i),o}return l(t,e),t.prototype.updateData=function(e,t,n,r,i){this.node=t,t.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var o=this;vl(o).dataIndex=t.dataIndex;var a=t.getModel(),s=a.getModel("emphasis"),l=t.getLayout(),u=z({},l);u.label=null;var c=t.getVisual("style");c.lineJoin="bevel";var h=t.getVisual("decal");h&&(c.decal=Rv(h,i));var d=AT(a.getModel("itemStyle"),u,!0);z(u,d),W(Sl,(function(e){var t=o.ensureState(e),n=a.getModel([e,"itemStyle"]);t.style=n.getItemStyle();var r=AT(n,u);r&&(t.shape=r)})),e?(o.setShape(u),o.shape.r=l.r0,Lc(o,{shape:{r:l.r}},n,t.dataIndex)):(Ec(o,{shape:u},n),kc(o)),o.useStyle(c),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var f=s.get("focus");au(this,"relative"===f?Me(t.getAncestorsIndices(),t.getDescendantIndices()):"ancestor"===f?t.getAncestorsIndices():"descendant"===f?t.getDescendantIndices():f,s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),r=n.getModel("label"),i=this.node.getLayout(),o=i.endAngle-i.startAngle,a=(i.startAngle+i.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,c=u.getTextContent(),h=this.node.dataIndex,d=r.get("minAngle")/180*Math.PI,p=r.get("show")&&!(null!=d&&Math.abs(o)<d);function f(e,t){var n=e.get(t);return null==n?r.get(t):n}c.ignore=!p,W(Tl,(function(r){var d="normal"===r?n.getModel("label"):n.getModel([r,"label"]),p="normal"===r,g=p?c:c.ensureState(r),m=e.getFormattedLabel(h,r);p&&(m=m||t.node.name),g.style=yh(d,{},null,"normal"!==r,!0),m&&(g.style.text=m);var v=d.get("show");null==v||p||(g.ignore=!v);var y,_=f(d,"position"),x=p?u:u.states[r],b=x.style.fill;x.textConfig={outsideFill:"inherit"===d.get("color")?b:null,inside:"outside"!==_};var w=f(d,"distance")||0,S=f(d,"align"),T=f(d,"rotate"),M=.5*Math.PI,C=1.5*Math.PI,D=As("tangential"===T?Math.PI/2-a:a),A=D>M&&!ho(D-M)&&D<C;"outside"===_?(y=i.r+w,S=A?"right":"left"):S&&"center"!==S?"left"===S?(y=i.r0+w,S=A?"right":"left"):"right"===S&&(y=i.r-w,S=A?"left":"right"):(y=o===2*Math.PI&&0===i.r0?0:(i.r+i.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=y*s+i.cx,g.y=y*l+i.cy;var I=0;"radial"===T?I=As(-a)+(A?Math.PI:0):"tangential"===T?I=As(Math.PI/2-a)+(A?Math.PI:0):ne(T)&&(I=T*Math.PI/180),g.rotation=As(I)})),c.dirtyStyle()},t}(Qu),gO="sunburstRootToNode",mO="sunburstHighlight";var vO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){var i=this;this.seriesModel=e,this.api=n,this.ecModel=t;var o=e.getData(),a=o.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),c=[];s.eachNode((function(e){c.push(e)}));var h=this._oldChildren||[];!function(r,i){if(0===r.length&&0===i.length)return;function s(e){return e.getId()}function c(s,c){!function(r,i){u||!r||r.getValue()||(r=null);if(r!==a&&i!==a)if(i&&i.piece)r?(i.piece.updateData(!1,r,e,t,n),o.setItemGraphicEl(r.dataIndex,i.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(i);else if(r){var s=new fO(r,e,t,n);l.add(s),o.setItemGraphicEl(r.dataIndex,s)}}(null==s?null:r[s],null==c?null:i[c])}new s_(i,r,s,s).add(c).update(c).remove($(c,null)).execute()}(c,h),function(r,o){o.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,e,t,n):(i.virtualPiece=new fO(r,e,t,n),l.add(i.virtualPiece)),o.piece.off("click"),i.virtualPiece.on("click",(function(e){i._rootToNode(o.parentNode)}))):i.virtualPiece&&(l.remove(i.virtualPiece),i.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(r){if(!n&&r.piece&&r.piece===t.target){var i=r.getModel().get("nodeClick");if("rootToNode"===i)e._rootToNode(r);else if("link"===i){var o=r.getModel(),a=o.get("link");if(a)Vd(a,o.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:gO,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="sunburst",t}(Kg),yO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};_O(n);var r=this._levelModels=j(e.levels||[],(function(e){return new Fh(e,this,t)}),this),i=IA.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=i.getNodeByDataIndex(t),o=r[n.depth];return o&&(e.parentModel=o),e}))}));return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=PA(r,this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){BA(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(Vg);function _O(e){var t=0;W(e.children,(function(e){_O(e);var n=e.value;J(n)&&(n=n[0]),t+=n}));var n=e.value;J(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),J(e.value)?e.value[0]=n:e.value=n}var xO=Math.PI/180;function bO(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),r=e.get("radius");J(r)||(r=[0,r]),J(t)||(t=[t,t]);var i=n.getWidth(),o=n.getHeight(),a=Math.min(i,o),s=to(t[0],i),l=to(t[1],o),u=to(r[0],a/2),c=to(r[1],a/2),h=-e.get("startAngle")*xO,d=e.get("minAngle")*xO,p=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&wO(f,m);var v=0;W(f.children,(function(e){!isNaN(e.getValue())&&v++}));var y=f.getValue(),_=Math.PI/(y||v)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(c-u)/(b||1),S=e.get("clockwise"),T=e.get("stillShowZeroSum"),M=S?1:-1,C=function(t,n){if(t){var r=n;if(t!==p){var i=t.getValue(),o=0===y&&T?_:i*_;o<d&&(o=d),r=n+M*o;var c=t.depth-g-(x?-1:1),h=u+w*c,f=u+w*(c+1),m=e.getLevelModel(t);if(m){var v=m.get("r0",!0),b=m.get("r",!0),D=m.get("radius",!0);null!=D&&(v=D[0],b=D[1]),null!=v&&(h=to(v,a/2)),null!=b&&(f=to(b,a/2))}t.setLayout({angle:o,startAngle:n,endAngle:r,clockwise:S,cx:s,cy:l,r0:h,r:f})}if(t.children&&t.children.length){var A=0;W(t.children,(function(e){A+=C(e,n+A)}))}return r-n}};if(x){var D=u,A=u+w,I=2*Math.PI;p.setLayout({angle:I,startAngle:h,endAngle:h+I,clockwise:S,cx:s,cy:l,r0:D,r:A})}C(f,h)}))}function wO(e,t){var n=e.children||[];e.children=function(e,t){if(Q(t)){var n=j(e,(function(e,t){var n=e.getValue();return{params:{depth:e.depth,height:e.height,dataIndex:e.dataIndex,getValue:function(){return n}},index:t}}));return n.sort((function(e,n){return t(e.params,n.params)})),j(n,(function(t){return e[t.index]}))}var r="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(r?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(r?-1:1):n}))}(n,t),n.length&&W(e.children,(function(e){wO(e,t)}))}function SO(e){var t={};e.eachSeriesByType("sunburst",(function(e){var n=e.getData(),r=n.tree;r.eachNode((function(i){var o=i.getModel().getModel("itemStyle").getItemStyle();o.fill||(o.fill=function(e,n,r){for(var i=e;i&&i.depth>1;)i=i.parentNode;var o=n.getColorFromPalette(i.name||i.dataIndex+"",t);return e.depth>1&&ee(o)&&(o=ir(o,(e.depth-1)/(r-1)*.5)),o}(i,e,r.root.height)),z(n.ensureUniqueItemVisual(i.dataIndex,"style"),o)}))}))}var TO={color:"fill",borderColor:"stroke"},MO={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},CO=$o(),DO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return G_(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=CO(r).info),i},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Vg);function AO(e,t){return t=t||[0,0],j(["x","y"],(function(n,r){var i=this.getAxis(n),o=t[r],a=e[r]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))}),this)}function IO(e,t){return t=t||[0,0],j([0,1],(function(n){var r=t[n],i=e[n]/2,o=[],a=[];return o[n]=r-i,a[n]=r+i,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function EO(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function LO(e,t){return t=t||[0,0],j(["Radius","Angle"],(function(n,r){var i=this["get"+n+"Axis"](),o=t[r],a=e[r]/2,s="category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}var NO={};function PO(e,t,n,r){return e&&(e.legacy||!1!==e.legacy&&!n&&!r&&"tspan"!==t&&("text"===t||Ae(e,"text")))}function OO(e,t,n){var r,i,o,a=e;if("text"===t)o=a;else{o={},Ae(a,"text")&&(o.text=a.text),Ae(a,"rich")&&(o.rich=a.rich),Ae(a,"textFill")&&(o.fill=a.textFill),Ae(a,"textStroke")&&(o.stroke=a.textStroke),Ae(a,"fontFamily")&&(o.fontFamily=a.fontFamily),Ae(a,"fontSize")&&(o.fontSize=a.fontSize),Ae(a,"fontStyle")&&(o.fontStyle=a.fontStyle),Ae(a,"fontWeight")&&(o.fontWeight=a.fontWeight),i={type:"text",style:o,silent:!0},r={};var s=Ae(a,"textPosition");n?r.position=s?a.textPosition:"inside":s&&(r.position=a.textPosition),Ae(a,"textPosition")&&(r.position=a.textPosition),Ae(a,"textOffset")&&(r.offset=a.textOffset),Ae(a,"textRotation")&&(r.rotation=a.textRotation),Ae(a,"textDistance")&&(r.distance=a.textDistance)}return RO(o,e),W(o.rich,(function(e){RO(e,e)})),{textConfig:r,textContent:i}}function RO(e,t){t&&(t.font=t.textFont||t.font,Ae(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),Ae(t,"textAlign")&&(e.align=t.textAlign),Ae(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),Ae(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),Ae(t,"textWidth")&&(e.width=t.textWidth),Ae(t,"textHeight")&&(e.height=t.textHeight),Ae(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),Ae(t,"textPadding")&&(e.padding=t.textPadding),Ae(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),Ae(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),Ae(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),Ae(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),Ae(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),Ae(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Ae(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function kO(e,t,n){var r=e;r.textPosition=r.textPosition||n.position||"inside",null!=n.offset&&(r.textOffset=n.offset),null!=n.rotation&&(r.textRotation=n.rotation),null!=n.distance&&(r.textDistance=n.distance);var i=r.textPosition.indexOf("inside")>=0,o=e.fill||"#000";zO(r,t);var a=null==r.textFill;return i?a&&(r.textFill=n.insideFill||"#fff",!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=o),null==r.textStrokeWidth&&(r.textStrokeWidth=2)):(a&&(r.textFill=e.fill||n.outsideFill||"#000"),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,W(t.rich,(function(e){zO(e,e)})),r}function zO(e,t){t&&(Ae(t,"fill")&&(e.textFill=t.fill),Ae(t,"stroke")&&(e.textStroke=t.fill),Ae(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),Ae(t,"font")&&(e.font=t.font),Ae(t,"fontStyle")&&(e.fontStyle=t.fontStyle),Ae(t,"fontWeight")&&(e.fontWeight=t.fontWeight),Ae(t,"fontSize")&&(e.fontSize=t.fontSize),Ae(t,"fontFamily")&&(e.fontFamily=t.fontFamily),Ae(t,"align")&&(e.textAlign=t.align),Ae(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),Ae(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),Ae(t,"width")&&(e.textWidth=t.width),Ae(t,"height")&&(e.textHeight=t.height),Ae(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),Ae(t,"padding")&&(e.textPadding=t.padding),Ae(t,"borderColor")&&(e.textBorderColor=t.borderColor),Ae(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),Ae(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),Ae(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),Ae(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),Ae(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Ae(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Ae(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),Ae(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),Ae(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),Ae(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function VO(e,t){if("production"!==process.env.NODE_ENV){var n=e+"^_^"+t;NO[n]||(console.warn('[ECharts] DEPRECATED: "'+e+'" has been deprecated. '+t),NO[n]=!0)}}var BO={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},FO=q(BO),GO=X(Si,(function(e,t){return e[t]=1,e}),{}),HO=Si.join(", "),UO=["","style","shape","extra"],WO=$o();function jO(e,t,n,r,i){var o=e+"Animation",a=Ac(e,r,i)||{},s=WO(t).userDuring;return a.duration>0&&(a.during=s?K(eR,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),z(a,n[o]),a}function XO(e,t,n,r){var i=(r=r||{}).dataIndex,o=r.isInit,a=r.clearStyle,s=n.isAnimationEnabled(),l=WO(e),u=t.style;l.userDuring=t.during;var c={},h={};if(function(e,t,n){for(var r=0;r<FO.length;r++){var i=FO[r],o=BO[i],a=t[i];a&&(n[o[0]]=a[0],n[o[1]]=a[1])}for(r=0;r<Si.length;r++){var s=Si[r];null!=t[s]&&(n[s]=t[s])}}(0,t,h),nR("shape",t,h),nR("extra",t,h),!o&&s&&(function(e,t,n){for(var r=t.transition,i=qO(r)?Si:zo(r||[]),o=0;o<i.length;o++){var a=i[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=e[a];"production"!==process.env.NODE_ENV&&KO(a,"el.transition"),n[a]=s}}}(e,t,c),tR("shape",e,t,c),tR("extra",e,t,c),function(e,t,n,r){if(!n)return;var i,o=e.style;if(o){var a=n.transition,s=t.transition;if(a&&!qO(a)){var l=zo(a);!i&&(i=r.style={});for(var u=0;u<l.length;u++){var c=o[f=l[u]];i[f]=c}}else if(e.getAnimationStyleProps&&(qO(s)||qO(a)||F(s,"style")>=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!i&&(i=r.style={});var p=q(n);for(u=0;u<p.length;u++){var f;if(d[f=p[u]]){c=o[f];i[f]=c}}}}}}(e,t,u,c)),h.style=u,function(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,o=0;o<i.length;o++){var a=i[o];"style"===a.targetName&&a.changeTarget(e.style)}}e.setStyle(r)}t.style=null,e.attr(t),t.style=r}(e,h,a),function(e,t){Ae(t,"silent")&&(e.silent=t.silent),Ae(t,"ignore")&&(e.ignore=t.ignore),e instanceof Ga&&Ae(t,"invisible")&&(e.invisible=t.invisible);e instanceof Us&&Ae(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}(e,t),s)if(o){var d={};W(UO,(function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(d[e]=d[e]||{}),z(e?d[e]:d,n.enterFrom))}));var p=jO("enter",e,t,n,i);p.duration>0&&e.animateFrom(d,p)}else!function(e,t,n,r,i){var o=jO("update",e,t,r,n);o.duration>0&&e.animateFrom(i,o)}(e,t,i||0,n,c);YO(e,t),u?e.dirty():e.markRedraw()}function YO(e,t){for(var n=WO(e).leaveToProps,r=0;r<UO.length;r++){var i=UO[r],o=i?t[i]:t;o&&o.leaveTo&&(n||(n=WO(e).leaveToProps={}),i&&(n[i]=n[i]||{}),z(i?n[i]:n,o.leaveTo))}}function ZO(e,t,n,r){if(e){var i=e.parent,o=WO(e).leaveToProps;if(o){var a=jO("update",e,t,n,0);a.done=function(){i.remove(e)},e.animateTo(o,a)}else i.remove(e)}}function qO(e){return"all"===e}var KO,$O={},JO={setTransform:function(e,t){return"production"!==process.env.NODE_ENV&&me(Ae(GO,e),"Only "+HO+" available in `setTransform`."),$O.el[e]=t,this},getTransform:function(e){return"production"!==process.env.NODE_ENV&&me(Ae(GO,e),"Only "+HO+" available in `getTransform`."),$O.el[e]},setShape:function(e,t){"production"!==process.env.NODE_ENV&&QO(e);var n=$O.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){"production"!==process.env.NODE_ENV&&QO(e);var t=$O.el.shape;if(t)return t[e]},setStyle:function(e,t){"production"!==process.env.NODE_ENV&&QO(e);var n=$O.el,r=n.style;return r&&("production"!==process.env.NODE_ENV&&ce(t)&&Ao("style."+e+" must not be assigned with NaN."),r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){"production"!==process.env.NODE_ENV&&QO(e);var t=$O.el.style;if(t)return t[e]},setExtra:function(e,t){return"production"!==process.env.NODE_ENV&&QO(e),($O.el.extra||($O.el.extra={}))[e]=t,this},getExtra:function(e){"production"!==process.env.NODE_ENV&&QO(e);var t=$O.el.extra;if(t)return t[e]}};function QO(e){if("production"!==process.env.NODE_ENV&&("transition"===e||"enterFrom"===e||"leaveTo"===e))throw new Error('key must not be "'+e+'"')}function eR(){var e=this,t=e.el;if(t){var n=WO(t).userDuring,r=e.userDuring;n===r?($O.el=t,r(JO)):e.el=e.userDuring=null}}function tR(e,t,n,r){var i=n[e];if(i){var o,a=t[e];if(a){var s=n.transition,l=i.transition;if(l)if(!o&&(o=r[e]={}),qO(l))z(o,a);else for(var u=zo(l),c=0;c<u.length;c++){var h=a[p=u[c]];o[p]=h}else if(qO(s)||F(s,e)>=0){!o&&(o=r[e]={});var d=q(a);for(c=0;c<d.length;c++){var p;h=a[p=d[c]];rR(i[p],h)&&(o[p]=h)}}}}}function nR(e,t,n){var r=t[e];if(r)for(var i=n[e]={},o=q(r),a=0;a<o.length;a++){var s=o[a];i[s]=Vr(r[s])}}function rR(e,t){return U(e)?e!==t:null!=e&&isFinite(e)}"production"!==process.env.NODE_ENV&&(KO=function(e,t){Ae(GO,e)||Ao("Prop `"+e+"` is not a permitted in `"+t+"`. Only `"+q(GO).join("`, `")+"` are permitted.")});var iR=$o(),oR=["percent","easing","shape","style","extra"];function aR(e){e.stopAnimation("keyframe"),e.attr(iR(e))}function sR(e,t,n){if(n.isAnimationEnabled()&&t)if(J(t))W(t,(function(t){sR(e,t,n)}));else{var r=t.keyframes,i=t.duration;if(n&&null==i){var o=Ac("enter",n,0);i=o&&o.duration}if(r&&i){var a=iR(e);W(UO,(function(n){if(!n||e[n]){var o,s=!1;r.sort((function(e,t){return e.percent-t.percent})),W(r,(function(r){var l=e.animators,u=n?r[n]:r;if("production"!==process.env.NODE_ENV&&r.percent>=1&&(s=!0),u){var c=q(u);if(n||(c=Y(c,(function(e){return F(oR,e)<0}))),c.length){o||((o=e.animate(n,t.loop,!0)).scope="keyframe");for(var h=0;h<l.length;h++)l[h]!==o&&l[h].targetName===o.targetName&&l[h].stopTracks(c);n&&(a[n]=a[n]||{});var d=n?a[n]:a;W(c,(function(t){d[t]=((n?e[n]:e)||{})[t]})),o.whenWithKeys(i*r.percent,u,c,r.easing)}}})),o&&("production"!==process.env.NODE_ENV&&(s||Ao("End frame with percent: 1 is missing in the keyframeAnimation.",!0)),o.delay(t.delay||0).duration(i).start(t.easing))}}))}}}var lR="emphasis",uR="normal",cR="blur",hR="select",dR=[uR,lR,cR,hR],pR={normal:["itemStyle"],emphasis:[lR,"itemStyle"],blur:[cR,"itemStyle"],select:[hR,"itemStyle"]},fR={normal:["label"],emphasis:[lR,"label"],blur:[cR,"label"],select:[hR,"label"]},gR=["x","y"],mR={normal:{},emphasis:{},blur:{},select:{}},vR={cartesian2d:function(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:K(AO,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:K(IO,e)}}},single:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:K(EO,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),o=n.dataToAngle(r[1]),a=e.coordToPoint([i,o]);return a.push(i,o*Math.PI/180),a},size:K(LO,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function yR(e){return e instanceof Us}function _R(e){return e instanceof Ga}var xR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._data,o=e.getData(),a=this.group,s=MR(e,o,t,n);i||a.removeAll(),o.diff(i).add((function(t){DR(n,null,t,s(t,r),e,a,o)})).remove((function(t){var n=i.getItemGraphicEl(t);n&&ZO(n,CO(n).option,e)})).update((function(t,l){var u=i.getItemGraphicEl(l);DR(n,u,t,s(t,r),e,a,o)})).execute();var l=e.get("clip",!0)?iT(e.coordinateSystem,!1,e):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,r,i){var o=t.getData(),a=MR(t,o,n,r),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=DR(null,null,u,a(u,i),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){hh(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,r){var i=t.element;if(null==i||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},t.type="custom",t}(Kg);function bR(e){var t,n=e.type;if("path"===n){var r=e.shape,i=null!=r.width&&null!=r.height?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,o=zR(r);t=jc(o,null,i,r.layout||"center"),CO(t).customPathData=o}else if("image"===n)t=new Zs({}),CO(t).customImagePath=e.style.image;else if("text"===n)t=new il({});else if("group"===n)t=new Wi;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var a=Wc(n);if(!a){var s="";"production"!==process.env.NODE_ENV&&(s='graphic type "'+n+'" can not be found.'),Po(s)}t=new a}return CO(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function wR(e,t,n,r,i,o,a){aR(t);var s=i&&i.normal.cfg;s&&t.setTextConfig(s),r&&null==r.transition&&(r.transition=gR);var l=r&&r.style;if(l){if("text"===t.type){var u=l;Ae(u,"textFill")&&(u.fill=u.textFill),Ae(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,h=yR(t)?l.decal:null;e&&h&&(h.dirty=!0,c=Rv(h,e)),l.__decalPattern=c}_R(t)&&(l&&(c=l.__decalPattern)&&(l.decal=c));XO(t,r,o,{dataIndex:n,isInit:a,clearStyle:!0}),sR(t,r.keyframeAnimation,o)}function SR(e,t,n,r,i){var o=t.isGroup?null:t,a=i&&i[e].cfg;if(o){var s=o.ensureState(e);if(!1===r){var l=o.getState(e);l&&(l.style=null)}else s.style=r||null;a&&(s.textConfig=a),Ul(o)}}function TR(e,t,n){var r=n===uR,i=r?t:LR(t,n),o=i?i.z2:null;null!=o&&((r?e:e.ensureState(n)).z2=o||0)}function MR(e,t,n,r){var i=e.get("renderItem"),o=e.coordinateSystem,a={};o&&("production"!==process.env.NODE_ENV&&(me(i,"series.render is required."),me(o.prepareCustoms||vR[o.type],"This coordSys does not support custom series.")),a=o.prepareCustoms?o.prepareCustoms(o):vR[o.type](o));for(var s,l,u=V({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:function(e,n){return null==n&&(n=s),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,r){"production"!==process.env.NODE_ENV&&VO("api.style","Please write literal style directly instead.");null==r&&(r=s);var i=t.getItemVisual(r,"style"),o=i&&i.fill,a=i&&i.opacity,l=y(r,uR).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:ee(o)?o:"#000"},c=_(r,uR),h=yh(c,null,u,!1,!0);h.text=c.getShallow("show")?de(e.getFormattedLabel(r,uR),VS(t,r)):null;var d=_h(c,u,!1);return b(n,l),l=kO(l,h,d),n&&x(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=s),e=e||0;var r=t.getDimensionInfo(e);if(!r){var i=t.getDimensionIndex(e);return i>=0?t.getStore().get(i,n):void 0}var o=t.get(r.name,n),a=r&&r.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,r){"production"!==process.env.NODE_ENV&&VO("api.styleEmphasis","Please write literal style directly instead.");null==r&&(r=s);var i=y(r,lR).getItemStyle(),o=_(r,lR),a=yh(o,null,null,!0,!0);a.text=o.getShallow("show")?pe(e.getFormattedLabel(r,lR),e.getFormattedLabel(r,uR),VS(t,r)):null;var l=_h(o,null,!0);return b(n,i),i=kO(i,a,l),n&&x(i,n),i.legacy=!0,i},visual:function(e,n){if(null==n&&(n=s),Ae(TO,e)){var r=t.getItemVisual(n,"style");return r?r[TO[e]]:null}if(Ae(MO,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===o.type){return function(e){var t=[],n=e.axis,r="axis0";if("category"===n.type){for(var i=n.getBandWidth(),o=0;o<e.count;o++)t.push(V({bandWidth:i,axisKey:r,stackId:ax+o},e));var a=hx(t),s=[];for(o=0;o<e.count;o++){var l=a[r][ax+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(V({axis:o.getBaseAxis()},e))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return Th(e,n)}},a.api||{}),c={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:a.coordSys,dataInsideLength:t.count(),encode:CR(e.getData())},h={},d={},p={},f={},g=0;g<dR.length;g++){var m=dR[g];p[m]=e.getModel(pR[m]),f[m]=e.getModel(fR[m])}function v(e){return e===s?l||(l=t.getItemModel(e)):t.getItemModel(e)}function y(e,n){return t.hasItemOption?e===s?h[n]||(h[n]=v(e).getModel(pR[n])):v(e).getModel(pR[n]):p[n]}function _(e,n){return t.hasItemOption?e===s?d[n]||(d[n]=v(e).getModel(fR[n])):v(e).getModel(fR[n]):f[n]}return function(e,n){return s=e,l=null,h={},d={},i&&i(V({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},c),u)};function x(e,t){for(var n in t)Ae(t,n)&&(e[n]=t[n])}function b(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function CR(e){var t={};return W(e.dimensions,(function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim;(t[i]=t[i]||[])[r.coordDimIndex]=e.getDimensionIndex(n)}})),t}function DR(e,t,n,r,i,o,a){if(r){var s=AR(e,t,n,r,i,o);return s&&a.setItemGraphicEl(n,s),s&&au(s,r.focus,r.blurScope,r.emphasisDisabled),s}o.remove(t)}function AR(e,t,n,r,i,o){"production"!==process.env.NODE_ENV&&me(r,"should not have an null/undefined element setting");var a=-1,s=t;t&&IR(t,r,i)&&(a=F(o.childrenRef(),t),t=null);var l,u,c=!t,h=t;h?h.clearStates():(h=bR(r),s&&(l=s,(u=h).copyTransform(l),_R(u)&&_R(l)&&(u.setStyle(l.style),u.z=l.z,u.z2=l.z2,u.zlevel=l.zlevel,u.invisible=l.invisible,u.ignore=l.ignore,yR(u)&&yR(l)&&u.setShape(l.shape)))),!1===r.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),mR.normal.cfg=mR.normal.conOpt=mR.emphasis.cfg=mR.emphasis.conOpt=mR.blur.cfg=mR.blur.conOpt=mR.select.cfg=mR.select.conOpt=null,mR.isLegacy=!1,function(e,t,n,r,i,o){if(e.isGroup)return;ER(n,null,o),ER(n,lR,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===a)c&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=bR(a),e.setTextContent(c)),wR(null,c,t,a,null,r,i);for(var h=a&&a.style,d=0;d<dR.length;d++){var p=dR[d];if(p!==uR){var f=o[p].conOpt;SR(p,c,0,NR(a,f,p),null)}}h?c.dirty():c.markRedraw()}}}(h,n,r,i,c,mR),function(e,t,n,r,i){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&IR(a,o,r)&&(a=null),a||(a=bR(o),"production"!==process.env.NODE_ENV&&me(yR(a),"Only any type of `path` can be used in `clipPath`, rather than "+a.type+"."),e.setClipPath(a)),wR(null,a,t,o,null,r,i)}}(h,n,r,i,c),wR(e,h,n,r,mR,i,c),Ae(r,"info")&&(CO(h).info=r.info);for(var d=0;d<dR.length;d++){var p=dR[d];if(p!==uR){var f=LR(r,p);SR(p,h,0,NR(r,f,p),mR)}}return function(e,t,n){if(!e.isGroup){var r=e,i=n.currentZ,o=n.currentZLevel;r.z=i,r.zlevel=o;var a=t.z2;null!=a&&(r.z2=a||0);for(var s=0;s<dR.length;s++)TR(r,t,dR[s])}}(h,r,i),"group"===r.type&&function(e,t,n,r,i){var o=r.children,a=o?o.length:0,s=r.$mergeChildren,l="byName"===s||r.diffChildrenByName,u=!1===s;if(!a&&!l&&!u)return;if(l)return c={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:i,group:t},void new s_(c.oldChildren,c.newChildren,OR,OR,c).add(RR).update(RR).remove(kR).execute();var c;u&&t.removeAll();for(var h=0;h<a;h++){var d=o[h],p=t.childAt(h);d?(null==d.ignore&&(d.ignore=!1),AR(e,p,n,d,i,t)):("production"!==process.env.NODE_ENV&&me(p,"renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."),p.ignore=!0)}for(var f=t.childCount()-1;f>=h;f--){var g=t.childAt(f);PR(t,g,i)}}(e,h,n,r,i),a>=0?o.replaceAt(h,a):o.add(h),h}function IR(e,t,n){var r,i=CO(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==i.customGraphicType||"path"===o&&((r=a)&&(Ae(r,"pathData")||Ae(r,"d")))&&zR(a)!==i.customPathData||"image"===o&&Ae(s,"image")&&s.image!==i.customImagePath}function ER(e,t,n){var r=t?LR(e,t):e,i=t?NR(e,r,lR):e.style,o=e.type,a=r?r.textConfig:null,s=e.textContent,l=s?t?LR(s,t):s:null;if(i&&(n.isLegacy||PO(i,o,!!a,!!l))){n.isLegacy=!0;var u=OO(i,o,!t);!a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text"),"production"!==process.env.NODE_ENV&&me("text"===c.type,'textContent.type must be "text"')}var h=t?n[t]:n.normal;h.cfg=a,h.conOpt=l}function LR(e,t){return t?e?e[t]:null:e}function NR(e,t,n){var r=t&&t.style;return null==r&&n===lR&&e&&(r=e.styleEmphasis),r}function PR(e,t,n){t&&ZO(t,CO(e).option,n)}function OR(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function RR(e,t){var n=this.context,r=null!=e?n.newChildren[e]:null,i=null!=t?n.oldChildren[t]:null;AR(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function kR(e){var t=this.context,n=t.oldChildren[e];n&&ZO(n,CO(n).option,t.seriesModel)}function zR(e){return e&&(e.pathData||e.d)}var VR=$o(),BR=O,FR=K,GR=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==o){this._lastValue=i,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,i,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(a){var h=$(HR,t,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,t)}else a=this._group=new Wi,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);XR(a,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),r=e.axis,i="category"===r.type,o=t.get("snap");if(!o&&!i)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(i&&r.getBandWidth()>a)return!0;if(o){var s=ZM(e).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var o=VR(e).pointerEl=new dh[i.type](BR(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=VR(e).labelEl=new il(BR(t.label));e.add(i),WR(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=VR(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=VR(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),WR(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return i&&r.remove(i),void(this._handle=null);this._handle||(t=!0,i=this._handle=oh(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){bt(e.event)},onmousedown:FR(this._onHandleDragMove,this,0,0),drift:FR(this._onHandleDragMove,this),ondragend:FR(this._onHandleDragEnd,this)}),r.add(i)),XR(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");J(s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,am(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){HR(this._axisPointerModel,!t&&this._moveAnimation,this._handle,jR(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(jR(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(jR(r)),VR(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),sm(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function HR(e,t,n,r){UR(VR(n).lastProp,r)||(VR(n).lastProp=r,t?Ec(n,r,e):(n.stopAnimation(),n.attr(r)))}function UR(e,t){if(re(e)&&re(t)){var n=!0;return W(t,(function(t,r){n=n&&UR(e[r],t)})),!!n}return e===t}function WR(e,t){e[t.get(["label","show"])?"show":"hide"]()}function jR(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function XR(e,t,n){var r=t.get("z"),i=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=r&&(e.z=r),null!=i&&(e.zlevel=i),e.silent=n)}))}function YR(e){var t,n=e.get("type"),r=e.getModel(n+"Style");return"line"===n?(t=r.getLineStyle()).fill=null:"shadow"===n&&((t=r.getAreaStyle()).stroke=null),t}function ZR(e,t,n,r,i){var o=qR(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=Ed(a.get("padding")||0),l=a.getFont(),u=Ai(o,l),c=i.position,h=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=i.align;"right"===p&&(c[0]-=h),"center"===p&&(c[0]-=h/2);var f=i.verticalAlign;"bottom"===f&&(c[1]-=d),"middle"===f&&(c[1]-=d/2),function(e,t,n,r){var i=r.getWidth(),o=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,o)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(c,h,d,r);var g=a.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:yh(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function qR(e,t,n,r,i){e=t.scale.parse(e);var o=t.scale.getLabel({value:e},{precision:i.precision}),a=i.formatter;if(a){var s={value:Wx(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};W(r,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)})),ee(a)?o=a.replace("{value}",o):Q(a)&&(o=a(s))}return o}function KR(e,t,n){var r=[1,0,0,1,0,0];return Lt(r,r,n.rotation),Et(r,r,n.position),Qc([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function $R(e,t,n,r,i,o){var a=FM.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get(["label","margin"]),ZR(t,r,i,o,{position:KR(r.axis,e,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function JR(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function QR(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function ek(e,t,n,r,i,o){return{cx:e,cy:t,r0:n,r:r,startAngle:i,endAngle:o,clockwise:!0}}var tk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis,a=o.grid,s=r.get("type"),l=nk(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(t,!0));if(s&&"none"!==s){var c=YR(r),h=rk[s](o,u,l);h.style=c,e.graphicKey=h.type,e.pointer=h}$R(t,e,EM(a.model,n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=EM(t.axis.grid.model,t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=KR(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.grid,a=i.getGlobalExtent(!0),s=nk(o,i).getOtherAxis(i).getGlobalExtent(),l="x"===i.dim?0:1,u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];h[l]=u[l];return{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(GR);function nk(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var rk={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:JR([t,n[0]],[t,n[1]],ik(e))}},shadow:function(e,t,n){var r=Math.max(1,e.getBandWidth()),i=n[1]-n[0];return{type:"Rect",shape:QR([t-r/2,n[0]],[r,i],ik(e))}}};function ik(e){return"x"===e.dim?0:1}var ok=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}($d),ak=$o(),sk=W;function lk(e,t,n){if(!d.node){var r=t.getZr();ak(r).records||(ak(r).records={}),function(e,t){if(ak(e).initialized)return;function n(n,r){e.on(n,(function(n){var i=function(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}(t);sk(ak(e).records,(function(e){e&&r(e,n,i.dispatchAction)})),function(e,t){var n,r=e.showTip.length,i=e.hideTip.length;r?n=e.showTip[r-1]:i&&(n=e.hideTip[i-1]);n&&(n.dispatchAction=null,t.dispatchAction(n))}(i.pendings,t)}))}ak(e).initialized=!0,n("click",$(ck,"click")),n("mousemove",$(ck,"mousemove")),n("globalout",uk)}(r,t),(ak(r).records[e]||(ak(r).records[e]={})).handler=n}}function uk(e,t,n){e.handler("leave",null,n)}function ck(e,t,n,r){t.handler(e,n,r)}function hk(e,t){if(!d.node){var n=t.getZr();(ak(n).records||{})[e]&&(ak(n).records[e]=null)}}var dk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=t.getComponent("tooltip"),i=e.get("triggerOn")||r&&r.get("triggerOn")||"mousemove|click";lk("axisPointer",n,(function(e,t,n){"none"!==i&&("leave"===e||i.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){hk("axisPointer",t)},t.prototype.dispose=function(e,t){hk("axisPointer",t)},t.type="axisPointer",t}(Xg);function pk(e,t){var n,r=[],i=e.seriesIndex;if(null==i||!(n=t.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=Ko(o,e);if(null==a||a<0||J(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,h=u.dim,d="x"===c||"radius"===c?1:0,p=o.mapDimension(h),f=[];f[d]=o.get(p,a),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(f)||[]}else r=l.dataToPoint(o.getValues(j(l.dimensions,(function(e){return o.mapDimension(e)})),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var fk=$o();function gk(e,t,n){var r=e.currTrigger,i=[e.x,e.y],o=e,a=e.dispatchAction||K(n.dispatchAction,n),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){xk(i)&&(i=pk({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},t).point);var l=xk(i),u=o.axesInfo,c=s.axesInfo,h="leave"===r||xk(i),d={},p={},f={list:[],map:{}},g={showPointer:$(vk,p),showTooltip:$(yk,f)};W(s.coordSysMap,(function(e,t){var n=l||e.containPoint(i);W(s.coordSysAxesInfo[t],(function(e,t){var r=e.axis,o=function(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}(u,e);if(!h&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=r.pointToData(i)),null!=a&&mk(e,a,g,!1,d)}}))}));var m={};return W(c,(function(e,t){var n=e.linkGroup;n&&!p[t]&&W(n.axesInfo,(function(t,r){var i=p[r];if(t!==e&&i){var o=i.value;n.mapper&&(o=e.axis.scale.parse(n.mapper(o,_k(t),_k(e)))),m[e.key]=o}}))})),W(m,(function(e,t){mk(c[t],e,g,!0,d)})),function(e,t,n){var r=n.axesInfo=[];W(t,(function(t,n){var i=t.axisPointerModel.option,o=e[n];o?(!t.useHandle&&(i.status="show"),i.value=o.value,i.seriesDataIndices=(o.payloadBatch||[]).slice()):!t.useHandle&&(i.status="hide"),"show"===i.status&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})}))}(p,c,d),function(e,t,n,r){if(xk(t)||!e.list.length)return void r({type:"hideTip"});var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}(f,i,e,a),function(e,t,n){var r=n.getZr(),i="axisPointerLastHighlights",o=fk(r)[i]||{},a=fk(r)[i]={};W(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&W(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;a[t]=e}))}));var s=[],l=[];W(o,(function(e,t){!a[t]&&l.push(e)})),W(a,(function(e,t){!o[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(c,0,n),d}}function mk(e,t,n,r,i){var o=e.axis;if(!o.scale.isBlank()&&o.containData(t))if(e.involveSeries){var a=function(e,t){var n=t.axis,r=n.dim,i=e,o=[],a=Number.MAX_VALUE,s=-1;return W(t.seriesModels,(function(t,l){var u,c,h=t.getData().mapDimensionsAll(r);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(h,e,n);c=d.dataIndices,u=d.nestestValue}else{if(!(c=t.getData().indicesOfNearest(h[0],e,"category"===n.type?.5:null)).length)return;u=t.getData().get(h[0],c[0])}if(null!=u&&isFinite(u)){var p=e-u,f=Math.abs(p);f<=a&&((f<a||p>=0&&s<0)&&(a=f,s=p,i=u,o.length=0),W(c,(function(e){o.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:o,snapToValue:i}}(t,e),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==i.seriesIndex&&z(i,s[0]),!r&&e.snap&&o.containData(l)&&null!=l&&(t=l),n.showPointer(e,t,s),n.showTooltip(e,a,l)}else n.showPointer(e,t)}function vk(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function yk(e,t,n,r){var i=n.payloadBatch,o=t.axis,a=o.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var l=t.coordSys.model,u=KM(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function _k(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=t.componentIndex,n.axisName=n[r+"AxisName"]=t.name,n.axisId=n[r+"AxisId"]=t.id,n}function xk(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function bk(e){JM.registerAxisPointerClass("CartesianAxisPointer",tk),e.registerComponentModel(ok),e.registerComponentView(dk),e.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!J(t)&&(e.axisPointer.link=[t])}})),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=XM(e,t)})),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},gk)}var wk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o).getExtent(),l=o.dataToCoord(t),u=r.get("type");if(u&&"none"!==u){var c=YR(r),h=Sk[u](o,a,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}var d=function(e,t,n,r,i){var o=t.axis,a=o.dataToCoord(e),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,h=r.getRadiusAxis().getExtent();if("radius"===o.dim){var d=[1,0,0,1,0,0];Lt(d,d,s),Et(d,d,[r.cx,r.cy]),l=Qc([a,-i],d);var p=t.getModel("axisLabel").get("rotate")||0,f=FM.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,c=f.textVerticalAlign}else{var g=h[1];l=r.coordToPoint([g+i,a]);var m=r.cx,v=r.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",c=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}(t,n,0,a,r.get(["label","margin"]));ZR(e,n,r,i,d)},t}(GR);var Sk={line:function(e,t,n,r){return"angle"===e.dim?{type:"Line",shape:JR(t.coordToPoint([r[0],n]),t.coordToPoint([r[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,r){var i=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:ek(t.cx,t.cy,r[0],r[1],(-n-i/2)*o,(i/2-n)*o)}:{type:"Sector",shape:ek(t.cx,t.cy,n-i/2,n+i/2,0,2*Math.PI)}}},Tk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}($d),Mk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",ta).models[0]},t.type="polarAxis",t}($d);H(Mk,qx);var Ck=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="angleAxis",t}(Mk),Dk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="radiusAxis",t}(Mk),Ak=function(e){function t(t,n){return e.call(this,"radius",t,n)||this}return l(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t}(Eb);Ak.prototype.dataToRadius=Eb.prototype.dataToCoord,Ak.prototype.radiusToData=Eb.prototype.coordToData;var Ik=$o(),Ek=function(e){function t(t,n){return e.call(this,"angle",t,n||[0,360])||this}return l(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var o=r[0],a=e.dataToCoord(o+1)-e.dataToCoord(o),s=Math.abs(a),l=Ai(null==o?"":o+"",t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var c=Math.max(0,Math.floor(u)),h=Ik(e.model),d=h.lastAutoInterval,p=h.lastTickCount;return null!=d&&null!=p&&Math.abs(d-c)<=1&&Math.abs(p-i)<=1&&d>c?c=d:(h.lastTickCount=i,h.lastAutoInterval=c),c},t}(Eb);Ek.prototype.dataToAngle=Eb.prototype.dataToCoord,Ek.prototype.angleToData=Eb.prototype.coordToData;var Lk=["radius","angle"],Nk=function(){function e(e){this.dimensions=Lk,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new Ak,this._angleAxis=new Ek,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===e&&t.push(n),r.scale.type===e&&t.push(r),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),o=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);r.inverse?o=a-360:a=o+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,u=l<o?1:-1;l<o||l>a;)l+=360*u;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),r=Math.PI/180,i=1e-4;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*r,endAngle:-n[1]*r,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,r=t-this.cy,o=n*n+r*r,a=this.r,s=this.r0;return a!==s&&o-i<=a*a&&o+i>=s*s}}},e.prototype.convertToPixel=function(e,t,n){return Pk(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return Pk(t)===this?this.pointToData(n):null},e}();function Pk(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function Ok(e,t){var n=this,r=n.getAngleAxis(),i=n.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();W(Zx(t,"radius"),(function(e){i.scale.unionExtentFromData(t,e)})),W(Zx(t,"angle"),(function(e){r.scale.unionExtentFromData(t,e)}))}})),Gx(r.scale,r.model),Gx(i.scale,i.model),"category"===r.type&&!r.onBand){var o=r.getExtent(),a=360/r.scale.count();r.inverse?o[1]+=a:o[1]-=a,r.setExtent(o[0],o[1])}}function Rk(e,t){var n;if(e.type=t.get("type"),e.scale=Hx(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),function(e){return"angleAxis"===e.mainType}(t)){e.inverse=e.inverse!==t.get("clockwise");var r=t.get("startAngle"),i=null!==(n=t.get("endAngle"))&&void 0!==n?n:r+(e.inverse?-360:360);e.setExtent(r,i)}t.axis=e,e.model=t}var kk={dimensions:Lk,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,r){var i=new Nk(r+"");i.update=Ok;var o=i.getRadiusAxis(),a=i.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");Rk(o,s),Rk(a,l),function(e,t,n){var r=t.get("center"),i=n.getWidth(),o=n.getHeight();e.cx=to(r[0],i),e.cy=to(r[1],o);var a=e.getRadiusAxis(),s=Math.min(i,o)/2,l=t.get("radius");null==l?l=[0,"100%"]:J(l)||(l=[0,l]);var u=[to(l[0],s),to(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}(i,e,t),n.push(i),e.coordinateSystem=i,i.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",ta).models[0];if("production"!==process.env.NODE_ENV&&!t)throw new Error('Polar "'+he(e.get("polarIndex"),e.get("polarId"),0)+'" not found');e.coordinateSystem=t.coordinateSystem}})),n}},zk=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Vk(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var r=e.coordToPoint([t[0],n]),i=e.coordToPoint([t[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function Bk(e){return e.getRadiusAxis().inverse?0:1}function Fk(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var Gk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return l(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=j(n.getViewLabels(),(function(e){e=O(e);var t=n.scale,r="ordinal"===t.type?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(r),e}));Fk(s),Fk(o),W(zk,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||Hk[t](this.group,e,r,o,a,i,s)}),this)}},t.type="angleAxis",t}(JM),Hk={axisLine:function(e,t,n,r,i,o){var a,s=t.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),u=Math.PI/180,c=l.getExtent(),h=Bk(n),d=h?0:1,p=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(a=0===o[d]?new dh[p]({shape:{cx:n.cx,cy:n.cy,r:o[h],startAngle:-c[0]*u,endAngle:-c[1]*u,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new tc({shape:{cx:n.cx,cy:n.cy,r:o[h],r0:o[d]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(a)},axisTick:function(e,t,n,r,i,o){var a=t.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[Bk(n)],u=j(r,(function(e){return new uc({shape:Vk(n,[l,l+s],e.coord)})}));e.add(Zc(u,{style:V(a.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,r,i,o){if(i.length){for(var a=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[Bk(n)],c=[],h=0;h<i.length;h++)for(var d=0;d<i[h].length;d++)c.push(new uc({shape:Vk(n,[u,u+l],i[h][d].coord)}));e.add(Zc(c,{style:V(s.getModel("lineStyle").getLineStyle(),V(a.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(e,t,n,r,i,o,a){var s=t.getCategories(!0),l=t.getModel("axisLabel"),u=l.get("margin"),c=t.get("triggerEvent");W(a,(function(r,i){var a=l,h=r.tickValue,d=o[Bk(n)],p=n.coordToPoint([d+u,r.coord]),f=n.cx,g=n.cy,m=Math.abs(p[0]-f)/d<.3?"center":p[0]>f?"left":"right",v=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[h]){var y=s[h];re(y)&&y.textStyle&&(a=new Fh(y.textStyle,l,l.ecModel))}var _=new il({silent:FM.isLabelSilent(t),style:yh(a,{x:p[0],y:p[1],fill:a.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:r.formattedLabel,align:m,verticalAlign:v})});if(e.add(_),c){var x=FM.makeAxisEventDataBase(t);x.targetType="axisLabel",x.value=r.rawLabel,vl(_).eventData=x}}),this)},splitLine:function(e,t,n,r,i,o){var a=t.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<r.length;c++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new uc({shape:Vk(n,o,r[c].coord)}))}for(c=0;c<u.length;c++)e.add(Zc(u[c],{style:V({stroke:s[c%s.length]},a.getLineStyle()),silent:!0,z:t.get("z")}))},minorSplitLine:function(e,t,n,r,i,o){if(i.length){for(var a=t.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<i.length;l++)for(var u=0;u<i[l].length;u++)s.push(new uc({shape:Vk(n,o,i[l][u].coord)}));e.add(Zc(s,{style:a.getLineStyle(),silent:!0,z:t.get("z")}))}},splitArea:function(e,t,n,r,i,o){if(r.length){var a=t.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=Math.PI/180,h=-r[0].coord*c,d=Math.min(o[0],o[1]),p=Math.max(o[0],o[1]),f=t.get("clockwise"),g=1,m=r.length;g<=m;g++){var v=g===m?r[0].coord:r[g].coord,y=l++%s.length;u[y]=u[y]||[],u[y].push(new Qu({shape:{cx:n.cx,cy:n.cy,r0:d,r:p,startAngle:h,endAngle:-v*c,clockwise:f},silent:!0})),h=-v*c}for(g=0;g<u.length;g++)e.add(Zc(u[g],{style:V({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}},Uk=["axisLine","axisTickLabel","axisName"],Wk=["splitLine","splitArea","minorSplitLine"],jk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return l(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=this._axisGroup,r=this._axisGroup=new Wi;this.group.add(r);var i=e.axis,o=i.polar,a=o.getAngleAxis(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=a.getExtent()[0],c=i.getExtent(),h=function(e,t,n){return{position:[e.cx,e.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(o,e,u),d=new FM(e,h);W(Uk,d.add,d),r.add(d.getGroup()),nh(n,r,e),W(Wk,(function(t){e.get([t,"show"])&&!i.scale.isBlank()&&Xk[t](this.group,e,o,u,c,s,l)}),this)}},t.type="radiusAxis",t}(JM),Xk={splitLine:function(e,t,n,r,i,o){var a=t.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0,u=n.getAngleAxis(),c=Math.PI/180,h=u.getExtent(),d=360===Math.abs(h[1]-h[0])?"Circle":"Arc";s=s instanceof Array?s:[s];for(var p=[],f=0;f<o.length;f++){var g=l++%s.length;p[g]=p[g]||[],p[g].push(new dh[d]({shape:{cx:n.cx,cy:n.cy,r:Math.max(o[f].coord,0),startAngle:-h[0]*c,endAngle:-h[1]*c,clockwise:u.inverse}}))}for(f=0;f<p.length;f++)e.add(Zc(p[f],{style:V({stroke:s[f%s.length],fill:null},a.getLineStyle()),silent:!0}))},minorSplitLine:function(e,t,n,r,i,o,a){if(a.length){for(var s=t.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<a.length;u++)for(var c=0;c<a[u].length;c++)l.push(new ku({shape:{cx:n.cx,cy:n.cy,r:a[u][c].coord}}));e.add(Zc(l,{style:V({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(e,t,n,r,i,o){if(o.length){var a=t.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=o[0].coord,h=1;h<o.length;h++){var d=l++%s.length;u[d]=u[d]||[],u[d].push(new Qu({shape:{cx:n.cx,cy:n.cy,r0:c,r:o[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),c=o[h].coord}for(h=0;h<u.length;h++)e.add(Zc(u[h],{style:V({fill:s[h%s.length]},a.getAreaStyle()),silent:!0}))}}};function Yk(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function Zk(e,t){return t.dim+e.model.componentIndex}function qk(e,t,n){var r={},i=function(e){var t={};W(e,(function(e,n){var r=e.getData(),i=e.coordinateSystem,o=i.getBaseAxis(),a=Zk(i,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/r.count(),u=t[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;t[a]=u;var h=Yk(e);c[h]||u.autoWidthCount++,c[h]=c[h]||{width:0,maxWidth:0};var d=to(e.get("barWidth"),l),p=to(e.get("barMaxWidth"),l),f=e.get("barGap"),g=e.get("barCategoryGap");d&&!c[h].width&&(d=Math.min(u.remainedWidth,d),c[h].width=d,u.remainedWidth-=d),p&&(c[h].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return W(t,(function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,o=to(e.categoryGap,i),a=to(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-o)/(l+(l-1)*a);u=Math.max(u,0),W(r,(function(e,t){var n=e.maxWidth;n&&n<u&&(n=Math.min(n,s),e.width&&(n=Math.min(n,e.width)),s-=n,e.width=n,l--)})),u=(s-o)/(l+(l-1)*a),u=Math.max(u,0);var c,h=0;W(r,(function(e,t){e.width||(e.width=u),c=e,h+=e.width*(1+a)})),c&&(h-=c.width*a);var d=-h/2;W(r,(function(e,r){n[t][r]=n[t][r]||{offset:d,width:e.width},d+=e.width*(1+a)}))})),n}(Y(t.getSeriesByType(e),(function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&"polar"===e.coordinateSystem.type})));t.eachSeriesByType(e,(function(e){if("polar"===e.coordinateSystem.type){var t=e.getData(),n=e.coordinateSystem,o=n.getBaseAxis(),a=Zk(n,o),s=Yk(e),l=i[a][s],u=l.offset,c=l.width,h=n.getOtherAxis(o),d=e.coordinateSystem.cx,p=e.coordinateSystem.cy,f=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;r[s]=r[s]||[];for(var m=t.mapDimension(h.dim),v=t.mapDimension(o.dim),y=B_(t,m),_="radius"!==o.dim||!e.get("roundCap",!0),x=h.model.get("startValue"),b=h.dataToCoord(x||0),w=0,S=t.count();w<S;w++){var T=t.get(m,w),M=t.get(v,w),C=T>=0?"p":"n",D=b;y&&(r[s][M]||(r[s][M]={p:b,n:b}),D=r[s][M][C]);var A=void 0,I=void 0,E=void 0,L=void 0;if("radius"===h.dim){var N=h.dataToCoord(T)-b,P=o.dataToCoord(M);Math.abs(N)<f&&(N=(N<0?-1:1)*f),A=D,I=D+N,L=(E=P-u)-c,y&&(r[s][M][C]=I)}else{var O=h.dataToCoord(T,_)-b,R=o.dataToCoord(M);Math.abs(O)<g&&(O=(O<0?-1:1)*g),I=(A=R+u)+c,E=D,L=D+O,y&&(r[s][M][C]=L)}t.setItemLayout(w,{cx:d,cy:p,r0:A,r:I,startAngle:-E*Math.PI/180,endAngle:-L*Math.PI/180,clockwise:E>=L})}}}))}var Kk={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},$k={splitNumber:5},Jk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="polar",t}(Xg);function Qk(e,t){t=t||{};var n=e.coordinateSystem,r=e.axis,i={},o=r.position,a=r.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};i.position=["vertical"===a?u.vertical[o]:l[0],"horizontal"===a?u.horizontal[o]:l[3]];i.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),he(t.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),i.labelRotation="top"===o?-c:c,i.z2=1,i}var ez=["axisLine","axisTickLabel","axisName"],tz=["splitArea","splitLine"],nz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}return l(t,e),t.prototype.render=function(t,n,r,i){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new Wi;var s=Qk(t),l=new FM(t,s);W(ez,l.add,l),o.add(this._axisGroup),o.add(l.getGroup()),W(tz,(function(e){t.get([e,"show"])&&rz[e](this,this.group,this._axisGroup,t)}),this),nh(a,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)},t.prototype.remove=function(){tC(this)},t.type="singleAxis",t}(JM),rz={splitLine:function(e,t,n,r){var i=r.axis;if(!i.scale.isBlank()){var o=r.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),u=r.coordinateSystem.getRect(),c=i.isHorizontal(),h=[],d=0,p=i.getTicksCoords({tickModel:o}),f=[],g=[],m=0;m<p.length;++m){var v=i.toGlobalCoord(p[m].coord);c?(f[0]=v,f[1]=u.y,g[0]=v,g[1]=u.y+u.height):(f[0]=u.x,f[1]=v,g[0]=u.x+u.width,g[1]=v);var y=new uc({shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},silent:!0});Kc(y.shape,l);var _=d++%s.length;h[_]=h[_]||[],h[_].push(y)}var x=a.getLineStyle(["color"]);for(m=0;m<h.length;++m)t.add(Zc(h[m],{style:V({stroke:s[m%s.length]},x),silent:!0}))}},splitArea:function(e,t,n,r){eC(e,n,r,r)}},iz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getCoordSysModel=function(){return this},t.type="singleAxis",t.layoutMode="box",t.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},t}($d);H(iz,qx.prototype);var oz=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.type=i||"value",a.position=o||"bottom",a}return l(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.pointToData=function(e,t){return this.coordinateSystem.pointToData(e)[0]},t}(Eb),az=["single"],sz=function(){function e(e,t,n){this.type="single",this.dimension="single",this.dimensions=az,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=this.dimension,i=new oz(r,Hx(e),[0,0],e.get("type"),e.get("position")),o="category"===i.type;i.onBand=o&&e.get("boundaryGap"),i.inverse=e.get("inverse"),i.orient=e.get("orient"),e.axis=i,i.model=e,i.coordinateSystem=this,this._axis=i},e.prototype.update=function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();W(t.mapDimensionsAll(this.dimension),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),Gx(this._axis.scale,this._axis.model)}}),this)},e.prototype.resize=function(e,t){this._rect=Wd({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},e.prototype.getRect=function(){return this._rect},e.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,n=t.isHorizontal(),r=n?[0,e.width]:[0,e.height],i=t.inverse?1:0;t.setExtent(r[i],r[1-i]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),r=n[0]+n[1],i=e.isHorizontal();e.toGlobalCoord=i?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=i?function(e){return e-t}:function(e){return r-e+t}},e.prototype.getAxis=function(){return this._axis},e.prototype.getBaseAxis=function(){return this._axis},e.prototype.getAxes=function(){return[this._axis]},e.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},e.prototype.containPoint=function(e){var t=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),r=[],i="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),r[i]=t.toGlobalCoord(t.dataToCoord(+e)),r[1-i]=0===i?n.y+n.height/2:n.x+n.width/2,r},e.prototype.convertToPixel=function(e,t,n){return lz(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return lz(t)===this?this.pointToData(n):null},e}();function lz(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}var uz={create:function(e,t){var n=[];return e.eachComponent("singleAxis",(function(r,i){var o=new sz(r,e,t);o.name="single_"+i,o.resize(r,t),r.coordinateSystem=o,n.push(o)})),e.eachSeries((function(e){if("singleAxis"===e.get("coordinateSystem")){var t=e.getReferringComponents("singleAxis",ta).models[0];e.coordinateSystem=t&&t.coordinateSystem}})),n},dimensions:az},cz=["x","y"],hz=["width","height"],dz=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis,a=o.coordinateSystem,s=gz(a,1-fz(o)),l=a.dataToPoint(t)[0],u=r.get("type");if(u&&"none"!==u){var c=YR(r),h=pz[u](o,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}$R(t,e,Qk(n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=Qk(t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=KR(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.coordinateSystem,a=fz(i),s=gz(o,a),l=[e.x,e.y];l[a]+=t[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=gz(o,1-a),c=(u[1]+u[0])/2,h=[c,c];return h[a]=l[a],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},t}(GR),pz={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:JR([t,n[0]],[t,n[1]],fz(e))}},shadow:function(e,t,n){var r=e.getBandWidth(),i=n[1]-n[0];return{type:"Rect",shape:QR([t-r/2,n[0]],[r,i],fz(e))}}};function fz(e){return e.isHorizontal()?0:1}function gz(e,t){var n=e.getRect();return[n[cz[t]],n[cz[t]]+n[hz[t]]]}var mz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="single",t}(Xg);var vz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t,n,r){var i=Zd(t);e.prototype.init.apply(this,arguments),yz(t,i)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),yz(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}($d);function yz(e,t){var n,r=e.cellSize;1===(n=J(r)?r:e.cellSize=[r,r]).length&&(n[1]=n[0]);var i=j([0,1],(function(e){return function(e,t){return null!=e[Gd[t][0]]||null!=e[Gd[t][1]]&&null!=e[Gd[t][2]]}(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));Yd(e,t,{type:"box",ignoreSize:i})}var _z=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=this.group;r.removeAll();var i=e.coordinateSystem,o=i.getRangeInfo(),a=i.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,o,r),this._renderLines(e,o,a,r),this._renderYearText(e,o,a,r),this._renderMonthText(e,s,a,r),this._renderWeekText(e,s,o,a,r)},t.prototype._renderDayRect=function(e,t,n){for(var r=e.coordinateSystem,i=e.getModel("itemStyle").getItemStyle(),o=r.getCellWidth(),a=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var l=r.dataToRect([s],!1).tl,u=new tl({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:i});n.add(u)}},t.prototype._renderLines=function(e,t,n,r){var i=this,o=e.coordinateSystem,a=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,c=0;u.time<=t.end.time;c++){d(u.formatedDate),0===c&&(u=o.getDateInfo(t.start.y+"-"+t.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=o.getDateInfo(h)}function d(t){i._firstDayOfMonth.push(o.getDateInfo(t)),i._firstDayPoints.push(o.dataToRect([t],!1).tl);var l=i._getLinePointsOfOneWeek(e,t,n);i._tlpoints.push(l[0]),i._blpoints.push(l[l.length-1]),s&&i._drawSplitline(l,a,r)}d(o.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,l,n),a,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,l,n),a,r)},t.prototype._getEdgesPoints=function(e,t,n){var r=[e[0].slice(),e[e.length-1].slice()],i="horizontal"===n?0:1;return r[0][i]=r[0][i]-t/2,r[1][i]=r[1][i]+t/2,r},t.prototype._drawSplitline=function(e,t,n){var r=new ac({z2:20,shape:{points:e},style:t});n.add(r)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var r=e.coordinateSystem,i=r.getDateInfo(t),o=[],a=0;a<7;a++){var s=r.getNextNDay(i.time,a),l=r.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},t.prototype._formatterLabel=function(e,t){return ee(e)&&e?(n=e,W(t,(function(e,t){n=n.replace("{"+t+"}",e)})),n):Q(e)?e(t):t.nameMap;var n},t.prototype._yearTextPositionControl=function(e,t,n,r,i){var o=t[0],a=t[1],s=["center","bottom"];"bottom"===r?(a+=i,s=["center","top"]):"left"===r?o-=i:"right"===r?(o+=i,s=["center","top"]):a-=i;var l=0;return"left"!==r&&"right"!==r||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,r){var i=e.getModel("yearLabel");if(i.get("show")){var o=i.get("margin"),a=i.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var p=i.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new il({z2:30,style:yh(i,{text:g}),silent:i.get("silent")});m.attr(this._yearTextPositionControl(m,h[a],n,a,o)),r.add(m)}},t.prototype._monthTextPositionControl=function(e,t,n,r,i){var o="left",a="top",s=e[0],l=e[1];return"horizontal"===n?(l+=i,t&&(o="center"),"start"===r&&(a="bottom")):(s+=i,t&&(a="middle"),"start"===r&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},t.prototype._renderMonthText=function(e,t,n,r){var i=e.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),a=i.get("margin"),s=i.get("position"),l=i.get("align"),u=[this._tlpoints,this._blpoints];o&&!ee(o)||(o&&(t=$h(o)||t),o=t.get(["time","monthAbbr"])||[]);var c="start"===s?0:1,h="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=i.get("silent"),f=0;f<u[c].length-1;f++){var g=u[c][f].slice(),m=this._firstDayOfMonth[f];if(d){var v=this._firstDayPoints[f];g[h]=(v[h]+u[0][f+1][h])/2}var y=i.get("formatter"),_=o[+m.m-1],x={yyyy:m.y,yy:(m.y+"").slice(2),MM:m.m,M:+m.m,nameMap:_},b=this._formatterLabel(y,x),w=new il({z2:30,style:z(yh(i,{text:b}),this._monthTextPositionControl(g,d,n,s,a)),silent:p});r.add(w)}}},t.prototype._weekTextPositionControl=function(e,t,n,r,i){var o="center",a="middle",s=e[0],l=e[1],u="start"===n;return"horizontal"===t?(s=s+r+(u?1:-1)*i[0]/2,o=u?"right":"left"):(l=l+r+(u?1:-1)*i[1]/2,a=u?"bottom":"top"),{x:s,y:l,align:o,verticalAlign:a}},t.prototype._renderWeekText=function(e,t,n,r,i){var o=e.getModel("dayLabel");if(o.get("show")){var a=e.coordinateSystem,s=o.get("position"),l=o.get("nameMap"),u=o.get("margin"),c=a.getFirstDayOfWeek();if(!l||ee(l))l&&(t=$h(l)||t),l=t.get(["time","dayOfWeekShort"])||j(t.get(["time","dayOfWeekAbbr"]),(function(e){return e[0]}));var h=a.getNextNDay(n.end.time,7-n.lweek).time,d=[a.getCellWidth(),a.getCellHeight()];u=to(u,Math.min(d[1],d[0])),"start"===s&&(h=a.getNextNDay(n.start.time,-(7+n.fweek)).time,u=-u);for(var p=o.get("silent"),f=0;f<7;f++){var g,m=a.getNextNDay(h,f),v=a.dataToRect([m.time],!1).center;g=Math.abs((f+c)%7);var y=new il({z2:30,style:z(yh(o,{text:l[g]}),this._weekTextPositionControl(v,r,s,u,d)),silent:p});i.add(y)}}},t.type="calendar",t}(Xg),xz=864e5,bz=function(){function e(t,n,r){this.type="calendar",this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t}return e.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){var t=(e=fo(e)).getFullYear(),n=e.getMonth()+1,r=n<10?"0"+n:""+n,i=e.getDate(),o=i<10?"0"+i:""+i,a=e.getDay();return{y:t+"",m:r,d:o,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+r+"-"+o,date:e}},e.prototype.getNextNDay=function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},e.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,r=["width","height"],i=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),a="horizontal"===this._orient?[n,7]:[7,n];W([0,1],(function(e){u(i,e)&&(o[r[e]]=i[e]*a[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=Wd(o,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}W([0,1],(function(e){u(i,e)||(i[e]=l[r[e]]/a[e])})),this._sw=i[0],this._sh=i[1]},e.prototype.dataToPoint=function(e,t){J(e)&&(e=e[0]),null==t&&(t=!0);var n=this.getDateInfo(e),r=this._rangeInfo,i=n.formatedDate;if(t&&!(n.time>=r.start.time&&n.time<r.end.time+xz))return[NaN,NaN];var o=n.day,a=this._getRangeInfo([r.start.time,i]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]:[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},e.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},e.prototype.dataToRect=function(e,t){var n=this.dataToPoint(e,t);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},e.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,n=Math.floor((e[1]-this._rect.y)/this._sh)+1,r=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,t-1,r):this._getDateByWeeksAndDay(t,n-1,r)},e.prototype.convertToPixel=function(e,t,n){var r=wz(t);return r===this?r.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){var r=wz(t);return r===this?r.pointToData(n):null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.prototype._initRangeOption=function(){var e,t=this._model.get("range");if(J(t)&&1===t.length&&(t=t[0]),J(t))e=t;else{var n=t.toString();if(/^\d{4}$/.test(n)&&(e=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var r=this.getDateInfo(n),i=r.date;i.setMonth(i.getMonth()+1);var o=this.getNextNDay(i,-1);e=[r.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(e=[n,n])}if(!e)return"production"!==process.env.NODE_ENV&&P("Invalid date range."),t;var a=this._getRangeInfo(e);return a.start.time>a.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var r=Math.floor(n[1].time/xz)-Math.floor(n[0].time/xz)+1,i=new Date(n[0].time),o=i.getDate(),a=n[1].date.getDate();i.setDate(o+r-1);var s=i.getDate();if(s!==a)for(var l=i.getTime()-n[1].time>0?1:-1;(s=i.getDate())!==a&&(i.getTime()-n[1].time)*l>0;)r-=l,i.setDate(s-l);var u=Math.floor((r+n[0].day+6)/7),c=t?1-u:u-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:r,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var r=this._getRangeInfo(n);if(e>r.weeks||0===e&&t<r.fweek||e===r.weeks&&t>r.lweek)return null;var i=7*(e-1)-r.fweek+t,o=new Date(r.start.time);return o.setDate(+r.start.d+i),this.getDateInfo(o)},e.create=function(t,n){var r=[];return t.eachComponent("calendar",(function(t){var n=new e(t);r.push(n),t.coordinateSystem=n})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=r[e.get("calendarIndex")||0])})),r},e.dimensions=["time","value"],e}();function wz(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function Sz(e,t){var n;return W(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}var Tz=["transition","enterFrom","leaveTo"],Mz=Tz.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Cz(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var r=n?Tz:Mz,i=0;i<r.length;i++){var o=r[i];null==e[o]&&null!=t[o]&&(e[o]=t[o])}}var Dz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventAutoZ=!0,n}return l(t,e),t.prototype.mergeOption=function(t,n){var r=this.option.elements;this.option.elements=null,e.prototype.mergeOption.call(this,t,n),this.option.elements=r},t.prototype.optionUpdated=function(e,t){var n=this.option,r=(t?n:e).elements,i=n.elements=t?[]:n.elements,o=[];this._flatten(r,o,null);var a=Ho(i,o,"normalMerge"),s=this._elOptionsToUpdate=[];W(a,(function(e,t){var n=e.newOption;"production"!==process.env.NODE_ENV&&me(re(n)||e.existing,"Empty graphic option definition"),n&&(s.push(n),function(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),null==t.parentId){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}(e,n),function(e,t,n){var r=z({},n),i=e[t],o=n.$action||"merge";if("merge"===o)if(i){if("production"!==process.env.NODE_ENV){var a=n.type;me(!a||i.type===a,'Please set $action: "replace" to change `type`')}R(i,r,!0),Yd(i,r,{ignoreSize:!0}),qd(n,i),Cz(n,i),Cz(n,i,"shape"),Cz(n,i,"style"),Cz(n,i,"extra"),n.clipPath=i.clipPath}else e[t]=r;else"replace"===o?e[t]=r:"remove"===o&&i&&(e[t]=null)}(i,t,n),function(e,t){if(e&&(e.hv=t.hv=[Sz(t,["left","right"]),Sz(t,["top","bottom"])],"group"===e.type)){var n=e,r=t;null==n.width&&(n.width=r.width=0),null==n.height&&(n.height=r.height=0)}}(i[t],n))}),this),n.elements=Y(i,(function(e){return e&&delete e.$action,null!=e}))},t.prototype._flatten=function(e,t,n){W(e,(function(e){if(e){n&&(e.parentOption=n),t.push(e);var r=e.children;r&&r.length&&this._flatten(r,t,e),delete e.children}}),this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type="graphic",t.defaultOption={elements:[]},t}($d),Az={path:null,compoundPath:null,group:Wi,image:Zs,text:il},Iz=$o(),Ez=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){this._elMap=Te()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,r=this.group,i=e.get("z"),o=e.get("zlevel");W(t,(function(t){var a=jo(t.id,null),s=null!=a?n.get(a):null,l=jo(t.parentId,null),u=null!=l?n.get(l):r,c=t.type,h=t.style;"text"===c&&h&&t.hv&&t.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var d=t.textContent,p=t.textConfig;if(h&&PO(h,c,!!p,!!d)){var f=OO(h,c,!0);!p&&f.textConfig&&(p=t.textConfig=f.textConfig),!d&&f.textContent&&(d=f.textContent)}var g=function(e){return e=z({},e),W(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Fd),(function(t){delete e[t]})),e}(t);"production"!==process.env.NODE_ENV&&s&&me(u===s.parent,"Changing parent is not supported.");var m=t.$action||"merge",v="merge"===m,y="replace"===m;if(v){var _=s;(C=!s)?_=Nz(a,u,t.type,n):(_&&(Iz(_).isNew=!1),aR(_)),_&&(XO(_,g,e,{isInit:C}),Oz(_,t,i,o))}else if(y){Pz(s,t,n,e);var x=Nz(a,u,t.type,n);x&&(XO(x,g,e,{isInit:!0}),Oz(x,t,i,o))}else"remove"===m&&(YO(s,t),Pz(s,t,n,e));var b=n.get(a);if(b&&d)if(v){var w=b.getTextContent();w?w.attr(d):b.setTextContent(new il(d))}else y&&b.setTextContent(new il(d));if(b){var S=t.clipPath;if(S){var T=S.type,M=void 0,C=!1;if(v){var D=b.getClipPath();M=(C=!D||Iz(D).type!==T)?Lz(T):D}else y&&(C=!0,M=Lz(T));b.setClipPath(M),XO(M,S,e,{isInit:C}),sR(M,S.keyframeAnimation,e)}var A=Iz(b);b.setTextConfig(p),A.option=t,function(e,t,n){var r=vl(e).eventData;e.silent||e.ignore||r||(r=vl(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name});r&&(r.info=n.info)}(b,e,t),uh({el:b,componentModel:e,itemName:b.name,itemTooltipOption:t.tooltip}),sR(b,t.keyframeAnimation,e)}}))}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,r=this.group,i=this._elMap,o=t.getWidth(),a=t.getHeight(),s=["x","y"],l=0;l<n.length;l++){if((f=null!=(p=jo((d=n[l]).id,null))?i.get(p):null)&&f.isGroup){var u=(g=f.parent)===r,c=Iz(f),h=Iz(g);c.width=to(c.option.width,u?o:h.width)||0,c.height=to(c.option.height,u?a:h.height)||0}}for(l=n.length-1;l>=0;l--){var d,p,f;if(f=null!=(p=jo((d=n[l]).id,null))?i.get(p):null){var g=f.parent,m=(h=Iz(g),{}),v=jd(f,d,g===r?{width:o,height:a}:{width:h.width,height:h.height},null,{hv:d.hv,boundingMode:d.bounding},m);if(!Iz(f).isNew&&v){for(var y=d.transition,_={},x=0;x<s.length;x++){var b=s[x],w=m[b];y&&(qO(y)||F(y,b)>=0)?_[b]=w:f[b]=w}Ec(f,_,e,0)}else f.attr(m)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each((function(n){Pz(n,Iz(n).option,t,e._lastGraphicModel)})),this._elMap=Te()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Xg);function Lz(e){"production"!==process.env.NODE_ENV&&me(e,"graphic type MUST be set");var t=Ae(Az,e)?Az[e]:Wc(e);"production"!==process.env.NODE_ENV&&me(t,"graphic type "+e+" can not be found");var n=new t({});return Iz(n).type=e,n}function Nz(e,t,n,r){var i=Lz(n);return t.add(i),r.set(e,i),Iz(i).id=e,Iz(i).isNew=!0,i}function Pz(e,t,n,r){e&&e.parent&&("group"===e.type&&e.traverse((function(e){Pz(e,t,n,r)})),ZO(e,t,r),n.removeKey(Iz(e).id))}function Oz(e,t,n,r){e.isGroup||W([["cursor",Ga.prototype.cursor],["zlevel",r||0],["z",n||0],["z2",0]],(function(n){var r=n[0];Ae(t,r)?e[r]=de(t[r],n[1]):null==e[r]&&(e[r]=n[1])})),W(q(t),(function(n){if(0===n.indexOf("on")){var r=t[n];e[n]=Q(r)?r:null}})),Ae(t,"draggable")&&(e.draggable=t.draggable),null!=t.name&&(e.name=t.name),null!=t.id&&(e.id=t.id)}var Rz=["x","y","radius","angle","single"],kz=["cartesian2d","polar","singleAxis"];function zz(e){return"production"!==process.env.NODE_ENV&&me(e),e+"Axis"}function Vz(e,t){var n,r=Te(),i=[],o=Te();e.eachComponent({mainType:"dataZoom",query:t},(function(e){o.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",a)}while(n);function a(e){!o.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var i=r.get(e);i&&i[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){o.set(e.uid,!0),i.push(e),e.eachTargetAxis((function(e,t){(r.get(e)||r.set(e,[]))[t]=!0}))}return i}function Bz(e){var t=e.ecModel,n={infoList:[],infoMap:Te()};return e.eachTargetAxis((function(e,r){var i=t.getComponent(zz(e),r);if(i){var o=i.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(i)}}})),n}var Fz=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),Gz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return l(t,e),t.prototype.init=function(e,t,n){var r=Hz(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=Hz(e);R(this.option,e,!0),R(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;W([["start","startValue"],["end","endValue"]],(function(e,r){"value"===this._rangePropMode[r]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=Te();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return W(Rz,(function(n){var r=this.getReferringComponents(zz(n),na);if(r.specified){t=!0;var i=new Fz;W(r.models,(function(e){i.add(e.componentIndex)})),e.set(n,i)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i="vertical"===t?"y":"x";o(n.findComponents({mainType:i+"Axis"}),i)}r&&o(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function o(t,n){var i=t[0];if(i){var o=new Fz;if(o.add(i.componentIndex),e.set(n,o),r=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",ta).models[0];a&&W(t,(function(e){i.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",ta).models[0]&&o.add(e.componentIndex)}))}}}r&&W(Rz,(function(t){if(r){var i=n.findComponents({mainType:zz(t),filter:function(e){return"category"===e.get("type",!0)}});if(i[0]){var o=new Fz;o.add(i[0].componentIndex),e.set(t,o),r=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");W([["start","startValue"],["end","endValue"]],(function(r,i){var o=null!=e[r[0]],a=null!=e[r[1]];o&&!a?t[i]="percent":!o&&a?t[i]="value":n?t[i]=n[i]:o&&(t[i]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(zz(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,r){W(n.indexList,(function(n){e.call(t,r,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){"production"!==process.env.NODE_ENV&&me(e&&null!=t);var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(zz(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;W([["start","startValue"],["end","endValue"]],(function(r){null==e[r[0]]&&null==e[r[1]]||(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;W(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],o=this._targetAxisInfoMap.get(i),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(i,o.indexList[a]);if(s.hostedBy(this))return s;t||(t=s)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return"production"!==process.env.NODE_ENV&&me(this._orient),this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t}($d);function Hz(e){var t={};return W(["start","end","startValue","endValue","throttle"],(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}var Uz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.select",t}(Gz),Wz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(Xg),jz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.select",t}(Wz),Xz=W,Yz=ro,Zz=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries((function(t){if(function(e){var t=e.get("coordinateSystem");return F(kz,t)>=0}(t)){var n=zz(this._dimName),r=t.getReferringComponents(n,ta).models[0];r&&this._axisIndex===r.componentIndex&&e.push(t)}}),this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return O(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,r=this.getAxisModel().axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];Xz(["start","end"],(function(l,u){var c=e[l],h=e[l+"Value"];"percent"===i[u]?(null==c&&(c=o[u]),h=r.parse(eo(c,o,n))):(t=!0,c=eo(h=null==h?n[u]:r.parse(h),n,o)),s[u]=null==h||isNaN(h)?n[u]:h,a[u]=null==c||isNaN(c)?o[u]:c})),Yz(s),Yz(a);var l=this._minMaxSpan;function u(e,t,n,i,o){var a=o?"Span":"ValueSpan";cL(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=eo(e[s],n,i,!0),o&&(t[s]=r.parse(t[s]))}return t?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,n){var r=[1/0,-1/0];Xz(n,(function(e){!function(e,t,n){t&&W(Zx(t,n),(function(n){var r=t.getApproximateExtent(n);r[0]<e[0]&&(e[0]=r[0]),r[1]>e[1]&&(e[1]=r[1])}))}(r,e.getData(),t)}));var i=e.getAxisModel(),o=Vx(i.axis.scale,i,r).calculate();return[o.min,o.max]}(this,this._dimName,t),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,r=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;"none"!==i&&Xz(r,(function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if("weakFilter"===i){var a=t.getStore(),s=j(r,(function(e){return t.getDimensionIndex(e)}),t);t.filterSelf((function(e){for(var t,n,i,l=0;l<r.length;l++){var u=a.get(s[l],e),c=!isNaN(u),h=u<o[0],d=u>o[1];if(c&&!h&&!d)return!0;c&&(i=!0),h&&(t=!0),d&&(n=!0)}return i&&t&&n}))}else Xz(r,(function(n){if("empty"===i)e.setData(t=t.map(n,(function(e){return function(e){return e>=o[0]&&e<=o[1]}(e)?e:NaN})));else{var r={};r[n]=o,t.selectRange(r)}}));Xz(r,(function(e){t.setApproximateExtent(o,e)}))}}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;Xz(["min","max"],(function(r){var i=t.get(r+"Span"),o=t.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=eo(n[0]+o,n,[0,100],!0):null!=i&&(o=eo(i,[0,100],n,!0)-n[0]),e[r+"Span"]=i,e[r+"ValueSpan"]=o}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=ao(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;0!==t[0]&&i.setDeterminedMinMax("min",+n[0].toFixed(r)),100!==t[1]&&i.setDeterminedMinMax("max",+n[1].toFixed(r)),i.freeze()}},e}();var qz={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(r,i){var o=e.getComponent(zz(r),i);t(r,i,o,n)}))}))}t((function(e,t,n,r){n.__dzAxisProxy=null}));var n=[];t((function(t,r,i,o){i.__dzAxisProxy||(i.__dzAxisProxy=new Zz(t,r,o,e),n.push(i.__dzAxisProxy))}));var r=Te();return W(n,(function(e){W(e.getTargetSeriesModels(),(function(e){r.set(e.uid,e)}))})),r},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){e.getAxisProxy(t,n).reset(e)})),e.eachTargetAxis((function(n,r){e.getAxisProxy(n,r).filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}}))}};var Kz=!1;function $z(e){Kz||(Kz=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,qz),function(e){e.registerAction("dataZoom",(function(e,t){W(Vz(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}))}(e),e.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function Jz(e){e.registerComponentModel(Uz),e.registerComponentView(jz),$z(e)}var Qz=function(){},eV={};function tV(e,t){eV[e]=t}function nV(e){return eV[e]}var rV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;W(this.option.feature,(function(e,n){var r=nV(n);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),R(e,r.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}($d);function iV(e,t){var n=Ed(t.get("padding")),r=t.getItemStyle(["color","opacity"]);return r.fill=t.get("backgroundColor"),e=new tl({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:r,silent:!0,z2:-1})}var oV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),e.get("show")){var o=+e.get("itemSize"),a="vertical"===e.get("orient"),s=e.get("feature")||{},l=this._features||(this._features={}),u=[];W(s,(function(e,t){u.push(t)})),new s_(this._featureNames||[],u).add(c).update(c).remove($(c,null)).execute(),this._featureNames=u,function(e,t,n){var r=t.getBoxLayoutParams(),i=t.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Wd(r,o,i);Ud(t.get("orient"),e,t.get("itemGap"),a.width,a.height),jd(e,r,o,i)}(i,e,n),i.add(iV(i.getBoundingRect(),e)),a||i.eachChild((function(e){var t=e.__title,r=e.ensureState("emphasis"),a=r.textConfig||(r.textConfig={}),s=e.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!Q(l)&&t){var u=l.style||(l.style={}),c=Ai(t,il.makeFont(u)),h=e.x+i.x,d=!1;e.y+i.y+o+c.height>n.getHeight()&&(a.position="top",d=!0);var p=d?-5-c.height:o+10;h+c.width/2>n.getWidth()?(a.position=["100%",p],u.align="right"):h-c.width/2<0&&(a.position=[0,p],u.align="left")}}))}function c(c,h){var d,p=u[c],f=u[h],g=s[p],m=new Fh(g,e,e.ecModel);if(r&&null!=r.newTitle&&r.featureName===p&&(g.title=r.newTitle),p&&!f){if(function(e){return 0===e.indexOf("my")}(p))d={onclick:m.option.onclick,featureName:p};else{var v=nV(p);if(!v)return;d=new v}l[p]=d}else if(!(d=l[f]))return;d.uid=Hh("toolbox-feature"),d.model=m,d.ecModel=t,d.api=n;var y=d instanceof Qz;p||!f?!m.get("show")||y&&d.unusable?y&&d.remove&&d.remove(t,n):(!function(r,s,l){var u,c,h=r.getModel("iconStyle"),d=r.getModel(["emphasis","iconStyle"]),p=s instanceof Qz&&s.getIcons?s.getIcons():r.get("icon"),f=r.get("title")||{};ee(p)?(u={})[l]=p:u=p;ee(f)?(c={})[l]=f:c=f;var g=r.iconPaths={};W(u,(function(l,u){var p=oh(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(h.getItemStyle()),p.ensureState("emphasis").style=d.getItemStyle();var f=new il({style:{text:c[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null,font:Th({fontStyle:d.get("textFontStyle"),fontFamily:d.get("textFontFamily"),fontSize:d.get("textFontSize"),fontWeight:d.get("textFontWeight")},t)},ignore:!0});p.setTextContent(f),uh({el:p,componentModel:e,itemName:u,formatterParamsExtra:{title:c[u]}}),p.__title=c[u],p.on("mouseover",(function(){var t=d.getItemStyle(),r=a?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";f.setStyle({fill:d.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||r}),f.ignore=!e.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==r.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()})),("emphasis"===r.get(["iconStatus",u])?Xl:Yl)(p),i.add(p),p.on("click",K(s.onclick,s,t,n,u)),g[u]=p}))}(m,d,p),m.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&("emphasis"===t?Xl:Yl)(r[e])},d instanceof Qz&&d.render&&d.render(m,t,n,r)):y&&d.dispose&&d.dispose(t,n)}},t.prototype.updateView=function(e,t,n,r){W(this._features,(function(e){e instanceof Qz&&e.updateView&&e.updateView(e.model,t,n,r)}))},t.prototype.remove=function(e,t){W(this._features,(function(n){n instanceof Qz&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){W(this._features,(function(n){n instanceof Qz&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox",t}(Xg);var aV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.onclick=function(e,t){var n=this.model,r=n.get("name")||e.get("title.0.text")||"echarts",i="svg"===t.getZr().painter.getType(),o=i?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=d.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||i){var l=a.split(","),u=l[0].indexOf("base64")>-1,c=i?decodeURIComponent(l[1]):l[1];u&&(c=window.atob(c));var h=r+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var p=c.length,f=new Uint8Array(p);p--;)f[p]=c.charCodeAt(p);var g=new Blob([f]);window.navigator.msSaveOrOpenBlob(g,h)}else{var m=document.createElement("iframe");document.body.appendChild(m);var v=m.contentWindow,y=v.document;y.open("image/svg+xml","replace"),y.write(c),y.close(),v.focus(),y.execCommand("SaveAs",!0,h),document.body.removeChild(m)}}else{var _=n.get("lang"),x='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(_&&_[0]||"")+'" /></body>',b=window.open();b.document.write(x),b.document.title=r}else{var w=document.createElement("a");w.download=r+"."+o,w.target="_blank",w.href=a;var S=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(S)}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},t}(Qz),sV="__ec_magicType_stack__",lV=[["line","bar"],["stack"]],uV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return W(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get(["seriesIndex",n]);if(cV[n]){var o,a={series:[]};W(lV,(function(e){F(e,n)>=0&&W(e,(function(e){r.setIconStatus(e,"normal")}))})),r.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},(function(e){var t=e.subType,i=e.id,o=cV[n](t,i,e,r);o&&(V(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,ta).models[0].componentIndex;a[u]=a[u]||[];for(var h=0;h<=c;h++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(o=R({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},t}(Qz),cV={line:function(e,t,n,r){if("bar"===e)return R({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(e,t,n,r){if("line"===e)return R({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(e,t,n,r){var i=n.get("stack")===sV;if("line"===e||"bar"===e)return r.setIconStatus("stack",i?"normal":"emphasis"),R({id:t,stack:i?"":sV},r.get(["option","stack"])||{},!0)}};jy({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)}));var hV=new Array(60).join("-"),dV="\t";function pV(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var fV=new RegExp("[\t]+","g");function gV(e,t){var n=e.split(new RegExp("\n*"+hV+"\n*","g")),r={series:[]};return W(n,(function(e,n){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(dV)>=0)return!0}(e)){var i=function(e){for(var t=e.split(/\n+/g),n=[],r=j(pV(t.shift()).split(fV),(function(e){return{name:e,data:[]}})),i=0;i<t.length;i++){var o=pV(t[i]).split(fV);n.push(o.shift());for(var a=0;a<o.length;a++)r[a]&&(r[a].data[i]=o[a])}return{series:r,categories:n}}(e),o=t[n],a=o.axisDim+"Axis";o&&(r[a]=r[a]||[],r[a][o.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{i=function(e){for(var t=e.split(/\n+/g),n=pV(t.shift()),r=[],i=0;i<t.length;i++){var o=pV(t[i]);if(o){var a=o.split(fV),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(e);r.series.push(i)}})),r}var mV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.onclick=function(e,t){setTimeout((function(){t.dispatchAction({type:"hideTip"})}));var n=t.getDom(),r=this.model;this._dom&&n.removeChild(this._dom);var i=document.createElement("div");i.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",i.style.backgroundColor=r.get("backgroundColor")||"#fff";var o=document.createElement("h4"),a=r.get("lang")||[];o.innerHTML=a[0]||r.get("title"),o.style.cssText="margin:10px 20px",o.style.color=r.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="overflow:auto";var u=r.get("optionToContent"),c=r.get("contentToOption"),h=function(e){var t,n,r,i=function(e){var t={},n=[],r=[];return e.eachRawSeries((function(e){var i=e.coordinateSystem;if(!i||"cartesian2d"!==i.type&&"polar"!==i.type)n.push(e);else{var o=i.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;t[a]||(t[a]={categoryAxis:o,valueAxis:i.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),t[a].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:r}}(e);return{value:Y([(n=i.seriesGroupByCategoryAxis,r=[],W(n,(function(e,t){var n=e.categoryAxis,i=e.valueAxis.dim,o=[" "].concat(j(e.series,(function(e){return e.name}))),a=[n.model.getCategories()];W(e.series,(function(e){var t=e.getRawData();a.push(e.getRawData().mapArray(t.mapDimension(i),(function(e){return e})))}));for(var s=[o.join(dV)],l=0;l<a[0].length;l++){for(var u=[],c=0;c<a.length;c++)u.push(a[c][l]);s.push(u.join(dV))}r.push(s.join("\n"))})),r.join("\n\n"+hV+"\n\n")),(t=i.other,j(t,(function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,i=arguments[e-1],o=t.getName(i),a=0;a<e-1;a++)r[a]=arguments[a];n.push((o?o+dV:"")+r.join(dV))})),n.join("\n")})).join("\n\n"+hV+"\n\n"))],(function(e){return!!e.replace(/[\n\t\s]/g,"")})).join("\n\n"+hV+"\n\n"),meta:i.meta}}(e);if(Q(u)){var d=u(t.getOption());ee(d)?s.innerHTML=d:ae(d)&&s.appendChild(d)}else{l.readOnly=r.get("readOnly");var p=l.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=r.get("textColor"),p.borderColor=r.get("textareaBorderColor"),p.backgroundColor=r.get("textareaColor"),l.value=h.value,s.appendChild(l)}var f=h.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+r.get("buttonColor"),m+=";color:"+r.get("buttonTextColor");var _=this;function x(){n.removeChild(i),_._dom=null}xt(v,"click",x),xt(y,"click",(function(){if(null==c&&null!=u||null!=c&&null==u)return"production"!==process.env.NODE_ENV&&Ao("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),void x();var e;try{e=Q(c)?c(s,t.getOption()):gV(l.value,f)}catch(e){throw x(),new Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),x()})),v.innerHTML=a[1],y.innerHTML=a[2],y.style.cssText=v.style.cssText=m,!r.get("readOnly")&&g.appendChild(y),g.appendChild(v),i.appendChild(o),i.appendChild(s),i.appendChild(g),s.style.height=n.clientHeight-80+"px",n.appendChild(i),this._dom=i},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(Qz);function vV(e,t){return j(e,(function(e,n){var r=t&&t[n];if(re(r)&&!J(r)){re(e)&&!J(e)||(e={value:e});var i=null!=r.name&&null==e.name;return e=V(e,r),i&&delete e.name,e}return e}))}jy({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var n=[];W(e.newOption.series,(function(e){var r=t.getSeriesByName(e.name)[0];if(r){var i=r.get("data");n.push({name:e.name,data:vV(e.data,i)})}else n.push(z({type:"scatter"},e))})),t.mergeOption(V({series:n},e.newOption))}));var yV=W,_V=$o();function xV(e){var t=_V(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var bV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.onclick=function(e,t){!function(e){_V(e).snapshots=null}(e),t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(Qz);jy({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")}));var wV=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],SV=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=MV(t,e);W(CV,(function(e,t){(!n||!n.include||F(n.include,t)>=0)&&e(i,r._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var r=IV[e.brushType](0,n,t);e.__rangeOffset={offset:LV[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){W(e,(function(e){var r=this.findTargetInfo(e,t);r&&!0!==r&&W(r.coordSyses,(function(r){var i=IV[e.brushType](1,r,e.range,!0);n(e,i.values,r,t)}))}),this)},e.prototype.setInputRanges=function(e,t){W(e,(function(e){var n,r,i,o,a,s=this.findTargetInfo(e,t);if("production"!==process.env.NODE_ENV&&(me(!s||!0===s||e.coordRange,"coordRange must be specified when coord index specified."),me(!s||!0!==s||e.range,"range must be specified in global brush.")),e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=IV[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?LV[e.brushType](l.values,u.offset,(n=l.xyMinMax,r=u.xyMinMax,i=PV(n),o=PV(r),a=[i[0]/o[0],i[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},e.prototype.makePanelOpts=function(e,t){return j(this._targetInfoList,(function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:dN(r),isTargetByCursor:fN(r,e,n.coordSysModel),getLinearBrushOtherExtent:pN(r)}}))},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return!0===r||r&&F(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=MV(t,e),i=0;i<n.length;i++){var o=n[i],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<DV.length;s++)if(DV[s](r,o))return o}return!0},e}();function TV(e){return e[0]>e[1]&&e.reverse(),e}function MV(e,t){return Qo(e,t,{includeMainTypes:wV})}var CV={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,o=Te(),a={},s={};(n||r||i)&&(W(n,(function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0})),W(r,(function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0})),W(i,(function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0})),o.each((function(e){var i=e.coordinateSystem,o=[];W(i.getCartesians(),(function(e,t){(F(n,e.getAxis("x").model)>=0||F(r,e.getAxis("y").model)>=0)&&o.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:AV.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){W(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:AV.geo})}))}},DV=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],AV={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Jc(e)),t}},IV={lineX:$(EV,0),lineY:$(EV,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),o=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),a=[TV([i[0],o[0]]),TV([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:j(n,(function(n){var o=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o})),xyMinMax:i}}};function EV(e,t,n,r){"production"!==process.env.NODE_ENV&&me("cartesian2d"===n.type,"lineX/lineY brush is available only in cartesian2d.");var i=n.getAxis(["x","y"][e]),o=TV(j([0,1],(function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))}))),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var LV={lineX:$(NV,0),lineY:$(NV,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return j(e,(function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]}))}};function NV(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function PV(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var OV,RV,kV=W,zV=ko+"toolbox-dataZoom_",VV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new RL(n.getZr()),this._brushController.on("brush",K(this._onBrush,this)).mount()),function(e,t,n,r,i){var o=n._isZoomActive;r&&"takeGlobalCursor"===r.type&&(o="dataZoomSelect"===r.key&&r.dataZoomSelectActive);n._isZoomActive=o,e.setIconStatus("zoom",o?"emphasis":"normal");var a=new SV(FV(e),t,{include:["grid"]}),s=a.makePanelOpts(i,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,r,n),function(e,t){e.setIconStatus("back",function(e){return xV(e).length}(t)>1?"emphasis":"normal")}(e,t)},t.prototype.onclick=function(e,t,n){BV[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},r=this.ecModel;this._brushController.updateCovers([]),new SV(FV(this.model),r,{include:["grid"]}).matchOutputRanges(t,r,(function(e,t,n){if("cartesian2d"===n.type){var r=e.brushType;"rect"===r?(i("x",n,t[0]),i("y",n,t[1])):i({lineX:"x",lineY:"y"}[r],n,t)}})),function(e,t){var n=xV(e);yV(t,(function(t,r){for(var i=n.length-1;i>=0&&!n[i][r];i--);if(i<0){var o=e.queryComponents({mainType:"dataZoom",subType:"select",id:r})[0];if(o){var a=o.getPercentRange();n[0][r]={dataZoomId:r,start:a[0],end:a[1]}}}})),n.push(t)}(r,n),this._dispatchZoomAction(n)}function i(e,t,i){var o=t.getAxis(e),a=o.model,s=function(e,t,n){var r;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(r=n)})),r}(e,a,r),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(i=cL(0,i.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:i[0],endValue:i[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];kV(e,(function(e,n){t.push(O(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(Qz),BV={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(function(e){var t=xV(e),n=t[t.length-1];t.length>1&&t.pop();var r={};return yV(n,(function(e,n){for(var i=t.length-1;i>=0;i--)if(e=t[i][n]){r[n]=e;break}})),r}(this.ecModel))}};function FV(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}OV="dataZoom",RV=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var r=t.getModel(n),i=[],o=Qo(e,FV(r));return kV(o.xAxisModels,(function(e){return a(e,"xAxis","xAxisIndex")})),kV(o.yAxisModels,(function(e){return a(e,"yAxis","yAxisIndex")})),i}function a(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:zV+t+o};a[n]=o,i.push(a)}},me(null==_p.get(OV)&&RV),_p.set(OV,RV);var GV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}($d);function HV(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function UV(e){if(d.domSupported)for(var t=document.documentElement.style,n=0,r=e.length;n<r;n++)if(e[n]in t)return e[n]}var WV=UV(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function jV(e,t){if(!e)return t;t=Id(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var XV=jV(UV(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),YV=jV(WV,"transform"),ZV="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(d.transform3dSupported?"will-change:transform;":"");function qV(e,t,n){var r=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!d.transformSupported)return n?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var o=d.transform3dSupported,a="translate"+(o?"3d":"")+"("+r+","+i+(o?",0":"")+")";return n?"top:0;left:0;"+YV+":"+a+";":[["top",0],["left",0],[WV,a]]}function KV(e,t,n){var r=[],i=e.get("transitionDuration"),o=e.get("backgroundColor"),a=e.get("shadowBlur"),s=e.get("shadowColor"),l=e.get("shadowOffsetX"),u=e.get("shadowOffsetY"),c=e.getModel("textStyle"),h=Ng(e,"html"),p=l+"px "+u+"px "+a+"px "+s;return r.push("box-shadow:"+p),t&&i&&r.push(function(e,t){var n="cubic-bezier(0.23,1,0.32,1)",r=" "+e/2+"s "+n,i="opacity"+r+",visibility"+r;return t||(r=" "+e+"s "+n,i+=d.transformSupported?","+YV+r:",left"+r+",top"+r),XV+":"+i}(i,n)),o&&r.push("background-color:"+o),W(["width","color","radius"],(function(t){var n="border-"+t,i=Id(n),o=e.get(i);null!=o&&r.push(n+":"+o+("color"===t?"":"px"))})),r.push(function(e){var t=[],n=e.get("fontSize"),r=e.getTextColor();r&&t.push("color:"+r),t.push("font:"+e.getFont());var i=de(e.get("lineHeight"),Math.round(3*n/2));n&&t.push("line-height:"+i+"px");var o=e.get("textShadowColor"),a=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return o&&a&&t.push("text-shadow:"+s+"px "+l+"px "+a+"px "+o),W(["decoration","align"],(function(n){var r=e.get(n);r&&t.push("text-"+n+":"+r)})),t.join(";")}(c)),null!=h&&r.push("padding:"+Ed(h).join("px ")+"px"),r.join(";")+";"}function $V(e,t,n,r,i){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&function(e,t,n,r,i){lt(st,t,r,i,!0)&&lt(e,n,st[0],st[1])}(e,a,n,r,i)}else{e[0]=r,e[1]=i;var s=o&&o.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var JV=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,d.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,o=i&&(ee(i)?document.querySelector(i):ae(i)?i:Q(i)&&i(e.getDom()));$V(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!a._enterable){var t=r.handler;_t(r.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=(o="position",(a=(i=t).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(i))?a[o]:null),r=t.style;"absolute"!==r.position&&"absolute"!==n&&(r.position="relative")}var i,o,a,s=e.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=ZV+KV(e,!this._firstShow,this._longHide)+qV(i[0],i[1],!0)+"border-color:"+zd(t)+";"+(e.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var o=this.el;if(null!=e){var a="";if(ee(i)&&"item"===n.get("trigger")&&!HV(n)&&(a=function(e,t,n){if(!ee(n)||"inside"===n)return"";var r=e.get("backgroundColor"),i=e.get("borderWidth");t=zd(t);var o,a,s="left"===(o=n)?"right":"right"===o?"left":"top"===o?"bottom":"top",l=Math.max(1.5*Math.round(i),6),u="",c=YV+":";F(["left","right"],s)>-1?(u+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var h=a*Math.PI/180,d=l+i,p=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h)),f=t+" solid "+i+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(u+=";"+s+":-"+Math.round(100*((p-Math.SQRT2*i)/2+Math.SQRT2*i-(p-d)/2))/100+"px")+";"+c+";","border-bottom:"+f,"border-right:"+f,"background-color:"+r+";"].join("")+'"></div>'}(n,r,i)),ee(e))o.innerHTML=e+a;else if(e){o.innerHTML="",J(e)||(e=[e]);for(var s=0;s<e.length;s++)ae(e[s])&&e[s].parentNode!==o&&o.appendChild(e[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}}else o.innerHTML=""},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},e.prototype.moveTo=function(e,t){if(this.el){var n=this._styleCoord;if($V(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var r=this.el.style;W(qV(n[0],n[1]),(function(e){r[e[0]]=e[1]}))}}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",d.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return e._longHide=!0}),500)},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(K(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},e}(),QV=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),nB(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,r,i){var o=this;re(e)&&Po("production"!==process.env.NODE_ENV?"Passing DOM nodes as content is not supported in richText tooltip!":""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new il({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:Ng(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),W(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(e){o.el.style[e]=n.get(e)})),W(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(e){o.el.style[e]=a.get(e)||0})),this._zr.add(this.el);var s=this;this.el.on("mouseover",(function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0})),this.el.on("mouseout",(function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1}))},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=tB(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var r=this._styleCoord;nB(r,this._zr,e,t),e=r[0],t=r[1];var i=n.style,o=eB(i.borderWidth||0),a=tB(i);n.x=e+o+a.left,n.y=t+o+a.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(K(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function eB(e){return Math.max(0,e)}function tB(e){var t=eB(e.shadowBlur||0),n=eB(e.shadowOffsetX||0),r=eB(e.shadowOffsetY||0);return{left:eB(t-n),right:eB(t+n),top:eB(t-r),bottom:eB(t+r)}}function nB(e,t,n,r){e[0]=n,e[1]=r,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var rB=new tl({shape:{x:-1,y:-1,width:2,height:2}}),iB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){if(!d.node&&t.getDom()){var n,r=e.getComponent("tooltip"),i=this._renderMode="auto"===(n=r.get("renderMode"))?d.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===i?new QV(t):new JV(t,{appendTo:r.get("appendToBody",!0)?"body":r.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!d.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var r=this._tooltipContent;r.update(e),r.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&e.get("transitionDuration")?am(this,"_updatePosition",50,"fixRate"):sm(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");lk("itemTooltip",this._api,K((function(t,n,r){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,r):"leave"===t&&this._hide(r))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==r&&"click"!==r){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!d.node&&n.getDom()){var i=aB(r,n);this._ticket="";var o=r.dataByCoordSys,a=function(e,t,n){var r=ea(e).queryOptionMap,i=r.keys()[0];if(!i||"series"===i)return;var o=ra(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(t){var n=vl(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0})),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}(r,t,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:r.position,positionDefault:"bottom"},i)}else if(r.tooltip&&null!=r.x&&null!=r.y){var l=rB;l.x=r.x,l.y=r.y,l.update(),vl(l).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:l},i)}else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,r))return;var u=pk(r,t),c=u.point[0],h=u.point[1];null!=c&&null!=h&&this._tryShow({offsetX:c,offsetY:h,target:u.el,position:r.position,positionDefault:"bottom"},i)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(aB(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,o=r.dataIndex,a=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=t.getSeriesByIndex(i);if(s)if("axis"===oB([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){var i,o;if("legend"===vl(n).ssrType)return;this._lastDataByCoordSys=null,Km(n,(function(e){return null!=vl(e).dataIndex?(i=e,!0):null!=vl(e).tooltipConfig?(o=e,!0):void 0}),!0),i?this._showSeriesItemTooltip(e,i,t):o?this._showComponentItemTooltip(e,o,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=K(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],o=oB([t.tooltipOption],r),a=this._renderMode,s=[],l=wg("section",{blocks:[],noHeader:!0}),u=[],c=new Pg;W(e,(function(e){W(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var o=qR(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),h=wg("section",{header:o,noHeader:!ve(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),W(e.seriesDataIndices,(function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=e.axisDim,f.axisIndex=e.axisIndex,f.axisType=e.axisType,f.axisId=e.axisId,f.axisValue=Wx(t.axis,{value:i}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",zd(f.color),a);var g=Vf(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=oB([d],r).get("valueFormatter");h.blocks.push(v?z({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var h=t.position,d=o.get("order"),p=Ag(l,c,a,d,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"<br/>",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(o,h,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],h,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=vl(t),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,u=i.dataType,c=s.getData(u),h=this._renderMode,d=e.positionDefault,p=oB([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),m=new Pg;g.marker=m.makeTooltipMarker("item",zd(g.color),h);var v=Vf(s.formatTooltip(l,!1,u)),y=p.get("order"),_=p.get("valueFormatter"),x=v.frag,b=x?Ag(_?z({valueFormatter:_},x):x,m,h,y,r.get("useUTC"),p.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(p,(function(){this._showTooltipContent(p,b,g,w,e.offsetX,e.offsetY,e.position,e.target,m)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r="html"===this._renderMode,i=vl(t),o=i.tooltipConfig.option||{},a=o.encodeHTMLContent;if(ee(o)){o={content:o,formatter:o},a=!0}a&&r&&o.content&&((o=O(o)).content=dt(o.content));var s=[o],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=e.positionDefault,c=oB(s,this._tooltipModel,u?{position:u}:null),h=c.get("content"),d=Math.random()+"",p=new Pg;this._showOrMove(c,(function(){var n=O(c.get("formatterParams")||{});this._showTooltipContent(c,h,n,d,e.offsetX,e.offsetY,e.position,t,p)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,o,a,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent;u.setEnterable(e.get("enterable"));var c=e.get("formatter");a=a||e.get("position");var h=t,d=this._getNearestPoint([i,o],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(ee(c)){var p=e.ecModel.get("useUTC"),f=J(n)?n[0]:n;h=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=hd(f.axisValue,h,p)),h=Od(h,n,!0)}else if(Q(c)){var g=K((function(t,r){t===this._ticket&&(u.setContent(r,l,e,d,a),this._updatePosition(e,a,i,o,u,n,s))}),this);this._ticket=r,h=c(n,r,g)}else h=c;u.setContent(h,l,e,d,a),u.show(e,d),this._updatePosition(e,a,i,o,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r){return"axis"===n||J(t)?{color:r||("html"===this._renderMode?"#fff":"none")}:J(t)?void 0:{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=i.getSize(),c=e.get("align"),h=e.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),Q(t)&&(t=t([n,r],o,i.el,d,{viewSize:[s,l],contentSize:u.slice()})),J(t))n=to(t[0],s),r=to(t[1],l);else if(re(t)){var p=t;p.width=u[0],p.height=u[1];var f=Wd(p,{width:s,height:l});n=f.x,r=f.y,c=null,h=null}else if(ee(t)&&a){var g=function(e,t,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-o/2;break;case"top":s=t.x+u/2-i/2,l=t.y-o-a;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+a;break;case"left":s=t.x-i-a,l=t.y+c/2-o/2;break;case"right":s=t.x+u+a,l=t.y+c/2-o/2}return[s,l]}(t,d,u,e.get("borderWidth"));n=g[0],r=g[1]}else{g=function(e,t,n,r,i,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(e+l+o+2>r?e-=l+o:e+=o);null!=a&&(t+u+a>i?t-=u+a:t+=a);return[e,t]}(n,r,i,s,l,c?null:20,h?null:20);n=g[0],r=g[1]}if(c&&(n-=sB(c)?u[0]/2:"right"===c?u[0]:0),h&&(r-=sB(h)?u[1]/2:"bottom"===h?u[1]:0),HV(e)){g=function(e,t,n,r,i){var o=n.getSize(),a=o[0],s=o[1];return e=Math.min(e+a,r)-a,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(n,r,i,s,l);n=g[0],r=g[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&W(n,(function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(i=i&&a.length===s.length)&&W(a,(function(e,n){var o=s[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];(i=i&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length)&&W(a,(function(e,t){var n=l[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex})),r&&W(e.seriesDataIndices,(function(e){var n=e.seriesIndex,o=t[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)}))}))})),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!d.node&&t.getDom()&&(sm(this,"_updatePosition"),this._tooltipContent.dispose(),hk("itemTooltip",t))},t.type="tooltip",t}(Xg);function oB(e,t,n){var r,i=t.ecModel;n?(r=new Fh(n,i,i),r=new Fh(t.option,r,i)):r=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof Fh&&(a=a.get("tooltip",!0)),ee(a)&&(a={formatter:a}),a&&(r=new Fh(a,r,i)))}return r}function aB(e,t){return e.dispatchAction||K(t.dispatchAction,t)}function sB(e){return"center"===e||"middle"===e}var lB=["rect","polygon","keep","clear"];function uB(e,t){var n=zo(e?e.brush:[]);if(n.length){var r=[];W(n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(r=r.concat(t))}));var i=e&&e.toolbox;J(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var o=i.feature||(i.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,r),function(e){var t={};W(e,(function(e){t[e]=1})),e.length=0,W(t,(function(t,n){e.push(n)}))}(s),t&&!s.length&&s.push.apply(s,lB)}}var cB=W;function hB(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function dB(e,t,n){var r={};return cB(t,(function(t){var i,o=r[t]=((i=function(){}).prototype.__hidden=i.prototype,new i);cB(e[t],(function(e,r){if(rI.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),o[r]=new rI(i),"opacity"===r&&((i=O(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new rI(i))}}))})),r}function pB(e,t,n){var r;W(n,(function(e){t.hasOwnProperty(e)&&hB(t[e])&&(r=!0)})),r&&W(n,(function(n){t.hasOwnProperty(n)&&hB(t[n])?e[n]=O(t[n]):delete e[n]}))}var fB={lineX:gB(0),lineY:gB(1),rect:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])},rect:function(e,t,n){return e&&n.boundingRect.intersect(e)}},polygon:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])&&nb(n.range,e[0],e[1])},rect:function(e,t,n){var r=n.range;if(!e||r.length<=1)return!1;var i=e.x,o=e.y,a=e.width,s=e.height,l=r[0];return!!(nb(r,i,o)||nb(r,i+a,o)||nb(r,i,o+s)||nb(r,i+a,o+s)||jt.create(e).contain(l[0],l[1])||ah(i,o,i+a,o,r)||ah(i,o,i,o+s,r)||ah(i+a,o,i+a,o+s,r)||ah(i,o+s,i+a,o+s,r))||void 0}}};function gB(e){var t=["x","y"],n=["width","height"];return{point:function(t,n,r){if(t){var i=r.range;return mB(t[e],i)}},rect:function(r,i,o){if(r){var a=o.range,s=[r[t[e]],r[t[e]]+r[n[e]]];return s[1]<s[0]&&s.reverse(),mB(s[0],a)||mB(s[1],a)||mB(a[0],s)||mB(a[1],s)}}}}function mB(e,t){return t[0]<=e&&e<=t[1]}var vB=["inBrush","outOfBrush"],yB="__ecBrushSelect",_B="__ecInBrushSelectEvent";function xB(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new SV(t.option,e)).setInputRanges(t.areas,e)}))}function bB(e,t,n){var r,i,o=[];e.eachComponent({mainType:"brush"},(function(e){n&&"takeGlobalCursor"===n.type&&e.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1})})),xB(e),e.eachComponent({mainType:"brush"},(function(t,n){var a={brushId:t.id,brushIndex:n,brushName:t.name,areas:O(t.areas),selected:[]};o.push(a);var s=t.option,l=s.brushLink,u=[],c=[],h=[],d=!1;n||(r=s.throttleType,i=s.throttleDelay);var p=j(t.areas,(function(e){var t=TB[e.brushType],n=V({boundingRect:t?t(e):void 0},e);return n.selectors=function(e){var t=e.brushType,n={point:function(r){return fB[t].point(r,n,e)},rect:function(r){return fB[t].rect(r,n,e)}};return n}(n),n})),f=dB(t.option,vB,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||!!u[e]}function m(e){return!!e.length}J(l)&&W(l,(function(e){u[e]=1})),e.eachSeries((function(n,r){var i=h[r]=[];"parallel"===n.subType?function(e,t){var n=e.coordinateSystem;d=d||n.hasAxisBrushed(),g(t)&&n.eachActiveState(e.getData(),(function(e,t){"active"===e&&(c[t]=1)}))}(n,r):function(n,r,i){if(!n.brushSelector||function(e,t){var n=e.option.seriesIndex;return null!=n&&"all"!==n&&(J(n)?F(n,t)<0:t!==n)}(t,r))return;if(W(p,(function(r){t.brushTargetManager.controlSeries(r,n,e)&&i.push(r),d=d||m(i)})),g(r)&&m(i)){var o=n.getData();o.each((function(e){SB(n,i,o,e)&&(c[e]=1)}))}}(n,r,i)})),e.eachSeries((function(e,t){var n={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};a.selected.push(n);var r=h[t],i=e.getData(),o=g(t)?function(e){return c[e]?(n.dataIndex.push(i.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(t){return SB(e,r,i,t)?(n.dataIndex.push(i.getRawIndex(t)),"inBrush"):"outOfBrush"};(g(t)?d:m(r))&&function(e,t,n,r,i){var o,a={};function s(e){return jm(n,o,e)}function l(e,t){Ym(n,o,e,t)}W(e,(function(e){var n=rI.prepareVisualTypes(t[e]);a[e]=n})),n.each((function(e,u){o=e;var c=n.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var h=r.call(i,e),d=t[h],p=a[h],f=0,g=p.length;f<g;f++){var m=p[f];d[m]&&d[m].applyVisual(e,s,l)}}))}(vB,f,i,o)}))})),function(e,t,n,r,i){if(!i)return;var o=e.getZr();if(o[_B])return;o[yB]||(o[yB]=wB);var a=am(o,yB,n,t);a(e,r)}(t,r,i,o,n)}function wB(e,t){if(!e.isDisposed()){var n=e.getZr();n[_B]=!0,e.dispatchAction({type:"brushSelect",batch:t}),n[_B]=!1}}function SB(e,t,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i];if(e.brushSelector(r,n,a.selectors,a))return!0}}var TB={rect:function(e){return MB(e.range)},polygon:function(e){for(var t,n=e.range,r=0,i=n.length;r<i;r++){t=t||[[1/0,-1/0],[1/0,-1/0]];var o=n[r];o[0]<t[0][0]&&(t[0][0]=o[0]),o[0]>t[0][1]&&(t[0][1]=o[0]),o[1]<t[1][0]&&(t[1][0]=o[1]),o[1]>t[1][1]&&(t[1][1]=o[1])}return t&&MB(t)}};function MB(e){return new jt(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var CB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new RL(t.getZr())).on("brush",K(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){xB(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:t,areas:O(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:t,areas:O(n),$from:t})},t.type="brush",t}(Xg),DB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return l(t,e),t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&pB(n,e,["inBrush","outOfBrush"]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},r.hasOwnProperty("liftZ")||(r.liftZ=5)},t.prototype.setAreas=function(e){"production"!==process.env.NODE_ENV&&(me(J(e)),W(e,(function(e){me(e.brushType,"Illegal areas")}))),e&&(this.areas=j(e,(function(e){return AB(this.option,e)}),this))},t.prototype.setBrushOption=function(e){this.brushOption=AB(this.option,e),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},t}($d);function AB(e,t){return R({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Fh(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var IB=["rect","polygon","lineX","lineY","keep","clear"],EB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(e,t,n){var r,i,o;t.eachComponent({mainType:"brush"},(function(e){r=e.brushType,i=e.brushOption.brushMode||"single",o=o||!!e.areas.length})),this._brushType=r,this._brushMode=i,W(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===i:"clear"===t?o:t===r)?"emphasis":"normal")}))},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get("icon",!0),n={};return W(e.get("type",!0),(function(e){t[e]&&(n[e]=t[e])})),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;"clear"===n?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?r:r!==n&&n,brushMode:"keep"===n?"multiple"===i?"single":"multiple":i}})},t.getDefaultOption=function(e){return{show:!0,type:IB.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:e.getLocaleModel().get(["toolbox","brush","title"])}},t}(Qz);var LB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return l(t,e),t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}($d),NB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var r=this.group,i=e.getModel("textStyle"),o=e.getModel("subtextStyle"),a=e.get("textAlign"),s=de(e.get("textBaseline"),e.get("textVerticalAlign")),l=new il({style:yh(i,{text:e.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new il({style:yh(o,{text:c,fill:o.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!d&&!f,h.silent=!p&&!f,d&&l.on("click",(function(){Vd(d,"_"+e.get("target"))})),p&&h.on("click",(function(){Vd(p,"_"+e.get("subtarget"))})),vl(l).eventData=vl(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,r.add(l),c&&r.add(h);var g=r.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=Wd(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));a||("middle"===(a=e.get("left")||e.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),r.x=v.x,r.y=v.y,r.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),h.setStyle(y),g=r.getBoundingRect();var _=v.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var b=new tl({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});r.add(b)}},t.type="title",t}(Xg);var PB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode="box",n}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],r=t.axisType,i=this._names=[];"category"===r?(e=[],W(n,(function(t,n){var r,o=jo(Fo(t),"");re(t)?(r=O(t)).value=n:r=n,e.push(r),i.push(o)}))):e=n;var o={category:"ordinal",time:"time",value:"number"}[r]||"number";(this._data=new L_([{name:"value",type:o}],this)).initData(e,i)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}($d),OB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="timeline.slider",t.defaultOption=Uh(PB.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(PB);H(OB,zf.prototype);var RB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="timeline",t}(Xg),kB=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r)||this;return o.type=i||"value",o}return l(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(Eb),zB=Math.PI,VB=$o(),BB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var r=this._layout(e,n),i=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return wg("nameValue",{noName:!0,value:a.scale.getLabel({value:e})})},W(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](r,i,a,e)}),this),this._renderAxisLabel(r,o,a,e),this._position(r,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,r,i,o,a=e.get(["label","position"]),s=e.get("orient"),l=function(e,t){return Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t),u={horizontal:"center",vertical:(n=null==a||"auto"===a?"horizontal"===s?l.y+l.height/2<t.getHeight()/2?"-":"+":l.x+l.width/2<t.getWidth()/2?"+":"-":ee(a)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[s][a]:a)>=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:zB/2},d="vertical"===s?l.height:l.width,p=e.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,v=g+m,y=e.get(["label","rotate"])||0;y=y*zB/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,T=d;"left"===_||"bottom"===_?(x&&(r=[0,0],S+=v),b&&(i=[S,0],S+=v),w&&(o=[T-g,0],T-=v)):(x&&(r=[T-g,0],T-=v),b&&(i=[0,0],S+=v),w&&(o=[T-g,0],T-=v));var M=[S,T];return e.get("inverse")&&M.reverse(),{viewRect:l,mainLength:d,orient:s,rotation:h[s],labelRotation:y,labelPosOpt:n,labelAlign:e.get(["label","align"])||u[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:r,prevBtnPosition:i,nextBtnPosition:o,axisExtent:M,controlSize:g,controlGap:m}},t.prototype._position=function(e,t){var n=this._mainGroup,r=this._labelGroup,i=e.viewRect;if("vertical"===e.orient){var o=[1,0,0,1,0,0],a=i.x,s=i.y+i.height;Et(o,o,[-a,-s]),Lt(o,o,-zB/2),Et(o,o,[a,s]),(i=i.clone()).applyTransform(o)}var l=m(i),u=m(n.getBoundingRect()),c=m(r.getBoundingRect()),h=[n.x,n.y],d=[r.x,r.y];d[0]=h[0]=l[0][0];var p,f=e.labelPosOpt;null==f||ee(f)?(v(h,u,l,1,p="+"===f?0:1),v(d,c,l,1,1-p)):(v(h,u,l,1,p=f>=0?0:1),d[1]=h[1]+f);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,n,r,i){e[r]+=n[r][i]-t[r][i]}n.setPosition(h),r.setPosition(d),n.rotation=r.rotation=e.rotation,g(n),g(r)},t.prototype._createAxis=function(e,t){var n=t.getData(),r=t.get("axisType"),i=function(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new ex({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case"time":return new mx({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new nx}}(t,r);i.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var o=n.getDataExtent("value");i.setExtent(o[0],o[1]),i.calcNiceTicks();var a=new kB("value",i,e.axisExtent,r);return a.model=t,a},t.prototype._createGroup=function(e){var t=this[e]=new Wi;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,r){var i=n.getExtent();if(r.get(["lineStyle","show"])){var o=new uc({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:z({lineCap:"round"},r.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(o);var a=this._progressLine=new uc({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:V({lineCap:"round",lineWidth:o.style.lineWidth},r.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(a)}},t.prototype._renderAxisTick=function(e,t,n,r){var i=this,o=r.getData(),a=n.scale.getTicks();this._tickSymbols=[],W(a,(function(e){var a=n.dataToCoord(e.value),s=o.getItemModel(e.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:a,y:0,onclick:K(i._changeTimeline,i,e.value)},d=FB(s,l,t,h);d.ensureState("emphasis").style=u.getItemStyle(),d.ensureState("progress").style=c.getItemStyle(),ou(d);var p=vl(d);s.get("tooltip")?(p.dataIndex=e.value,p.dataModel=r):p.dataIndex=p.dataModel=null,i._tickSymbols.push(d)}))},t.prototype._renderAxisLabel=function(e,t,n,r){var i=this;if(n.getLabelModel().get("show")){var o=r.getData(),a=n.getViewLabels();this._tickLabels=[],W(a,(function(r){var a=r.tickValue,s=o.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(r.tickValue),d=new il({x:h,y:0,rotation:e.labelRotation-e.rotation,onclick:K(i._changeTimeline,i,a),silent:!1,style:yh(l,{text:r.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});d.ensureState("emphasis").style=yh(u),d.ensureState("progress").style=yh(c),t.add(d),ou(d),VB(d).dataIndex=a,i._tickLabels.push(d)}))}},t.prototype._renderControl=function(e,t,n,r){var i=e.controlSize,o=e.rotation,a=r.getModel("controlStyle").getItemStyle(),s=r.getModel(["emphasis","controlStyle"]).getItemStyle(),l=r.getPlayState(),u=r.get("inverse",!0);function c(e,n,l,u){if(e){var c=Ni(de(r.get(["controlStyle",n+"BtnSize"]),i),i),h=function(e,t,n,r){var i=r.style,o=oh(e.get(["controlStyle",t]),r,new jt(n[0],n[1],n[2],n[3]));i&&o.setStyle(i);return o}(r,n+"Icon",[0,-c/2,c,c],{x:e[0],y:e[1],originX:i/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});h.ensureState("emphasis").style=s,t.add(h),ou(h)}}c(e.nextBtnPosition,"next",K(this._changeTimeline,this,u?"-":"+")),c(e.prevBtnPosition,"prev",K(this._changeTimeline,this,u?"+":"-")),c(e.playPosition,l?"stop":"play",K(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,r){var i=r.getData(),o=r.getCurrentIndex(),a=i.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=K(s._handlePointerDrag,s),e.ondragend=K(s._handlePointerDragend,s),GB(e,s._progressLine,o,n,r,!0)},onUpdate:function(e){GB(e,s._progressLine,o,n,r)}};this._currentPointer=FB(a,a,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],r=ro(this._axis.getExtent().slice());n>r[1]&&(n=r[1]),n<r[0]&&(n=r[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var i=this._progressLine;i&&(i.shape.x2=n,i.dirty());var o=this._findNearestTick(n),a=this.model;(t||o!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(o)},t.prototype._doPlayStop=function(){var e=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout((function(){var t=e.model;e._changeTimeline(t.getCurrentIndex()+(t.get("rewind",!0)?-1:1))}),this.model.get("playInterval")))},t.prototype._toAxisCoord=function(e){return Qc(e,this._mainGroup.getLocalTransform(),!0)},t.prototype._findNearestTick=function(e){var t,n=this.model.getData(),r=1/0,i=this._axis;return n.each(["value"],(function(n,o){var a=i.dataToCoord(n),s=Math.abs(a-e);s<r&&(r=s,t=o)})),t},t.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._changeTimeline=function(e){var t=this.model.getCurrentIndex();"+"===e?e=t+1:"-"===e&&(e=t-1),this.api.dispatchAction({type:"timelineChange",currentIndex:e,from:this.uid})},t.prototype._updateTicksStatus=function(){var e=this.model.getCurrentIndex(),t=this._tickSymbols,n=this._tickLabels;if(t)for(var r=0;r<t.length;r++)t&&t[r]&&t[r].toggleState("progress",r<e);if(n)for(r=0;r<n.length;r++)n&&n[r]&&n[r].toggleState("progress",VB(n[r]).dataIndex<=e)},t.type="timeline.slider",t}(RB);function FB(e,t,n,r,i,o){var a=t.get("color");i?(i.setColor(a),n.add(i),o&&o.onUpdate(i)):((i=lv(e.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(i),o&&o.onCreate(i));var s=t.getItemStyle(["color"]);i.setStyle(s),r=R({rectHover:!0,z2:100},r,!0);var l=uv(e.get("symbolSize"));r.scaleX=l[0]/2,r.scaleY=l[1]/2;var u=cv(e.get("symbolOffset"),l);u&&(r.x=(r.x||0)+u[0],r.y=(r.y||0)+u[1]);var c=e.get("symbolRotate");return r.rotation=(c||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function GB(e,t,n,r,i,o){if(!e.dragging){var a=i.getModel("checkpointStyle"),s=r.dataToCoord(i.getData().get("value",n));if(o||!a.get("animation",!0))e.attr({x:s,y:0}),t&&t.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};e.stopAnimation(null,!0),e.animateTo({x:s,y:0},l),t&&t.animateTo({shape:{x2:s}},l)}}}function HB(e){var t=e&&e.timeline;J(t)||(t=t?[t]:[]),W(t,(function(e){e&&function(e){var t=e.type,n={number:"value",time:"time"};n[t]&&(e.axisType=n[t],delete e.type);if(UB(e),WB(e,"controlPosition")){var r=e.controlStyle||(e.controlStyle={});WB(r,"position")||(r.position=e.controlPosition),"none"!==r.position||WB(r,"show")||(r.show=!1,delete r.position),delete e.controlPosition}W(e.data||[],(function(e){re(e)&&!J(e)&&(!WB(e,"value")&&WB(e,"name")&&(e.value=e.name),UB(e))}))}(e)}))}function UB(e){var t=e.itemStyle||(e.itemStyle={}),n=t.emphasis||(t.emphasis={}),r=e.label||e.label||{},i=r.normal||(r.normal={}),o={normal:1,emphasis:1};W(r,(function(e,t){o[t]||WB(i,t)||(i[t]=e)})),n.label&&!WB(r,"emphasis")&&(r.emphasis=n.label,delete n.label)}function WB(e,t){return e.hasOwnProperty(t)}function jB(e,t){if(!e)return!1;for(var n=J(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function XB(e){Vo(e,"label",["show"])}var YB=$o(),ZB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return l(t,e),t.prototype.init=function(e,t,n){if("production"!==process.env.NODE_ENV&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(d.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries((function(e){var n=e.get(this.mainType,!0),o=YB(e)[i];n&&n.data?(o?o._mergeOption(n,t,!0):(r&&XB(n),W(n.data,(function(e){e instanceof Array?(XB(e[0]),XB(e[1])):XB(e)})),z(o=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),YB(e)[i]=o):YB(e)[i]=null}),this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),o=r.getName(e);return wg("section",{header:this.name,blocks:[wg("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.prototype.getDataParams=function(e,t){var n=zf.prototype.getDataParams.call(this,e,t),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},t.getMarkerModelFromSeries=function(e,t){return YB(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}($d);H(ZB,zf.prototype);var qB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(ZB);function KB(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function $B(e,t,n,r,i,o){var a=[],s=B_(t,r)?t.getCalculationInfo("stackResultDimension"):r,l=rF(t,s,e),u=t.indicesOfNearest(s,l)[0];a[i]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(r,u),h=io(t.get(r,u));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,c]}var JB={min:$($B,"min"),max:$($B,"max"),average:$($B,"average"),median:$($B,"median")};function QB(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!J(t.coord)&&J(i)){var o=eF(t,n,r,e);if((t=O(t)).type&&JB[t.type]&&o.baseAxis&&o.valueAxis){var a=F(i,o.baseAxis.dim),s=F(i,o.valueAxis.dim),l=JB[t.type](n,o.baseDataDim,o.valueDataDim,a,s);t.coord=l[0],t.value=l[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&J(i))for(var u=t.coord,c=0;c<2;c++)JB[u[c]]&&(u[c]=rF(n,n.mapDimension(i[c]),u[c]));else t.coord=[];return t}}function eF(e,t,n,r){var i={};return null!=e.valueIndex||null!=e.valueDim?(i.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=n.getAxis(function(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function tF(e,t){return!(e&&e.containData&&t.coord&&!KB(t))||e.containData(t.coord)}function nF(e,t){return e?function(e,n,r,i){return Hf(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return Hf(e.value,t[i])}}function rF(e,t,n){if("average"===n){var r=0,i=0;return e.each(t,(function(e,t){isNaN(e)||(r+=e,i++)})),r/i}return"median"===n?e.getMedian(t):e.getDataExtent(t)["max"===n?1:0]}var iF=$o(),oF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){this.markerGroupMap=Te()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each((function(e){iF(e).keep=!1})),t.eachSeries((function(e){var i=ZB.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)})),i.each((function(e){!iF(e).keep&&r.group.remove(e.group)}))},t.prototype.markKeep=function(e){iF(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;W(e,(function(e){var r=ZB.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl((function(e){e&&(t?Zl(e):ql(e))}))}))},t.type="marker",t}(Xg);function aF(e,t,n){var r=t.coordinateSystem;e.each((function(i){var o,a=e.getItemModel(i),s=to(a.get("x"),n.getWidth()),l=to(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var u=e.get(r.dimensions[0],i),c=e.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(i,o)}))}var sF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=ZB.getMarkerModelFromSeries(e,"markPoint");t&&(aF(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new jS),u=function(e,t,n){var r;r=e?j(e&&e.dimensions,(function(e){return z(z({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new L_(r,n),o=j(n.get("data"),$(QB,t));e&&(o=Y(o,$(tF,e)));var a=nF(!!e,r);return i.initData(o,null,a),i}(i,e,t);t.setData(u),aF(t.getData(),e,r),u.each((function(e){var n=u.getItemModel(e),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(Q(r)||Q(i)||Q(o)||Q(s)){var c=t.getRawValue(e),h=t.getDataParams(e);Q(r)&&(r=r(c,h)),Q(i)&&(i=i(c,h)),Q(o)&&(o=o(c,h)),Q(s)&&(s=s(c,h))}var d=n.getModel("itemStyle").getItemStyle(),p=Xm(a,"color");d.fill||(d.fill=p),u.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){vl(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(oF);var lF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(ZB),uF=$o(),cF=function(e,t,n,r){var i,o=e.getData();if(J(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=t.getAxis(null!=r.yAxis?"y":"x"),l=he(r.yAxis,r.xAxis);else{var u=eF(r,o,t,e);s=u.valueAxis,l=rF(o,F_(o,u.valueDataDim),a)}var c="x"===s.dim?0:1,h=1-c,d=O(r),p={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,p.coord[h]=1/0;var f=n.get("precision");f>=0&&ne(l)&&(l=+l.toFixed(Math.min(f,20))),d.coord[c]=p.coord[c]=l,i=[d,p,{type:a,valueIndex:r.valueIndex,value:l}]}else"production"!==process.env.NODE_ENV&&P("Invalid markLine data."),i=[]}var g=[QB(e,i[0]),QB(e,i[1]),z({},i[2])];return g[2].type=g[2].type||null,R(g[2],g[0]),R(g[2],g[1]),g};function hF(e){return!isNaN(e)&&!isFinite(e)}function dF(e,t,n,r){var i=1-e,o=r.dimensions[e];return hF(t[i])&&hF(n[i])&&t[e]===n[e]&&r.getAxis(o).containData(t[e])}function pF(e,t){if("cartesian2d"===e.type){var n=t[0].coord,r=t[1].coord;if(n&&r&&(dF(1,n,r,e)||dF(0,n,r,e)))return!0}return tF(e,t[0])&&tF(e,t[1])}function fF(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=to(s.get("x"),i.getWidth()),u=to(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),d=e.get(c[1],t);o=a.dataToPoint([h,d])}if(oT(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");c=a.dimensions;hF(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):hF(e.get(c[1],t))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var gF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=ZB.getMarkerModelFromSeries(e,"markLine");if(t){var r=t.getData(),i=uF(t).from,o=uF(t).to;i.each((function(t){fF(i,t,!0,e,n),fF(o,t,!1,e,n)})),r.each((function(e){r.setItemLayout(e,[i.getItemLayout(e),o.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new vE);this.group.add(l.group);var u=function(e,t,n){var r;r=e?j(e&&e.dimensions,(function(e){return z(z({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new L_(r,n),o=new L_(r,n),a=new L_([],n),s=j(n.get("data"),$(cF,t,e,n));e&&(s=Y(s,$(pF,e)));var l=nF(!!e,r);return i.initData(j(s,(function(e){return e[0]})),null,l),o.initData(j(s,(function(e){return e[1]})),null,l),a.initData(j(s,(function(e){return e[2]}))),a.hasItemOption=!0,{from:i,to:o,line:a}}(i,e,t),c=u.from,h=u.to,d=u.line;uF(t).from=c,uF(t).to=h,t.setData(d);var p=t.get("symbol"),f=t.get("symbolSize"),g=t.get("symbolRotate"),m=t.get("symbolOffset");function v(t,n,i){var o=t.getItemModel(n);fF(t,n,i,e,r);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=Xm(a,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:de(o.get("symbolOffset",!0),m[i?0:1]),symbolRotate:de(o.get("symbolRotate",!0),g[i?0:1]),symbolSize:de(o.get("symbolSize"),f[i?0:1]),symbol:de(o.get("symbol",!0),p[i?0:1]),style:s})}J(p)||(p=[p,p]),J(f)||(f=[f,f]),J(g)||(g=[g,g]),J(m)||(m=[m,m]),u.from.each((function(e){v(c,e,!0),v(h,e,!1)})),d.each((function(e){var t=d.getItemModel(e).getModel("lineStyle").getLineStyle();d.setItemLayout(e,[c.getItemLayout(e),h.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),d.setItemVisual(e,{fromSymbolKeepAspect:c.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:c.getItemVisual(e,"symbolOffset"),fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolKeepAspect:h.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(e,"symbolOffset"),toSymbolRotate:h.getItemVisual(e,"symbolRotate"),toSymbolSize:h.getItemVisual(e,"symbolSize"),toSymbol:h.getItemVisual(e,"symbol"),style:t})})),l.updateData(d),u.line.eachItemGraphicEl((function(e){vl(e).dataModel=t,e.traverse((function(e){vl(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(oF);var mF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(ZB),vF=$o(),yF=function(e,t,n,r){var i=r[0],o=r[1];if(i&&o){var a=QB(e,i),s=QB(e,o),l=a.coord,u=s.coord;l[0]=he(l[0],-1/0),l[1]=he(l[1],-1/0),u[0]=he(u[0],1/0),u[1]=he(u[1],1/0);var c=k([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function _F(e){return!isNaN(e)&&!isFinite(e)}function xF(e,t,n,r){var i=1-e;return _F(t[i])&&_F(n[i])}function bF(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},o={coord:r,x:t.x1,y:t.y1};return oT(e,"cartesian2d")?!(!n||!r||!xF(1,n,r)&&!xF(0,n,r))||function(e,t,n){return!(e&&e.containZone&&t.coord&&n.coord&&!KB(t)&&!KB(n))||e.containZone(t.coord,n.coord)}(e,i,o):tF(e,i)||tF(e,o)}function wF(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=to(s.get(n[0]),i.getWidth()),u=to(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),d=a.clampData(c),p=a.clampData(h),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?h[0]:c[0]:f[0]=d[0]>p[0]?c[0]:h[0],"y0"===n[1]?f[1]=d[1]>p[1]?h[1]:c[1]:f[1]=d[1]>p[1]?c[1]:h[1],o=r.getMarkerPosition(f,n,!0)}else{var g=[y=e.get(n[0],t),_=e.get(n[1],t)];a.clampData&&a.clampData(g,g),o=a.dataToPoint(g,!0)}if(oT(a,"cartesian2d")){var m=a.getAxis("x"),v=a.getAxis("y"),y=e.get(n[0],t),_=e.get(n[1],t);_F(y)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):_F(_)&&(o[1]=v.toGlobalCoord(v.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var SF=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],TF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=ZB.getMarkerModelFromSeries(e,"markArea");if(t){var r=t.getData();r.each((function(t){var i=j(SF,(function(i){return wF(r,t,i,e,n)}));r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape("points",i)}))}}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Wi});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){var r,i,o=["x0","y0","x1","y1"];if(e){var a=j(e&&e.dimensions,(function(e){var n=t.getData();return z(z({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}));i=j(o,(function(e,t){return{name:e,type:a[t%2].type}})),r=new L_(i,n)}else r=new L_(i=[{name:"value",type:"float"}],n);var s=j(n.get("data"),$(yF,t,e,n));e&&(s=Y(s,$(bF,e)));var l=e?function(e,t,n,r){return Hf(e.coord[Math.floor(r/2)][r%2],i[r])}:function(e,t,n,r){return Hf(e.value,i[r])};return r.initData(s,null,l),r.hasItemOption=!0,r}(i,e,t);t.setData(u),u.each((function(t){var n=j(SF,(function(n){return wF(u,t,n,e,r)})),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),h=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],d=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];ro(h),ro(d);var p=!!(l[0]>h[1]||l[1]<h[0]||c[0]>d[1]||c[1]<d[0]);u.setItemLayout(t,{points:n,allClipped:p});var f=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=Xm(a,"color");f.fill||(f.fill=g,ee(f.fill)&&(f.fill=cr(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)})),u.diff(vF(l).data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new ic({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}})).update((function(e,n){var r=vF(l).data.getItemGraphicEl(n),i=u.getItemLayout(e);i.allClipped?r&&l.group.remove(r):(r?Ec(r,{shape:{points:i.points}},t,e):r=new ic({shape:{points:i.points}}),u.setItemGraphicEl(e,r),l.group.add(r))})).remove((function(e){var t=vF(l).data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),mh(e,vh(r),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:ee(i.fill)?cr(i.fill,1):"#000"}),cu(e,r),au(e,null,null,r.get(["emphasis","disabled"])),vl(e).dataModel=t})),vF(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(oF);var MF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),J(t)&&W(t,(function(e,r){ee(e)&&(e={type:e}),t[r]=R(e,function(e,t){return"all"===t?{type:"all",title:e.getLocaleModel().get(["legend","selector","all"])}:"inverse"===t?{type:"inverse",title:e.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,e.type))}))},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get("name");if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries((function(r){var i,o=r.name;if(n.push(o),r.legendVisualProvider){var a=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(a)),a.length?t=t.concat(a):i=!0}else i=!0;i&&Zo(r)&&t.push(r.name)})),this._availableNames=n;var r=this.get("data")||t,i=Te(),o=j(r,(function(e){return(ee(e)||ne(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new Fh(e,this,this.ecModel))}),this);this._data=Y(o,(function(e){return!!e}))},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;"single"===this.get("selectedMode")&&W(this._data,(function(e){t[e.get("name")]=!1}));t[e]=!0},t.prototype.unSelect=function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;W(e,(function(e){t[e.get("name",!0)]=!0}))},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;W(e,(function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]}))},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&F(this._availableNames,e)>=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}($d),CF=$,DF=W,AF=Wi,IF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return l(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new AF),this.group.add(this._selectorGroup=new AF),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var i=e.get("align"),o=e.get("orient");i&&"auto"!==i||(i="right"===e.get("left")&&"vertical"===o?"right":"left");var a=e.get("selector",!0),s=e.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(i,e,t,n,a,o,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=Wd(l,u,c),d=this.layoutInner(e,i,h,r,a,s),p=Wd(V({width:d.width,height:d.height},l),u,c);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=iV(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,o,a){var s=this.getContentGroup(),l=Te(),u=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),DF(t.getData(),(function(i,o){var a=i.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new AF;return h.newline=!0,void s.add(h)}var d=n.getSeriesByName(a)[0];if(!l.get(a)){if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),v=this._createItem(d,a,o,i,t,e,f,m,g,u,r);v.on("click",CF(EF,a,null,r,c)).on("mouseover",CF(NF,d.name,null,r,c)).on("mouseout",CF(PF,d.name,null,r,c)),n.ssr&&v.eachChild((function(e){var t=vl(e);t.seriesIndex=d.seriesIndex,t.dataIndex=o,t.ssrType="legend"})),l.set(a,!0)}else n.eachRawSeries((function(s){if(!l.get(a)&&s.legendVisualProvider){var h=s.legendVisualProvider;if(!h.containName(a))return;var d=h.indexOfName(a),p=h.getItemVisual(d,"style"),f=h.getItemVisual(d,"legendIcon"),g=nr(p.fill);g&&0===g[3]&&(g[3]=.2,p=z(z({},p),{fill:hr(g,"rgba")}));var m=this._createItem(s,a,o,i,t,e,{},p,f,u,r);m.on("click",CF(EF,null,a,r,c)).on("mouseover",CF(NF,null,a,r,c)).on("mouseout",CF(PF,null,a,r,c)),n.ssr&&m.eachChild((function(e){var t=vl(e);t.seriesIndex=s.seriesIndex,t.dataIndex=o,t.ssrType="legend"})),l.set(a,!0)}}),this);"production"!==process.env.NODE_ENV&&(l.get(a)||console.warn(a+" series not exists. Legend data should be same with series name or data name."))}}),this),i&&this._createSelector(i,t,r,o,a)},t.prototype._createSelector=function(e,t,n,r,i){var o=this.getSelectorGroup();DF(e,(function(e){var r=e.type,i=new il({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect",legendId:t.id})}});o.add(i),mh(i,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),ou(i)}))},t.prototype._createItem=function(e,t,n,r,i,o,a,s,l,u,c){var h=e.visualDrawType,d=i.get("itemWidth"),p=i.get("itemHeight"),f=i.isSelected(t),g=r.get("symbolRotate"),m=r.get("symbolKeepAspect"),v=r.get("icon"),y=function(e,t,n,r,i,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=t.lineWidth>0?2:0),DF(e,(function(n,r){"inherit"===e[r]&&(e[r]=t[r])}))}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");u.decal=h&&"inherit"!==h?Rv(h,a):r.decal,"inherit"===u.fill&&(u.fill=r[i]);"inherit"===u.stroke&&(u.stroke=r[c]);"inherit"===u.opacity&&(u.opacity=("fill"===i?r:n).opacity);s(u,r);var d=t.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=r.fill),"auto"===u.stroke&&(u.stroke=r.fill),"auto"===p.stroke&&(p.stroke=r.fill),!o){var f=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===f?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=v||l||"roundRect",r,a,s,h,f,c),_=new AF,x=r.getModel("textStyle");if(!Q(e.getLegendIcon)||v&&"inherit"!==v){var b="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;_.add(function(e){var t=e.icon||"roundRect",n=lv(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:d,itemHeight:p,icon:l,iconRotate:b,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}))}else _.add(e.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));var w="left"===o?d+5:-5,S=o,T=i.get("formatter"),M=t;ee(T)&&T?M=T.replace("{name}",null!=t?t:""):Q(T)&&(M=T(t));var C=f?x.getTextColor():r.get("inactiveColor");_.add(new il({style:yh(x,{text:M,x:w,y:p/2,fill:C,align:S,verticalAlign:"middle"},{inheritColor:C})}));var D=new tl({shape:_.getBoundingRect(),style:{fill:"transparent"}}),A=r.getModel("tooltip");return A.get("show")&&uh({el:D,componentModel:i,itemName:t,itemTooltipOption:A.option}),_.add(D),_.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(_),ou(_),_.__legendDataIndex=n,_},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Ud(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),i){Ud("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?h[p]+=l[f]+d:u[p]+=c[f]+d,h[1-p]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+d+c[f],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+h[1-p]),v}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Xg);function EF(e,t,n,r){PF(e,t,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),NF(e,t,n,r)}function LF(e){for(var t,n=e.getZr().storage.getDisplayList(),r=0,i=n.length;r<i&&!(t=n[r].states.emphasis);)r++;return t&&t.hoverLayer}function NF(e,t,n,r){LF(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:r})}function PF(e,t,n,r){LF(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:r})}function OF(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0}))}function RF(e,t,n){var r="allSelect"===e||"inverseSelect"===e,i={},o=[];n.eachComponent({mainType:"legend",query:t},(function(n){r?n[e]():n[e](t.name),kF(n,i),o.push(n.componentIndex)}));var a={};return n.eachComponent("legend",(function(e){W(i,(function(t,n){e[t?"select":"unSelect"](n)})),kF(e,a)})),r?{selected:a,legendIndex:o}:{name:t.name,selected:a}}function kF(e,t){var n=t||{};return W(e.getData(),(function(t){var r=t.get("name");if("\n"!==r&&""!==r){var i=e.isSelected(r);Ae(n,r)?n[r]=n[r]&&i:n[r]=i}})),n}function zF(e){e.registerComponentModel(MF),e.registerComponentView(IF),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,OF),e.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(e){e.registerAction("legendToggleSelect","legendselectchanged",$(RF,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",$(RF,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",$(RF,"inverseSelect")),e.registerAction("legendSelect","legendselected",$(RF,"select")),e.registerAction("legendUnSelect","legendunselected",$(RF,"unSelect"))}(e)}var VF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Zd(t);e.prototype.init.call(this,t,n,r),BF(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),BF(this,this.option,t)},t.type="legend.scroll",t.defaultOption=Uh(MF.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(MF);function BF(e,t,n){var r=[1,1];r[e.getOrient().index]=0,Yd(t,n,{type:"box",ignoreSize:!!r})}var FF=Wi,GF=["width","height"],HF=["x","y"],UF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return l(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new FF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new FF)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,o,a,s){var l=this;e.prototype.renderInner.call(this,t,n,r,i,o,a,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=J(c)?c:[c,c];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(e,t){var r=e+"DataIndex",o=oh(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:K(l._pageGo,l,r,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=e,u.add(o)}u.add(new il({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getSelectorGroup(),s=e.getOrient().index,l=GF[s],u=HF[s],c=GF[1-s],h=HF[1-s];i&&Ud("horizontal",a,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=O(n);i&&(g[l]=n[l]-p[l]-d);var m=this._layoutContentAndController(e,r,g,s,l,c,h,u);if(i){if("end"===o)f[s]+=m[l]+d;else{var v=p[l]+d;f[s]-=v,m[u]-=v}m[l]+=p[l]+d,f[1-s]+=m[h]+m[c]/2-p[c]/2,m[c]=Math.max(m[c],p[c]),m[h]=Math.min(m[h],p[h]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,r,i,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;Ud(e.get("orient"),l,e.get("itemGap"),r?n.width:null,r?null:n.height),Ud("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=c.getBoundingRect(),p=this._showController=h[i]>n[i],f=[-h.x,-h.y];t||(f[r]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=de(e.get("pageButtonGap",!0),e.get("itemGap",!0));p&&("end"===e.get("pageButtonPosition",!0)?m[r]+=n[i]-d[i]:g[r]+=d[i]+v);m[1-r]+=h[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[i]=p?n[i]:h[i],y[o]=Math.max(h[o],d[o]),y[a]=Math.min(0,d[a]+m[1-r]),u.__rectSize=n[i],p){var _={x:0,y:0};_[i]=Math.max(n[i]-d[i]-v,0),_[o]=y[o],u.setClipPath(new tl({shape:_})),u.__rectSize=_[i]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&Ec(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?e:null),this._updatePageInfoView(e,x),y},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;W(["pagePrev","pageNext"],(function(r){var i=null!=t[r+"DataIndex"],o=n.childOfName(r);o&&(o.setStyle("fill",i?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=i?"pointer":"default")}));var r=n.childOfName("pageText"),i=e.get("pageFormatter"),o=t.pageIndex,a=null!=o?o+1:0,s=t.pageCount;r&&i&&r.setStyle("text",ee(i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,o=GF[i],a=HF[i],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=c?1:0,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[i]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=c;++f)(!(v=y(l[f]))&&m.e>g.s+r||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(f=s-1,g=p,m=p,v=null;f>=-1;--f)(v=y(l[f]))&&_(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),n=t[a]+e[a];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===e&&(t=i)})),null!=t?t:n):0;var t,n},t.type="legend.scroll",t}(IF);function WF(e){i_(zF),e.registerComponentModel(VF),e.registerComponentView(UF),function(e){e.registerAction("legendScroll","legendscroll",(function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(n)}))}))}(e)}var jF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.inside",t.defaultOption=Uh(Gz.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Gz),XF=$o();function YF(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function ZF(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function qF(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function KF(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=XF(t),r=n.coordSysRecordMap||(n.coordSysRecordMap=Te());r.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){W(Bz(e).infoList,(function(n){var i=n.model.uid,o=r.get(i)||r.set(i,function(e,t){var n={model:t,containsPoint:$(qF,t),dispatchAction:$(ZF,e),dataZoomInfoMap:null,controller:null},r=n.controller=new AC(e.getZr());return W(["pan","zoom","scrollMove"],(function(e){r.on(e,(function(t){var r=[];n.dataZoomInfoMap.each((function(i){if(t.isAvailableBehavior(i.model.option)){var o=(i.getRange||{})[e],a=o&&o(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get("disabled",!0)&&a&&r.push({dataZoomId:i.model.id,start:a[0],end:a[1]})}})),r.length&&n.dispatchAction(r)}))})),n}(t,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=Te())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),r.each((function(e){var t,n=e.controller,i=e.dataZoomInfoMap;if(i){var o=i.keys()[0];null!=o&&(t=i.get(o))}if(t){var a=function(e){var t,n="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},i=!0;return e.each((function(e){var o=e.model,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");r[n+a]>r[n+t]&&(t=a),i=i&&o.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}(i);n.enable(a.controlType,a.opt),n.setPointerChecker(e.containsPoint),am(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else YF(r,e)}))}))}var $F=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return l(t,e),t.prototype.render=function(t,n,r){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),function(e,t,n){XF(e).coordSysRecordMap.each((function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)}))}(r,t,{pan:K(JF.pan,this),zoom:K(JF.zoom,this),scrollMove:K(JF.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=XF(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var o=r[i],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||YF(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(Wz),JF={zoom:function(e,t,n,r){var i=this.range,o=i.slice(),a=e.axisModels[0];if(a){var s=eG[t](null,[r.originX,r.originY],a,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return cL(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1]?o:void 0}},pan:QF((function(e,t,n,r,i,o){var a=eG[r]([o.oldX,o.oldY],[o.newX,o.newY],t,i,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength})),scrollMove:QF((function(e,t,n,r,i,o){return eG[r]([0,0],[o.scrollDelta,o.scrollDelta],t,i,n).signal*(e[1]-e[0])*o.scrollDelta}))};function QF(e){return function(t,n,r,i){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s)return cL(e(a,s,t,n,r,i),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var eG={grid:function(e,t,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],"x"===o.dim?(a.pixel=t[0]-e[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(e,t,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(a.pixel=t[0]-e[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(e,t,n,r,i){var o=n.axis,a=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===o.orient?(s.pixel=t[0]-e[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};function tG(e){$z(e),e.registerComponentModel(jF),e.registerComponentView($F),KF(e)}var nG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=Uh(Gz.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(Gz),rG=tl,iG="horizontal",oG="vertical",aG=["line","bar","candlestick","scatter"],sG={easing:"cubicOut",duration:100,delay:0},lG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return l(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=K(this._onBrush,this),this._onBrushEnd=K(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),am(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){sm(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Wi;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?7:0,r=this._findCoordRect(),i={width:t.getWidth(),height:t.getHeight()},o=this._orient===iG?{right:i.width-r.x-r.width,top:i.height-30-7-n,width:r.width,height:30}:{right:7,top:r.y,width:30,height:r.height},a=Zd(e.option);W(["right","top","width","height"],(function(e){"ph"===a[e]&&(a[e]=o[e])}));var s=Wd(a,i);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===oG&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==iG||i?n===iG&&i?{scaleY:a?1:-1,scaleX:-1}:n!==oG||i?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=e.getBoundingRect([o]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get("brushSelect");n.add(new rG({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var i=new rG({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:K(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),o=r.getShadowDim&&r.getShadowDim(),a=o&&i.getDimensionInfo(o)?r.getShadowDim():e.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(i!==this._shadowData||a!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u=i.getDataExtent(a),c=.3*(u[1]-u[0]);u=[u[0]-c,u[1]+c];var h,d=[0,t[1]],p=[0,t[0]],f=[[t[0],0],[0,0]],g=[],m=p[1]/(i.count()-1),v=0,y=Math.round(i.count()/t[0]);i.each([a],(function(e,t){if(y>0&&t%y)v+=m;else{var n=null==e||isNaN(e)||""===e,r=n?0:eo(e,u,d,!0);n&&!h&&t?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&h&&(f.push([v,0]),g.push([v,0])),f.push([v,r]),g.push([v,r]),v+=m,h=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=i,this._shadowDim=a,this._shadowSize=[t[0],t[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(e){var t=_.getModel(e?"selectedDataBackground":"dataBackground"),n=new Wi,r=new ic({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new ac({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,r=this.ecModel;return e.eachTargetAxis((function(i,o){W(e.getAxisProxy(i,o).getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&F(aG,e.get("type"))<0)){var a,s=r.getComponent(zz(i),o).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(i),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:i,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),c=t.filler=new rG({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});i.add(c),i.add(new rG({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),W([0,1],(function(t){var o=a.get("handleIcon");!ov[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o,"production"!==process.env.NODE_ENV&&Eo("handleIcon now needs 'path://' prefix when using a path string"));var s=lv(o,-1,0,2,2,null,!0);s.attr({cursor:uG(this._orient),draggable:!0,drift:K(this._onDragMove,this,t),ondragend:K(this._onDragEnd,this),onmouseover:K(this._showDataInfo,this,!0),onmouseout:K(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=to(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),ou(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),i.add(n[t]=s);var h=a.getModel("textStyle"),d=(a.get("handleLabel")||{}).show||!1;e.add(r[t]=new il({silent:!0,invisible:!d,style:yh(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))}),this);var h=c;if(u){var d=to(a.get("moveHandleSize"),o[1]),p=t.moveHandle=new tl({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=t.moveHandleIcon=lv(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=t.moveZone=new tl({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",(function(){s.enterEmphasis(p)})).on("mouseout",(function(){s.leaveEmphasis(p)})),i.add(p),i.add(g),i.add(h)}h.attr({draggable:!0,cursor:uG(this._orient),drift:K(this._onDragMove,this,"all"),ondragstart:K(this._showDataInfo,this,!0),ondragend:K(this._onDragEnd,this),onmouseover:K(this._showDataInfo,this,!0),onmouseout:K(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[eo(e[0],[0,100],t,!0),eo(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];cL(t,r,i,n.get("zoomLock")?"all":e,null!=o.minSpan?eo(o.minSpan,a,i,!0):null,null!=o.maxSpan?eo(o.maxSpan,a,i,!0):null);var s=this._range,l=this._range=ro([eo(r[0],i,a,!0),eo(r[1],i,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=ro(n.slice()),i=this._size;W([0,1],(function(e){var r=t.handles[e],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:i[1]/2-o/2})}),this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(o),t.moveZone.setShape(o),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],l=0;l<a.length;l++){var u=a[l],c=u.getClipPath();c||(c=new tl,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,o=["",""];if(t.get("showDetail")){var a=t.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=e?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();o=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=ro(this._handleEnds.slice());function h(e){var t=Jc(n.handles[e].parent,this.group),a=eh(0===e?"right":"left",t),s=this._handleWidth/2+5,l=Qc([c[e]+(0===e?-s:s),this._size[1]/2],t);r[e].setStyle({x:l[0],y:l[1],verticalAlign:i===iG?"middle":a,align:i===iG?a:"center",text:o[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get("labelFormatter"),i=n.get("labelPrecision");null!=i&&"auto"!==i||(i=t.getPixelPrecision());var o=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return Q(r)?r(e,o):ee(r)?r.replace("{value}",o):o},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get("handleLabel")||{}).show||!1,n=this.dataZoomModel.getModel(["emphasis","handleLabel"]).get("show")||!1,r=e||this._dragging?n:t,i=this._displayables,o=i.handleLabels;o[0].attr("invisible",!r),o[1].attr("invisible",!r),i.moveHandle&&this.api[r?"enterEmphasis":"leaveEmphasis"](i.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,bt(r.event);var i=Qc([t,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(e,i[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new kt(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100];this._range=ro([eo(n.x,r,i,!0),eo(n.x+n.width,r,i,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(bt(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new rG({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(e,t),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),i.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?sG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=Bz(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return e},t.type="dataZoom.slider",t}(Wz);function uG(e){return"vertical"===e?"ns-resize":"ew-resize"}function cG(e){e.registerComponentModel(nG),e.registerComponentView(lG),$z(e)}var hG=function(e,t,n){var r=O((dG[e]||{})[t]);return n&&J(r)?r[r.length-1]:r},dG={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},pG=rI.mapVisual,fG=rI.eachVisual,gG=J,mG=W,vG=ro,yG=eo,_G=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&pB(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=K(e,this),this.controllerVisuals=dB(this.option.controller,t,e),this.targetVisuals=dB(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,n){t.push(n)})):t=zo(e),t},t.prototype.eachTargetSeries=function(e,t){W(this.getTargetSeriesIndices(),(function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)}),this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries((function(n){n===e&&(t=!0)})),t},t.prototype.formatValueText=function(e,t,n){var r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],J(e)&&(e=e.slice(),r=!0);var l=t?e:r?[u(e[0]),u(e[1])]:u(e);return ee(s)?s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l):Q(s)?r?s(e[0],e[1]):s(e):r?e[0]===a[0]?n[0]+" "+l[1]:e[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(e){return e===a[0]?"min":e===a[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=vG([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],o=e.getDimensionInfo(i);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||(t.target={}),i=t.controller||(t.controller={});R(r,n),R(i,n);var o=this.isCategory();function a(n){gG(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,r),a.call(this,i),function(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},mG(r,(function(e,t){if(rI.isValidType(t)){var n=hG(t,"inactive",o);null!=n&&(i[t]=n,"color"!==t||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}})))}.call(this,r,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";mG(this.stateList,(function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?r:[r]}),null==l.symbol&&(l.symbol=t&&O(t)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&O(n)||(o?s[0]:[s[0],s[0]])),l.symbol=pG(l.symbol,(function(e){return"none"===e?i:e}));var u=l.symbolSize;if(null!=u){var c=-1/0;fG(u,(function(e){e>c&&(c=e)})),l.symbolSize=pG(u,(function(e){return yG(e,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,i)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}($d),xG=[20,140],bG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=xG[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=xG[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):J(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),W(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=ro((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),(function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)}),this),t.push({seriesId:n.id,dataIndex:r})}),this),t},t.prototype.getVisualMeta=function(e){var t=wG(this,"outOfRange",this.getExtent()),n=wG(this,"inRange",this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var o=0,a=0,s=n.length,l=t.length;a<l&&(!n.length||t[a]<=n[0]);a++)t[a]<n[o]&&i(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(t[a],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=Uh(_G.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(_G);function wG(e,t,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],a=0;a<=200&&i<n[1];a++)o.push(i),i+=r;return o.push(n[1]),o}var SG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return l(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){this.visualMapModel=e,!1!==e.get("show")?this.doRender(e,t,n,r):this.group.removeAll()},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=Ed(t.get("padding")||0),r=e.getBoundingRect();e.add(new tl({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var r=(n=n||{}).forceState,i=this.visualMapModel,o={};if("color"===t){var a=i.get("contentColor");o.color=a}function s(e){return o[e]}function l(e,t){o[e]=t}var u=i.controllerVisuals[r||i.getValueState(e)];return W(rI.prepareVisualTypes(u),(function(r){var i=u[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=u.__alphaForOpacity),rI.dependsOn(r,t)&&i&&i.applyVisual(e,s,l)})),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;jd(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,r){},t.type="visualMap",t}(Xg),TG=[["left","right","width"],["top","bottom","height"]];function MG(e,t,n){var r=e.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:t.getWidth(),height:t.getHeight()},a="horizontal"===r.orient?1:0,s=TG[a],l=[0,null,10],u={},c=0;c<3;c++)u[TG[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:r[s[c]];var h=[["x","width",3],["y","height",0]][a],d=Wd(u,o,r.padding);return s[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function CG(e,t){return W(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}var DG=eo,AG=W,IG=Math.min,EG=Math.max,LG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return l(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=K(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=K(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){r&&"selectDataRange"===r.type&&r.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),a=i.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new il({style:yh(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,o=this._useHandle,a=MG(t,this.api,r),s=n.mainGroup=this._createBarGroup(a),l=new Wi;s.add(l),l.add(n.outOfRange=NG()),l.add(n.inRange=NG(null,o?OG(this._orient):null,K(this._dragHandle,this,"all",!1),K(this._dragHandle,this,"all",!0))),l.setClipPath(new tl({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=EG(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,c,i),this._createHandle(t,s,1,r,c,i)),this._createIndicator(t,s,r,c,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,o){var a=K(this._dragHandle,this,n,!1),s=K(this._dragHandle,this,n,!0),l=Ni(e.get("handleSize"),r[0]),u=lv(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=OG(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){bt(e.event)}}),u.x=r[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),hu(u,!0),t.add(u);var h=this.visualMapModel.textStyleModel,d=new il({cursor:c,draggable:!0,drift:a,onmousemove:function(e){bt(e.event)},ondragend:s,style:yh(h,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=d},t.prototype._createIndicator=function(e,t,n,r,i){var o=Ni(e.get("indicatorSize"),n[0]),a=lv(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(a instanceof Zs){var l=a.style;a.useStyle(z({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);t.add(a);var u=this.visualMapModel.textStyleModel,c=new il({silent:!0,invisible:!0,style:yh(u,{x:0,y:0,text:""})});this.group.add(c);var h=[("horizontal"===i?r/2:6)+n[0]/2,0],d=this._shapes;d.indicator=a,d.indicatorLabel=c,d.indicatorLabelPoint=h,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}t===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():PG(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[DG(t[0],n,r,!0),DG(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];cL(t,r,i,e,0);var o=n.getExtent();this._dataInterval=[DG(r[0],i,o,!0),DG(r[1],i,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],o=e?i:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,i),a=[this.getControllerVisual(e[0],"symbolSize",i),this.getControllerVisual(e[1],"symbolSize",i)],s=this._createBarPoints(n,a);return{barColor:new yc(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],r=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var i=1;i<100;i++){var o=e[0]+r*i;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:i/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Wi("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent(),l=this._applyTransform("left",n.mainGroup);AG([0,1],(function(u){var c=i[u];c.setStyle("fill",t.handlesColor[u]),c.y=e[u];var h=DG(e[u],[0,a[1]],s,!0),d=this.getControllerVisual(h,"symbolSize");c.scaleX=c.scaleY=d/a[0],c.x=a[0]-d/2;var p=Qc(n.handleLabelPoints[u],Jc(c,this.group));if("horizontal"===this._orient){var f="left"===l||"top"===l?(a[0]-d)/2:(a[0]-d)/-2;p[1]+=f}o[u].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[u]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),d=DG(e,o,s,!0),p=a[0]-h/2,f={x:u.x,y:u.y};u.y=d,u.x=p;var g=Qc(l.indicatorLabelPoint,Jc(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+i.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var _={x:p,y:d,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,b),m.animateTo(x,b)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var S=0;S<w.length;S++)this.api.enterBlur(w[S])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=IG(EG(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i=[0,r[1]],o=n.getExtent();e=IG(EG(i[0],e),i[1]);var a=function(e,t,n){var r=6,i=e.get("hoverLinkDataSize");i&&(r=DG(i,t,n,!0)/2);return r}(n,o,i),s=[e-a,e+a],l=DG(e,i,o,!0),u=[DG(s[0],i,o,!0),DG(s[1],i,o,!0)];s[0]<i[0]&&(u[0]=-1/0),s[1]>i[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var c=this._hoverLinkDataIndices,h=[];(t||PG(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=function(e,t){var n={},r={};return i(e||[],n),i(t||[],r,n),[o(n),o(r)];function i(e,t,n){for(var r=0,i=e.length;r<i;r++){var o=jo(e[r].seriesId,null);if(null==o)return;for(var a=zo(e[r].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(t[o]||(t[o]={}))[c]=1}}}function o(e,t){var n=[];for(var r in e)if(e.hasOwnProperty(r)&&null!=e[r])if(t)n.push(+r);else{var i=o(e[r],!0);i.length&&n.push({seriesId:r,dataIndex:i})}return n}}(c,h);this._dispatchHighDown("downplay",CG(d[0],n)),this._dispatchHighDown("highlight",CG(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(Km(e.target,(function(e){var n=vl(e);if(null!=n.dataIndex)return t=n,!0}),!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",CG(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=Jc(t,r?null:this.group);return J(e)?Qc(e,i,n):eh(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(SG);function NG(e,t,n,r){return new ic({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){bt(e.event)},ondragend:r})}function PG(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function OG(e){return"vertical"===e?"ns-resize":"ew-resize"}var RG={type:"selectDataRange",event:"dataRangeSelected",update:"update"},kG=function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))},zG=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",(function(t){var r,i,o,a,s,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((r=t.stateList,i=t.targetVisuals,o=K(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},W(r,(function(e){var t=rI.prepareVisualTypes(i[e]);s[e]=t})),{progress:function(e,t){var n,r;function l(e){return jm(t,r,e)}function u(e,n){Ym(t,r,e,n)}null!=a&&(n=t.getDimensionIndex(a));for(var c=t.getStore();null!=(r=e.next());){var h=t.getRawDataItem(r);if(!h||!1!==h.visualMap)for(var d=null!=a?c.get(n,r):r,p=o(d),f=i[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(d,l,u)}}}}))})),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(K(VG,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}})),e.getData().setVisual("visualMeta",r)}}];function VG(e,t,n,r){for(var i=t.targetVisuals[r],o=rI.prepareVisualTypes(i),a={color:Xm(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=i["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,d)}return a.color;function h(e){return a[e]}function d(e,t){a[e]=t}}var BG=W;function FG(e){var t=e&&e.visualMap;J(t)||(t=t?[t]:[]),BG(t,(function(e){if(e){GG(e,"splitList")&&!GG(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&J(t)&&BG(t,(function(e){re(e)&&(GG(e,"start")&&!GG(e,"min")&&(e.min=e.start),GG(e,"end")&&!GG(e,"max")&&(e.max=e.end))}))}}))}function GG(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var HG=!1;function UG(e){HG||(HG=!0,e.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"})),e.registerAction(RG,kG),W(zG,(function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)})),e.registerPreprocessor(FG))}function WG(e){e.registerComponentModel(bG),e.registerComponentView(LG),UG(e)}var jG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return l(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],XG[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual((function(e,t){"categories"===r?(e.mappingMethod="category",e.categories=O(i)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=j(this._pieceList,(function(e){return e=O(e),"inRange"!==t&&(e.visual=null),e})))}))},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=rI.listVisualTypes(),i=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}W(t.pieces,(function(e){W(r,(function(t){e.hasOwnProperty(t)&&(n[t]=1)}))})),W(n,(function(e,n){var r=!1;W(this.stateList,(function(e){r=r||o(t,e,n)||o(t.target,e,n)}),this),!r&&W(this.stateList,(function(e){(t[e]||(t[e]={}))[n]=hG(n,"inRange"===e?"active":"inactive",i)}))}),this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,W(r,(function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)}),this),"single"===n.selectedMode){var o=!1;W(r,(function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(o?i[n]=!1:o=!0)}),this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=O(e)},t.prototype.getValueState=function(e){var t=rI.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),(function(t,r){rI.findPieceIndex(t,n)===e&&i.push(r)}),this),t.push({seriesId:r.id,dataIndex:i})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return W(i,(function(e){var t=e.interval;t&&(t[0]>a&&s([a,t[0]],"outOfRange"),s(t.slice()),a=t[1])}),this),{stops:t,outerColors:n}}function s(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=e(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=Uh(_G.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(_G),XG={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a<i;s+=o,a++){var l=a===i-1?r[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),_o(e),W(e,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(e){var t=this.option;W(t.categories,(function(t){e.push({text:this.formatValueText(t,!0),value:t})}),this),YG(t,e)},pieces:function(e){var t=this.option;W(t.pieces,(function(t,n){re(t)||(t={value:t});var r={text:"",index:n};if(null!=t.label&&(r.text=t.label),t.hasOwnProperty("value")){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],a=r.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var h=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&null==o[c];d++)o[c]=t[h[d]],a[c]=s[d],u[c]=2===d;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),"production"!==process.env.NODE_ENV&&o[0]>o[1]&&console.warn("Piece "+n+"is illegal: "+o+" lower bound should not greater then uppper bound."),o[0]===o[1]&&a[0]&&a[1]&&(r.value=o[0])}r.visual=rI.retrieveVisuals(t),e.push(r)}),this),YG(t,e),_o(e),W(e,(function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function YG(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var ZG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),r=t.textStyleModel,i=r.getFont(),o=r.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=he(t.get("showLabel",!0),!u),h=!t.get("selectedMode");u&&this._renderEndsText(e,u[0],s,c,a),W(l.viewPieceList,(function(r){var l=r.piece,u=new Wi;u.onclick=K(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var d=t.getRepresentValue(l);if(this._createItemSymbol(u,d,[0,0,s[0],s[1]],h),c){var p=this.visualMapModel.getValueState(d);u.add(new il({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:i,fill:o,opacity:"outOfRange"===p?.5:1},silent:h}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,c,a),Ud(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return r("highlight")})).on("mouseout",(function(){return r("downplay")}));var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:CG(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return MG(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var o=new Wi,a=this.visualMapModel.textStyleModel;o.add(new il({style:yh(a,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=j(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),r=e.get("orient"),i=e.get("inverse");return("horizontal"===r?i:!i)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=lv(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color"));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=O(n.selected),o=t.getSelectedMapKey(e);"single"===r||!0===r?(i[o]=!0,W(i,(function(e,t){i[t]=t===o}))):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type="visualMap.piecewise",t}(SG);function qG(e){e.registerComponentModel(jG),e.registerComponentView(ZG),UG(e)}var KG={label:{enabled:!0},decal:{show:!1}},$G=$o(),JG={};function QG(e,t){var n=e.getModel("aria");if(n.get("enabled")){var r=O(KG);R(r.label,e.getLocaleModel().get("aria"),!1),R(n.option,r,!1),function(){if(n.getModel("decal").get("show")){var t=Te();e.eachSeries((function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),$G(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if(Q(t.enableAriaDecal))t.enableAriaDecal();else{var n=t.getData();if(t.isColorBySeries()){var r=Cp(t.ecModel,t.name,JG,e.getSeriesCount()),i=n.getVisual("decal");n.setVisual("decal",u(i,r))}else{var o=t.getRawData(),a={},s=$G(t).scope;n.each((function(e){var t=n.getRawIndex(e);a[t]=e}));var l=o.count();o.each((function(e){var r=a[e],i=o.getName(e)||e+"",c=Cp(t.ecModel,i,s,l),h=n.getItemVisual(r,"decal");n.setItemVisual(r,"decal",u(h,c))}))}}function u(e,t){var n=e?z(z({},t),e):t;return n.dirty=!0,n}}))}}(),function(){var r=t.getZr().dom;if(!r)return;var o=e.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=V(a.option,o),!a.get("enabled"))return;if(r.setAttribute("role","img"),a.get("description"))return void r.setAttribute("aria-label",a.get("description"));var s,l=e.getSeriesCount(),u=a.get(["data","maxCount"])||10,c=a.get(["series","maxCount"])||10,h=Math.min(l,c);if(l<1)return;var d=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();s=d?i(a.get(["general","withTitle"]),{title:d}):a.get(["general","withoutTitle"]);var p=[];s+=i(l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]),{seriesCount:l}),e.eachSeries((function(t,n){if(n<h){var r=void 0,o=t.get("name")?"withName":"withoutName";r=i(r=l>1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(x=t.subType,b=e.getLocaleModel().get(["series","typeNames"]),b[x]||b.chart)});var s=t.getData();if(s.count()>u)r+=i(a.get(["data","partialData"]),{displayCnt:u});else r+=a.get(["data","allData"]);for(var c=a.get(["data","separator","middle"]),d=a.get(["data","separator","end"]),f=a.get(["data","excludeDimensionId"]),g=[],m=0;m<s.count();m++)if(m<u){var v=s.getName(m),y=f?Y(s.getValues(m),(function(e,t){return-1===F(f,t)})):s.getValues(m),_=a.get(["data",v?"withName":"withoutName"]);g.push(i(_,{name:v,value:y.join(c)}))}r+=g.join(c)+d,p.push(r)}var x,b}));var f=a.getModel(["series","multiple","separator"]),g=f.get("middle"),m=f.get("end");s+=p.join(g)+m,r.setAttribute("aria-label",s)}()}function i(e,t){if(!ee(e))return e;var n=e;return W(t,(function(e,t){n=n.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),n}}function eH(e){if(e&&e.aria){var t=e.aria;null!=t.show&&(t.enabled=t.show),t.label=t.label||{},W(["description","general","series","data"],(function(e){null!=t[e]&&(t.label[e]=t[e])}))}}var tH={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},nH=function(){function e(e){if(null==(this._condVal=ee(e)?new RegExp(e):ue(e)?e:null)){var t="";"production"!==process.env.NODE_ENV&&(t=No("Illegal regexp",e,"in")),Po(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return ee(t)?this._condVal.test(e):!!ne(t)&&this._condVal.test(e+"")},e}(),rH=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),iH=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},e}(),oH=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},e}(),aH=function(){function e(){}return e.prototype.evaluate=function(){return!this.child.evaluate()},e}(),sH=function(){function e(){}return e.prototype.evaluate=function(){for(var e=!!this.valueParser,t=(0,this.getValue)(this.valueGetterParam),n=e?this.valueParser(t):null,r=0;r<this.subCondList.length;r++)if(!this.subCondList[r].evaluate(e?n:t))return!1;return!0},e}();function lH(e,t){if(!0===e||!1===e){var n=new rH;return n.value=e,n}var r="";return cH(e)||("production"!==process.env.NODE_ENV&&(r=No("Illegal config. Expect a plain object but actually",e)),Po(r)),e.and?uH("and",e,t):e.or?uH("or",e,t):e.not?function(e,t){var n=e.not,r="";"production"!==process.env.NODE_ENV&&(r=No('"not" condition should only be `not: {}`.',"Illegal condition:",e));cH(n)||Po(r);var i=new aH;i.child=lH(n,t),i.child||Po(r);return i}(e,t):function(e,t){for(var n="",r=t.prepareGetValue(e),i=[],o=q(e),a=e.parser,s=a?Wf(a):null,l=0;l<o.length;l++){var u=o[l];if("parser"!==u&&!t.valueGetterAttrMap.get(u)){var c=Ae(tH,u)?tH[u]:u,h=e[u],d=s?s(h):h,p=qf(c,d)||"reg"===c&&new nH(d);p||("production"!==process.env.NODE_ENV&&(n=No('Illegal relational operation: "'+u+'" in condition:',e)),Po(n)),i.push(p)}}i.length||("production"!==process.env.NODE_ENV&&(n=No("Relational condition must have at least one operator.","Illegal condition:",e)),Po(n));var f=new sH;return f.valueGetterParam=r,f.valueParser=s,f.getValue=t.getValue,f.subCondList=i,f}(e,t)}function uH(e,t,n){var r=t[e],i="";"production"!==process.env.NODE_ENV&&(i=No('"and"/"or" condition should only be `'+e+": [...]` and must not be empty array.","Illegal condition:",t)),J(r)||Po(i),r.length||Po(i);var o="and"===e?new iH:new oH;return o.children=j(r,(function(e){return lH(e,n)})),o.children.length||Po(i),o}function cH(e){return re(e)&&!U(e)}var hH=function(){function e(e,t){this._cond=lH(e,t)}return e.prototype.evaluate=function(){return this._cond.evaluate()},e}();var dH={type:"echarts:filter",transform:function(e){for(var t,n,r,i=e.upstream,o=(n=e.config,r={valueGetterAttrMap:Te({dimension:!0}),prepareGetValue:function(e){var t="",n=e.dimension;Ae(e,"dimension")||("production"!==process.env.NODE_ENV&&(t=No('Relation condition must has prop "dimension" specified.',"Illegal condition:",e)),Po(t));var r=i.getDimensionInfo(n);return r||("production"!==process.env.NODE_ENV&&(t=No("Can not find dimension info via: "+n+".\n","Existing dimensions: ",i.cloneAllDimensionInfo(),".\n","Illegal condition:",e,".\n")),Po(t)),{dimIdx:r.index}},getValue:function(e){return i.retrieveValueFromItem(t,e.dimIdx)}},new hH(n,r)),a=[],s=0,l=i.count();s<l;s++)t=i.getRawDataItem(s),o.evaluate()&&a.push(t);return{data:a}}},pH="";"production"!==process.env.NODE_ENV&&(pH=["Valid config is like:",'{ dimension: "age", order: "asc" }','or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" "));var fH={type:"echarts:sort",transform:function(e){var t=e.upstream,n=e.config,r="",i=zo(n);i.length||("production"!==process.env.NODE_ENV&&(r="Empty `config` in sort transform."),Po(r));var o=[];W(i,(function(e){var n=e.dimension,i=e.order,a=e.parser,s=e.incomparable;if(null==n&&("production"!==process.env.NODE_ENV&&(r='Sort transform config must has "dimension" specified.'+pH),Po(r)),"asc"!==i&&"desc"!==i&&("production"!==process.env.NODE_ENV&&(r='Sort transform config must has "order" specified.'+pH),Po(r)),s&&"min"!==s&&"max"!==s){var l="";"production"!==process.env.NODE_ENV&&(l='incomparable must be "min" or "max" rather than "'+s+'".'),Po(l)}if("asc"!==i&&"desc"!==i){var u="";"production"!==process.env.NODE_ENV&&(u='order must be "asc" or "desc" rather than "'+i+'".'),Po(u)}var c=t.getDimensionInfo(n);c||("production"!==process.env.NODE_ENV&&(r=No("Can not find dimension info via: "+n+".\n","Existing dimensions: ",t.cloneAllDimensionInfo(),".\n","Illegal config:",e,".\n")),Po(r));var h=a?Wf(a):null;a&&!h&&("production"!==process.env.NODE_ENV&&(r=No("Invalid parser name "+a+".\n","Illegal config:",e,".\n")),Po(r)),o.push({dimIdx:c.index,parser:h,comparator:new Yf(i,s)})}));var a=t.sourceFormat;a!==rp&&a!==ip&&("production"!==process.env.NODE_ENV&&(r='sourceFormat "'+a+'" is not supported yet'),Po(r));for(var s=[],l=0,u=t.count();l<u;l++)s.push(t.getRawDataItem(l));return s.sort((function(e,n){for(var r=0;r<o.length;r++){var i=o[r],a=t.retrieveValueFromItem(e,i.dimIdx),s=t.retrieveValueFromItem(n,i.dimIdx);i.parser&&(a=i.parser(a),s=i.parser(s));var l=i.comparator.evaluate(a,s);if(0!==l)return l}return 0})),{data:s}}};var gH=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return l(t,e),t.prototype.init=function(t,n,r){e.prototype.init.call(this,t,n,r),this._sourceManager=new fg(this),gg(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),gg(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:lp},t}($d),mH=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return l(t,e),t.type="dataset",t}(Xg);function vH(e){e.registerComponentModel(gH),e.registerComponentView(mH)}var yH=Ss.CMD;function _H(e,t){return Math.abs(e-t)<1e-5}function xH(e){var t,n,r,i,o,a=e.data,s=e.len(),l=[],u=0,c=0,h=0,d=0;function p(e,n){t&&t.length>2&&l.push(t),t=[e,n]}function f(e,n,r,i){_H(e,r)&&_H(n,i)||t.push(e,n,r,i,r,i)}function g(e,n,r,i,o,a){var s=Math.abs(n-e),l=4*Math.tan(s/4)/3,u=n<e?-1:1,c=Math.cos(e),h=Math.sin(e),d=Math.cos(n),p=Math.sin(n),f=c*o+r,g=h*a+i,m=d*o+r,v=p*a+i,y=o*l*u,_=a*l*u;t.push(f-y*h,g+_*c,m+y*p,v-_*d,m,v)}for(var m=0;m<s;){var v=a[m++],y=1===m;switch(y&&(h=u=a[m],d=c=a[m+1],v!==yH.L&&v!==yH.C&&v!==yH.Q||(t=[h,d])),v){case yH.M:u=h=a[m++],c=d=a[m++],p(h,d);break;case yH.L:f(u,c,n=a[m++],r=a[m++]),u=n,c=r;break;case yH.C:t.push(a[m++],a[m++],a[m++],a[m++],u=a[m++],c=a[m++]);break;case yH.Q:n=a[m++],r=a[m++],i=a[m++],o=a[m++],t.push(u+2/3*(n-u),c+2/3*(r-c),i+2/3*(n-i),o+2/3*(r-o),i,o),u=i,c=o;break;case yH.A:var _=a[m++],x=a[m++],b=a[m++],w=a[m++],S=a[m++],T=a[m++]+S;m+=1;var M=!a[m++];n=Math.cos(S)*b+_,r=Math.sin(S)*w+x,y?p(h=n,d=r):f(u,c,n,r),u=Math.cos(T)*b+_,c=Math.sin(T)*w+x;for(var C=(M?-1:1)*Math.PI/2,D=S;M?D>T:D<T;D+=C){g(D,M?Math.max(D+C,T):Math.min(D+C,T),_,x,b,w)}break;case yH.R:h=u=a[m++],d=c=a[m++],n=h+a[m++],r=d+a[m++],p(n,d),f(n,d,n,r),f(n,r,h,r),f(h,r,h,d),f(h,d,n,d);break;case yH.Z:t&&f(u,c,h,d),u=h,c=d}}return t&&t.length>2&&l.push(t),l}function bH(e,t,n,r,i,o,a,s,l,u){if(_H(e,n)&&_H(t,r)&&_H(i,a)&&_H(o,s))l.push(a,s);else{var c=2/u,h=c*c,d=a-e,p=s-t,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-e,m=r-t,v=i-a,y=o-s,_=g*g+m*m,x=v*v+y*y;if(_<h&&x<h)l.push(a,s);else{var b=d*g+p*m,w=-d*v-p*y;if(_-b*b<h&&b>=0&&x-w*w<h&&w>=0)l.push(a,s);else{var S=[],T=[];In(e,n,i,a,.5,S),In(t,r,o,s,.5,T),bH(S[0],T[0],S[1],T[1],S[2],T[2],S[3],T[3],l,u),bH(S[4],T[4],S[5],T[5],S[6],T[6],S[7],T[7],l,u)}}}}function wH(e,t,n){var r=e[t],i=e[1-t],o=Math.abs(r/i),a=Math.ceil(Math.sqrt(o*n)),s=Math.floor(n/a);0===s&&(s=1,a=n);for(var l=[],u=0;u<a;u++)l.push(s);var c=n-a*s;if(c>0)for(u=0;u<c;u++)l[u%a]+=1;return l}function SH(e,t,n){for(var r=e.r0,i=e.r,o=e.startAngle,a=e.endAngle,s=Math.abs(a-o),l=s*i,u=i-r,c=l>Math.abs(u),h=wH([l,u],c?0:1,t),d=(c?s:u)/h.length,p=0;p<h.length;p++)for(var f=(c?u:s)/h[p],g=0;g<h[p];g++){var m={};c?(m.startAngle=o+d*p,m.endAngle=o+d*(p+1),m.r0=r+f*g,m.r=r+f*(g+1)):(m.startAngle=o+f*g,m.endAngle=o+f*(g+1),m.r0=r+d*p,m.r=r+d*(p+1)),m.clockwise=e.clockwise,m.cx=e.cx,m.cy=e.cy,n.push(m)}}function TH(e,t,n,r){return e*r-n*t}function MH(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=TH(c,h,l,u);if(Math.abs(d)<1e-6)return null;var p=TH(e-i,t-o,c,h)/d;return p<0||p>1?null:new kt(p*l+e,p*u+t)}function CH(e,t,n){var r=new kt;kt.sub(r,n,t),r.normalize();var i=new kt;return kt.sub(i,e,t),i.dot(r)}function DH(e,t){var n=e[e.length-1];n&&n[0]===t[0]&&n[1]===t[1]||e.push(t)}function AH(e){var t=e.points,n=[],r=[];Ja(t,n,r);var i=new jt(n[0],n[1],r[0]-n[0],r[1]-n[1]),o=i.width,a=i.height,s=i.x,l=i.y,u=new kt,c=new kt;return o>a?(u.x=c.x=s+o/2,u.y=l,c.y=l+a):(u.y=c.y=l+a/2,u.x=s,c.x=s+o),function(e,t,n){for(var r=e.length,i=[],o=0;o<r;o++){var a=e[o],s=e[(o+1)%r],l=MH(a[0],a[1],s[0],s[1],t.x,t.y,n.x,n.y);l&&i.push({projPt:CH(l,t,n),pt:l,idx:o})}if(i.length<2)return[{points:e},{points:e}];i.sort((function(e,t){return e.projPt-t.projPt}));var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var h=u;u=c,c=h}var d=[u.pt.x,u.pt.y],p=[c.pt.x,c.pt.y],f=[d],g=[p];for(o=u.idx+1;o<=c.idx;o++)DH(f,e[o].slice());for(DH(f,p),DH(f,d),o=c.idx+1;o<=u.idx+r;o++)DH(g,e[o%r].slice());return DH(g,d),DH(g,p),[{points:f},{points:g}]}(t,u,c)}function IH(e,t,n,r){if(1===n)r.push(t);else{var i=Math.floor(n/2),o=e(t);IH(e,o[0],i,r),IH(e,o[1],n-i,r)}return r}function EH(e,t){t.setStyle(e.style),t.z=e.z,t.z2=e.z2,t.zlevel=e.zlevel}function LH(e,t){var n,r=[],i=e.shape;switch(e.type){case"rect":!function(e,t,n){for(var r=e.width,i=e.height,o=r>i,a=wH([r,i],o?0:1,t),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",c=o?"y":"x",h=e[s]/a.length,d=0;d<a.length;d++)for(var p=e[l]/a[d],f=0;f<a[d];f++){var g={};g[u]=d*h,g[c]=f*p,g[s]=h,g[l]=p,g.x+=e.x,g.y+=e.y,n.push(g)}}(i,t,r),n=tl;break;case"sector":SH(i,t,r),n=Qu;break;case"circle":SH({r0:0,r:i.r,startAngle:0,endAngle:2*Math.PI,cx:i.cx,cy:i.cy},t,r),n=Qu;break;default:var o=e.getComputedTransform(),a=o?Math.sqrt(Math.max(o[0]*o[0]+o[1]*o[1],o[2]*o[2]+o[3]*o[3])):1,s=j(function(e,t){var n=xH(e),r=[];t=t||1;for(var i=0;i<n.length;i++){var o=n[i],a=[],s=o[0],l=o[1];a.push(s,l);for(var u=2;u<o.length;){var c=o[u++],h=o[u++],d=o[u++],p=o[u++],f=o[u++],g=o[u++];bH(s,l,c,h,d,p,f,g,a,t),s=f,l=g}r.push(a)}return r}(e.getUpdatedPathProxy(),a),(function(e){return function(e){for(var t=[],n=0;n<e.length;)t.push([e[n++],e[n++]]);return t}(e)})),l=s.length;if(0===l)IH(AH,{points:s[0]},t,r);else if(l===t)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,h=j(s,(function(e){var t=[],n=[];Ja(e,t,n);var r=(n[1]-t[1])*(n[0]-t[0]);return c+=r,{poly:e,area:r}}));h.sort((function(e,t){return t.area-e.area}));var d=t;for(u=0;u<l;u++){var p=h[u];if(d<=0)break;var f=u===l-1?d:Math.ceil(p.area/c*t);f<0||(IH(AH,{points:p.poly},f,r),d-=f)}}n=ic}if(!n)return function(e,t){for(var n=[],r=0;r<t;r++)n.push(Ou(e));return n}(e,t);var g=[];for(u=0;u<r.length;u++){var m=new n;m.setShape(r[u]),EH(e,m),g.push(m)}return g}function NH(e,t){var n=e.length,r=t.length;if(n===r)return[e,t];for(var i=[],o=[],a=n<r?e:t,s=Math.min(n,r),l=Math.abs(r-n)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,h=[a[0],a[1]],d=l,p=2;p<s;){var f=a[p-2],g=a[p-1],m=a[p++],v=a[p++],y=a[p++],_=a[p++],x=a[p++],b=a[p++];if(d<=0)h.push(m,v,y,_,x,b);else{for(var w=Math.min(d,c-1)+1,S=1;S<=w;S++){var T=S/w;In(f,m,y,x,T,i),In(g,v,_,b,T,o),f=i[3],g=o[3],h.push(i[1],o[1],i[2],o[2],f,g),m=i[5],v=o[5],y=i[6],_=o[6]}d-=w-1}}return a===e?[h,t]:[e,h]}function PH(e,t){for(var n=e.length,r=e[n-2],i=e[n-1],o=[],a=0;a<t.length;)o[a++]=r,o[a++]=i;return o}function OH(e){for(var t=0,n=0,r=0,i=e.length,o=0,a=i-2;o<i;a=o,o+=2){var s=e[a],l=e[a+1],u=e[o],c=e[o+1],h=s*c-u*l;t+=h,n+=(s+u)*h,r+=(l+c)*h}return 0===t?[e[0]||0,e[1]||0]:[n/t/3,r/t/3,t]}function RH(e,t,n,r){for(var i=(e.length-2)/6,o=1/0,a=0,s=e.length,l=s-2,u=0;u<i;u++){for(var c=6*u,h=0,d=0;d<s;d+=2){var p=0===d?c:(c+d-2)%l+2,f=e[p]-n[0],g=e[p+1]-n[1],m=t[d]-r[0]-f,v=t[d+1]-r[1]-g;h+=m*m+v*v}h<o&&(o=h,a=u)}return a}function kH(e){for(var t=[],n=e.length,r=0;r<n;r+=2)t[r]=e[n-r-2],t[r+1]=e[n-r-1];return t}function zH(e){return e.__isCombineMorphing}var VH="__mOriginal_";function BH(e,t,n){var r=VH+t,i=e[r]||e[t];e[r]||(e[r]=e[t]);var o=n.replace,a=n.after,s=n.before;e[t]=function(){var e,t=arguments;return s&&s.apply(this,t),e=o?o.apply(this,t):i.apply(this,t),a&&a.apply(this,t),e}}function FH(e,t){var n=VH+t;e[n]&&(e[t]=e[n],e[n]=null)}function GH(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;){var o=r[i],a=r[i+1];r[i++]=t[0]*o+t[2]*a+t[4],r[i++]=t[1]*o+t[3]*a+t[5]}}function HH(e,t){var n=e.getUpdatedPathProxy(),r=t.getUpdatedPathProxy(),i=function(e,t){for(var n,r,i,o=[],a=[],s=0;s<Math.max(e.length,t.length);s++){var l=e[s],u=t[s],c=void 0,h=void 0;l?u?(r=c=(n=NH(l,u))[0],i=h=n[1]):(h=PH(i||l,l),c=l):(c=PH(r||u,u),h=u),o.push(c),a.push(h)}return[o,a]}(xH(n),xH(r)),o=i[0],a=i[1],s=e.getComputedTransform(),l=t.getComputedTransform();s&&GH(o,s),l&&GH(a,l),BH(t,"updateTransform",{replace:function(){this.transform=null}}),t.transform=null;var u=function(e,t,n,r){for(var i,o=[],a=0;a<e.length;a++){var s=e[a],l=t[a],u=OH(s),c=OH(l);null==i&&(i=u[2]<0!=c[2]<0);var h=[],d=[],p=0,f=1/0,g=[],m=s.length;i&&(s=kH(s));for(var v=6*RH(s,l,u,c),y=m-2,_=0;_<y;_+=2){var x=(v+_)%y+2;h[_+2]=s[x]-u[0],h[_+3]=s[x+1]-u[1]}h[0]=s[v]-u[0],h[1]=s[v+1]-u[1];for(var b=r/n,w=-r/2;w<=r/2;w+=b){var S=Math.sin(w),T=Math.cos(w),M=0;for(_=0;_<s.length;_+=2){var C=h[_],D=h[_+1],A=l[_]-c[0],I=l[_+1]-c[1],E=A*T-I*S,L=A*S+I*T;g[_]=E,g[_+1]=L;var N=E-C,P=L-D;M+=N*N+P*P}if(M<f){f=M,p=w;for(var O=0;O<g.length;O++)d[O]=g[O]}}o.push({from:h,to:d,fromCp:u,toCp:c,rotation:-p})}return o}(o,a,10,Math.PI),c=[];BH(t,"buildPath",{replace:function(e){for(var n=t.__morphT,r=1-n,i=[],o=0;o<u.length;o++){var a=u[o],s=a.from,l=a.to,h=a.rotation*n,d=a.fromCp,p=a.toCp,f=Math.sin(h),g=Math.cos(h);qe(i,d,p,n);for(var m=0;m<s.length;m+=2){var v=s[m],y=s[m+1],_=v*r+(S=l[m])*n,x=y*r+(T=l[m+1])*n;c[m]=_*g-x*f+i[0],c[m+1]=_*f+x*g+i[1]}var b=c[0],w=c[1];e.moveTo(b,w);for(m=2;m<s.length;){var S=c[m++],T=c[m++],M=c[m++],C=c[m++],D=c[m++],A=c[m++];b===S&&w===T&&M===D&&C===A?e.lineTo(D,A):e.bezierCurveTo(S,T,M,C,D,A),b=D,w=A}}}})}function UH(e,t,n){if(!e||!t)return t;var r=n.done,i=n.during;return HH(e,t),t.__morphT=0,t.animateTo({__morphT:1},V({during:function(e){t.dirtyShape(),i&&i(e)},done:function(){FH(t,"buildPath"),FH(t,"updateTransform"),t.__morphT=-1,t.createPathProxy(),t.dirtyShape(),r&&r()}},n)),t}function WH(e,t,n,r,i,o){e=i===n?0:Math.round(32767*(e-n)/(i-n)),t=o===r?0:Math.round(32767*(t-r)/(o-r));for(var a,s=0,l=32768;l>0;l/=2){var u=0,c=0;(e&l)>0&&(u=1),(t&l)>0&&(c=1),s+=l*l*(3*u^c),0===c&&(1===u&&(e=l-1-e,t=l-1-t),a=e,e=t,t=a)}return s}function jH(e){var t=1/0,n=1/0,r=-1/0,i=-1/0,o=j(e,(function(e){var o=e.getBoundingRect(),a=e.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return t=Math.min(s,t),n=Math.min(l,n),r=Math.max(s,r),i=Math.max(l,i),[s,l]}));return j(o,(function(o,a){return{cp:o,z:WH(o[0],o[1],t,n,r,i),path:e[a]}})).sort((function(e,t){return e.z-t.z})).map((function(e){return e.path}))}function XH(e){return LH(e.path,e.count)}function YH(e){return J(e[0])}function ZH(e,t){for(var n=[],r=e.length,i=0;i<r;i++)n.push({one:e[i],many:[]});for(i=0;i<t.length;i++){var o=t[i].length,a=void 0;for(a=0;a<o;a++)n[a%r].many.push(t[i][a])}var s=0;for(i=r-1;i>=0;i--)if(!n[i].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[i].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var qH={clone:function(e){for(var t=[],n=1-Math.pow(1-e.path.style.opacity,1/e.count),r=0;r<e.count;r++){var i=Ou(e.path);i.setStyle("opacity",n),t.push(i)}return t},split:null};function KH(e,t,n,r,i,o){if(e.length&&t.length){var a=Ac("update",r,i);if(a&&a.duration>0){var s,l,u=r.getModel("universalTransition").get("delay"),c=Object.assign({setToFinal:!0},a);YH(e)&&(s=e,l=t),YH(t)&&(s=t,l=e);for(var h=s?s===e:e.length>t.length,d=s?ZH(l,s):ZH(h?t:e,[h?e:t]),p=0,f=0;f<d.length;f++)p+=d[f].many.length;var g=0;for(f=0;f<d.length;f++)m(d[f],h,g,p),g+=d[f].many.length}}function m(e,t,r,i,a){var s=e.many,l=e.one;if(1!==s.length||a)for(var h=V({dividePath:qH[n],individualDelay:u&&function(e,t,n,o){return u(e+r,i)}},c),d=t?function(e,t,n){var r=[];!function e(t){for(var n=0;n<t.length;n++){var i=t[n];zH(i)?e(i.childrenRef()):i instanceof Us&&r.push(i)}}(e);var i=r.length;if(!i)return{fromIndividuals:[],toIndividuals:[],count:0};var o=(n.dividePath||XH)({path:t,count:i});if(o.length!==i)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};r=jH(r),o=jH(o);for(var a=n.done,s=n.during,l=n.individualDelay,u=new wi,c=0;c<i;c++){var h=r[c],d=o[c];d.parent=t,d.copyTransform(u),l||HH(h,d)}function p(e){for(var t=0;t<o.length;t++)o[t].addSelfToZr(e)}function f(){t.__isCombineMorphing=!1,t.__morphT=-1,t.childrenRef=null,FH(t,"addSelfToZr"),FH(t,"removeSelfFromZr")}t.__isCombineMorphing=!0,t.childrenRef=function(){return o},BH(t,"addSelfToZr",{after:function(e){p(e)}}),BH(t,"removeSelfFromZr",{after:function(e){for(var t=0;t<o.length;t++)o[t].removeSelfFromZr(e)}});var g=o.length;if(l){var m=g,v=function(){0==--m&&(f(),a&&a())};for(c=0;c<g;c++){var y=l?V({delay:(n.delay||0)+l(c,g,r[c],o[c]),done:v},n):n;UH(r[c],o[c],y)}}else t.__morphT=0,t.animateTo({__morphT:1},V({during:function(e){for(var n=0;n<g;n++){var r=o[n];r.__morphT=t.__morphT,r.dirtyShape()}s&&s(e)},done:function(){f();for(var t=0;t<e.length;t++)FH(e[t],"updateTransform");a&&a()}},n));return t.__zr&&p(t.__zr),{fromIndividuals:r,toIndividuals:o,count:g}}(s,l,h):function(e,t,n){var r=t.length,i=[],o=n.dividePath||XH;if(zH(e)){!function e(t){for(var n=0;n<t.length;n++){var r=t[n];zH(r)?e(r.childrenRef()):r instanceof Us&&i.push(r)}}(e.childrenRef());var a=i.length;if(a<r)for(var s=0,l=a;l<r;l++)i.push(Ou(i[s++%a]));i.length=r}else{i=o({path:e,count:r});var u=e.getComputedTransform();for(l=0;l<i.length;l++)i[l].setLocalTransform(u);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}i=jH(i),t=jH(t);var c=n.individualDelay;for(l=0;l<r;l++){var h=c?V({delay:(n.delay||0)+c(l,r,i[l],t[l])},n):n;UH(i[l],t[l],h)}return{fromIndividuals:i,toIndividuals:t,count:t.length}}(l,s,h),p=d.fromIndividuals,f=d.toIndividuals,g=p.length,v=0;v<g;v++){y=u?V({delay:u(v,g)},c):c;o(p[v],f[v],t?s[v]:e.one,t?e.one:s[v],y)}else{var y,_=t?s[0]:l,x=t?l:s[0];if(zH(_))m({many:[_],one:x},!0,r,i,!0);else UH(_,x,y=u?V({delay:u(r,i)},c):c),o(_,x,_,x,y)}}}function $H(e){if(!e)return[];if(J(e)){for(var t=[],n=0;n<e.length;n++)t.push($H(e[n]));return t}var r=[];return e.traverse((function(e){e instanceof Us&&!e.disableMorphing&&!e.invisible&&!e.ignore&&r.push(e)})),r}var JH=$o();function QH(e,t,n,r){var i=function(e,t){for(var n=e.dimensions,r=0;r<n.length;r++){var i=e.getDimensionInfo(n[r]);if(i&&0===i.otherDims[t])return n[r]}}(e,r?"itemChildGroupId":"itemGroupId");if(i){var o=function(e,t,n){var r=e.getDimensionInfo(n),i=r&&r.ordinalMeta;if(r){var o=e.get(r.name,t);return i&&i.categories[o]||o+""}}(e,t,i);return o}var a=e.getRawDataItem(t),s=r?"childGroupId":"groupId";return a&&a[s]?a[s]+"":r?void 0:n||e.getId(t)}function eU(e){var t=[];return W(e,(function(e){var n=e.data,r=e.dataGroupId;if(n.count()>1e4)"production"!==process.env.NODE_ENV&&Ao("Universal transition is disabled on large data > 10k.");else for(var i=n.getIndices(),o=0;o<i.length;o++)t.push({data:n,groupId:QH(n,o,r,!1),childGroupId:QH(n,o,r,!0),divide:e.divide,dataIndex:o})})),t}function tU(e,t,n){e.traverse((function(e){e instanceof Us&&Lc(e,{style:{opacity:0}},t,{dataIndex:n,isFrom:!0})}))}function nU(e){if(e.parent){var t=e.getComputedTransform();e.setLocalTransform(t),e.parent.remove(e)}}function rU(e){e.stopAnimation(),e.isGroup&&e.traverse((function(e){e.stopAnimation()}))}function iU(e,t,n){var r=Ac("update",n,t);r&&e.traverse((function(e){if(e instanceof Ga){var t=function(e){return Dc(e).oldStyle}(e);t&&e.animateFrom({style:t},r)}}))}function oU(e,t,n){var r=eU(e),i=eU(t);function o(e,t,n,r,i){(n||e)&&t.animateFrom({style:n&&n!==e?z(z({},n.style),e.style):e.style},i)}var a=!1,s=0,l=Te(),u=Te();r.forEach((function(e){e.groupId&&l.set(e.groupId,!0),e.childGroupId&&u.set(e.childGroupId,!0)}));for(var c=0;c<i.length;c++){var h=i[c].groupId;if(u.get(h)){s=1;break}var d=i[c].childGroupId;if(d&&l.get(d)){s=2;break}}function p(e,t){return function(n){var r=n.data,i=n.dataIndex;return t?r.getId(i):e?1===s?n.childGroupId:n.groupId:2===s?n.childGroupId:n.groupId}}var f=function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++){var i=e[r],o=t[r];if(i.data.getId(i.dataIndex)!==o.data.getId(o.dataIndex))return!1}return!0}(r,i),g={};if(!f)for(c=0;c<i.length;c++){var m=i[c],v=m.data.getItemGraphicEl(m.dataIndex);v&&(g[v.id]=!0)}function y(e,t){var n=r[t],s=i[e],l=s.data.hostModel,u=n.data.getItemGraphicEl(n.dataIndex),c=s.data.getItemGraphicEl(s.dataIndex);u!==c?u&&g[u.id]||c&&(rU(c),u?(rU(u),nU(u),a=!0,KH($H(u),$H(c),s.divide,l,e,o)):tU(c,l,e)):c&&iU(c,s.dataIndex,l)}new s_(r,i,p(!0,f),p(!1,f),null,"multiple").update(y).updateManyToOne((function(e,t){var n=i[e],s=n.data,l=s.hostModel,u=s.getItemGraphicEl(n.dataIndex),c=Y(j(t,(function(e){return r[e].data.getItemGraphicEl(r[e].dataIndex)})),(function(e){return e&&e!==u&&!g[e.id]}));u&&(rU(u),c.length?(W(c,(function(e){rU(e),nU(e)})),a=!0,KH($H(c),$H(u),n.divide,l,e,o)):tU(u,l,n.dataIndex))})).updateOneToMany((function(e,t){var n=r[t],s=n.data.getItemGraphicEl(n.dataIndex);if(!s||!g[s.id]){var l=Y(j(e,(function(e){return i[e].data.getItemGraphicEl(i[e].dataIndex)})),(function(e){return e&&e!==s})),u=i[e[0]].data.hostModel;l.length&&(W(l,(function(e){return rU(e)})),s?(rU(s),nU(s),a=!0,KH($H(s),$H(l),n.divide,u,e[0],o)):W(l,(function(t){return tU(t,u,e[0])})))}})).updateManyToMany((function(e,t){new s_(t,e,(function(e){return r[e].data.getId(r[e].dataIndex)}),(function(e){return i[e].data.getId(i[e].dataIndex)})).update((function(n,r){y(e[n],t[r])})).execute()})).execute(),a&&W(t,(function(e){var t=e.data.hostModel,r=t&&n.getViewOfSeriesModel(t),i=Ac("update",t,0);r&&t.isAnimationEnabled()&&i&&i.duration>0&&r.group.traverse((function(e){e instanceof Us&&!e.animators.length&&e.animateFrom({style:{opacity:0}},i)}))}))}function aU(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function sU(e){return J(e)?e.sort().join(","):e}function lU(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function uU(e,t){for(var n=0;n<e.length;n++){if(null!=t.seriesIndex&&t.seriesIndex===e[n].seriesIndex||null!=t.seriesId&&t.seriesId===e[n].id)return n}}i_([kS]),i_([function(e){e.registerPainter("svg",AS)}]),i_([function(e){e.registerChartView(vT),e.registerSeriesModel(zS),e.registerLayout(yT("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,bT("line"))},function(e){e.registerChartView(LT),e.registerSeriesModel(ST),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,$(dx,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,px("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,bT("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))}))},function(e){e.registerChartView(aM),e.registerSeriesModel(cM),Zm("pie",e.registerAction),e.registerLayout($($T,"pie")),e.registerProcessor(QT("pie")),e.registerProcessor(function(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf((function(e){var t=n.mapDimension("value"),r=n.get(t,e);return!(ne(r)&&!isNaN(r)&&r<0)}))}}}("pie"))},function(e){i_(cC),e.registerSeriesModel(hM),e.registerChartView(gM),e.registerLayout(yT("scatter"))},function(e){i_(TC),e.registerChartView(gC),e.registerSeriesModel(mC),e.registerLayout(hC),e.registerProcessor(QT("radar")),e.registerPreprocessor(fC)},function(e){i_(eA),e.registerChartView(RD),e.registerSeriesModel(kD),e.registerLayout(VD),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,zD),Zm("map",e.registerAction)},function(e){e.registerChartView(dA),e.registerSeriesModel(OA),e.registerLayout(kA),e.registerVisual(zA),function(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=e.dataIndex,r=t.getData().tree.getNodeByDataIndex(n);r.isExpand=!r.isExpand}))})),e.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t,n){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var r=$D(t.coordinateSystem,e,void 0,n);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))}(e)},function(e){e.registerSeriesModel(FA),e.registerChartView(QA),e.registerVisual(mI),e.registerLayout(II),function(e){for(var t=0;t<VA.length;t++)e.registerAction({type:VA[t],update:"updateView"},Ie);e.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,n){var r=EA(e,["treemapZoomToNode","treemapRootToNode"],t);if(r){var i=t.getViewRoot();i&&(e.direction=NA(i,r.node)?"rollUp":"drillDown"),t.resetViewRoot(r.node)}}))}))}(e)},function(e){e.registerChartView(EE),e.registerSeriesModel(zE),e.registerProcessor(RI),e.registerVisual(kI),e.registerVisual(VI),e.registerLayout(ZI),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,nE),e.registerLayout(iE),e.registerCoordinateSystem("graphView",{dimensions:FD.dimensions,create:oE}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Ie),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Ie),e.registerAction(VE,(function(e,t,n){t.eachComponent({mainType:"series",query:e},(function(t){var r=$D(t.coordinateSystem,e,void 0,n);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))},function(e){e.registerChartView(HE),e.registerSeriesModel(UE)},function(e){e.registerChartView(XE),e.registerSeriesModel(YE),e.registerLayout(ZE),e.registerProcessor(QT("funnel"))},function(e){i_(xN),e.registerChartView(qE),e.registerSeriesModel(eL),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,rL)},function(e){e.registerChartView(SN),e.registerSeriesModel(MN),e.registerLayout(CN),e.registerVisual(VN),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}))},function(e){e.registerSeriesModel(FN),e.registerChartView(GN),e.registerLayout(ZN),e.registerTransform(qN)},function(e){e.registerChartView(oP),e.registerSeriesModel(mP),e.registerPreprocessor(vP),e.registerVisual(rP),e.registerLayout(yP)},function(e){e.registerChartView(wP),e.registerSeriesModel(SP),e.registerLayout(yT("effectScatter"))},function(e){e.registerChartView(LP),e.registerSeriesModel(RP),e.registerLayout(EP),e.registerVisual(zP)},function(e){e.registerChartView(FP),e.registerSeriesModel(GP)},function(e){e.registerChartView(jP),e.registerSeriesModel(uO),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,$(dx,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,px("pictorialBar"))},function(e){e.registerChartView(cO),e.registerSeriesModel(hO),e.registerLayout(dO),e.registerProcessor(QT("themeRiver"))},function(e){e.registerChartView(vO),e.registerSeriesModel(yO),e.registerLayout($(bO,"sunburst")),e.registerProcessor($(QT,"sunburst")),e.registerVisual(SO),function(e){e.registerAction({type:gO,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,n){var r=EA(e,[gO],t);if(r){var i=t.getViewRoot();i&&(e.direction=NA(i,r.node)?"rollUp":"drillDown"),t.resetViewRoot(r.node)}}))})),e.registerAction({type:mO,update:"none"},(function(e,t,n){e=z({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t){var n=EA(e,[mO],t);n&&(e.dataIndex=n.node.dataIndex)})),"production"!==process.env.NODE_ENV&&Lo("sunburstHighlight","highlight"),n.dispatchAction(z(e,{type:"highlight"}))})),e.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t,n){e=z({},e),"production"!==process.env.NODE_ENV&&Lo("sunburstUnhighlight","downplay"),n.dispatchAction(z(e,{type:"downplay"}))}))}(e)},function(e){e.registerChartView(xR),e.registerSeriesModel(DO)}]),i_((function(e){i_(cC),i_(bk)})),i_((function(e){i_(bk),JM.registerAxisPointerClass("PolarAxisPointer",wk),e.registerCoordinateSystem("polar",kk),e.registerComponentModel(Tk),e.registerComponentView(Jk),SM(e,"angle",Ck,Kk),SM(e,"radius",Dk,$k),e.registerComponentView(Gk),e.registerComponentView(jk),e.registerLayout($(qk,"bar"))})),i_(eA),i_((function(e){i_(bk),JM.registerAxisPointerClass("SingleAxisPointer",dz),e.registerComponentView(mz),e.registerComponentView(nz),e.registerComponentModel(iz),SM(e,"single",iz,iz.defaultOption),e.registerCoordinateSystem("single",uz)})),i_(xN),i_((function(e){e.registerComponentModel(vz),e.registerComponentView(_z),e.registerCoordinateSystem("calendar",bz)})),i_((function(e){e.registerComponentModel(Dz),e.registerComponentView(Ez),e.registerPreprocessor((function(e){var t=e.graphic;J(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}))})),i_((function(e){e.registerComponentModel(rV),e.registerComponentView(oV),tV("saveAsImage",aV),tV("magicType",uV),tV("dataView",mV),tV("dataZoom",VV),tV("restore",bV),i_(Jz)})),i_((function(e){i_(bk),e.registerComponentModel(GV),e.registerComponentView(iB),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ie),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ie)})),i_(bk),i_((function(e){e.registerComponentView(CB),e.registerComponentModel(DB),e.registerPreprocessor(uB),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,bB),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Ie),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Ie),tV("brush",EB)})),i_((function(e){e.registerComponentModel(LB),e.registerComponentView(NB)})),i_((function(e){e.registerComponentModel(OB),e.registerComponentView(BB),e.registerSubTypeDefaulter("timeline",(function(){return"slider"})),function(e){e.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t,n){var r=t.getComponent("timeline");return r&&null!=e.currentIndex&&(r.setCurrentIndex(e.currentIndex),!r.get("loop",!0)&&r.isIndexMax()&&r.getPlayState()&&(r.setPlayState(!1),n.dispatchAction({type:"timelinePlayChange",playState:!1,from:e.from}))),t.resetOption("timeline",{replaceMerge:r.get("replaceMerge",!0)}),V({currentIndex:r.option.currentIndex},e)})),e.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var n=t.getComponent("timeline");n&&null!=e.playState&&n.setPlayState(e.playState)}))}(e),e.registerPreprocessor(HB)})),i_((function(e){e.registerComponentModel(qB),e.registerComponentView(sF),e.registerPreprocessor((function(e){jB(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})}))})),i_((function(e){e.registerComponentModel(lF),e.registerComponentView(gF),e.registerPreprocessor((function(e){jB(e.series,"markLine")&&(e.markLine=e.markLine||{})}))})),i_((function(e){e.registerComponentModel(mF),e.registerComponentView(TF),e.registerPreprocessor((function(e){jB(e.series,"markArea")&&(e.markArea=e.markArea||{})}))})),i_((function(e){i_(zF),i_(WF)})),i_((function(e){i_(tG),i_(cG)})),i_(tG),i_(cG),i_((function(e){i_(WG),i_(qG)})),i_(WG),i_(qG),i_((function(e){e.registerPreprocessor(eH),e.registerVisual(e.PRIORITY.VISUAL.ARIA,QG)})),i_((function(e){e.registerTransform(dH),e.registerTransform(fH)})),i_(vH),i_((function(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){W(zo(n.seriesTransition),(function(e){W(zo(e.to),(function(e){for(var t=n.updatedSeries,r=0;r<t.length;r++)(null!=e.seriesIndex&&e.seriesIndex===t[r].seriesIndex||null!=e.seriesId&&e.seriesId===t[r].id)&&(t[r][zg]=!0)}))}))})),e.registerUpdateLifecycle("series:transition",(function(e,t,n){var r=JH(t);if(r.oldSeries&&n.updatedSeries&&n.optionChanged){var i=n.seriesTransition;if(i)W(zo(i),(function(e){!function(e,t,n,r){var i=[],o=[];W(zo(e.from),(function(e){var n=uU(t.oldSeries,e);n>=0&&i.push({dataGroupId:t.oldDataGroupIds[n],data:t.oldData[n],divide:lU(t.oldData[n]),groupIdDim:e.dimension})})),W(zo(e.to),(function(e){var r=uU(n.updatedSeries,e);if(r>=0){var i=n.updatedSeries[r].getData();o.push({dataGroupId:t.oldDataGroupIds[r],data:i,divide:lU(i),groupIdDim:e.dimension})}})),i.length>0&&o.length>0&&oU(i,o,r)}(e,r,n,t)}));else{var o=function(e,t){var n=Te(),r=Te(),i=Te();function o(e){n.get(e)&&Ao("Duplicated seriesKey in universalTransition "+e)}return W(e.oldSeries,(function(t,n){var o=e.oldDataGroupIds[n],a=e.oldData[n],s=aU(t),l=sU(s);r.set(l,{dataGroupId:o,data:a}),J(s)&&W(s,(function(e){i.set(e,{key:l,dataGroupId:o,data:a})}))})),W(t.updatedSeries,(function(e){if(e.isUniversalTransitionEnabled()&&e.isAnimationEnabled()){var t=e.get("dataGroupId"),a=e.getData(),s=aU(e),l=sU(s),u=r.get(l);if(u)"production"!==process.env.NODE_ENV&&o(l),n.set(l,{oldSeries:[{dataGroupId:u.dataGroupId,divide:lU(u.data),data:u.data}],newSeries:[{dataGroupId:t,divide:lU(a),data:a}]});else if(J(s)){"production"!==process.env.NODE_ENV&&o(l);var c=[];W(s,(function(e){var t=r.get(e);t.data&&c.push({dataGroupId:t.dataGroupId,divide:lU(t.data),data:t.data})})),c.length&&n.set(l,{oldSeries:c,newSeries:[{dataGroupId:t,data:a,divide:lU(a)}]})}else{var h=i.get(s);if(h){var d=n.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:lU(h.data)}],newSeries:[]},n.set(h.key,d)),d.newSeries.push({dataGroupId:t,data:a,divide:lU(a)})}}}})),n}(r,n);W(o.keys(),(function(e){var n=o.get(e);oU(n.oldSeries,n.newSeries,t)}))}W(n.updatedSeries,(function(e){e[zg]&&(e[zg]=!1)}))}for(var a=e.getSeries(),s=r.oldSeries=[],l=r.oldDataGroupIds=[],u=r.oldData=[],c=0;c<a.length;c++){var h=a[c].getData();h.count()<1e4&&(s.push(a[c]),l.push(a[c].get("dataGroupId")),u.push(h))}}))})),i_(mw);var cU=Object.freeze({__proto__:null,Axis:Eb,ChartView:Kg,ComponentModel:$d,ComponentView:Xg,List:L_,Model:Fh,PRIORITY:Wv,SeriesModel:Vg,color:gr,connect:function(e){if(J(e)){var t=e;e=null,W(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+Py++,W(t,(function(t){t.group=e}))}return Ly[e]=!0,e},dataTool:{},dependencies:{zrender:"5.6.1"},disConnect:zy,disconnect:ky,dispose:function(e){ee(e)?e=Ey[e]:e instanceof _y||(e=Vy(e)),e instanceof _y&&!e.isDisposed()&&e.dispose()},env:d,extendChartView:function(e){var t=Kg.extend(e);return Kg.registerClass(t),t},extendComponentModel:function(e){var t=$d.extend(e);return $d.registerClass(t),t},extendComponentView:function(e){var t=Xg.extend(e);return Xg.registerClass(t),t},extendSeriesModel:function(e){var t=Vg.extend(e);return Vg.registerClass(t),t},format:vb,getCoordinateSystemDimensions:Yy,getInstanceByDom:Vy,getInstanceById:function(e){return Ey[e]},getMap:e_,graphic:mb,helper:eb,init:Ry,innerDrawElementOnCanvas:Ev,matrix:Rt,number:fb,parseGeoJSON:pb,parseGeoJson:pb,registerAction:jy,registerCoordinateSystem:Xy,registerLayout:Zy,registerLoading:Jy,registerLocale:Kh,registerMap:Qy,registerPostInit:Hy,registerPostUpdate:Uy,registerPreprocessor:Fy,registerProcessor:Gy,registerTheme:By,registerTransform:t_,registerUpdateLifecycle:Wy,registerVisual:qy,setCanvasCreator:function(e){"production"!==process.env.NODE_ENV&&Eo("setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead."),_({createCanvas:e})},setPlatformAPI:_,throttle:om,time:gb,use:i_,util:yb,vector:Qe,version:"5.6.0",zrUtil:Le,zrender:Qi});function hU(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dU,pU={exports:{}},fU={};var gU,mU={};
12
- /**
13
- * @license React
14
- * react-jsx-runtime.development.js
15
- *
16
- * Copyright (c) Facebook, Inc. and its affiliates.
17
- *
18
- * This source code is licensed under the MIT license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- */"production"===process.env.NODE_ENV?pU.exports=function(){if(dU)return fU;dU=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,l={},u=null,c=null;for(s in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,s)&&!a.hasOwnProperty(s)&&(l[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===l[s]&&(l[s]=t[s]);return{$$typeof:n,type:e,key:u,ref:c,props:l,_owner:o.current}}return fU.Fragment=r,fU.jsx=s,fU.jsxs=s,fU}():pU.exports=(gU||(gU=1,"production"!==process.env.NODE_ENV&&function(){var t,n=e,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,v=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=v.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var i=n.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,n)}function _(e){return e.displayName||"Context"}function x(e){if(null==e)return null;if("number"==typeof e.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case i:return"Portal";case s:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case d:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case u:return _(e)+".Consumer";case l:return _(e._context)+".Provider";case c:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:x(e.type)||"Memo";case f:var n=e,r=n._payload,g=n._init;try{return x(g(r))}catch(e){return null}}return null}t=Symbol.for("react.module.reference");var b,w,S,T,M,C,D,A=Object.assign,I=0;function E(){}E.__reactDisabledLog=!0;var L,N=v.ReactCurrentDispatcher;function P(e,t,n){if(void 0===L)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||""}return"\n"+L+e}var O,R=!1,k="function"==typeof WeakMap?WeakMap:Map;function z(e,t){if(!e||R)return"";var n,r=O.get(e);if(void 0!==r)return r;R=!0;var i,o=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=N.current,N.current=null,function(){if(0===I){b=console.log,w=console.info,S=console.warn,T=console.error,M=console.group,C=console.groupCollapsed,D=console.groupEnd;var e={configurable:!0,enumerable:!0,value:E,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),l=n.stack.split("\n"),u=s.length-1,c=l.length-1;u>=1&&c>=0&&s[u]!==l[c];)c--;for(;u>=1&&c>=0;u--,c--)if(s[u]!==l[c]){if(1!==u||1!==c)do{if(u--,--c<0||s[u]!==l[c]){var h="\n"+s[u].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),"function"==typeof e&&O.set(e,h),h}}while(u>=1&&c>=0);break}}}finally{R=!1,N.current=i,function(){if(0==--I){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:b}),info:A({},e,{value:w}),warn:A({},e,{value:S}),error:A({},e,{value:T}),group:A({},e,{value:M}),groupCollapsed:A({},e,{value:C}),groupEnd:A({},e,{value:D})})}I<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=o}var d=e?e.displayName||e.name:"",p=d?P(d):"";return"function"==typeof e&&O.set(e,p),p}function V(e,t,n){if(null==e)return"";if("function"==typeof e)return z(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return P(e);switch(e){case h:return P("Suspense");case d:return P("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return z(e.render,!1);case p:return V(e.type,t,n);case f:var i=e,o=i._payload,a=i._init;try{return V(a(o),t,n)}catch(e){}}return""}O=new k;var B=Object.prototype.hasOwnProperty,F={},G=v.ReactDebugCurrentFrame;function H(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var U=Array.isArray;function W(e){return U(e)}function j(e){return""+e}function X(e){if(function(e){try{return j(e),!1}catch(e){return!0}}(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),j(e)}var Y,Z,q=v.ReactCurrentOwner,K={key:!0,ref:!0,__self:!0,__source:!0};function $(e,t,n,i,o){var a,s={},l=null,u=null;for(a in void 0!==n&&(X(n),l=""+n),function(e){if(B.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(X(t.key),l=""+t.key),function(e){if(B.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(u=t.ref,function(e){"string"==typeof e.ref&&q.current}(t)),t)B.call(t,a)&&!K.hasOwnProperty(a)&&(s[a]=t[a]);if(e&&e.defaultProps){var c=e.defaultProps;for(a in c)void 0===s[a]&&(s[a]=c[a])}if(l||u){var h="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){Y||(Y=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(s,h),u&&function(e,t){var n=function(){Z||(Z=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(s,h)}return function(e,t,n,i,o,a,s){var l={$$typeof:r,type:e,key:t,ref:n,props:s,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,u,o,i,q.current,s)}var J,Q=v.ReactCurrentOwner,ee=v.ReactDebugCurrentFrame;function te(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);ee.setExtraStackFrame(n)}else ee.setExtraStackFrame(null)}function ne(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function re(){if(Q.current){var e=x(Q.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}J=!1;var ie={};function oe(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=re();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ie[n]){ie[n]=!0;var r="";e&&e._owner&&e._owner!==Q.current&&(r=" It was passed a child from "+x(e._owner.type)+"."),te(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),te(null)}}}function ae(e,t){if("object"==typeof e)if(W(e))for(var n=0;n<e.length;n++){var r=e[n];ne(r)&&oe(r,t)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var o,a=i.call(e);!(o=a.next()).done;)ne(o.value)&&oe(o.value,t)}}function se(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==c&&n.$$typeof!==p)return;t=n.propTypes}if(t){var r=x(n);!function(e,t,n,r,i){var o=Function.call.bind(B);for(var a in e)if(o(e,a)){var s=void 0;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(H(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,typeof s),H(null)),s instanceof Error&&!(s.message in F)&&(F[s.message]=!0,H(i),y("Failed %s type: %s",n,s.message),H(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||J||(J=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var le={};function ue(e,n,i,m,v,_){var b=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===a||e===h||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===l||e.$$typeof===u||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var w,S="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),S+=re(),null===e?w="null":W(e)?w="array":void 0!==e&&e.$$typeof===r?(w="<"+(x(e.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):w=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,S)}var T=$(e,n,i,v,_);if(null==T)return T;if(b){var M=n.children;if(void 0!==M)if(m)if(W(M)){for(var C=0;C<M.length;C++)ae(M[C],e);Object.freeze&&Object.freeze(M)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ae(M,e)}if(B.call(n,"key")){var D=x(e),A=Object.keys(n).filter((function(e){return"key"!==e})),I=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";le[D+I]||(y('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',I,D,A.length>0?"{"+A.join(": ..., ")+": ...}":"{}",D),le[D+I]=!0)}return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){te(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),te(null);break}}null!==e.ref&&(te(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),te(null))}(T):se(T),T}var ce=function(e,t,n){return ue(e,t,n,!1)},he=function(e,t,n){return ue(e,t,n,!0)};mU.Fragment=o,mU.jsx=ce,mU.jsxs=he}()),mU);var vU=pU.exports;function yU(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var _U=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,xU=yU((function(e){return _U.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),bU="-ms-",wU="-moz-",SU="-webkit-",TU="comm",MU="rule",CU="decl",DU="@keyframes",AU=Math.abs,IU=String.fromCharCode,EU=Object.assign;function LU(e){return e.trim()}function NU(e,t){return(e=t.exec(e))?e[0]:e}function PU(e,t,n){return e.replace(t,n)}function OU(e,t,n){return e.indexOf(t,n)}function RU(e,t){return 0|e.charCodeAt(t)}function kU(e,t,n){return e.slice(t,n)}function zU(e){return e.length}function VU(e){return e.length}function BU(e,t){return t.push(e),e}function FU(e,t){return e.filter((function(e){return!NU(e,t)}))}var GU=1,HU=1,UU=0,WU=0,jU=0,XU="";function YU(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:GU,column:HU,length:a,return:"",siblings:s}}function ZU(e,t){return EU(YU("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function qU(e){for(;e.root;)e=ZU(e.root,{children:[e]});BU(e,e.siblings)}function KU(){return jU=WU>0?RU(XU,--WU):0,HU--,10===jU&&(HU=1,GU--),jU}function $U(){return jU=WU<UU?RU(XU,WU++):0,HU++,10===jU&&(HU=1,GU++),jU}function JU(){return RU(XU,WU)}function QU(){return WU}function eW(e,t){return kU(XU,e,t)}function tW(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function nW(e){return LU(eW(WU-1,oW(91===e?e+2:40===e?e+1:e)))}function rW(e){for(;(jU=JU())&&jU<33;)$U();return tW(e)>2||tW(jU)>3?"":" "}function iW(e,t){for(;--t&&$U()&&!(jU<48||jU>102||jU>57&&jU<65||jU>70&&jU<97););return eW(e,QU()+(t<6&&32==JU()&&32==$U()))}function oW(e){for(;$U();)switch(jU){case e:return WU;case 34:case 39:34!==e&&39!==e&&oW(jU);break;case 40:41===e&&oW(e);break;case 92:$U()}return WU}function aW(e,t){for(;$U()&&e+jU!==57&&(e+jU!==84||47!==JU()););return"/*"+eW(t,WU-1)+"*"+IU(47===e?e:$U())}function sW(e){for(;!tW(JU());)$U();return eW(e,WU)}function lW(e){return function(e){return XU="",e}(uW("",null,null,null,[""],e=function(e){return GU=HU=1,UU=zU(XU=e),WU=0,[]}(e),0,[0],e))}function uW(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,h=a,d=0,p=0,f=0,g=1,m=1,v=1,y=0,_="",x=i,b=o,w=r,S=_;m;)switch(f=y,y=$U()){case 40:if(108!=f&&58==RU(S,h-1)){-1!=OU(S+=PU(nW(y),"&","&\f"),"&\f",AU(u?s[u-1]:0))&&(v=-1);break}case 34:case 39:case 91:S+=nW(y);break;case 9:case 10:case 13:case 32:S+=rW(f);break;case 92:S+=iW(QU()-1,7);continue;case 47:switch(JU()){case 42:case 47:BU(hW(aW($U(),QU()),t,n,l),l);break;default:S+="/"}break;case 123*g:s[u++]=zU(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+c:-1==v&&(S=PU(S,/\f/g,"")),p>0&&zU(S)-h&&BU(p>32?dW(S+";",r,n,h-1,l):dW(PU(S," ","")+";",r,n,h-2,l),l);break;case 59:S+=";";default:if(BU(w=cW(S,t,n,u,c,i,s,_,x=[],b=[],h,o),o),123===y)if(0===c)uW(S,t,w,w,x,o,h,s,b);else switch(99===d&&110===RU(S,3)?100:d){case 100:case 108:case 109:case 115:uW(e,w,w,r&&BU(cW(e,w,w,0,0,i,s,_,i,x=[],h,b),b),i,b,h,s,r?x:b);break;default:uW(S,w,w,w,[""],b,0,s,b)}}u=c=p=0,g=v=1,_=S="",h=a;break;case 58:h=1+zU(S),p=f;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==KU())continue;switch(S+=IU(y),y*g){case 38:v=c>0?1:(S+="\f",-1);break;case 44:s[u++]=(zU(S)-1)*v,v=1;break;case 64:45===JU()&&(S+=nW($U())),d=JU(),c=h=zU(_=S+=sW(QU())),y++;break;case 45:45===f&&2==zU(S)&&(g=0)}}return o}function cW(e,t,n,r,i,o,a,s,l,u,c,h){for(var d=i-1,p=0===i?o:[""],f=VU(p),g=0,m=0,v=0;g<r;++g)for(var y=0,_=kU(e,d+1,d=AU(m=a[g])),x=e;y<f;++y)(x=LU(m>0?p[y]+" "+_:PU(_,/&\f/g,p[y])))&&(l[v++]=x);return YU(e,t,n,0===i?MU:s,l,u,c,h)}function hW(e,t,n,r){return YU(e,t,n,TU,IU(jU),kU(e,2,-2),0,r)}function dW(e,t,n,r,i){return YU(e,t,n,CU,kU(e,0,r),kU(e,r+1,-1),r,i)}function pW(e,t,n){switch(function(e,t){return 45^RU(e,0)?(((t<<2^RU(e,0))<<2^RU(e,1))<<2^RU(e,2))<<2^RU(e,3):0}(e,t)){case 5103:return SU+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return SU+e+e;case 4789:return wU+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return SU+e+wU+e+bU+e+e;case 5936:switch(RU(e,t+11)){case 114:return SU+e+bU+PU(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return SU+e+bU+PU(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return SU+e+bU+PU(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return SU+e+bU+e+e;case 6165:return SU+e+bU+"flex-"+e+e;case 5187:return SU+e+PU(e,/(\w+).+(:[^]+)/,SU+"box-$1$2"+bU+"flex-$1$2")+e;case 5443:return SU+e+bU+"flex-item-"+PU(e,/flex-|-self/g,"")+(NU(e,/flex-|baseline/)?"":bU+"grid-row-"+PU(e,/flex-|-self/g,""))+e;case 4675:return SU+e+bU+"flex-line-pack"+PU(e,/align-content|flex-|-self/g,"")+e;case 5548:return SU+e+bU+PU(e,"shrink","negative")+e;case 5292:return SU+e+bU+PU(e,"basis","preferred-size")+e;case 6060:return SU+"box-"+PU(e,"-grow","")+SU+e+bU+PU(e,"grow","positive")+e;case 4554:return SU+PU(e,/([^-])(transform)/g,"$1"+SU+"$2")+e;case 6187:return PU(PU(PU(e,/(zoom-|grab)/,SU+"$1"),/(image-set)/,SU+"$1"),e,"")+e;case 5495:case 3959:return PU(e,/(image-set\([^]*)/,SU+"$1$`$1");case 4968:return PU(PU(e,/(.+:)(flex-)?(.*)/,SU+"box-pack:$3"+bU+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+SU+e+e;case 4200:if(!NU(e,/flex-|baseline/))return bU+"grid-column-align"+kU(e,t)+e;break;case 2592:case 3360:return bU+PU(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,NU(e.props,/grid-\w+-end/)}))?~OU(e+(n=n[t].value),"span",0)?e:bU+PU(e,"-start","")+e+bU+"grid-row-span:"+(~OU(n,"span",0)?NU(n,/\d+/):+NU(n,/\d+/)-+NU(e,/\d+/))+";":bU+PU(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return NU(e.props,/grid-\w+-start/)}))?e:bU+PU(PU(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return PU(e,/(.+)-inline(.+)/,SU+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(zU(e)-1-t>6)switch(RU(e,t+1)){case 109:if(45!==RU(e,t+4))break;case 102:return PU(e,/(.+:)(.+)-([^]+)/,"$1"+SU+"$2-$3$1"+wU+(108==RU(e,t+3)?"$3":"$2-$3"))+e;case 115:return~OU(e,"stretch",0)?pW(PU(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return PU(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,o,a,s){return bU+n+":"+r+s+(i?bU+n+"-span:"+(o?a:+a-+r)+s:"")+e}));case 4949:if(121===RU(e,t+6))return PU(e,":",":"+SU)+e;break;case 6444:switch(RU(e,45===RU(e,14)?18:11)){case 120:return PU(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+SU+(45===RU(e,14)?"inline-":"")+"box$3$1"+SU+"$2$3$1"+bU+"$2box$3")+e;case 100:return PU(e,":",":"+bU)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return PU(e,"scroll-","scroll-snap-")+e}return e}function fW(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function gW(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case CU:return e.return=e.return||e.value;case TU:return"";case DU:return e.return=e.value+"{"+fW(e.children,r)+"}";case MU:if(!zU(e.value=e.props.join(",")))return""}return zU(n=fW(e.children,r))?e.return=e.value+"{"+n+"}":""}function mW(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case CU:return void(e.return=pW(e.value,e.length,n));case DU:return fW([ZU(e,{value:PU(e.value,"@","@"+SU)})],r);case MU:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(NU(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":qU(ZU(e,{props:[PU(t,/:(read-\w+)/,":-moz-$1")]})),qU(ZU(e,{props:[t]})),EU(e,{props:FU(n,r)});break;case"::placeholder":qU(ZU(e,{props:[PU(t,/:(plac\w+)/,":"+SU+"input-$1")]})),qU(ZU(e,{props:[PU(t,/:(plac\w+)/,":-moz-$1")]})),qU(ZU(e,{props:[PU(t,/:(plac\w+)/,bU+"input-$1")]})),qU(ZU(e,{props:[t]})),EU(e,{props:FU(n,r)})}return""}))}}var vW={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yW="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",_W="active",xW="data-styled-version",bW="6.1.14",wW="/*!sc*/\n",SW="undefined"!=typeof window&&"HTMLElement"in window,TW=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),MW=/invalid hook call/i,CW=new Set,DW=function(e,n){if("production"!==process.env.NODE_ENV){var r=n?' with the id of "'.concat(n,'"'):"",i="The component ".concat(e).concat(r," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",o=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];MW.test(e)?(a=!1,CW.delete(i)):o.apply(void 0,c([e],t,!1))},t(),a&&!CW.has(i)&&(console.warn(i),CW.add(i))}catch(e){MW.test(e.message)&&CW.delete(i)}finally{console.error=o}}},AW=Object.freeze([]),IW=Object.freeze({});var EW=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),LW=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,NW=/(^-|-$)/g;function PW(e){return e.replace(LW,"-").replace(NW,"")}var OW=/(a)(d)/gi,RW=function(e){return String.fromCharCode(e+(e>25?39:97))};function kW(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=RW(t%52)+n;return(RW(t%52)+n).replace(OW,"$1-$2")}var zW,VW=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},BW=function(e){return VW(5381,e)};function FW(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function GW(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var HW="function"==typeof Symbol&&Symbol.for,UW=HW?Symbol.for("react.memo"):60115,WW=HW?Symbol.for("react.forward_ref"):60112,jW={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},XW={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},YW={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ZW=((zW={})[WW]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zW[UW]=YW,zW);function qW(e){return("type"in(t=e)&&t.type.$$typeof)===UW?YW:"$$typeof"in e?ZW[e.$$typeof]:jW;var t}var KW=Object.defineProperty,$W=Object.getOwnPropertyNames,JW=Object.getOwnPropertySymbols,QW=Object.getOwnPropertyDescriptor,ej=Object.getPrototypeOf,tj=Object.prototype;function nj(e,t,n){if("string"!=typeof t){if(tj){var r=ej(t);r&&r!==tj&&nj(e,r,n)}var i=$W(t);JW&&(i=i.concat(JW(t)));for(var o=qW(e),a=qW(t),s=0;s<i.length;++s){var l=i[s];if(!(l in XW||n&&n[l]||a&&l in a||o&&l in o)){var u=QW(t,l);try{KW(e,l,u)}catch(e){}}}}return e}function rj(e){return"function"==typeof e}function ij(e){return"object"==typeof e&&"styledComponentId"in e}function oj(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function aj(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function sj(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function lj(e,t,n){if(void 0===n&&(n=!1),!n&&!sj(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=lj(e[r],t[r]);else if(sj(t))for(var r in t)e[r]=lj(e[r],t[r]);return e}function uj(e,t){Object.defineProperty(e,"toString",{value:t})}var cj="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function hj(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],i=1,o=e.length;i<o;i+=1)r.push(e[i]);return r.forEach((function(e){n=n.replace(/%[a-z]/,e)})),n}function dj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(hj.apply(void 0,c([cj[e]],t,!1)).trim())}var pj=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw dj(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o<i;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),s=(o=0,t.length);o<s;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o<i;o++)t+="".concat(this.tag.getRule(o)).concat(wW);return t},e}(),fj=1<<30,gj=new Map,mj=new Map,vj=1,yj=function(e){if(gj.has(e))return gj.get(e);for(;mj.has(vj);)vj++;var t=vj++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>fj))throw dj(16,"".concat(t));return gj.set(e,t),mj.set(t,e),t},_j=function(e,t){vj=t+1,gj.set(e,t),mj.set(t,e)},xj="style[".concat(yW,"][").concat(xW,'="').concat(bW,'"]'),bj=new RegExp("^".concat(yW,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),wj=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},Sj=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(wW),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var l=s.match(bj);if(l){var u=0|parseInt(l[1],10),c=l[2];0!==u&&(_j(c,u),wj(e,c,l[3]),e.getTag().insertRules(u,i)),i.length=0}else i.push(s)}}},Tj=function(e){for(var t=document.querySelectorAll(xj),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(yW)!==_W&&(Sj(e,i),i.parentNode&&i.parentNode.removeChild(i))}};var Mj=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(yW,"]")));return t[t.length-1]}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(yW,_W),r.setAttribute(xW,bW);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Cj=function(){function e(e){this.element=Mj(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}throw dj(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Dj=function(){function e(e){this.element=Mj(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Aj=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Ij=SW,Ej={isServer:!SW,useCSSOMInjection:!TW},Lj=function(){function e(e,t,n){void 0===e&&(e=IW),void 0===t&&(t={});var r=this;this.options=u(u({},Ej),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&SW&&Ij&&(Ij=!1,Tj(this)),uj(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=function(n){var i=function(e){return mj.get(e)}(n);if(void 0===i)return"continue";var o=e.names.get(i),a=t.getGroup(n);if(void 0===o||!o.size||0===a.length)return"continue";var s="".concat(yW,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==o&&o.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(wW)},o=0;o<n;o++)i(o);return r}(r)}))}return e.registerId=function(e){return yj(e)},e.prototype.rehydrate=function(){!this.server&&SW&&Tj(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(u(u({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Aj(n):t?new Cj(n):new Dj(n)}(this.options),new pj(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(yj(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(yj(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(yj(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Nj=/&/g,Pj=/^\s*\/\/.*$/gm;function Oj(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Oj(e.children,t)),e}))}var Rj=new Lj,kj=function(){var e,t,n,r=IW,i=r.options,o=void 0===i?IW:i,a=r.plugins,s=void 0===a?AW:a,l=function(n,r,i){return i.startsWith(t)&&i.endsWith(t)&&i.replaceAll(t,"").length>0?".".concat(e):n},u=s.slice();u.push((function(e){e.type===MU&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Nj,t).replace(n,l))})),o.prefix&&u.push(mW),u.push(gW);var c=function(r,i,a,s){void 0===i&&(i=""),void 0===a&&(a=""),void 0===s&&(s="&"),e=s,t=i,n=new RegExp("\\".concat(t,"\\b"),"g");var l=r.replace(Pj,""),c=lW(a||i?"".concat(a," ").concat(i," { ").concat(l," }"):l);o.namespace&&(c=Oj(c,o.namespace));var h,d=[];return fW(c,function(e){var t=VU(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}(u.concat((h=function(e){return d.push(e)},function(e){e.root||(e=e.return)&&h(e)})))),d};return c.hash=s.length?s.reduce((function(e,t){return t.name||dj(15),VW(e,t.name)}),5381).toString():"",c}(),zj=e.createContext({shouldForwardProp:void 0,styleSheet:Rj,stylis:kj});function Vj(){return i(zj)}zj.Consumer,e.createContext(void 0);var Bj=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=kj);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,uj(this,(function(){throw dj(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=kj),this.name+e.hash},e}(),Fj=function(e){return e>="A"&&e<="Z"};function Gj(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Fj(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Hj=function(e){return null==e||!1===e||""===e},Uj=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!Hj(o)&&(Array.isArray(o)&&o.isCss||rj(o)?r.push("".concat(Gj(i),":"),o,";"):sj(o)?r.push.apply(r,c(c(["".concat(i," {")],Uj(o),!1),["}"],!1)):r.push("".concat(Gj(i),": ").concat((t=i,null==(n=o)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in vW||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Wj(e,t,n,r){if(Hj(e))return[];if(ij(e))return[".".concat(e.styledComponentId)];if(rj(e)){if(!rj(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof i||Array.isArray(i)||i instanceof Bj||sj(i)||null===i||console.error("".concat(FW(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Wj(i,t,n,r)}var o;return e instanceof Bj?n?(e.inject(n,r),[e.getName(r)]):[e]:sj(e)?Uj(e):Array.isArray(e)?Array.prototype.concat.apply(AW,e.map((function(e){return Wj(e,t,n,r)}))):[e.toString()]}var jj=BW(bW),Xj=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(rj(n)&&!ij(n))return!1}return!0}(e),this.componentId=t,this.baseHash=VW(jj,t),this.baseStyle=n,Lj.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=oj(r,this.staticRulesId);else{var i=aj(Wj(this.rules,e,t,n)),o=kW(VW(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=n(i,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}r=oj(r,o),this.staticRulesId=o}else{for(var s=VW(this.baseHash,n.hash),l="",u=0;u<this.rules.length;u++){var c=this.rules[u];if("string"==typeof c)l+=c,"production"!==process.env.NODE_ENV&&(s=VW(s,c));else if(c){var h=aj(Wj(c,e,t,n));s=VW(s,h+u),l+=h}}if(l){var d=kW(s>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=oj(r,d)}}return r},e}(),Yj=e.createContext(void 0);Yj.Consumer;var Zj={},qj=new Set;function Kj(t,i,o){var a=ij(t),s=t,l=!GW(t),c=i.attrs,h=void 0===c?AW:c,d=i.componentId,p=void 0===d?function(e,t){var n="string"!=typeof e?"sc":PW(e);Zj[n]=(Zj[n]||0)+1;var r="".concat(n,"-").concat(function(e){return kW(BW(e)>>>0)}(bW+n+Zj[n]));return t?"".concat(t,"-").concat(r):r}(i.displayName,i.parentComponentId):d,f=i.displayName,g=void 0===f?function(e){return GW(e)?"styled.".concat(e):"Styled(".concat(FW(e),")")}(t):f,m=i.displayName&&i.componentId?"".concat(PW(i.displayName),"-").concat(i.componentId):i.componentId||p,v=a&&s.attrs?s.attrs.concat(h).filter(Boolean):h,y=i.shouldForwardProp;if(a&&s.shouldForwardProp){var _=s.shouldForwardProp;if(i.shouldForwardProp){var x=i.shouldForwardProp;y=function(e,t){return _(e,t)&&x(e,t)}}else y=_}var b=new Xj(o,m,a?s.componentStyle:void 0);function w(t,i){return function(t,i,o){var a=t.attrs,s=t.componentStyle,l=t.defaultProps,c=t.foldedComponentIds,h=t.styledComponentId,d=t.target,p=e.useContext(Yj),f=Vj(),g=t.shouldForwardProp||f.shouldForwardProp;"production"!==process.env.NODE_ENV&&n(h);var m=function(e,t,n){return void 0===n&&(n=IW),e.theme!==n.theme&&e.theme||t||n.theme}(i,p,l)||IW,v=function(e,t,n){for(var r,i=u(u({},t),{className:void 0,theme:n}),o=0;o<e.length;o+=1){var a=rj(r=e[o])?r(i):r;for(var s in a)i[s]="className"===s?oj(i[s],a[s]):"style"===s?u(u({},i[s]),a[s]):a[s]}return t.className&&(i.className=oj(i.className,t.className)),i}(a,i,m),y=v.as||d,_={};for(var x in v)void 0===v[x]||"$"===x[0]||"as"===x||"theme"===x&&v.theme===m||("forwardedAs"===x?_.as=v.forwardedAs:g&&!g(x,y)||(_[x]=v[x],g||"development"!==process.env.NODE_ENV||xU(x)||qj.has(x)||!EW.has(y)||(qj.add(x),console.warn('styled-components: it looks like an unknown prop "'.concat(x,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var b=function(e,t){var r=Vj(),i=e.generateAndInjectStyles(t,r.styleSheet,r.stylis);return"production"!==process.env.NODE_ENV&&n(i),i}(s,v);"production"!==process.env.NODE_ENV&&t.warnTooManyClasses&&t.warnTooManyClasses(b);var w=oj(c,h);return b&&(w+=" "+b),v.className&&(w+=" "+v.className),_[GW(y)&&!EW.has(y)?"class":"className"]=w,o&&(_.ref=o),r(y,_)}(S,t,i)}w.displayName=g;var S=e.forwardRef(w);return S.attrs=v,S.componentStyle=b,S.displayName=g,S.shouldForwardProp=y,S.foldedComponentIds=a?oj(s.foldedComponentIds,s.styledComponentId):"",S.styledComponentId=m,S.target=a?s.target:t,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=a?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++)lj(e,i[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(DW(g,m),S.warnTooManyClasses=function(e,t){var n={},r=!1;return function(i){if(!r&&(n[i]=!0,Object.keys(n).length>=200)){var o=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(o,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(g,m)),uj(S,(function(){return".".concat(S.styledComponentId)})),l&&nj(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function $j(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var Jj=function(e){return Object.assign(e,{isCss:!0})};function Qj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(rj(e)||sj(e))return Jj(Wj($j(AW,c([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Wj(r):Jj(Wj($j(r,t)))}function eX(e,t,n){if(void 0===n&&(n=IW),!t)throw dj(1,t);var r=function(r){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return e(t,n,Qj.apply(void 0,c([r],i,!1)))};return r.attrs=function(r){return eX(e,t,u(u({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return eX(e,t,u(u({},n),r))},r}var tX=function(e){return eX(Kj,e)},nX=tX;EW.forEach((function(e){nX[e]=tX(e)})),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var rX="__sc-".concat(yW,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[rX]||(window[rX]=0),1===window[rX]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[rX]+=1);const iX=nX.div`
21
- height: 100%;
22
- `;var oX;!function(e){e[e.MINI_AREA=0]="MINI_AREA",e[e.AREA=1]="AREA",e[e.DUAL_LINE_BAR=2]="DUAL_LINE_BAR",e[e.STACK_DUAL_LINE_BAR=3]="STACK_DUAL_LINE_BAR",e[e.COLUMN=4]="COLUMN",e[e.STACK_COLUMN=5]="STACK_COLUMN",e[e.LINE=6]="LINE",e[e.BAR=7]="BAR",e[e.STACK_BAR=8]="STACK_BAR",e[e.FUNNEL=9]="FUNNEL",e[e.PIE=10]="PIE",e[e.CYCLE=11]="CYCLE",e[e.RADAR=12]="RADAR"}(oX||(oX={}));const aX=["#3D84FF","#00DCF0","#FCBC26","#00DB75","#BDB8FF","#40B4FF","#FFA101","#90ABE0","#6EE67A","#6B84FF","#FA6B69"],sX={grid:{top:24,left:0,right:12,bottom:32,containLabel:!0},color:aX,legend:{itemWidth:10,itemHeight:10,bottom:0,type:"scroll",icon:"circle"}};function lX(){return lX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lX.apply(null,arguments)}function uX(e,t){return uX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uX(e,t)}function cX(e){return cX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cX(e)}function hX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hX=function(){return!!e})()}function dX(e){var t="function"==typeof Map?new Map:void 0;return dX=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(hX())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&uX(i,n.prototype),i}(e,arguments,cX(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),uX(n,e)},dX(e)}var pX={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function fX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0],o=[];for(r=1;r<t.length;r+=1)o.push(t[r]);return o.forEach((function(e){i=i.replace(/%[a-z]/,e)})),i}var gX=function(e){function t(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n=e.call(this,fX.apply(void 0,[pX[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,uX(e,t)}(t,e),t}(dX(Error));function mX(e){return Math.round(255*e)}function vX(e,t,n){return mX(e)+","+mX(t)+","+mX(n)}function yX(e,t,n,r){if(void 0===r&&(r=vX),0===t)return r(n,n,n);var i=(e%360+360)%360/60,o=(1-Math.abs(2*n-1))*t,a=o*(1-Math.abs(i%2-1)),s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);var c=n-o/2;return r(s+c,l+c,u+c)}var _X={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var xX=/^#[a-fA-F0-9]{6}$/,bX=/^#[a-fA-F0-9]{8}$/,wX=/^#[a-fA-F0-9]{3}$/,SX=/^#[a-fA-F0-9]{4}$/,TX=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,MX=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,CX=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,DX=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function AX(e){if("string"!=typeof e)throw new gX(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return _X[t]?"#"+_X[t]:e}(e);if(t.match(xX))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(bX)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(wX))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(SX)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=TX.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=MX.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])>1?parseFloat(""+o[4])/100:parseFloat(""+o[4])};var a=CX.exec(t);if(a){var s="rgb("+yX(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=TX.exec(s);if(!l)throw new gX(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=DX.exec(t.substring(0,50));if(u){var c="rgb("+yX(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",h=TX.exec(c);if(!h)throw new gX(4,t,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new gX(5)}function IX(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=o-a,u=s>.5?l/(2-o-a):l/(o+a);switch(o){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:u,lightness:s,alpha:e.alpha}:{hue:t,saturation:u,lightness:s}}(AX(e))}var EX=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function LX(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function NX(e){return LX(Math.round(255*e))}function PX(e,t,n){return EX("#"+NX(e)+NX(t)+NX(n))}function OX(e,t,n){return yX(e,t,n,PX)}function RX(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return EX("#"+LX(e)+LX(t)+LX(n));if("object"==typeof e&&void 0===t&&void 0===n)return EX("#"+LX(e.red)+LX(e.green)+LX(e.blue));throw new gX(6)}function kX(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=AX(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?RX(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new gX(7)}function zX(e){if("object"!=typeof e)throw new gX(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return kX(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return RX(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return function(e,t,n,r){if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?OX(e.hue,e.saturation,e.lightness):"rgba("+yX(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new gX(2)}(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return function(e,t,n){if("object"==typeof e&&void 0===t&&void 0===n)return OX(e.hue,e.saturation,e.lightness);throw new gX(1)}(e);throw new gX(8)}function VX(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):VX(e,t,r)}}function BX(e){return VX(e,e.length,[])}function FX(e,t,n){return Math.max(e,Math.min(t,n))}BX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(lX({},n,{hue:n.hue+parseFloat(e)}))})),BX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(lX({},n,{lightness:FX(0,1,n.lightness-parseFloat(e))}))})),BX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(lX({},n,{saturation:FX(0,1,n.saturation-parseFloat(e))}))})),BX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(lX({},n,{lightness:FX(0,1,n.lightness+parseFloat(e))}))}));var GX=BX((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=AX(t),i=lX({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),o=AX(n),a=lX({},o,{alpha:"number"==typeof o.alpha?o.alpha:1}),s=i.alpha-a.alpha,l=2*parseFloat(e)-1,u=((l*s==-1?l:l+s)/(1+l*s)+1)/2,c=1-u;return kX({red:Math.floor(i.red*u+a.red*c),green:Math.floor(i.green*u+a.green*c),blue:Math.floor(i.blue*u+a.blue*c),alpha:i.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})})),HX=GX;function UX(e){return Array.isArray(e)&&e.length>0}BX((function(e,t){if("transparent"===t)return t;var n=AX(t);return kX(lX({},n,{alpha:FX(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))})),BX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(lX({},n,{saturation:FX(0,1,n.saturation+parseFloat(e))}))})),BX((function(e,t){return"transparent"===t?t:zX(lX({},IX(t),{hue:parseFloat(e)}))})),BX((function(e,t){return"transparent"===t?t:zX(lX({},IX(t),{lightness:parseFloat(e)}))})),BX((function(e,t){return"transparent"===t?t:zX(lX({},IX(t),{saturation:parseFloat(e)}))})),BX((function(e,t){return"transparent"===t?t:HX(parseFloat(e),"rgb(0, 0, 0)",t)})),BX((function(e,t){return"transparent"===t?t:HX(parseFloat(e),"rgb(255, 255, 255)",t)})),BX((function(e,t){if("transparent"===t)return t;var n=AX(t);return kX(lX({},n,{alpha:FX(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));const WX=(e,t=2)=>"number"==typeof e?`${Number((100*e).toFixed(t))}%`:"-%";function jX(e){return Array.isArray(e)?[...new Set(e)]:[]}const XX=e=>Array.isArray(e)&&0!==e.length?e.reduce(((e,t)=>{const n=Number(t);return e+(Object.is(n,NaN)?0:n)}),0):0,YX=(e,t="desc")=>{if(Array.isArray(e)&&"asc"===t){return JSON.parse(JSON.stringify(e)).sort(((e,t)=>e.value-t.value))}if(Array.isArray(e)&&"desc"===t){return JSON.parse(JSON.stringify(e)).sort(((e,t)=>t.value-e.value))}return e},ZX=e=>{let t=e.data;return(e=>Array.isArray(e)&&e.length>0)(t)||(t=e.extraData),{boundaryGap:!0,axisTick:{alignWithLabel:!0},data:jX(null==t?void 0:t.map((e=>e.label))),axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}}},qX=(e,t)=>(e.sort(((e,n)=>t.indexOf(e.label)-t.indexOf(n.label))),e);function KX(e,t){let n=null;return function(...r){clearTimeout(n),n=setTimeout((()=>{e.apply(globalThis,r)}),t)}}const $X=e=>"dark"===e.theme?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)";function JX(e){const t=e.reduce(((e,t)=>{const{label:n,value:r}=t;return e[n]||(e[n]=0),r&&(e[n]+=Number(r)),e}),{});return Object.values(t).map((e=>parseFloat(e.toFixed(2))))}const QX=e=>{const t=(e=>{const{data:t,extraData:n,sort:r}=e;if(t&&r){const a=(i=[...t],"asc"===(o=r)?i.sort(((e,t)=>e.value-t.value)):"desc"===o&&i.sort(((e,t)=>t.value-e.value)),i),s=jX(a.map((e=>e.label))),l=qX(a,s),u=qX([...null!=n?n:[]],s);return Object.assign(Object.assign({},e),{data:l,extraData:u})}var i,o;return e})(e);switch(t.chartType){case oX.MINI_AREA:return(e=>{var t,n,r;const i=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),o=e.color;return{color:o,grid:{top:4,left:0,right:0,bottom:0,containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{show:!1},xAxis:{show:!1,boundaryGap:!1,data:jX(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label)))},yAxis:{show:!1,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},series:[...i.map(((t,n)=>{var r,i;const a=null!==(r=null==o?void 0:o[n])&&void 0!==r?r:aX[n];return Object.assign(Object.assign({name:t,type:"line",smooth:!0,lineStyle:{width:2},showSymbol:!1,areaStyle:{opacity:.8,color:new yc(0,0,0,1,[{offset:0,color:kX(a,.5)},{offset:1,color:"dark"===e.theme?kX("gray",.1):"#fff"}])},emphasis:{focus:"series"}},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(i=e.data)||void 0===i?void 0:i.filter((e=>e.type===t)).map((e=>e.value))})}))]}})(t);case oX.AREA:return(e=>{var t,n;const r=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:ZX(e),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:[...r.map(((t,n)=>{var r;const i=aX[n];return Object.assign(Object.assign({name:t,type:"line",smooth:!0,lineStyle:{width:2},showSymbol:!1,areaStyle:{opacity:.8,color:new yc(0,0,0,1,[{offset:0,color:kX(i,.5)},{offset:1,color:"dark"===e.theme?kX("gray",.1):"#fff"}])},emphasis:{focus:"series"}},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"},showSymbol:!0}),{data:null===(r=e.data)||void 0===r?void 0:r.filter((e=>e.type===t)).map((e=>e.value))})}))]}})(t);case oX.LINE:return(e=>{var t,n;const r=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:ZX(e),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"line",smooth:!1,lineStyle:{width:2},showSymbol:!0,emphasis:{focus:"series"}},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))})}))}})(t);case oX.COLUMN:return(e=>{var t,n;const r=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},ZX(e)),{axisPointer:{type:"shadow"}}),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:e.value>0?[500,500,0,0]:[0,0,500,500]}})))})}))}})(t);case oX.STACK_COLUMN:return(e=>{var t,n;const r=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},ZX(e)),{axisPointer:{type:"shadow"}}),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))})}))}})(t);case oX.BAR:return(e=>{var t,n,r;const i=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:{},yAxis:{data:jX(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label))),axisTick:{alignWithLabel:!0},axisPointer:{type:"shadow"},min:null===(r=e.yStart)||void 0===r?void 0:r[0],axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}},series:i.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"right"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:[0,500,500,0]}})))})}))}})(t);case oX.STACK_BAR:return(e=>{var t,n,r;const i=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{grid:Object.assign({},e.showStackTotal&&{right:32}),tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll",data:i},xAxis:{},yAxis:{data:jX(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label))),axisTick:{alignWithLabel:!0},axisPointer:{type:"shadow"},min:null===(r=e.yStart)||void 0===r?void 0:r[0],axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}},series:[...i.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&!e.showStackTotal&&{label:{show:!0,formatter:"{c}",position:"right"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))})})),Object.assign(Object.assign({name:"总和",type:"bar",stack:"abc",barGap:"-100%",barMaxWidth:8,itemStyle:{normal:{color:"transparent"}},tooltip:{show:!1}},e.showStackTotal&&{label:{normal:{show:!0,position:"right",color:"#000"},formatter:t=>{var n;return String(Number(XX(null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.label===t.name)).map((e=>e.value))).toFixed(2)))}}}),{data:JX(e.data)})]}})(t);case oX.FUNNEL:return(e=>{var t,n;const r=null!==(n=null===(t=YX(e.data))||void 0===t?void 0:t.map((t=>{var n;return{value:null!==(n=t.value)&&void 0!==n?n:0,name:e.reserveValueWithLabelType?t.label:t.type}})))&&void 0!==n?n:[],i={type:"funnel",minSize:"20%",left:10,top:24,width:"76%",sort:"descending",data:r};return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[Object.assign(Object.assign({},i),{label:{show:!0,position:"outer",formatter:"{c}"}}),Object.assign(Object.assign({},i),{emphasis:{label:{fontSize:20}},label:{show:!0,position:"inner",color:"#fff",formatter:e=>{const t=e.dataIndex;if(0===t)return"100%";const n=r[t-1].value;return WX(e.value/n)}}})]}})(t);case oX.DUAL_LINE_BAR:return(e=>{var t,n,r,i;const o=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),a=jX(null===(n=e.extraData)||void 0===n?void 0:n.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"},label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},ZX(e)),{axisPointer:{type:"shadow"}}),yAxis:[{alignTicks:!0,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},{alignTicks:!0,min:null===(i=e.yStart)||void 0===i?void 0:i[1]}],series:[...o.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:e.value>0?[500,500,0,0]:[0,0,500,500]}})))})})),...a.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"line",smooth:!0,yAxisIndex:1,showSymbol:!1},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.extraData)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))})}))]}})(t);case oX.STACK_DUAL_LINE_BAR:return(e=>{var t,n,r,i;const o=jX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),a=jX(null===(n=e.extraData)||void 0===n?void 0:n.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"},label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},ZX(e)),{axisPointer:{type:"shadow"}}),yAxis:[{alignTicks:!0,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},{alignTicks:!0,min:null===(i=e.yStart)||void 0===i?void 0:i[1]}],series:[...o.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))})})),...a.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"line",smooth:!0,yAxisIndex:1,showSymbol:!1},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.extraData)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))})}))]}})(t);case oX.PIE:return(e=>{var t,n;const r=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.value)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[{top:-30,type:"pie",radius:"50%",data:null===(n=YX(e.data))||void 0===n?void 0:n.map((t=>({value:t.value,name:e.reserveValueWithLabelType?t.label:t.type}))),label:{show:!0,fontSize:12,color:$X(e),position:"outside",formatter:e=>WX(e.value/(r||1))},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}})(t);case oX.CYCLE:return(e=>{var t,n,r,i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,_,x;const b=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.value)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[{top:-30,type:"pie",radius:["60%","48%"],data:null===(n=YX(e.data,e.sort))||void 0===n?void 0:n.map((t=>({value:t.value,name:e.reserveValueWithLabelType?t.label:t.type}))),label:{show:!0,fontSize:12,color:$X(e),position:"outside",formatter:e=>WX(e.value/(b||1))},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],graphic:[{type:"text",left:"center",top:null!==(o=null===(i=null===(r=e.cycleCenterConfig)||void 0===r?void 0:r.content)||void 0===i?void 0:i.top)&&void 0!==o?o:76,style:{text:null!==(l=null===(s=null===(a=e.cycleCenterConfig)||void 0===a?void 0:a.content)||void 0===s?void 0:s.value)&&void 0!==l?l:Number(b.toFixed(2)).toString(),fill:"dark"===e.theme?"#fff":"#12161F",fontFamily:"roboto",fontSize:null!==(h=null===(c=null===(u=e.cycleCenterConfig)||void 0===u?void 0:u.content)||void 0===c?void 0:c.fontSize)&&void 0!==h?h:28,fontWeight:"bold"}},{type:"text",left:"center",top:null!==(f=null===(p=null===(d=e.cycleCenterConfig)||void 0===d?void 0:d.title)||void 0===p?void 0:p.top)&&void 0!==f?f:112,style:{text:null!==(v=null===(m=null===(g=e.cycleCenterConfig)||void 0===g?void 0:g.title)||void 0===m?void 0:m.value)&&void 0!==v?v:"总计",fill:"dark"===e.theme?"#fff":"#394252 ",fontSize:null!==(x=null===(_=null===(y=e.cycleCenterConfig)||void 0===y?void 0:y.title)||void 0===_?void 0:_.fontSize)&&void 0!==x?x:14}}]}})(t);case oX.RADAR:return(e=>{var t,n;const r=jX(null===(t=e.data)||void 0===t?void 0:t.map((t=>e.reserveValueWithLabelType?t.label:t.type)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},radar:{shape:"circle",radius:"60%",indicator:jX(null===(n=e.data)||void 0===n?void 0:n.map((t=>e.reserveValueWithLabelType?t.type:t.label))).map((e=>({name:e}))),axisName:{color:"#5d677a"},splitArea:{areaStyle:{color:["transparent"]}},axisLine:{lineStyle:{color:"rgba(226, 229, 235, .3)"}},splitLine:{lineStyle:{color:"#e2e5eb",type:"dashed",dashOffset:1.5}}},series:[{type:"radar",data:r.map(((t,n)=>{var r;return{name:t,value:null===(r=e.data)||void 0===r?void 0:r.filter((n=>e.reserveValueWithLabelType?n.label:n.type===t)).map((e=>e.value)),areaStyle:{color:kX(aX[n],.2)},label:{show:e.reserveValueWithLabelType,formatter:e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toString()}}}})),emphasis:{lineStyle:{width:4}}}]}})(t);default:return{}}};var eY={color:["#3379ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],backgroundColor:"rgba(0,0,0,0)",textStyle:{},title:{textStyle:{color:"#272f3d"},subtextStyle:{color:"#394252"}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:"emptyCircle",smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:"emptyCircle",smooth:!1},bar:{itemStyle:{barBorderWidth:"0",barBorderColor:"#cccccc"}},pie:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},scatter:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},boxplot:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},parallel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},sankey:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},funnel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},gauge:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},candlestick:{itemStyle:{color:"#f15451",color0:"#00c267",borderColor:"#f15451",borderColor0:"#00c267",borderWidth:1}},graph:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"},lineStyle:{width:"1",color:"#dfe3eb"},symbolSize:4,symbol:"emptyCircle",smooth:!1,color:["#3379ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],label:{color:"#ffffff"}},map:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},geo:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"#eef0f5"}},axisTick:{show:!0,lineStyle:{color:"#eef0f5"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},valueAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!0,lineStyle:{color:["#eef0f5"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},logAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!0,lineStyle:{color:["#eef0f5"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:"#eef0f5"}},axisTick:{show:!0,lineStyle:{color:"#eef0f5"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},toolbox:{iconStyle:{borderColor:"#828c9e"},emphasis:{iconStyle:{borderColor:"#394252"}}},legend:{textStyle:{color:"#828b9e"}},tooltip:{axisPointer:{lineStyle:{color:"#ccd1db",width:"1"},crossStyle:{color:"#ccd1db",width:"1"}}},timeline:{lineStyle:{color:"#eef0f5",width:2},itemStyle:{color:"#eef0f5",borderWidth:"1"},controlStyle:{color:"#828c9e",borderColor:"#828c9e",borderWidth:1},checkpointStyle:{color:"#3379ff",borderColor:"#ffffff"},label:{color:"#b1b9c7"},emphasis:{itemStyle:{color:"#3379ff"},controlStyle:{color:"#828c9e",borderColor:"#828c9e",borderWidth:1},label:{color:"#b1b9c7"}}},visualMap:{color:["#062379","#2058d2","#3379ff","#a0cbff","#e8f4ff"]},dataZoom:{handleSize:"undefined%",textStyle:{}},markPoint:{label:{color:"#ffffff"},emphasis:{label:{color:"#ffffff"}}}},tY={color:["#5798ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],backgroundColor:"transparent",textStyle:{},title:{textStyle:{color:"#ffffff"},subtextStyle:{color:"#ffffff"}},line:{itemStyle:{borderWidth:"1"},lineStyle:{width:"2"},symbolSize:"6",symbol:"emptyCircle",smooth:!0},radar:{itemStyle:{borderWidth:"1"},lineStyle:{width:"2"},symbolSize:"6",symbol:"emptyCircle",smooth:!0},bar:{itemStyle:{barBorderWidth:"0",barBorderColor:"#cccccc"}},pie:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},scatter:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},boxplot:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},parallel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},sankey:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},funnel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},gauge:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},candlestick:{itemStyle:{color:"#f15451",color0:"#00c267",borderColor:"#f15451",borderColor0:"#00c267",borderWidth:1}},graph:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"},lineStyle:{width:"1",color:"#ffffff"},symbolSize:"6",symbol:"emptyCircle",smooth:!0,color:["#5798ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],label:{color:"#ffffff"}},map:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},geo:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisTick:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},valueAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!0,lineStyle:{color:["rgba(255,255,255,0.12)"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},logAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!0,lineStyle:{color:["rgba(255,255,255,0.12)"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisTick:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},toolbox:{iconStyle:{borderColor:"#ffffff"},emphasis:{iconStyle:{borderColor:"#ffffff"}}},legend:{textStyle:{color:"#ffffff"}},tooltip:{axisPointer:{lineStyle:{color:"#ffffff",width:"1"},crossStyle:{color:"#ffffff",width:"1"}}},timeline:{lineStyle:{color:"#ffffff",width:2},itemStyle:{color:"#ffffff",borderWidth:"1"},controlStyle:{color:"#ffffff",borderColor:"#ffffff",borderWidth:1},checkpointStyle:{color:"#5798ff",borderColor:"#ffffff"},label:{color:"#ffffff"},emphasis:{itemStyle:{color:"#5798ff"},controlStyle:{color:"#ffffff",borderColor:"#ffffff",borderWidth:1},label:{color:"#ffffff"}}},visualMap:{color:["#062379","#2058d2","#3379ff","#a0cbff","#e8f4ff"]},dataZoom:{handleSize:"undefined%",textStyle:{}},markPoint:{label:{color:"#ffffff"},emphasis:{label:{color:"#ffffff"}}}},nY=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===rY}(e)}(e)};var rY="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function iY(e,t){return!1!==t.clone&&t.isMergeableObject(e)?uY((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function oY(e,t,n){return e.concat(t).map((function(e){return iY(e,n)}))}function aY(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function sY(e,t){try{return t in e}catch(e){return!1}}function lY(e,t,n){var r={};return n.isMergeableObject(e)&&aY(e).forEach((function(t){r[t]=iY(e[t],n)})),aY(t).forEach((function(i){(function(e,t){return sY(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(sY(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return uY;var n=t.customMerge(e);return"function"==typeof n?n:uY}(i,n)(e[i],t[i],n):r[i]=iY(t[i],n))})),r}function uY(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||oY,n.isMergeableObject=n.isMergeableObject||nY,n.cloneUnlessOtherwiseSpecified=iY;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):lY(e,t,n):iY(t,n)}uY.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return uY(e,n,t)}),{})};var cY=hU(uY);By("light",cY(eY,sX)),By("dark",cY(tY,sX));const hY={arrayMerge:(e,t)=>t},dY=e=>{const n=t(null),[r,i]=o();return a((()=>{var t;const r=Ry(n.current,null!==(t=e.theme)&&void 0!==t?t:"light");i(r);const o=KX(r.resize,500),a=()=>o();return globalThis.addEventListener("resize",a),()=>{globalThis.removeEventListener("resize",a)}}),[e.theme]),a((()=>{var t;if(r){const n=r.getHeight()-48,i=Object.assign(Object.assign({},e),e.chartType===oX.CYCLE&&!e.cycleCenterConfig&&{cycleCenterConfig:{title:{top:n/2+24},content:{top:n/2-8}}}),{extraOption:o={},extraSeriesOption:a}=i;r.clear();const s=cY(((e,t)=>(UX(e.series)&&UX(t)&&t.forEach((t=>{e.series=e.series.map((e=>Object.assign(Object.assign({},e),e.name===t.name&&t)))})),e))(QX(i),a),o,hY);r.setOption(s),null===(t=i.onLoad)||void 0===t||t.call(i,r);const l=setTimeout((()=>{r.resize()}),500);return()=>{clearTimeout(l)}}}),[r,e]),vU.jsx(iX,{ref:n,className:e.className,style:e.style})};function pY(e,t,n){"object"==typeof t&&(n=t,t=null);var r,i=this;if(!(e instanceof Function))for(var o in r=[],e)e.hasOwnProperty(o)&&r.push(o);var a=function(t){if(i.apply(this,arguments),e instanceof Function?fY(this,e.call(this,t)):function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}}(this,e,r),this.constructor===a)for(var n=a.__initializers__,o=0;o<n.length;o++)n[o].apply(this,arguments)};a.__super__=i,i.__initializers__?a.__initializers__=i.__initializers__.slice():a.__initializers__=[],t&&a.__initializers__.push(t);var s=function(){};return s.prototype=i.prototype,a.prototype=new s,a.prototype.constructor=a,fY(a.prototype,n),a.extend=i.extend,a.derive=i.extend,a}function fY(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}i_([kS,vH]),i_(mw);var gY={extend:pY,derive:pY};function mY(e,t){this.action=e,this.context=t}var vY={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],n=t.length,r=-1,i=arguments;switch(i.length){case 1:for(;++r<n;)t[r].action.call(t[r].context);return;case 2:for(;++r<n;)t[r].action.call(t[r].context,i[1]);return;case 3:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2]);return;case 4:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2],i[3]);return;case 5:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2],i[3],i[4]);return;default:for(;++r<n;)t[r].action.apply(t[r].context,Array.prototype.slice.call(i,1));return}}},on:function(e,t,n){if(e&&t){var r=this.__handlers__||(this.__handlers__={});if(r[e]){if(this.has(e,t))return}else r[e]=[];var i=new mY(t,n||this);return r[e].push(i),this}},once:function(e,t,n){if(e&&t){var r=this;return this.on(e,(function n(){r.off(e,n),t.apply(this,arguments)}),n)}},before:function(e,t,n){if(e&&t)return e="before"+e,this.on(e,t,n)},after:function(e,t,n){if(e&&t)return e="after"+e,this.on(e,t,n)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var n=this.__handlers__||(this.__handlers__={});if(t){if(n[e]){for(var r=n[e],i=[],o=0;o<r.length;o++)t&&r[o].action!==t&&i.push(r[o]);n[e]=i}return this}n[e]=[]},has:function(e,t){var n=this.__handlers__;if(!n||!n[e])return!1;for(var r=n[e],i=0;i<r.length;i++)if(r[i].action===t)return!0}},yY=0,_Y=Array.prototype.forEach,xY={genGUID:function(){return++yY},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var n=e.split("/"),r=t.split("/"),i=n[0];"."===i||".."===i;)".."===i&&r.pop(),n.shift(),i=n[0];return r.join("/")+"/"+n.join("/")},extend:function(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},extendWithPropList:function(e,t,n){if(t)for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}return e},defaultsWithPropList:function(e,t,n){if(t)for(var r=0;r<n.length;r++){var i=n[r];null==e[i]&&(e[i]=t[i])}return e},each:function(e,t,n){if(e&&t)if(e.forEach&&e.forEach===_Y)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(xY.isObject(e)){if(xY.isArray(e))return e.slice();if(xY.isArrayLike(e)){for(var t=new e.constructor(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}return xY.extend({},e)}return e}},bY=function(){this.__uid__=xY.genGUID()};bY.__initializers__=[function(e){xY.extend(this,e)}],xY.extend(bY,gY),xY.extend(bY.prototype,vY);var wY=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB","ANGLE_instanced_arrays"],SY=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function TY(e){for(var t={},n={},r=0;r<wY.length;r++){o(wY[r])}for(r=0;r<SY.length;r++){var i=SY[r];n[i]=e.getParameter(e[i])}function o(n){if(e.getExtension){var r=e.getExtension(n);r||(r=e.getExtension("MOZ_"+n)),r||(r=e.getExtension("WEBKIT_"+n)),t[n]=r}}this.getExtension=function(e){return e in t||o(e),t[e]},this.getParameter=function(e){return n[e]}}var MY=256,CY=1024,DY=16384,AY=0,IY=1,EY=2,LY=3,NY=4,PY=5,OY=6,RY=35040,kY=35044,zY=35048,VY=1028,BY=1029,FY=1032,GY=2304,HY=2305,UY=5120,WY=5121,jY=5122,XY=5123,YY=5124,ZY=5125,qY=5126,KY=6402,$Y=6406,JY=6407,QY=6408,eZ=6409,tZ=6410,nZ=9728,rZ=9729,iZ=9984,oZ=9985,aZ=9986,sZ=9987,lZ=3553,uZ=34067,cZ=10497,hZ=33071,dZ=33648,pZ=36160,fZ=36161,gZ=34041,mZ=36064,vZ=36096,yZ=36128,_Z=33306;var xZ,bZ={get:function(e){var t=new XMLHttpRequest;t.open("get",e.url),t.responseType=e.responseType||"text",e.onprogress&&(t.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total;e.onprogress(n,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(n){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}},wZ={supportWebGL:function(){if(null==xZ)try{var e=document.createElement("canvas");if(!(e.getContext("webgl")||e.getContext("experimental-webgl")))throw new Error}catch(e){xZ=!1}return xZ}};wZ.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,wZ.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,wZ.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,wZ.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,wZ.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,wZ.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,wZ.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var SZ={};"undefined"!=typeof window?SZ=window:"undefined"!=typeof global&&(SZ=global),wZ.requestAnimationFrame=SZ.requestAnimationFrame||SZ.msRequestAnimationFrame||SZ.mozRequestAnimationFrame||SZ.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},wZ.createCanvas=function(){return document.createElement("canvas")},wZ.createImage=function(){return new SZ.Image},wZ.request={get:bZ.get},wZ.addEventListener=function(e,t,n,r){e.addEventListener(t,n,r)},wZ.removeEventListener=function(e,t,n){e.removeEventListener(t,n)};var TZ=function(){this.head=null,this.tail=null,this._length=0};TZ.prototype.insert=function(e){var t=new TZ.Entry(e);return this.insertEntry(t),t},TZ.prototype.insertAt=function(e,t){if(!(e<0)){for(var n=this.head,r=0;n&&r!=e;)n=n.next,r++;if(n){var i=new TZ.Entry(t),o=n.prev;o?(o.next=i,i.prev=o):this.head=i,i.next=n,n.prev=i}else this.insert(t)}},TZ.prototype.insertBeforeEntry=function(e,t){var n=new TZ.Entry(e),r=t.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=t,t.prev=n,this._length++},TZ.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},TZ.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._length--},TZ.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t?(this.remove(t),t.value):void 0}},TZ.prototype.getHead=function(){if(this.head)return this.head.value},TZ.prototype.getTail=function(){if(this.tail)return this.tail.value},TZ.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t.value}},TZ.prototype.indexOf=function(e){for(var t=this.head,n=0;t;){if(t.value===e)return n;t=t.next,n++}},TZ.prototype.length=function(){return this._length},TZ.prototype.isEmpty=function(){return 0===this._length},TZ.prototype.forEach=function(e,t){for(var n=this.head,r=0,i=void 0!==t;n;)i?e.call(t,n.value,r):e(n.value,r),n=n.next,r++},TZ.prototype.clear=function(){this.tail=this.head=null,this._length=0},TZ.Entry=function(e){this.value=e,this.next=null,this.prev=null};var MZ=function(e){this._list=new TZ,this._map={},this._maxSize=e||10};MZ.prototype.setMaxSize=function(e){this._maxSize=e},MZ.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var n=this._list.length();if(n>=this._maxSize&&n>0){var r=this._list.head;this._list.remove(r),delete this._map[r.key]}var i=this._list.insert(t);i.key=e,this._map[e]=i}},MZ.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},MZ.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},MZ.prototype.clear=function(){this._list.clear(),this._map={}};var CZ={},DZ={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function AZ(e){return(e=Math.round(e))<0?0:e>255?255:e}function IZ(e){return e<0?0:e>1?1:e}function EZ(e){return e.length&&"%"===e.charAt(e.length-1)?AZ(parseFloat(e)/100*255):AZ(parseInt(e,10))}function LZ(e){return e.length&&"%"===e.charAt(e.length-1)?IZ(parseFloat(e)/100):IZ(parseFloat(e))}function NZ(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function PZ(e,t,n){return e+(t-e)*n}function OZ(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function RZ(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var kZ=new MZ(20),zZ=null;function VZ(e,t){zZ&&RZ(zZ,t),zZ=kZ.put(e,zZ||t.slice())}function BZ(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=LZ(e[1]),i=LZ(e[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return OZ(t=t||[],AZ(255*NZ(a,o,n+1/3)),AZ(255*NZ(a,o,n)),AZ(255*NZ(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}CZ.parse=function(e,t){if(e){t=t||[];var n=kZ.get(e);if(n)return RZ(t,n);var r,i=(e+="").replace(/ /g,"").toLowerCase();if(i in DZ)return RZ(t,DZ[i]),VZ(e,t),t;if("#"===i.charAt(0))return 4===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=4095?(OZ(t,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),VZ(e,t),t):void OZ(t,0,0,0,1):7===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=16777215?(OZ(t,(16711680&r)>>16,(65280&r)>>8,255&r,1),VZ(e,t),t):void OZ(t,0,0,0,1):void 0;var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===i.length){var s=i.substr(0,o),l=i.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void OZ(t,0,0,0,1);u=LZ(l.pop());case"rgb":return 3!==l.length?void OZ(t,0,0,0,1):(OZ(t,EZ(l[0]),EZ(l[1]),EZ(l[2]),u),VZ(e,t),t);case"hsla":return 4!==l.length?void OZ(t,0,0,0,1):(l[3]=LZ(l[3]),BZ(l,t),VZ(e,t),t);case"hsl":return 3!==l.length?void OZ(t,0,0,0,1):(BZ(l,t),VZ(e,t),t);default:return}}OZ(t,0,0,0,1)}},CZ.parseToFloat=function(e,t){if(t=CZ.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},CZ.lift=function(e,t){var n=CZ.parse(e);if(n){for(var r=0;r<3;r++)n[r]=t<0?n[r]*(1-t)|0:(255-n[r])*t+n[r]|0;return CZ.stringify(n,4===n.length?"rgba":"rgb")}},CZ.toHex=function(e){var t=CZ.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},CZ.fastLerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=t[i],s=t[o],l=r-i;return n[0]=AZ(PZ(a[0],s[0],l)),n[1]=AZ(PZ(a[1],s[1],l)),n[2]=AZ(PZ(a[2],s[2],l)),n[3]=IZ(PZ(a[3],s[3],l)),n}},CZ.fastMapToColor=CZ.fastLerp,CZ.lerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=CZ.parse(t[i]),s=CZ.parse(t[o]),l=r-i,u=CZ.stringify([AZ(PZ(a[0],s[0],l)),AZ(PZ(a[1],s[1],l)),AZ(PZ(a[2],s[2],l)),IZ(PZ(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}},CZ.mapToColor=CZ.lerp,CZ.modifyHSL=function(e,t,n,r){if(e=CZ.parse(e))return e=function(e){if(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?t=d-h:i===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(e[1]=LZ(n)),null!=r&&(e[2]=LZ(r)),CZ.stringify(BZ(e),"rgba")},CZ.modifyAlpha=function(e,t){if((e=CZ.parse(e))&&null!=t)return e[3]=IZ(t),CZ.stringify(e,"rgba")},CZ.stringify=function(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}};var FZ=CZ.parseToFloat,GZ={};function HZ(e){var t=Object.keys(e);t.sort();for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e[i];null===o?n.push(i):n.push(i+" "+o.toString())}return n.join("\n")}var UZ,WZ=bY.extend((function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}}),(function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)}),{precision:"highp",setUniform:function(e,t){void 0===t&&console.warn('Uniform value "'+e+'" is undefined');var n=this.uniforms[e];n&&("string"==typeof t&&(t=FZ(t)||t),n.value=t,this.autoUpdateTextureStatus&&"t"===n.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var n=e[t];this.setUniform(t,n)}},isUniformEnabled:function(e){return this._enabledUniforms.indexOf(e)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==typeof e)for(var n in e){var r=e[n];this.setUniform(n,r)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var n=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var r=this.uniforms;this._enabledUniforms=Object.keys(r),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var i=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=xY.clone(e.vertexDefines),this.fragmentDefines=xY.clone(e.fragmentDefines),t){for(var a in n)r[a]&&(r[a].value=n[a].value);xY.defaults(this.vertexDefines,i),xY.defaults(this.fragmentDefines,o)}var s={};for(var l in e.textures)s[l]={shaderType:e.textures[l].shaderType,type:e.textures[l].type,enabled:!(!t||!this._textureStatus[l])&&this._textureStatus[l].enabled};this._textureStatus=s,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=xY.clone(this.vertexDefines),e.fragmentDefines=xY.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,n){var r=this.vertexDefines,i=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(n=t,t=e,e="both"),n=null!=n?n:null,"vertex"!==e&&"both"!==e||r[t]!==n&&(r[t]=n,this._programKey=""),"fragment"!==e&&"both"!==e||i[t]!==n&&(i[t]=n,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.enableTexture(e[t]);else{var n=this._textureStatus[e];if(n)n.enabled||(n.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!0;this._programKey=""},disableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.disableTexture(e[t]);else{var n=this._textureStatus[e];if(n)!n.enabled||(n.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!1;this._programKey=""},isTextureEnabled:function(e){var t=this._textureStatus;return!!t[e]&&t[e].enabled},getEnabledTextures:function(){var e=[],t=this._textureStatus;for(var n in t)t[n].enabled&&e.push(n);return e},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(e,t,n){n.sort();for(var r=[],i=0;i<n.length;i++){var o=n[i];r.push(o)}var a=HZ(e)+"\n"+HZ(t)+"\n"+r.join("\n");if(GZ[a])return GZ[a];var s=xY.genGUID();return GZ[a]=s,s}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}}),jZ=1e-6,XZ=Array,YZ=Math.random,ZZ={};ZZ.create=function(){var e=new XZ(2);return e[0]=0,e[1]=0,e},ZZ.clone=function(e){var t=new XZ(2);return t[0]=e[0],t[1]=e[1],t},ZZ.fromValues=function(e,t){var n=new XZ(2);return n[0]=e,n[1]=t,n},ZZ.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},ZZ.set=function(e,t,n){return e[0]=t,e[1]=n,e},ZZ.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},ZZ.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},ZZ.sub=ZZ.subtract,ZZ.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},ZZ.mul=ZZ.multiply,ZZ.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},ZZ.div=ZZ.divide,ZZ.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},ZZ.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},ZZ.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},ZZ.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},ZZ.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},ZZ.dist=ZZ.distance,ZZ.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r},ZZ.sqrDist=ZZ.squaredDistance,ZZ.length=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},ZZ.len=ZZ.length,ZZ.squaredLength=function(e){var t=e[0],n=e[1];return t*t+n*n},ZZ.sqrLen=ZZ.squaredLength,ZZ.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ZZ.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},ZZ.normalize=function(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},ZZ.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},ZZ.cross=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},ZZ.lerp=function(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e},ZZ.random=function(e,t){t=t||1;var n=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},ZZ.transformMat2=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},ZZ.transformMat2d=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},ZZ.transformMat3=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},ZZ.transformMat4=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},ZZ.forEach=(UZ=ZZ.create(),function(e,t,n,r,i,o){var a,s;for(t||(t=2),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a<s;a+=t)UZ[0]=e[a],UZ[1]=e[a+1],i(UZ,UZ,o),e[a]=UZ[0],e[a+1]=UZ[1];return e});var qZ=function(e,t){e=e||0,t=t||0,this.array=ZZ.fromValues(e,t),this._dirty=!0};if(qZ.prototype={constructor:qZ,add:function(e){return ZZ.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t){return this.array[0]=e,this.array[1]=t,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this._dirty=!0,this},clone:function(){return new qZ(this.x,this.y)},copy:function(e){return ZZ.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return ZZ.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return ZZ.dist(this.array,e.array)},distance:function(e){return ZZ.distance(this.array,e.array)},div:function(e){return ZZ.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return ZZ.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return ZZ.dot(this.array,e.array)},len:function(){return ZZ.len(this.array)},length:function(){return ZZ.length(this.array)},lerp:function(e,t,n){return ZZ.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return ZZ.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return ZZ.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return ZZ.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return ZZ.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return ZZ.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return ZZ.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return ZZ.random(this.array,e),this._dirty=!0,this},scale:function(e){return ZZ.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return ZZ.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return ZZ.sqrDist(this.array,e.array)},squaredDistance:function(e){return ZZ.squaredDistance(this.array,e.array)},sqrLen:function(){return ZZ.sqrLen(this.array)},squaredLength:function(){return ZZ.squaredLength(this.array)},sub:function(e){return ZZ.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return ZZ.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return ZZ.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return ZZ.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return ZZ.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return ZZ.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var KZ=qZ.prototype;Object.defineProperty(KZ,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty(KZ,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}})}qZ.add=function(e,t,n){return ZZ.add(e.array,t.array,n.array),e._dirty=!0,e},qZ.set=function(e,t,n){return ZZ.set(e.array,t,n),e._dirty=!0,e},qZ.copy=function(e,t){return ZZ.copy(e.array,t.array),e._dirty=!0,e},qZ.cross=function(e,t,n){return ZZ.cross(e.array,t.array,n.array),e._dirty=!0,e},qZ.distance=qZ.dist=function(e,t){return ZZ.distance(e.array,t.array)},qZ.div=function(e,t,n){return ZZ.divide(e.array,t.array,n.array),e._dirty=!0,e},qZ.divide=qZ.div,qZ.dot=function(e,t){return ZZ.dot(e.array,t.array)},qZ.len=function(e){return ZZ.length(e.array)},qZ.lerp=function(e,t,n,r){return ZZ.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},qZ.min=function(e,t,n){return ZZ.min(e.array,t.array,n.array),e._dirty=!0,e},qZ.max=function(e,t,n){return ZZ.max(e.array,t.array,n.array),e._dirty=!0,e},qZ.mul=function(e,t,n){return ZZ.multiply(e.array,t.array,n.array),e._dirty=!0,e},qZ.multiply=qZ.mul,qZ.negate=function(e,t){return ZZ.negate(e.array,t.array),e._dirty=!0,e},qZ.normalize=function(e,t){return ZZ.normalize(e.array,t.array),e._dirty=!0,e},qZ.random=function(e,t){return ZZ.random(e.array,t),e._dirty=!0,e},qZ.scale=function(e,t,n){return ZZ.scale(e.array,t.array,n),e._dirty=!0,e},qZ.scaleAndAdd=function(e,t,n,r){return ZZ.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},qZ.squaredDistance=qZ.sqrDist=function(e,t){return ZZ.sqrDist(e.array,t.array)},qZ.squaredLength=qZ.sqrLen=function(e){return ZZ.sqrLen(e.array)},qZ.sub=function(e,t,n){return ZZ.subtract(e.array,t.array,n.array),e._dirty=!0,e},qZ.subtract=qZ.sub,qZ.transformMat2=function(e,t,n){return ZZ.transformMat2(e.array,t.array,n.array),e._dirty=!0,e},qZ.transformMat2d=function(e,t,n){return ZZ.transformMat2d(e.array,t.array,n.array),e._dirty=!0,e},qZ.transformMat3=function(e,t,n){return ZZ.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},qZ.transformMat4=function(e,t,n){return ZZ.transformMat4(e.array,t.array,n.array),e._dirty=!0,e};var $Z={};function JZ(e){for(var t=e.split("\n"),n=0,r=t.length;n<r;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function QZ(e,t,n){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),JZ(n)].join("\n")}var eq=new wZ.Float32Array(16),tq=bY.extend({uniformSemantics:{},attributes:{}},(function(){this._locations={},this._textureSlot=0,this._program=null}),{bind:function(e){this._textureSlot=0,e.gl.useProgram(this._program)},hasUniform:function(e){var t=this._locations[e];return null!=t},useTextureSlot:function(e,t,n){t&&(e.gl.activeTexture(e.gl.TEXTURE0+n),t.isRenderable()?t.bind(e):t.unbind(e))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(e){this._textureSlot=e||0},takeCurrentTextureSlot:function(e,t){var n=this._textureSlot;return this.useTextureSlot(e,t,n),this._textureSlot++,n},setUniform:function(e,t,n,r){var i=this._locations[n];if(null==i)return!1;switch(t){case"m4":if(!(r instanceof Float32Array)){for(var o=0;o<r.length;o++)eq[o]=r[o];r=eq}e.uniformMatrix4fv(i,!1,r);break;case"2i":e.uniform2i(i,r[0],r[1]);break;case"2f":e.uniform2f(i,r[0],r[1]);break;case"3i":e.uniform3i(i,r[0],r[1],r[2]);break;case"3f":e.uniform3f(i,r[0],r[1],r[2]);break;case"4i":e.uniform4i(i,r[0],r[1],r[2],r[3]);break;case"4f":e.uniform4f(i,r[0],r[1],r[2],r[3]);break;case"1i":e.uniform1i(i,r);break;case"1f":e.uniform1f(i,r);break;case"1fv":e.uniform1fv(i,r);break;case"1iv":e.uniform1iv(i,r);break;case"2iv":e.uniform2iv(i,r);break;case"2fv":e.uniform2fv(i,r);break;case"3iv":e.uniform3iv(i,r);break;case"3fv":e.uniform3fv(i,r);break;case"4iv":e.uniform4iv(i,r);break;case"4fv":e.uniform4fv(i,r);break;case"m2":case"m2v":e.uniformMatrix2fv(i,!1,r);break;case"m3":case"m3v":e.uniformMatrix3fv(i,!1,r);break;case"m4v":if(Array.isArray(r)&&Array.isArray(r[0])){var a=new wZ.Float32Array(16*r.length),s=0;for(o=0;o<r.length;o++)for(var l=r[o],u=0;u<16;u++)a[s++]=l[u];e.uniformMatrix4fv(i,!1,a)}else e.uniformMatrix4fv(i,!1,r)}return!0},setUniformOfSemantic:function(e,t,n){var r=this.uniformSemantics[t];return!!r&&this.setUniform(e,r.type,r.symbol,n)},enableAttributes:function(e,t,n){var r,i=e.gl,o=this._program,a=this._locations;(r=n?n.__enabledAttributeList:$Z[e.__uid__])||(r=n?n.__enabledAttributeList=[]:$Z[e.__uid__]=[]);for(var s=[],l=0;l<t.length;l++){var u=t[l];if(this.attributes[u]){var c=a[u];if(null==c){if(-1===(c=i.getAttribLocation(o,u))){s[l]=-1;continue}a[u]=c}s[l]=c,r[c]?r[c]=2:r[c]=1}else s[l]=-1}for(l=0;l<r.length;l++)switch(r[l]){case 1:i.enableVertexAttribArray(l),r[l]=3;break;case 2:r[l]=3;break;case 3:i.disableVertexAttribArray(l),r[l]=0}return s},getAttribLocation:function(e,t){var n=this._locations,r=n[t];return null==r&&(r=e.getAttribLocation(this._program,t),n[t]=r),r},buildProgram:function(e,t,n,r){var i=e.createShader(e.VERTEX_SHADER),o=e.createProgram();e.shaderSource(i,n),e.compileShader(i);var a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,r),e.compileShader(a);var s=QZ(e,i,n);if(s)return s;if(s=QZ(e,a,r))return s;if(e.attachShader(o,i),e.attachShader(o,a),t.attributeSemantics.POSITION)e.bindAttribLocation(o,0,t.attributeSemantics.POSITION.symbol);else{var l=Object.keys(this.attributes);e.bindAttribLocation(o,0,l[0])}if(e.linkProgram(o),e.deleteShader(i),e.deleteShader(a),this._program=o,this.vertexCode=n,this.fragmentCode=r,!e.getProgramParameter(o,e.LINK_STATUS))return"Could not link program\n"+e.getProgramInfoLog(o);for(var u=0;u<t.uniforms.length;u++){var c=t.uniforms[u];this._locations[c]=e.getUniformLocation(o,c)}}}),nq=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function rq(e,t,n){var r={};for(var i in n)r[i+"_COUNT"]=n[i];return e.replace(nq,(function(e,n,i,o){var a="";isNaN(n)&&(n=n in t?t[n]:r[n]),isNaN(i)&&(i=i in t?t[i]:r[i]);for(var s=parseInt(n);s<parseInt(i);s++)a+="{"+o.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return a}))}function iq(e,t,n){var r=[];if(t)for(var i in t){var o=t[i];o>0&&r.push("#define "+i.toUpperCase()+"_COUNT "+o)}if(n)for(var a=0;a<n.length;a++){var s=n[a];r.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in e){var l=e[s];null===l?r.push("#define "+s):r.push("#define "+s+" "+l.toString())}return r.join("\n")}function oq(e){this._renderer=e,this._cache={}}oq.prototype.getProgram=function(e,t,n){var r=this._cache,i=e.isSkinnedMesh&&e.isSkinnedMesh(),o=e.isInstancedMesh&&e.isInstancedMesh(),a="s"+t.shader.shaderID+"m"+t.getProgramKey();if(n&&(a+="se"+n.getProgramKey(e.lightGroup)),i&&(a+=",sk"+e.joints.length),o&&(a+=",is"),y=r[a])return y;var s=n?n.getLightsNumbers(e.lightGroup):{},l=this._renderer,u=l.gl,c=t.getEnabledTextures(),h="";if(i){var d={SKINNING:null,JOINT_COUNT:e.joints.length};e.joints.length>l.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),h+="\n"+iq(d)+"\n"}o&&(h+="\n#define INSTANCING\n");var p=h+iq(t.vertexDefines,s,c),f=h+iq(t.fragmentDefines,s,c),g=p+"\n"+t.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=l.getGLExtension(e)}));m.indexOf("EXT_shader_texture_lod")>=0&&(f+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(f+="\n#define SUPPORT_STANDARD_DERIVATIVES");var v,y,_=function(e){for(var t=[],n=0;n<e.length;n++)t.push("#extension GL_"+e[n]+" : enable");return t.join("\n")}(m)+"\n"+(["precision",v=t.precision,"float"].join(" ")+";\n"+["precision",v,"int"].join(" ")+";\n"+["precision",v,"sampler2D"].join(" ")+";\n\n")+f+"\n"+t.shader.fragment,x=rq(g,t.vertexDefines,s),b=rq(_,t.fragmentDefines,s);(y=new tq).uniformSemantics=t.shader.uniformSemantics,y.attributes=t.shader.attributes;var w=y.buildProgram(u,t.shader,x,b);return y.__error=w,r[a]=y,y};var aq=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,sq=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,lq=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,uq={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function cq(e){for(var t=[],n=0;n<e;n++)t[n]=0;return t}var hq={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return cq(2)},vec3:function(){return cq(3)},vec4:function(){return cq(4)},ivec2:function(){return cq(2)},ivec3:function(){return cq(3)},ivec4:function(){return cq(4)},mat2:function(){return cq(4)},mat3:function(){return cq(9)},mat4:function(){return cq(16)},array:function(){return[]}},dq=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],pq=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],fq=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],gq={vec4:4,vec3:3,vec2:2,float:1},mq={},vq={};function yq(e){return e.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function _q(){console.error("Wrong uniform/attributes syntax")}function xq(e,t){for(var n=/[,=\(\):]/,r=t.replace(/:\s*\[\s*(.*)\s*\]/g,"="+e+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),i=[],o=0;o<r.length;o++)r[o].match(n)?i.push(r[o].charAt(0),r[o].slice(1)):i.push(r[o]);var a,s=0,l={},u=null;function c(e){e||_q();var t=e.match(/\[(.*?)\]/);a=e.replace(/\[(.*?)\]/,""),l[a]={},t&&(l[a].isArray=!0,l[a].arraySize=t[1])}c((r=i)[0]);for(o=1;o<r.length;o++){var h=r[o];if(h)if("="!==h)if(":"!==h)if(","!==h)if(")"!==h)if("("!==h)if(h.indexOf("vec")>=0){if(1!==s&&4!==s){_q();break}s=2,u=[]}else if(1!==s)if(4!==s)c(h),s=0;else{var d=h;dq.indexOf(d)>=0||pq.indexOf(d)>=0||fq.indexOf(d)>=0?l[a].semantic=d:"ignore"===d||"unconfigurable"===d?l[a].ignore=!0:l[a].value="bool"===e?"true"===d:parseFloat(d)}else l[a].value="bool"===e?"true"===h:parseFloat(h),u=null;else{if(2!==s){_q();break}if(!(u instanceof Array)){_q();break}u.push(+r[++o])}else l[a].value=new wZ.Float32Array(u),u=null,s=5;else if(2===s){if(!(u instanceof Array)){_q();break}u.push(+r[++o])}else s=5;else s=4;else{if(0!==s&&3!==s){_q();break}s=1}}return l}function bq(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),e=yq(e),t=yq(t),this._shaderID=function(e,t){var n="vertex:"+e+"fragment:"+t;if(mq[n])return mq[n];var r=xY.genGUID();return mq[n]=r,vq[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=bq.parseImport(e),this._fragmentCode=bq.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}bq.prototype={constructor:bq,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var n=this.uniformTemplates[t];e[t]={type:n.type,value:n.value()}}return e},_parseImport:function(){this._vertexCode=bq.parseImport(this.vertex),this._fragmentCode=bq.parseImport(this.fragment)},_addSemanticUniform:function(e,t,n){if(dq.indexOf(n)>=0)this.attributeSemantics[n]={symbol:e,type:t};else if(fq.indexOf(n)>=0){var r=!1,i=n;n.match(/TRANSPOSE$/)&&(r=!0,i=n.slice(0,-9)),this.matrixSemantics[n]={symbol:e,type:t,isTranspose:r,semanticNoTranspose:i}}else pq.indexOf(n)>=0&&(this.uniformSemantics[n]={symbol:e,type:t})},_addMaterialUniform:function(e,t,n,r,i,o){o[e]={type:n,value:i?hq.array:r||hq[t],semantic:null}},_parseUniforms:function(){var e={},t=this,n="vertex";function r(e){return null!=e?function(){return e}:null}function i(i,o,a){var s=xq(o,a),l=[];for(var u in s){var c=s[u],h=c.semantic,d=u,p=uq[o],f=r(s[u].value);s[u].isArray&&(d+="["+s[u].arraySize+"]",p+="v"),l.push(d),t._uniformList.push(u),c.ignore||("sampler2D"!==o&&"samplerCube"!==o||(t.textures[u]={shaderType:n,type:o}),h?t._addSemanticUniform(u,p,h):t._addMaterialUniform(u,o,p,f,s[u].isArray,e))}return l.length>0?"uniform "+o+" "+l.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(aq,i),n="fragment",this._fragmentCode=this._fragmentCode.replace(aq,i),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(sq,(function(n,r,i){var o=xq(r,i),a=gq[r]||1,s=[];for(var l in o){var u=o[l].semantic;if(e[l]={type:"float",size:a,semantic:u||null},u){if(dq.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:l,type:r}}s.push(l)}return"attribute "+r+" "+s.join(",")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this,t="vertex";function n(n,r,i){var o="vertex"===t?e.vertexDefines:e.fragmentDefines;return o[r]||(o[r]="false"!==i&&("true"===i||(i?isNaN(parseFloat(i))?i.trim():parseFloat(i):null))),""}this._vertexCode=this._vertexCode.replace(lq,n),t="fragment",this._fragmentCode=this._fragmentCode.replace(lq,n)},clone:function(){var e=vq[this._shaderID];return new bq(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(bq.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(bq.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(bq.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(bq.prototype,"uniforms",{get:function(){return this._uniformList}}));var wq=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;bq.parseImport=function(e){return e=e.replace(wq,(function(e,t,n){return(e=bq.source(n))?bq.parseImport(e):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var Sq=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;bq.import=function(e){e.replace(Sq,(function(e,t,n,r){if(r=r.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var i,o=n.split("."),a=bq.codes,s=0;s<o.length-1;)a[i=o[s++]]||(a[i]={}),a=a[i];a[i=o[s]]=r}return r}))},bq.codes={},bq.source=function(e){for(var t=e.split("."),n=bq.codes,r=0;n&&r<t.length;){n=n[t[r++]]}return"string"!=typeof n?(console.error('Shader "'+e+'" not existed in library'),""):n};var Tq="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec4 P = vec4(pos, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = WVP * P;\n v_Texcoord = uv * uvRepeat + uvOffset;\n}\n@end\n@export clay.prez.fragment\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end",Mq={create:function(){var e=new XZ(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new XZ(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=c*g-h*f,M=c*m-d*f,C=c*v-p*f,D=h*m-d*g,A=h*v-p*g,I=d*v-p*m,E=y*I-_*A+x*D+b*C-w*M+S*T;return E?(E=1/E,e[0]=(s*I-l*A+u*D)*E,e[1]=(i*A-r*I-o*D)*E,e[2]=(g*S-m*w+v*b)*E,e[3]=(d*w-h*S-p*b)*E,e[4]=(l*C-a*I-u*M)*E,e[5]=(n*I-i*C+o*M)*E,e[6]=(m*x-f*S-v*_)*E,e[7]=(c*S-d*x+p*_)*E,e[8]=(a*A-s*C+u*T)*E,e[9]=(r*C-n*A-o*T)*E,e[10]=(f*w-g*x+v*y)*E,e[11]=(h*x-c*w-p*y)*E,e[12]=(s*M-a*D-l*T)*E,e[13]=(n*D-r*M+i*T)*E,e[14]=(g*_-f*b-m*y)*E,e[15]=(c*b-h*_+d*y)*E,e):null},adjoint:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15];return e[0]=s*(d*v-p*m)-h*(l*v-u*m)+g*(l*p-u*d),e[1]=-(r*(d*v-p*m)-h*(i*v-o*m)+g*(i*p-o*d)),e[2]=r*(l*v-u*m)-s*(i*v-o*m)+g*(i*u-o*l),e[3]=-(r*(l*p-u*d)-s*(i*p-o*d)+h*(i*u-o*l)),e[4]=-(a*(d*v-p*m)-c*(l*v-u*m)+f*(l*p-u*d)),e[5]=n*(d*v-p*m)-c*(i*v-o*m)+f*(i*p-o*d),e[6]=-(n*(l*v-u*m)-a*(i*v-o*m)+f*(i*u-o*l)),e[7]=n*(l*p-u*d)-a*(i*p-o*d)+c*(i*u-o*l),e[8]=a*(h*v-p*g)-c*(s*v-u*g)+f*(s*p-u*h),e[9]=-(n*(h*v-p*g)-c*(r*v-o*g)+f*(r*p-o*h)),e[10]=n*(s*v-u*g)-a*(r*v-o*g)+f*(r*u-o*s),e[11]=-(n*(s*p-u*h)-a*(r*p-o*h)+c*(r*u-o*s)),e[12]=-(a*(h*m-d*g)-c*(s*m-l*g)+f*(s*d-l*h)),e[13]=n*(h*m-d*g)-c*(r*m-i*g)+f*(r*d-i*h),e[14]=-(n*(s*m-l*g)-a*(r*m-i*g)+f*(r*l-i*s)),e[15]=n*(s*d-l*h)-a*(r*d-i*h)+c*(r*l-i*s),e},determinant:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],g=e[14],m=e[15];return(t*a-n*o)*(h*m-d*g)-(t*s-r*o)*(c*m-d*f)+(t*l-i*o)*(c*g-h*f)+(n*s-r*a)*(u*m-d*p)-(n*l-i*a)*(u*g-h*p)+(r*l-i*s)*(u*f-c*p)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],g=t[12],m=t[13],v=t[14],y=t[15],_=n[0],x=n[1],b=n[2],w=n[3];return e[0]=_*r+x*s+b*h+w*g,e[1]=_*i+x*l+b*d+w*m,e[2]=_*o+x*u+b*p+w*v,e[3]=_*a+x*c+b*f+w*y,_=n[4],x=n[5],b=n[6],w=n[7],e[4]=_*r+x*s+b*h+w*g,e[5]=_*i+x*l+b*d+w*m,e[6]=_*o+x*u+b*p+w*v,e[7]=_*a+x*c+b*f+w*y,_=n[8],x=n[9],b=n[10],w=n[11],e[8]=_*r+x*s+b*h+w*g,e[9]=_*i+x*l+b*d+w*m,e[10]=_*o+x*u+b*p+w*v,e[11]=_*a+x*c+b*f+w*y,_=n[12],x=n[13],b=n[14],w=n[15],e[12]=_*r+x*s+b*h+w*g,e[13]=_*i+x*l+b*d+w*m,e[14]=_*o+x*u+b*p+w*v,e[15]=_*a+x*c+b*f+w*y,e},multiplyAffine:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[4],s=t[5],l=t[6],u=t[8],c=t[9],h=t[10],d=t[12],p=t[13],f=t[14],g=n[0],m=n[1],v=n[2];return e[0]=g*r+m*a+v*u,e[1]=g*i+m*s+v*c,e[2]=g*o+m*l+v*h,g=n[4],m=n[5],v=n[6],e[4]=g*r+m*a+v*u,e[5]=g*i+m*s+v*c,e[6]=g*o+m*l+v*h,g=n[8],m=n[9],v=n[10],e[8]=g*r+m*a+v*u,e[9]=g*i+m*s+v*c,e[10]=g*o+m*l+v*h,g=n[12],m=n[13],v=n[14],e[12]=g*r+m*a+v*u+d,e[13]=g*i+m*s+v*c+p,e[14]=g*o+m*l+v*h+f,e}};Mq.mul=Mq.multiply,Mq.mulAffine=Mq.multiplyAffine,Mq.translate=function(e,t,n){var r,i,o,a,s,l,u,c,h,d,p,f,g=n[0],m=n[1],v=n[2];return t===e?(e[12]=t[0]*g+t[4]*m+t[8]*v+t[12],e[13]=t[1]*g+t[5]*m+t[9]*v+t[13],e[14]=t[2]*g+t[6]*m+t[10]*v+t[14],e[15]=t[3]*g+t[7]*m+t[11]*v+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=r*g+s*m+h*v+t[12],e[13]=i*g+l*m+d*v+t[13],e[14]=o*g+u*m+p*v+t[14],e[15]=a*g+c*m+f*v+t[15]),e},Mq.scale=function(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},Mq.rotate=function(e,t,n,r){var i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,_,x,b,w,S,T,M,C,D,A=r[0],I=r[1],E=r[2],L=Math.sqrt(A*A+I*I+E*E);return Math.abs(L)<jZ?null:(A*=L=1/L,I*=L,E*=L,i=Math.sin(n),a=1-(o=Math.cos(n)),s=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],p=t[6],f=t[7],g=t[8],m=t[9],v=t[10],y=t[11],_=A*A*a+o,x=I*A*a+E*i,b=E*A*a-I*i,w=A*I*a-E*i,S=I*I*a+o,T=E*I*a+A*i,M=A*E*a+I*i,C=I*E*a-A*i,D=E*E*a+o,e[0]=s*_+h*x+g*b,e[1]=l*_+d*x+m*b,e[2]=u*_+p*x+v*b,e[3]=c*_+f*x+y*b,e[4]=s*w+h*S+g*T,e[5]=l*w+d*S+m*T,e[6]=u*w+p*S+v*T,e[7]=c*w+f*S+y*T,e[8]=s*M+h*C+g*D,e[9]=l*M+d*C+m*D,e[10]=u*M+p*C+v*D,e[11]=c*M+f*C+y*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},Mq.rotateX=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+u*r,e[5]=a*i+c*r,e[6]=s*i+h*r,e[7]=l*i+d*r,e[8]=u*i-o*r,e[9]=c*i-a*r,e[10]=h*i-s*r,e[11]=d*i-l*r,e},Mq.rotateY=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-u*r,e[1]=a*i-c*r,e[2]=s*i-h*r,e[3]=l*i-d*r,e[8]=o*r+u*i,e[9]=a*r+c*i,e[10]=s*r+h*i,e[11]=l*r+d*i,e},Mq.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+u*r,e[1]=a*i+c*r,e[2]=s*i+h*r,e[3]=l*i+d*r,e[4]=u*i-o*r,e[5]=c*i-a*r,e[6]=h*i-s*r,e[7]=d*i-l*r,e},Mq.fromRotationTranslation=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,l=i+i,u=o+o,c=r*s,h=r*l,d=r*u,p=i*l,f=i*u,g=o*u,m=a*s,v=a*l,y=a*u;return e[0]=1-(p+g),e[1]=h+y,e[2]=d-v,e[3]=0,e[4]=h-y,e[5]=1-(c+g),e[6]=f+m,e[7]=0,e[8]=d+v,e[9]=f-m,e[10]=1-(c+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},Mq.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return e[0]=1-h-f,e[1]=c+v,e[2]=d-m,e[3]=0,e[4]=c-v,e[5]=1-u-f,e[6]=p+g,e[7]=0,e[8]=d+m,e[9]=p-g,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},Mq.frustum=function(e,t,n,r,i,o,a){var s=1/(n-t),l=1/(i-r),u=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e},Mq.perspective=function(e,t,n,r,i){var o=1/Math.tan(t/2),a=1/(r-i);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*a,e[15]=0,e},Mq.ortho=function(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*u,e[15]=1,e},Mq.lookAt=function(e,t,n,r){var i,o,a,s,l,u,c,h,d,p,f=t[0],g=t[1],m=t[2],v=r[0],y=r[1],_=r[2],x=n[0],b=n[1],w=n[2];return Math.abs(f-x)<jZ&&Math.abs(g-b)<jZ&&Math.abs(m-w)<jZ?Mq.identity(e):(c=f-x,h=g-b,d=m-w,i=y*(d*=p=1/Math.sqrt(c*c+h*h+d*d))-_*(h*=p),o=_*(c*=p)-v*d,a=v*h-y*c,(p=Math.sqrt(i*i+o*o+a*a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-d*o,l=d*i-c*a,u=c*o-h*i,(p=Math.sqrt(s*s+l*l+u*u))?(s*=p=1/p,l*=p,u*=p):(s=0,l=0,u=0),e[0]=i,e[1]=s,e[2]=c,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=a,e[9]=u,e[10]=d,e[11]=0,e[12]=-(i*f+o*g+a*m),e[13]=-(s*f+l*g+u*m),e[14]=-(c*f+h*g+d*m),e[15]=1,e)},Mq.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))};var Cq={create:function(){var e=new XZ(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new XZ(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,n){var r=new XZ(3);return r[0]=e,r[1]=t,r[2]=n,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}};Cq.sub=Cq.subtract,Cq.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},Cq.mul=Cq.multiply,Cq.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},Cq.div=Cq.divide,Cq.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},Cq.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},Cq.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},Cq.scaleAndAdd=function(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},Cq.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+r*r+i*i)},Cq.dist=Cq.distance,Cq.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i},Cq.sqrDist=Cq.squaredDistance,Cq.length=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)},Cq.len=Cq.length,Cq.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},Cq.sqrLen=Cq.squaredLength,Cq.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},Cq.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},Cq.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o),e},Cq.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},Cq.cross=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e},Cq.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e},Cq.random=function(e,t){t=t||1;var n=2*YZ()*Math.PI,r=2*YZ()-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e},Cq.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e},Cq.transformMat3=function(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e},Cq.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return e[0]=c*u+p*-a+h*-l-d*-s,e[1]=h*u+p*-s+d*-a-c*-l,e[2]=d*u+p*-l+c*-s-h*-a,e},Cq.rotateX=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Cq.rotateY=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Cq.rotateZ=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Cq.forEach=function(){var e=Cq.create();return function(t,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}(),Cq.angle=function(e,t){var n=Cq.fromValues(e[0],e[1],e[2]),r=Cq.fromValues(t[0],t[1],t[2]);Cq.normalize(n,n),Cq.normalize(r,r);var i=Cq.dot(n,r);return i>1?0:Math.acos(i)},bq.import(Tq);var Dq=Mq.create,Aq={};function Iq(e){return e.material}function Eq(e,t,n){return t.uniforms[n].value}function Lq(e,t,n,r){return n!==r}function Nq(e){return!0}function Pq(){}var Oq={float:qY,byte:UY,ubyte:WY,short:jY,ushort:XY};function Rq(e,t,n){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=n,this.vao=null}function kq(e){var t,n;this.bind=function(e){t||((t=wZ.createCanvas()).width=t.height=1,t.getContext("2d"));var r=e.gl,i=!n;i&&(n=r.createTexture()),r.bindTexture(r.TEXTURE_2D,n),i&&r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var zq=bY.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=wZ.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new TY(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(e){throw"Error creating WebGL Context "+e}this._programMgr=new oq(this),this._placeholderTexture=new kq}),{resize:function(e,t){var n=this.canvas,r=this.devicePixelRatio;null!=e?(n.style&&(n.style.width=e+"px",n.style.height=t+"px"),n.width=e*r,n.height=t*r,this._width=e,this._height=t):(this._width=n.width/r,this._height=n.height/r),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,n,r,i){if("object"==typeof e){var o=e;e=o.x,t=o.y,n=o.width,r=o.height,i=o.devicePixelRatio}i=i||this.devicePixelRatio,this.gl.viewport(e*i,t*i,n*i,r*i),this.viewport={x:e,y:t,width:n,height:r,devicePixelRatio:i}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,n,r){var i=this.gl,o=this.clearColor;if(this.clearBit){i.colorMask(!0,!0,!0,!0),i.depthMask(!0);var a=this.viewport,s=!1,l=a.devicePixelRatio;(a.width!==this._width||a.height!==this._height||l&&l!==this.devicePixelRatio||a.x||a.y)&&(s=!0,i.enable(i.SCISSOR_TEST),i.scissor(a.x*l,a.y*l,a.width*l,a.height*l)),i.clearColor(o[0],o[1],o[2],o[3]),i.clear(this.clearBit),s&&i.disable(i.SCISSOR_TEST)}if(n||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var c=u.opaque,h=u.transparent,d=e.material;e.trigger("beforerender",this,e,t,u),r?(this.renderPreZ(c,e,t),i.depthFunc(i.LEQUAL)):i.depthFunc(i.LESS);for(var p=Dq(),f=Cq.create(),g=0;g<h.length;g++){var m=h[g];Mq.multiplyAffine(p,t.viewMatrix.array,m.worldTransform.array),Cq.transformMat4(f,m.position.array,p),m.__depth=f[2]}this.renderPass(c,t,{getMaterial:function(e){return d||e.material},sortCompare:this.opaqueSortCompare}),this.renderPass(h,t,{getMaterial:function(e){return d||e.material},sortCompare:this.transparentSortCompare}),e.trigger("afterrender",this,e,t,u),this._sceneRendering=null}else console.error("Can't find camera in the scene.")},getProgram:function(e,t,n){return t=t||e.material,this._programMgr.getProgram(e,t,n)},validateProgram:function(e){if(e.__error){var t=e.__error;if(Aq[e.__uid__])return;if(Aq[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,n){var r=n&&n.getMaterial||Iq;t=t||null;for(var i=0;i<e.length;i++){var o=e[i],a=r.call(this,o);if(i>0){var s=e[i-1],l=s.joints?s.joints.length:0;if((o.joints?o.joints.length:0)===l&&o.material===s.material&&o.lightGroup===s.lightGroup){o.__program=s.__program;continue}}var u=this._programMgr.getProgram(o,a,t);this.validateProgram(u),o.__program=u}},renderPass:function(e,t,n){this.trigger("beforerenderpass",this,e,t,n),(n=n||{}).getMaterial=n.getMaterial||Iq,n.getUniform=n.getUniform||Eq,n.isMaterialChanged=n.isMaterialChanged||Lq,n.beforeRender=n.beforeRender||Pq,n.afterRender=n.afterRender||Pq;var r=n.ifRender||Nq;this.updatePrograms(e,this._sceneRendering,n),n.sortCompare&&e.sort(n.sortCompare);var i=this.viewport,o=i.devicePixelRatio,a=[i.x*o,i.y*o,i.width*o,i.height*o],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[a[2],a[3]],c=Date.now();t?(Mq.copy(Vq.VIEW,t.viewMatrix.array),Mq.copy(Vq.PROJECTION,t.projectionMatrix.array),Mq.copy(Vq.VIEWINVERSE,t.worldTransform.array)):(Mq.identity(Vq.VIEW),Mq.identity(Vq.PROJECTION),Mq.identity(Vq.VIEWINVERSE)),Mq.multiply(Vq.VIEWPROJECTION,Vq.PROJECTION,Vq.VIEW),Mq.invert(Vq.PROJECTIONINVERSE,Vq.PROJECTION),Mq.invert(Vq.VIEWPROJECTIONINVERSE,Vq.VIEWPROJECTION);for(var h,d,p,f,g,m,v,y,_,x,b,w,S=this.gl,T=this._sceneRendering,M=0;M<e.length;M++){var C,D=e[M],A=null!=D.worldTransform;if(r(D)){A&&(C=D.isSkinnedMesh&&D.isSkinnedMesh()?D.offsetMatrix?D.offsetMatrix.array:Vq.IDENTITY:D.worldTransform.array);var I=D.geometry,E=n.getMaterial.call(this,D),L=D.__program,N=E.shader,P=I.__uid__+"-"+L.__uid__,O=P!==x;x=P,A&&(Mq.copy(Vq.WORLD,C),Mq.multiply(Vq.WORLDVIEWPROJECTION,Vq.VIEWPROJECTION,C),Mq.multiplyAffine(Vq.WORLDVIEW,Vq.VIEW,C),(N.matrixSemantics.WORLDINVERSE||N.matrixSemantics.WORLDINVERSETRANSPOSE)&&Mq.invert(Vq.WORLDINVERSE,C),(N.matrixSemantics.WORLDVIEWINVERSE||N.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&Mq.invert(Vq.WORLDVIEWINVERSE,Vq.WORLDVIEW),(N.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||N.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&Mq.invert(Vq.WORLDVIEWPROJECTIONINVERSE,Vq.WORLDVIEWPROJECTION)),D.beforeRender&&D.beforeRender(this),n.beforeRender.call(this,D,E,h);var R=L!==d;R?(L.bind(this),L.setUniformOfSemantic(S,"VIEWPORT",a),L.setUniformOfSemantic(S,"WINDOW_SIZE",l),t&&(L.setUniformOfSemantic(S,"NEAR",t.near),L.setUniformOfSemantic(S,"FAR",t.far)),L.setUniformOfSemantic(S,"DEVICEPIXELRATIO",o),L.setUniformOfSemantic(S,"TIME",c),L.setUniformOfSemantic(S,"VIEWPORT_SIZE",u),T&&T.setLightUniforms(L,D.lightGroup,this)):L=d,(R||n.isMaterialChanged(D,p,E,h))&&(E.depthTest!==f&&(E.depthTest?S.enable(S.DEPTH_TEST):S.disable(S.DEPTH_TEST),f=E.depthTest),E.depthMask!==g&&(S.depthMask(E.depthMask),g=E.depthMask),E.transparent!==_&&(E.transparent?S.enable(S.BLEND):S.disable(S.BLEND),_=E.transparent),E.transparent&&(E.blend?E.blend(S):(S.blendEquationSeparate(S.FUNC_ADD,S.FUNC_ADD),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA))),w=this._bindMaterial(D,E,L,p||null,h||null,d||null,n.getUniform),h=E);var k=N.matrixSemanticKeys;if(A)for(var z=0;z<k.length;z++){var V=k[z],B=N.matrixSemantics[V],F=Vq[V];if(B.isTranspose){var G=Vq[B.semanticNoTranspose];Mq.transpose(F,G)}L.setUniform(S,B.type,B.symbol,F)}D.cullFace!==v&&(v=D.cullFace,S.cullFace(v)),D.frontFace!==y&&(y=D.frontFace,S.frontFace(y)),D.culling!==m&&((m=D.culling)?S.enable(S.CULL_FACE):S.disable(S.CULL_FACE)),this._updateSkeleton(D,L,w),O&&(b=this._bindVAO(null,N,I,L)),this._renderObject(D,b,L),n.afterRender(this,D),D.afterRender&&D.afterRender(this),d=L,p=D}}this.trigger("afterrenderpass",this,e,t,n)},getMaxJointNumber:function(){return this.maxJointNumber},_updateSkeleton:function(e,t,n){var r=this.gl,i=e.skeleton;if(i)if(i.update(),e.joints.length>this.getMaxJointNumber()){var o=i.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,o,n),t.setUniform(r,"1i","skinMatricesTexture",n),t.setUniform(r,"1f","skinMatricesTextureSize",o.width)}else{var a=i.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(r,"SKIN_MATRIX",a)}},_renderObject:function(e,t,n){var r=this.gl,i=e.geometry,o=e.mode;null==o&&(o=4);var a=null,s=e.isInstancedMesh&&e.isInstancedMesh();if(!s||(a=this.getGLExtension("ANGLE_instanced_arrays"))){var l;if(s&&(l=this._bindInstancedAttributes(e,n,a)),t.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint")&&i.indices instanceof Uint32Array?r.UNSIGNED_INT:r.UNSIGNED_SHORT;s?a.drawElementsInstancedANGLE(o,t.indicesBuffer.count,u,0,e.getInstanceCount()):r.drawElements(o,t.indicesBuffer.count,u,0)}else s?a.drawArraysInstancedANGLE(o,0,i.vertexCount,e.getInstanceCount()):r.drawArrays(o,0,i.vertexCount);if(s)for(var c=0;c<l.length;c++)r.disableVertexAttribArray(l[c])}else console.warn("Device not support ANGLE_instanced_arrays extension")},_bindInstancedAttributes:function(e,t,n){for(var r=this.gl,i=e.getInstancedAttributesBuffers(this),o=[],a=0;a<i.length;a++){var s=i[a],l=t.getAttribLocation(r,s.symbol);if(!(l<0)){var u=Oq[s.type]||r.FLOAT;r.enableVertexAttribArray(l),r.bindBuffer(r.ARRAY_BUFFER,s.buffer),r.vertexAttribPointer(l,s.size,u,!1,0,0),n.vertexAttribDivisorANGLE(l,s.divisor),o.push(l)}}return o},_bindMaterial:function(e,t,n,r,i,o,a){for(var s=this.gl,l=o===n,u=n.currentTextureSlot(),c=t.getEnabledUniforms(),h=t.getTextureUniforms(),d=this._placeholderTexture,p=0;p<h.length;p++){var f=a(e,t,v=h[p]);if("t"===(m=t.uniforms[v].type)&&f)f.__slot=-1;else if("tv"===m)for(var g=0;g<f.length;g++)f[g]&&(f[g].__slot=-1)}d.__slot=-1;for(p=0;p<c.length;p++){var m,v=c[p],y=t.uniforms[v],_=(f=a(e,t,v),"t"===(m=y.type));if(_&&(f&&f.isRenderable()||(f=d)),i&&l){var x=a(r,i,v);if(_&&(x&&x.isRenderable()||(x=d)),x===f){if(_)n.takeCurrentTextureSlot(this,null);else if("tv"===m&&f)for(g=0;g<f.length;g++)n.takeCurrentTextureSlot(this,null);continue}}if(null!=f)if(_)if(f.__slot<0){var b=n.currentTextureSlot();n.setUniform(s,"1i",v,b)&&(n.takeCurrentTextureSlot(this,f),f.__slot=b)}else n.setUniform(s,"1i",v,f.__slot);else if(Array.isArray(f)){if(0===f.length)continue;if("tv"===m){if(!n.hasUniform(v))continue;var w=[];for(g=0;g<f.length;g++){var S=f[g];if(S.__slot<0){b=n.currentTextureSlot();w.push(b),n.takeCurrentTextureSlot(this,S),S.__slot=b}else w.push(S.__slot)}n.setUniform(s,"1iv",v,w)}else n.setUniform(s,y.type,v,f)}else n.setUniform(s,y.type,v,f)}var T=n.currentTextureSlot();return n.resetTextureSlot(u),T},_bindVAO:function(e,t,n,r){var i=!n.dynamic,o=this.gl,a=this.__uid__+"-"+r.__uid__,s=n.__vaoCache[a];if(!s){var l=n.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],c=u.attributeBuffers,h=u.indicesBuffer,d=[],p=[],f=0;f<c.length;f++){var g,m=(w=c[f]).name,v=w.semantic;if(v){var y=t.attributeSemantics[v];g=y&&y.symbol}else g=m;g&&r.attributes[g]&&(d.push(w),p.push(g))}s=new Rq(d,p,h),i&&(n.__vaoCache[a]=s)}var _=!0;e&&i&&(null==s.vao?s.vao=e.createVertexArrayOES():_=!1,e.bindVertexArrayOES(s.vao));d=s.availableAttributes,h=s.indicesBuffer;if(_){var x=r.enableAttributes(this,s.availableAttributeSymbols,e&&i&&s);for(f=0;f<d.length;f++){var b=x[f];if(-1!==b){var w,S=(w=d[f]).buffer,T=w.size,M=Oq[w.type]||o.FLOAT;o.bindBuffer(o.ARRAY_BUFFER,S),o.vertexAttribPointer(b,T,M,!1,0,0)}}n.isUseIndices()&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.buffer)}return s},renderPreZ:function(e,t,n){var r=this.gl,i=this._prezMaterial||new WZ({shader:new bq(bq.source("clay.prez.vertex"),bq.source("clay.prez.fragment"))});this._prezMaterial=i,r.colorMask(!1,!1,!1,!1),r.depthMask(!0),this.renderPass(e,n,{ifRender:function(e){return!e.ignorePreZ},isMaterialChanged:function(e,t){var n=e.material,r=t.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)},getUniform:function(e,t,n){return"alphaMap"===n?e.material.get("diffuseMap"):"alphaCutoff"===n?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:"uvRepeat"===n?e.material.get("uvRepeat"):"uvOffset"===n?e.material.get("uvOffset"):t.get(n)},getMaterial:function(){return i},sort:this.opaqueSortCompare}),r.colorMask(!0,!0,!0,!0),r.depthMask(!0)},disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,t,n){e.getParent()&&e.getParent().remove(e);var r={};e.traverse((function(e){var i=e.material;if(e.geometry&&t&&e.geometry.dispose(this),n&&i&&!r[i.__uid__]){for(var o=i.getTextureUniforms(),a=0;a<o.length;a++){var s=o[a],l=i.uniforms[s].value,u=i.uniforms[s].type;if(l)if("t"===u)l.dispose&&l.dispose(this);else if("tv"===u)for(var c=0;c<l.length;c++)l[c]&&l[c].dispose&&l[c].dispose(this)}r[i.__uid__]=!0}e.dispose&&e.dispose(this)}),this)},disposeGeometry:function(e){e.dispose(this)},disposeTexture:function(e){e.dispose(this)},disposeFrameBuffer:function(e){e.dispose(this)},dispose:function(){},screenToNDC:function(e,t,n){n||(n=new qZ),t=this._height-t;var r=this.viewport,i=n.array;return i[0]=(e-r.x)/r.width,i[0]=2*i[0]-1,i[1]=(t-r.y)/r.height,i[1]=2*i[1]-1,n}});zq.opaqueSortCompare=zq.prototype.opaqueSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.renderOrder-t.renderOrder},zq.transparentSortCompare=zq.prototype.transparentSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__depth===t.__depth?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.__depth-t.__depth:e.renderOrder-t.renderOrder};var Vq={IDENTITY:Dq(),WORLD:Dq(),VIEW:Dq(),PROJECTION:Dq(),WORLDVIEW:Dq(),VIEWPROJECTION:Dq(),WORLDVIEWPROJECTION:Dq(),WORLDINVERSE:Dq(),VIEWINVERSE:Dq(),PROJECTIONINVERSE:Dq(),WORLDVIEWINVERSE:Dq(),VIEWPROJECTIONINVERSE:Dq(),WORLDVIEWPROJECTIONINVERSE:Dq(),WORLDTRANSPOSE:Dq(),VIEWTRANSPOSE:Dq(),PROJECTIONTRANSPOSE:Dq(),WORLDVIEWTRANSPOSE:Dq(),VIEWPROJECTIONTRANSPOSE:Dq(),WORLDVIEWPROJECTIONTRANSPOSE:Dq(),WORLDINVERSETRANSPOSE:Dq(),VIEWINVERSETRANSPOSE:Dq(),PROJECTIONINVERSETRANSPOSE:Dq(),WORLDVIEWINVERSETRANSPOSE:Dq(),VIEWPROJECTIONINVERSETRANSPOSE:Dq(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:Dq()};zq.COLOR_BUFFER_BIT=DY,zq.DEPTH_BUFFER_BIT=MY,zq.STENCIL_BUFFER_BIT=CY;var Bq=function(e,t,n){e=e||0,t=t||0,n=n||0,this.array=Cq.fromValues(e,t,n),this._dirty=!0};Bq.prototype={constructor:Bq,add:function(e){return Cq.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new Bq(this.x,this.y,this.z)},copy:function(e){return Cq.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return Cq.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return Cq.dist(this.array,e.array)},distance:function(e){return Cq.distance(this.array,e.array)},div:function(e){return Cq.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return Cq.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return Cq.dot(this.array,e.array)},len:function(){return Cq.len(this.array)},length:function(){return Cq.length(this.array)},lerp:function(e,t,n){return Cq.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return Cq.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return Cq.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return Cq.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return Cq.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return Cq.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Cq.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return Cq.random(this.array,e),this._dirty=!0,this},scale:function(e){return Cq.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return Cq.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return Cq.sqrDist(this.array,e.array)},squaredDistance:function(e){return Cq.squaredDistance(this.array,e.array)},sqrLen:function(){return Cq.sqrLen(this.array)},squaredLength:function(){return Cq.squaredLength(this.array)},sub:function(e){return Cq.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return Cq.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return Cq.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return Cq.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return Cq.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t=this.array;if(0===(e=e.array)[15]){var n=-1/t[2];t[0]=e[0]*t[0]*n,t[1]=e[5]*t[1]*n,t[2]=(e[10]*t[2]+e[14])*n}else t[0]=e[0]*t[0]+e[12],t[1]=e[5]*t[1]+e[13],t[2]=e[10]*t[2]+e[14];return this._dirty=!0,this},eulerFromQuat:function(e,t){Bq.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){Bq.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Fq=Object.defineProperty;if(Fq){var Gq=Bq.prototype;Fq(Gq,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Fq(Gq,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),Fq(Gq,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function Hq(e,t,n){return e<t?t:e>n?n:e}Bq.add=function(e,t,n){return Cq.add(e.array,t.array,n.array),e._dirty=!0,e},Bq.set=function(e,t,n,r){Cq.set(e.array,t,n,r),e._dirty=!0},Bq.copy=function(e,t){return Cq.copy(e.array,t.array),e._dirty=!0,e},Bq.cross=function(e,t,n){return Cq.cross(e.array,t.array,n.array),e._dirty=!0,e},Bq.distance=Bq.dist=function(e,t){return Cq.distance(e.array,t.array)},Bq.div=function(e,t,n){return Cq.divide(e.array,t.array,n.array),e._dirty=!0,e},Bq.divide=Bq.div,Bq.dot=function(e,t){return Cq.dot(e.array,t.array)},Bq.len=function(e){return Cq.length(e.array)},Bq.lerp=function(e,t,n,r){return Cq.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},Bq.min=function(e,t,n){return Cq.min(e.array,t.array,n.array),e._dirty=!0,e},Bq.max=function(e,t,n){return Cq.max(e.array,t.array,n.array),e._dirty=!0,e},Bq.mul=function(e,t,n){return Cq.multiply(e.array,t.array,n.array),e._dirty=!0,e},Bq.multiply=Bq.mul,Bq.negate=function(e,t){return Cq.negate(e.array,t.array),e._dirty=!0,e},Bq.normalize=function(e,t){return Cq.normalize(e.array,t.array),e._dirty=!0,e},Bq.random=function(e,t){return Cq.random(e.array,t),e._dirty=!0,e},Bq.scale=function(e,t,n){return Cq.scale(e.array,t.array,n),e._dirty=!0,e},Bq.scaleAndAdd=function(e,t,n,r){return Cq.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},Bq.squaredDistance=Bq.sqrDist=function(e,t){return Cq.sqrDist(e.array,t.array)},Bq.squaredLength=Bq.sqrLen=function(e){return Cq.sqrLen(e.array)},Bq.sub=function(e,t,n){return Cq.subtract(e.array,t.array,n.array),e._dirty=!0,e},Bq.subtract=Bq.sub,Bq.transformMat3=function(e,t,n){return Cq.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},Bq.transformMat4=function(e,t,n){return Cq.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},Bq.transformQuat=function(e,t,n){return Cq.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var Uq=Math.atan2,Wq=Math.asin,jq=Math.abs;Bq.eulerFromQuat=function(e,t,n){e._dirty=!0,t=t.array;var r=e.array,i=t[0],o=t[1],a=t[2],s=t[3],l=i*i,u=o*o,c=a*a,h=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=Uq(2*(i*s-o*a),h-l-u+c),r[1]=Wq(Hq(2*(i*a+o*s),-1,1)),r[2]=Uq(2*(a*s-i*o),h+l-u-c);break;case"YXZ":r[0]=Wq(Hq(2*(i*s-o*a),-1,1)),r[1]=Uq(2*(i*a+o*s),h-l-u+c),r[2]=Uq(2*(i*o+a*s),h-l+u-c);break;case"ZXY":r[0]=Wq(Hq(2*(i*s+o*a),-1,1)),r[1]=Uq(2*(o*s-a*i),h-l-u+c),r[2]=Uq(2*(a*s-i*o),h-l+u-c);break;case"ZYX":r[0]=Uq(2*(i*s+a*o),h-l-u+c),r[1]=Wq(Hq(2*(o*s-i*a),-1,1)),r[2]=Uq(2*(i*o+a*s),h+l-u-c);break;case"YZX":r[0]=Uq(2*(i*s-a*o),h-l+u-c),r[1]=Uq(2*(o*s-i*a),h+l-u-c),r[2]=Wq(Hq(2*(i*o+a*s),-1,1));break;case"XZY":r[0]=Uq(2*(i*s+o*a),h-l+u-c),r[1]=Uq(2*(i*a+o*s),h+l-u-c),r[2]=Wq(Hq(2*(a*s-i*o),-1,1));break;default:console.warn("Unkown order: "+n)}return e},Bq.eulerFromMat3=function(e,t,n){var r=t.array,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],u=r[7],c=r[2],h=r[5],d=r[8],p=e.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":p[1]=Wq(Hq(a,-1,1)),jq(a)<.99999?(p[0]=Uq(-u,d),p[2]=Uq(-o,i)):(p[0]=Uq(h,l),p[2]=0);break;case"YXZ":p[0]=Wq(-Hq(u,-1,1)),jq(u)<.99999?(p[1]=Uq(a,d),p[2]=Uq(s,l)):(p[1]=Uq(-c,i),p[2]=0);break;case"ZXY":p[0]=Wq(Hq(h,-1,1)),jq(h)<.99999?(p[1]=Uq(-c,d),p[2]=Uq(-o,l)):(p[1]=0,p[2]=Uq(s,i));break;case"ZYX":p[1]=Wq(-Hq(c,-1,1)),jq(c)<.99999?(p[0]=Uq(h,d),p[2]=Uq(s,i)):(p[0]=0,p[2]=Uq(-o,l));break;case"YZX":p[2]=Wq(Hq(s,-1,1)),jq(s)<.99999?(p[0]=Uq(-u,l),p[1]=Uq(-c,i)):(p[0]=0,p[1]=Uq(a,d));break;case"XZY":p[2]=Wq(-Hq(o,-1,1)),jq(o)<.99999?(p[0]=Uq(h,l),p[1]=Uq(a,i)):(p[0]=Uq(-u,d),p[1]=0);break;default:console.warn("Unkown order: "+n)}return e._dirty=!0,e},Object.defineProperties(Bq,{POSITIVE_X:{get:function(){return new Bq(1,0,0)}},NEGATIVE_X:{get:function(){return new Bq(-1,0,0)}},POSITIVE_Y:{get:function(){return new Bq(0,1,0)}},NEGATIVE_Y:{get:function(){return new Bq(0,-1,0)}},POSITIVE_Z:{get:function(){return new Bq(0,0,1)}},NEGATIVE_Z:{get:function(){return new Bq(0,0,-1)}},UP:{get:function(){return new Bq(0,1,0)}},ZERO:{get:function(){return new Bq}}});var Xq,Yq,Zq,qq,Kq=function(e,t){this.origin=e||new Bq,this.direction=t||new Bq};Kq.prototype={constructor:Kq,intersectPlane:function(e,t){var n=e.normal.array,r=e.distance,i=this.origin.array,o=this.direction.array,a=Cq.dot(n,o);if(0===a)return null;t||(t=new Bq);var s=(Cq.dot(n,i)-r)/a;return Cq.scaleAndAdd(t.array,i,o,-s),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=Cq.dot(e.normal.array,this.direction.array);Cq.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:function(){var e=Cq.create();return function(t){Cq.sub(e,t,this.origin.array);var n=Cq.dot(e,this.direction.array);if(n<0)return Cq.distance(this.origin.array,t);var r=Cq.lenSquared(e);return Math.sqrt(r-n*n)}}(),intersectSphere:function(){var e=Cq.create();return function(t,n,r){var i=this.origin.array,o=this.direction.array;t=t.array,Cq.sub(e,t,i);var a=Cq.dot(e,o),s=Cq.squaredLength(e)-a*a,l=n*n;if(!(s>l)){var u=Math.sqrt(l-s),c=a-u,h=a+u;return r||(r=new Bq),c<0?h<0?null:(Cq.scaleAndAdd(r.array,i,o,h),r):(Cq.scaleAndAdd(r.array,i,o,c),r)}}}(),intersectBoundingBox:function(e,t){var n,r,i,o,a,s,l=this.direction.array,u=this.origin.array,c=e.min.array,h=e.max.array,d=1/l[0],p=1/l[1],f=1/l[2];if(d>=0?(n=(c[0]-u[0])*d,r=(h[0]-u[0])*d):(r=(c[0]-u[0])*d,n=(h[0]-u[0])*d),p>=0?(i=(c[1]-u[1])*p,o=(h[1]-u[1])*p):(o=(c[1]-u[1])*p,i=(h[1]-u[1])*p),n>o||i>r)return null;if((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),f>=0?(a=(c[2]-u[2])*f,s=(h[2]-u[2])*f):(s=(c[2]-u[2])*f,a=(h[2]-u[2])*f),n>s||a>r)return null;if((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0)return null;var g=n>=0?n:r;return t||(t=new Bq),Cq.scaleAndAdd(t.array,u,l,g),t},intersectTriangle:(Xq=Cq.create(),Yq=Cq.create(),Zq=Cq.create(),qq=Cq.create(),function(e,t,n,r,i,o){var a=this.direction.array,s=this.origin.array;e=e.array,t=t.array,n=n.array,Cq.sub(Xq,t,e),Cq.sub(Yq,n,e),Cq.cross(qq,Yq,a);var l=Cq.dot(Xq,qq);if(r){if(l>-1e-5)return null}else if(l>-1e-5&&l<1e-5)return null;Cq.sub(Zq,s,e);var u=Cq.dot(qq,Zq)/l;if(u<0||u>1)return null;Cq.cross(qq,Xq,Zq);var c=Cq.dot(a,qq)/l;if(c<0||c>1||u+c>1)return null;Cq.cross(qq,Xq,Yq);var h=-Cq.dot(Zq,qq)/l;return h<0?null:(i||(i=new Bq),o&&Bq.set(o,1-u-c,u,c),Cq.scaleAndAdd(i.array,s,a,h),i)}),applyTransform:function(e){Bq.add(this.direction,this.direction,this.origin),Bq.transformMat4(this.origin,this.origin,e),Bq.transformMat4(this.direction,this.direction,e),Bq.sub(this.direction,this.direction,this.origin),Bq.normalize(this.direction,this.direction)},copy:function(e){Bq.copy(this.origin,e.origin),Bq.copy(this.direction,e.direction)},clone:function(){var e=new Kq;return e.copy(this),e}};var $q={create:function(){var e=new XZ(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new XZ(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,n,r){var i=new XZ(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}};$q.sub=$q.subtract,$q.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},$q.mul=$q.multiply,$q.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e},$q.div=$q.divide,$q.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e},$q.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e},$q.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},$q.scaleAndAdd=function(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[3]=t[3]+n[3]*r,e},$q.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(n*n+r*r+i*i+o*o)},$q.dist=$q.distance,$q.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return n*n+r*r+i*i+o*o},$q.sqrDist=$q.squaredDistance,$q.length=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)},$q.len=$q.length,$q.squaredLength=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i},$q.sqrLen=$q.squaredLength,$q.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},$q.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},$q.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a),e},$q.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},$q.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e[3]=s+r*(n[3]-s),e},$q.random=function(e,t){return t=t||1,e[0]=YZ(),e[1]=YZ(),e[2]=YZ(),e[3]=YZ(),$q.normalize(e,e),$q.scale(e,e,t),e},$q.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e},$q.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return e[0]=c*u+p*-a+h*-l-d*-s,e[1]=h*u+p*-s+d*-a-c*-l,e[2]=d*u+p*-l+c*-s-h*-a,e},$q.forEach=function(){var e=$q.create();return function(t,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var Jq={create:function(){var e=new XZ(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new XZ(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=c*a-s*u,d=-c*o+s*l,p=u*o-a*l,f=n*h+r*d+i*p;return f?(f=1/f,e[0]=h*f,e[1]=(-c*r+i*u)*f,e[2]=(s*r-i*a)*f,e[3]=d*f,e[4]=(c*n-i*l)*f,e[5]=(-s*n+i*o)*f,e[6]=p*f,e[7]=(-u*n+r*l)*f,e[8]=(a*n-r*o)*f,e):null},adjoint:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8];return e[0]=a*c-s*u,e[1]=i*u-r*c,e[2]=r*s-i*a,e[3]=s*l-o*c,e[4]=n*c-i*l,e[5]=i*o-n*s,e[6]=o*u-a*l,e[7]=r*l-n*u,e[8]=n*a-r*o,e},determinant:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8];return t*(u*o-a*l)+n*(-u*i+a*s)+r*(l*i-o*s)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],p=n[1],f=n[2],g=n[3],m=n[4],v=n[5],y=n[6],_=n[7],x=n[8];return e[0]=d*r+p*a+f*u,e[1]=d*i+p*s+f*c,e[2]=d*o+p*l+f*h,e[3]=g*r+m*a+v*u,e[4]=g*i+m*s+v*c,e[5]=g*o+m*l+v*h,e[6]=y*r+_*a+x*u,e[7]=y*i+_*s+x*c,e[8]=y*o+_*l+x*h,e}};Jq.mul=Jq.multiply,Jq.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=d*r+p*a+u,e[7]=d*i+p*s+c,e[8]=d*o+p*l+h,e},Jq.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=Math.sin(n),p=Math.cos(n);return e[0]=p*r+d*a,e[1]=p*i+d*s,e[2]=p*o+d*l,e[3]=p*a-d*r,e[4]=p*s-d*i,e[5]=p*l-d*o,e[6]=u,e[7]=c,e[8]=h,e},Jq.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},Jq.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},Jq.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return e[0]=1-h-f,e[3]=c-v,e[6]=d+m,e[1]=c+v,e[4]=1-u-f,e[7]=p-g,e[2]=d-m,e[5]=p+g,e[8]=1-u-h,e},Jq.normalFromMat4=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=c*g-h*f,M=c*m-d*f,C=c*v-p*f,D=h*m-d*g,A=h*v-p*g,I=d*v-p*m,E=y*I-_*A+x*D+b*C-w*M+S*T;return E?(E=1/E,e[0]=(s*I-l*A+u*D)*E,e[1]=(l*C-a*I-u*M)*E,e[2]=(a*A-s*C+u*T)*E,e[3]=(i*A-r*I-o*D)*E,e[4]=(n*I-i*C+o*M)*E,e[5]=(r*C-n*A-o*T)*E,e[6]=(g*S-m*w+v*b)*E,e[7]=(m*x-f*S-v*_)*E,e[8]=(f*w-g*x+v*y)*E,e):null},Jq.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))};var Qq,eK,tK,nK,rK={};rK.create=function(){var e=new XZ(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},rK.rotationTo=(Qq=Cq.create(),eK=Cq.fromValues(1,0,0),tK=Cq.fromValues(0,1,0),function(e,t,n){var r=Cq.dot(t,n);return r<-.999999?(Cq.cross(Qq,eK,t),Cq.length(Qq)<1e-6&&Cq.cross(Qq,tK,t),Cq.normalize(Qq,Qq),rK.setAxisAngle(e,Qq,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Cq.cross(Qq,t,n),e[0]=Qq[0],e[1]=Qq[1],e[2]=Qq[2],e[3]=1+r,rK.normalize(e,e))}),rK.setAxes=(nK=Jq.create(),function(e,t,n,r){return nK[0]=n[0],nK[3]=n[1],nK[6]=n[2],nK[1]=r[0],nK[4]=r[1],nK[7]=r[2],nK[2]=-t[0],nK[5]=-t[1],nK[8]=-t[2],rK.normalize(e,rK.fromMat3(e,nK))}),rK.clone=$q.clone,rK.fromValues=$q.fromValues,rK.copy=$q.copy,rK.set=$q.set,rK.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},rK.setAxisAngle=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e},rK.add=$q.add,rK.multiply=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*c+a*s+i*u-o*l,e[1]=i*c+a*l+o*s-r*u,e[2]=o*c+a*u+r*l-i*s,e[3]=a*c-r*s-i*l-o*u,e},rK.mul=rK.multiply,rK.scale=$q.scale,rK.rotateX=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-r*s,e},rK.rotateY=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=i*l+a*s,e[2]=o*l+r*s,e[3]=a*l-i*s,e},rK.rotateZ=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=i*l-r*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},rK.calculateW=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e},rK.dot=$q.dot,rK.lerp=$q.lerp,rK.slerp=function(e,t,n,r){var i,o,a,s,l,u=t[0],c=t[1],h=t[2],d=t[3],p=n[0],f=n[1],g=n[2],m=n[3];return(o=u*p+c*f+h*g+d*m)<0&&(o=-o,p=-p,f=-f,g=-g,m=-m),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,l=Math.sin(r*i)/a):(s=1-r,l=r),e[0]=s*u+l*p,e[1]=s*c+l*f,e[2]=s*h+l*g,e[3]=s*d+l*m,e},rK.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e},rK.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},rK.length=$q.length,rK.len=rK.length,rK.squaredLength=$q.squaredLength,rK.sqrLen=rK.squaredLength,rK.normalize=$q.normalize,rK.fromMat3=function(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*o+a]-t[3*a+o])*n,e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e};var iK=function(){this._axisX=new Bq,this._axisY=new Bq,this._axisZ=new Bq,this.array=Mq.create(),this._dirty=!0};iK.prototype={constructor:iK,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return Mq.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new iK).copy(this)},copy:function(e){return Mq.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return Mq.determinant(this.array)},fromQuat:function(e){return Mq.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return Mq.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return iK.fromMat2d(this,e),this},frustum:function(e,t,n,r,i,o){return Mq.frustum(this.array,e,t,n,r,i,o),this._dirty=!0,this},identity:function(){return Mq.identity(this.array),this._dirty=!0,this},invert:function(){return Mq.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,n){return Mq.lookAt(this.array,e.array,t.array,n.array),this._dirty=!0,this},mul:function(e){return Mq.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return Mq.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return Mq.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return Mq.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,n,r,i,o){return Mq.ortho(this.array,e,t,n,r,i,o),this._dirty=!0,this},perspective:function(e,t,n,r){return Mq.perspective(this.array,e,t,n,r),this._dirty=!0,this},rotate:function(e,t){return Mq.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return Mq.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return Mq.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return Mq.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return Mq.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return Mq.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return Mq.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var e=Cq.create(),t=Cq.create(),n=Cq.create(),r=Jq.create();return function(i,o,a){var s=this.array;Cq.set(e,s[0],s[1],s[2]),Cq.set(t,s[4],s[5],s[6]),Cq.set(n,s[8],s[9],s[10]);var l=Cq.length(e),u=Cq.length(t),c=Cq.length(n);this.determinant()<0&&(l=-l),i&&i.set(l,u,c),a.set(s[12],s[13],s[14]),Jq.fromMat4(r,s),r[0]/=l,r[1]/=l,r[2]/=l,r[3]/=u,r[4]/=u,r[5]/=u,r[6]/=c,r[7]/=c,r[8]/=c,rK.fromMat3(o.array,r),rK.normalize(o.array,o.array),o._dirty=!0,a._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var oK=Object.defineProperty;if(oK){var aK=iK.prototype;oK(aK,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),oK(aK,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),oK(aK,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})}iK.adjoint=function(e,t){return Mq.adjoint(e.array,t.array),e._dirty=!0,e},iK.copy=function(e,t){return Mq.copy(e.array,t.array),e._dirty=!0,e},iK.determinant=function(e){return Mq.determinant(e.array)},iK.identity=function(e){return Mq.identity(e.array),e._dirty=!0,e},iK.ortho=function(e,t,n,r,i,o,a){return Mq.ortho(e.array,t,n,r,i,o,a),e._dirty=!0,e},iK.perspective=function(e,t,n,r,i){return Mq.perspective(e.array,t,n,r,i),e._dirty=!0,e},iK.lookAt=function(e,t,n,r){return Mq.lookAt(e.array,t.array,n.array,r.array),e._dirty=!0,e},iK.invert=function(e,t){return Mq.invert(e.array,t.array),e._dirty=!0,e},iK.mul=function(e,t,n){return Mq.mul(e.array,t.array,n.array),e._dirty=!0,e},iK.multiply=iK.mul,iK.fromQuat=function(e,t){return Mq.fromQuat(e.array,t.array),e._dirty=!0,e},iK.fromRotationTranslation=function(e,t,n){return Mq.fromRotationTranslation(e.array,t.array,n.array),e._dirty=!0,e},iK.fromMat2d=function(e,t){e._dirty=!0;t=t.array;return(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},iK.rotate=function(e,t,n,r){return Mq.rotate(e.array,t.array,n,r.array),e._dirty=!0,e},iK.rotateX=function(e,t,n){return Mq.rotateX(e.array,t.array,n),e._dirty=!0,e},iK.rotateY=function(e,t,n){return Mq.rotateY(e.array,t.array,n),e._dirty=!0,e},iK.rotateZ=function(e,t,n){return Mq.rotateZ(e.array,t.array,n),e._dirty=!0,e},iK.scale=function(e,t,n){return Mq.scale(e.array,t.array,n.array),e._dirty=!0,e},iK.transpose=function(e,t){return Mq.transpose(e.array,t.array),e._dirty=!0,e},iK.translate=function(e,t,n){return Mq.translate(e.array,t.array,n.array),e._dirty=!0,e};var sK,lK=function(e,t,n,r){e=e||0,t=t||0,n=n||0,r=void 0===r?1:r,this.array=rK.fromValues(e,t,n,r),this._dirty=!0};lK.prototype={constructor:lK,add:function(e){return rK.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return rK.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,n,r){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new lK(this.x,this.y,this.z,this.w)},conjugate:function(){return rK.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return rK.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return rK.dot(this.array,e.array)},fromMat3:function(e){return rK.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(sK=Jq.create(),function(e){return Jq.fromMat4(sK,e.array),Jq.transpose(sK,sK),rK.fromMat3(this.array,sK),this._dirty=!0,this}),identity:function(){return rK.identity(this.array),this._dirty=!0,this},invert:function(){return rK.invert(this.array,this.array),this._dirty=!0,this},len:function(){return rK.len(this.array)},length:function(){return rK.length(this.array)},lerp:function(e,t,n){return rK.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},mul:function(e){return rK.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return rK.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return rK.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return rK.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return rK.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return rK.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return rK.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return rK.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return rK.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,n){return rK.setAxes(this.array,e.array,t.array,n.array),this._dirty=!0,this},setAxisAngle:function(e,t){return rK.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,n){return rK.slerp(this.array,e.array,t.array,n),this._dirty=!0,this},sqrLen:function(){return rK.sqrLen(this.array)},squaredLength:function(){return rK.squaredLength(this.array)},fromEuler:function(e,t){return lK.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var uK=Object.defineProperty;if(uK){var cK=lK.prototype;uK(cK,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),uK(cK,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),uK(cK,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),uK(cK,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}lK.add=function(e,t,n){return rK.add(e.array,t.array,n.array),e._dirty=!0,e},lK.set=function(e,t,n,r,i){rK.set(e.array,t,n,r,i),e._dirty=!0},lK.copy=function(e,t){return rK.copy(e.array,t.array),e._dirty=!0,e},lK.calculateW=function(e,t){return rK.calculateW(e.array,t.array),e._dirty=!0,e},lK.conjugate=function(e,t){return rK.conjugate(e.array,t.array),e._dirty=!0,e},lK.identity=function(e){return rK.identity(e.array),e._dirty=!0,e},lK.invert=function(e,t){return rK.invert(e.array,t.array),e._dirty=!0,e},lK.dot=function(e,t){return rK.dot(e.array,t.array)},lK.len=function(e){return rK.length(e.array)},lK.lerp=function(e,t,n,r){return rK.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},lK.slerp=function(e,t,n,r){return rK.slerp(e.array,t.array,n.array,r),e._dirty=!0,e},lK.mul=function(e,t,n){return rK.multiply(e.array,t.array,n.array),e._dirty=!0,e},lK.multiply=lK.mul,lK.rotateX=function(e,t,n){return rK.rotateX(e.array,t.array,n),e._dirty=!0,e},lK.rotateY=function(e,t,n){return rK.rotateY(e.array,t.array,n),e._dirty=!0,e},lK.rotateZ=function(e,t,n){return rK.rotateZ(e.array,t.array,n),e._dirty=!0,e},lK.setAxisAngle=function(e,t,n){return rK.setAxisAngle(e.array,t.array,n),e._dirty=!0,e},lK.normalize=function(e,t){return rK.normalize(e.array,t.array),e._dirty=!0,e},lK.squaredLength=lK.sqrLen=function(e){return rK.sqrLen(e.array)},lK.fromMat3=function(e,t){return rK.fromMat3(e.array,t.array),e._dirty=!0,e},lK.setAxes=function(e,t,n,r){return rK.setAxes(e.array,t.array,n.array,r.array),e._dirty=!0,e},lK.rotationTo=function(e,t,n){return rK.rotationTo(e.array,t.array,n.array),e._dirty=!0,e},lK.fromEuler=function(e,t,n){e._dirty=!0,t=t.array;var r=e.array,i=Math.cos(t[0]/2),o=Math.cos(t[1]/2),a=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"YXZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"ZXY":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"ZYX":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"YZX":r[0]=s*o*a+i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a-s*l*u;break;case"XZY":r[0]=s*o*a-i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a+s*l*u}};var hK,dK,pK,fK,gK,mK,vK=Cq.set,yK=Cq.copy,_K=function(e,t){this.min=e||new Bq(1/0,1/0,1/0),this.max=t||new Bq(-1/0,-1/0,-1/0),this.vertices=null};_K.prototype={constructor:_K,updateFromVertices:function(e){if(e.length>0){var t=this.min,n=this.max,r=t.array,i=n.array;yK(r,e[0]),yK(i,e[0]);for(var o=1;o<e.length;o++){var a=e[o];a[0]<r[0]&&(r[0]=a[0]),a[1]<r[1]&&(r[1]=a[1]),a[2]<r[2]&&(r[2]=a[2]),a[0]>i[0]&&(i[0]=a[0]),a[1]>i[1]&&(i[1]=a[1]),a[2]>i[2]&&(i[2]=a[2])}t._dirty=!0,n._dirty=!0}},union:function(e){var t=this.min,n=this.max;return Cq.min(t.array,t.array,e.min.array),Cq.max(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersection:function(e){var t=this.min,n=this.max;return Cq.max(t.array,t.array,e.min.array),Cq.min(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,n=this.max.array,r=e.min.array,i=e.max.array;return!(t[0]>i[0]||t[1]>i[1]||t[2]>i[2]||n[0]<r[0]||n[1]<r[1]||n[2]<r[2])},containBoundingBox:function(e){var t=this.min.array,n=this.max.array,r=e.min.array,i=e.max.array;return t[0]<=r[0]&&t[1]<=r[1]&&t[2]<=r[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},containPoint:function(e){var t=this.min.array,n=this.max.array,r=e.array;return t[0]<=r[0]&&t[1]<=r[1]&&t[2]<=r[2]&&n[0]>=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:(hK=Cq.create(),dK=Cq.create(),pK=Cq.create(),fK=Cq.create(),gK=Cq.create(),mK=Cq.create(),function(e,t){var n=e.min.array,r=e.max.array,i=t.array;return hK[0]=i[0]*n[0],hK[1]=i[1]*n[0],hK[2]=i[2]*n[0],dK[0]=i[0]*r[0],dK[1]=i[1]*r[0],dK[2]=i[2]*r[0],pK[0]=i[4]*n[1],pK[1]=i[5]*n[1],pK[2]=i[6]*n[1],fK[0]=i[4]*r[1],fK[1]=i[5]*r[1],fK[2]=i[6]*r[1],gK[0]=i[8]*n[2],gK[1]=i[9]*n[2],gK[2]=i[10]*n[2],mK[0]=i[8]*r[2],mK[1]=i[9]*r[2],mK[2]=i[10]*r[2],n=this.min.array,r=this.max.array,n[0]=Math.min(hK[0],dK[0])+Math.min(pK[0],fK[0])+Math.min(gK[0],mK[0])+i[12],n[1]=Math.min(hK[1],dK[1])+Math.min(pK[1],fK[1])+Math.min(gK[1],mK[1])+i[13],n[2]=Math.min(hK[2],dK[2])+Math.min(pK[2],fK[2])+Math.min(gK[2],mK[2])+i[14],r[0]=Math.max(hK[0],dK[0])+Math.max(pK[0],fK[0])+Math.max(gK[0],mK[0])+i[12],r[1]=Math.max(hK[1],dK[1])+Math.max(pK[1],fK[1])+Math.max(gK[1],mK[1])+i[13],r[2]=Math.max(hK[2],dK[2])+Math.max(pK[2],fK[2])+Math.max(gK[2],mK[2])+i[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,n=this.max.array,r=e.array,i=t[0],o=t[1],a=t[2],s=n[0],l=n[1],u=t[2],c=n[0],h=n[1],d=n[2];if(1===r[15])t[0]=r[0]*i+r[12],t[1]=r[5]*o+r[13],n[2]=r[10]*a+r[14],n[0]=r[0]*c+r[12],n[1]=r[5]*h+r[13],t[2]=r[10]*d+r[14];else{var p=-1/a;t[0]=r[0]*i*p,t[1]=r[5]*o*p,n[2]=(r[10]*a+r[14])*p,p=-1/u,n[0]=r[0]*s*p,n[1]=r[5]*l*p,p=-1/d,t[2]=(r[10]*d+r[14])*p}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=Cq.fromValues(0,0,0);this.vertices=e}var n=this.min.array,r=this.max.array;return vK(e[0],n[0],n[1],n[2]),vK(e[1],n[0],r[1],n[2]),vK(e[2],r[0],n[1],n[2]),vK(e[3],r[0],r[1],n[2]),vK(e[4],n[0],n[1],r[2]),vK(e[5],n[0],r[1],r[2]),vK(e[6],r[0],n[1],r[2]),vK(e[7],r[0],r[1],r[2]),this},copy:function(e){var t=this.min,n=this.max;return yK(t.array,e.min.array),yK(n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},clone:function(){var e=new _K;return e.copy(this),e}};var xK,bK,wK=0,SK=bY.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+wK++),this.position||(this.position=new Bq),this.rotation||(this.rotation=new lK),this.scale||(this.scale=new Bq(1,1,1)),this.worldTransform=new iK,this.localTransform=new iK,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var n=t._nodeRepository;delete n[this.name],n[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var n=this._scene;n&&n!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,n=t.indexOf(e);n<0||(t.splice(n,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},getDescendantByName:function(e){for(var t=this._children,n=0;n<t.length;n++){var r=t[n];if(r.name===e)return r;var i=r.getDescendantByName(e);if(i)return i}},queryNode:function(e){if(e){for(var t=e.split("/"),n=this,r=0;r<t.length;r++){var i=t[r];if(i){for(var o=!1,a=n._children,s=0;s<a.length;s++){var l=a[s];if(l.name===i){n=l,o=!0;break}}if(!o)return}}return n}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,n=this.name;t._parent&&(n=t.name+"/"+n,t._parent!=e);)t=t._parent;return!t._parent&&e?null:n},traverse:function(e,t){e.call(t,this);for(var n=this._children,r=0,i=n.length;r<i;r++)n[r].traverse(e,t)},eachChild:function(e,t){for(var n=this._children,r=0,i=n.length;r<i;r++){var o=n[r];e.call(t,o,r)}},setLocalTransform:function(e){Mq.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){Mq.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(xK=Mq.create(),function(e){var t=this.localTransform,n=this.worldTransform;this._parent?(Mq.invert(xK,this._parent.worldTransform.array),Mq.multiply(t.array,xK,n.array)):Mq.copy(t.array,n.array);var r=e?null:this.scale;t.decomposeMatrix(r,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e=this.position,t=this.rotation,n=this.scale;if(this.transformNeedsUpdate()){var r=this.localTransform.array;Mq.fromRotationTranslation(r,t.array,e.array),Mq.scale(r,r,n.array),t._dirty=!1,n._dirty=!1,e._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?Mq.multiplyAffine(t,this._parent.worldTransform.array,e):Mq.copy(t,e)},updateWorldTransform:function(){for(var e=this;e&&e.getParent()&&e.getParent().transformNeedsUpdate();)e=e.getParent();e.update()},update:function(e){this.autoUpdateLocalTransform?this.updateLocalTransform():e=!0,(e||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),e=!0,this._needsUpdateWorldTransform=!1);for(var t=this._children,n=0,r=t.length;n<r;n++)t[n].update(e)},getBoundingBox:function(){function e(e){return!e.invisible&&e.geometry}var t=new _K,n=new iK,r=new iK;return function(i,o){return o=o||new _K,this._parent?iK.invert(r,this._parent.worldTransform):iK.identity(r),this.traverse((function(e){e.geometry&&e.geometry.boundingBox&&(t.copy(e.geometry.boundingBox),iK.multiply(n,r,e.worldTransform),t.applyTransform(n),o.union(t))}),this,e),o}}(),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var n=e.array;return n[0]=t[12],n[1]=t[13],n[2]=t[14],e}return new Bq(t[12],t[13],t[14])},clone:function(){var e=new this.constructor,t=this._children;e.setName(this.name),e.position.copy(this.position),e.rotation.copy(this.rotation),e.scale.copy(this.scale);for(var n=0;n<t.length;n++)e.add(t[n].clone());return e},rotateAround:function(){var e=new Bq,t=new iK;return function(n,r,i){e.copy(this.position).subtract(n);var o=this.localTransform;o.identity(),o.translate(n),o.rotate(i,r),t.fromRotationTranslation(this.rotation,e),o.multiply(t),o.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var e=new iK;return function(t,n){e.lookAt(this.position,t,n||this.localTransform.y).invert(),this.setLocalTransform(e),this.target=t}}()}),TK=SK.extend({material:null,geometry:null,mode:NY,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:BY,frontFace:HY,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=SK.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:(bK=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=SK.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<bK.length;t++){var n=bK[t];e[n]!==this[n]&&(e[n]=this[n])}return e})});TK.POINTS=AY,TK.LINES=IY,TK.LINE_LOOP=EY,TK.LINE_STRIP=LY,TK.TRIANGLES=NY,TK.TRIANGLE_STRIP=PY,TK.TRIANGLE_FAN=OY,TK.BACK=BY,TK.FRONT=VY,TK.FRONT_AND_BACK=FY,TK.CW=GY,TK.CCW=HY;var MK=bY.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new Kq,this._ndc=new qZ}),{pick:function(e,t,n){return this.pickAll(e,t,[],n)[0]||null},pickAll:function(e,t,n,r){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),n=n||[],this._intersectNode(this.scene,n,r||!1),n.sort(this._intersectionCompareFunc),n},_intersectNode:function(e,t,n){e instanceof TK&&e.isRenderable()&&(e.ignorePicking&&!n||!(e.mode===NY&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var r=0;r<e._children.length;r++)this._intersectNode(e._children[r],t,n)},_intersectRenderable:function(){var e=new Bq,t=new Bq,n=new Bq,r=new Kq,i=new iK;return function(o,a){var s=o.isSkinnedMesh();r.copy(this._ray),iK.invert(i,o.worldTransform),s||r.applyTransform(i);var l=o.geometry,u=s?o.skeleton.boundingBox:l.boundingBox;if(!u||r.intersectBoundingBox(u))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,o,a);else if(l.pickByRay)l.pickByRay(r,o,a);else{var c,h,d=o.cullFace===BY&&o.frontFace===HY||o.cullFace===VY&&o.frontFace===GY,p=l.indices,f=l.attributes.position,g=l.attributes.weight,m=l.attributes.joint,v=[];if(f&&f.value&&p){if(s){h=o.skeleton.getSubSkinMatrices(o.__uid__,o.joints);for(var y=0;y<o.joints.length;y++){v[y]=v[y]||[];for(var _=0;_<16;_++)v[y][_]=h[16*y+_]}var x=[],b=[],w=[],S=[],T=[],M=l.attributes.skinnedPosition;M&&M.value||(l.createAttribute("skinnedPosition","f",3),(M=l.attributes.skinnedPosition).init(l.vertexCount));for(y=0;y<l.vertexCount;y++){f.get(y,x),g.get(y,b),m.get(y,w),b[3]=1-b[0]-b[1]-b[2],Cq.set(S,0,0,0);for(_=0;_<4;_++)w[_]>=0&&b[_]>1e-4&&(Cq.transformMat4(T,x,v[w[_]]),Cq.scaleAndAdd(S,S,T,b[_]));M.set(y,S)}}for(y=0;y<p.length;y+=3){var C=p[y],D=p[y+1],A=p[y+2],I=s?l.attributes.skinnedPosition:f;if(I.get(C,e.array),I.get(D,t.array),I.get(A,n.array),c=d?r.intersectTriangle(e,t,n,o.culling):r.intersectTriangle(e,n,t,o.culling)){var E=new Bq;s?Bq.copy(E,c):Bq.transformMat4(E,c,o.worldTransform),a.push(new MK.Intersection(c,E,o,[C,D,A],y/3,Bq.dist(E,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});MK.Intersection=function(e,t,n,r,i,o){this.point=e,this.pointWorld=t,this.target=n,this.triangle=r,this.triangleIndex=i,this.distance=o};var CK="__dt__",DK=function(){this._contextId=0,this._caches=[],this._context={}};DK.prototype={use:function(e,t){var n=this._caches;n[e]||(n[e]={},t&&(n[e]=t())),this._contextId=e,this._context=n[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=CK+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=CK+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!0)},fresh:function(e){var t=CK+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t=CK+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!1)},isDirty:function(e){var t=CK+(e=e||""),n=this._context;return!n.hasOwnProperty(t)||!0===n[t]},deleteContext:function(e){delete this._caches[e],this._context={}},delete:function(e){delete this._context[e]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(e,t){Object.keys(this._caches).forEach((function(n){e&&e.call(t,n)}))},miss:function(e){return!this._context.hasOwnProperty(e)}},DK.prototype.constructor=DK;var AK=bY.extend({width:512,height:512,type:WY,format:QY,wrapS:cZ,wrapT:cZ,minFilter:sZ,magFilter:rZ,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},(function(){this._cache=new DK}),{getWebGLTexture:function(e){var t=e.gl,n=this._cache;return n.use(e.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):n.isDirty()&&(this.update(e),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(e){},updateCommon:function(e){var t=e.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===KY&&(this.useMipmap=!1);var n=e.getGLExtension("EXT_sRGB");this.format!==AK.SRGB||n||(this.format=AK.RGB),this.format!==AK.SRGB_ALPHA||n||(this.format=AK.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?hZ:this.wrapS},getAvailableWrapT:function(){return this.NPOT?hZ:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e===iZ||e===aZ?nZ:e===sZ||e===oZ?rZ:e:e},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("webgl_texture");n&&e.gl.deleteTexture(n),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(AK.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(AK.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),AK.BYTE=UY,AK.UNSIGNED_BYTE=WY,AK.SHORT=jY,AK.UNSIGNED_SHORT=XY,AK.INT=YY,AK.UNSIGNED_INT=ZY,AK.FLOAT=qY,AK.HALF_FLOAT=36193,AK.UNSIGNED_INT_24_8_WEBGL=34042,AK.DEPTH_COMPONENT=KY,AK.DEPTH_STENCIL=gZ,AK.ALPHA=$Y,AK.RGB=JY,AK.RGBA=QY,AK.LUMINANCE=eZ,AK.LUMINANCE_ALPHA=tZ,AK.SRGB=35904,AK.SRGB_ALPHA=35906,AK.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,AK.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,AK.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,AK.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,AK.NEAREST=nZ,AK.LINEAR=rZ,AK.NEAREST_MIPMAP_NEAREST=iZ,AK.LINEAR_MIPMAP_NEAREST=oZ,AK.NEAREST_MIPMAP_LINEAR=aZ,AK.LINEAR_MIPMAP_LINEAR=sZ,AK.REPEAT=cZ,AK.CLAMP_TO_EDGE=hZ,AK.MIRRORED_REPEAT=dZ;var IK=TK.extend({skeleton:null,joints:null},(function(){this.joints||(this.joints=[])}),{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=TK.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});IK.POINTS=AY,IK.LINES=IY,IK.LINE_LOOP=EY,IK.LINE_STRIP=LY,IK.TRIANGLES=NY,IK.TRIANGLE_STRIP=PY,IK.TRIANGLE_FAN=OY,IK.BACK=BY,IK.FRONT=VY,IK.FRONT_AND_BACK=FY,IK.CW=GY,IK.CCW=HY;var EK={isPowerOfTwo:function(e){return!(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}},LK=EK.isPowerOfTwo;function NK(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var PK=AK.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,r=this.type,i=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==AK.REPEAT&&this.wrapT!==AK.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i?this.minFilter:this.getAvailableMinFilter());var o=e.getGLExtension("EXT_texture_filter_anisotropic");(o&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,o.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(e.getGLExtension("OES_texture_half_float")||(r=qY));if(this.mipmaps.length)for(var a=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,a,s,n,r,!1),a/=2,s/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,r,i),!this.useMipmap||this.NPOT&&!i||t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,n,r,i,o,a,s){if(t.image){var l=t.image;s&&(this._potCanvas=function(e,t){var n=NK(e.width),r=NK(e.height);return(t=t||document.createElement("canvas")).width=n,t.height=r,t.getContext("2d").drawImage(e.image,0,0,n,r),t}(this,this._potCanvas),l=this._potCanvas),e.texImage2D(e.TEXTURE_2D,n,o,o,a,l)}else o<=AK.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=AK.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,n,o,r,i,0,t.pixels):e.texImage2D(e.TEXTURE_2D,n,o,r,i,0,o,a,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return LK(this.width)&&LK(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var n=wZ.createImage();t&&(n.crossOrigin=t);var r=this;return n.onload=function(){r.dirty(),r.trigger("success",r)},n.onerror=function(){r.trigger("error",r)},n.src=e,this.image=n,this}});function OK(e){return{byte:wZ.Int8Array,ubyte:wZ.Uint8Array,short:wZ.Int16Array,ushort:wZ.Uint16Array}[e]||wZ.Float32Array}function RK(e){return"attr_"+e}function kK(e,t,n,r){switch(this.name=e,this.type=t,this.size=n,this.semantic=r||"",this.value=null,n){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var n=this.value;return t[0]=n[2*e],t[1]=n[2*e+1],t},this.set=function(e,t){var n=this.value;n[2*e]=t[0],n[2*e+1]=t[1]},this.copy=function(e,t){var n=this.value;t*=2,n[e*=2]=n[t],n[e+1]=n[t+1]};break;case 3:this.get=function(e,t){var n=3*e,r=this.value;return t[0]=r[n],t[1]=r[n+1],t[2]=r[n+2],t},this.set=function(e,t){var n=3*e,r=this.value;r[n]=t[0],r[n+1]=t[1],r[n+2]=t[2]},this.copy=function(e,t){var n=this.value;t*=3,n[e*=3]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2]};break;case 4:this.get=function(e,t){var n=this.value,r=4*e;return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],t},this.set=function(e,t){var n=this.value,r=4*e;n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3]},this.copy=function(e,t){var n=this.value;t*=4,n[e*=4]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2],n[e+3]=n[t+3]}}}function zK(e,t,n,r,i){this.name=e,this.type=t,this.buffer=n,this.size=r,this.semantic=i,this.symbol="",this.needsRemove=!1}function VK(e){this.buffer=e,this.count=0}Object.defineProperty(PK.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(PK.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),kK.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=OK(this.type);this.value=new t(e*this.size)}},kK.prototype.fromArray=function(e){var t,n=OK(this.type);if(e[0]&&e[0].length){var r=0,i=this.size;t=new n(e.length*i);for(var o=0;o<e.length;o++)for(var a=0;a<i;a++)t[r++]=e[o][a]}else t=new n(e);this.value=t},kK.prototype.clone=function(e){var t=new kK(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var BK=bY.extend((function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}}),(function(){this._cache=new DK,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}}),{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var e=this.getEnabledAttributes(),t=0;t<e.length;t++)this.dirtyAttribute(e[t]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(e){this._cache.dirtyAll(RK(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&e>=0){t||(t=[]);var n=this.indices;return t[0]=n[3*e],t[1]=n[3*e+1],t[2]=n[3*e+2],t}},setTriangleIndices:function(e,t){var n=this.indices;n[3*e]=t[0],n[3*e+1]=t[1],n[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,n=this.vertexCount>65535?wZ.Uint32Array:wZ.Uint16Array;if(e[0]&&e[0].length){var r=0;t=new n(3*e.length);for(var i=0;i<e.length;i++)for(var o=0;o<3;o++)t[r++]=e[i][o]}else t=new n(e);this.indices=t},createAttribute:function(e,t,n,r){var i=new kK(e,t,n,r);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=i,this._attributeList.push(e),i},removeAttribute:function(e){var t=this._attributeList,n=t.indexOf(e);return n>=0&&(t.splice(n,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var n=[],r=this.vertexCount,i=0;i<t.length;i++){var o=t[i],a=this.attributes[o];a.value&&a.value.length===r*a.size&&n.push(o)}return this._enabledAttributes=n,n},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var n=t.isDirty("attributes"),r=t.isDirty("indices");if(n||r){this._updateBuffer(e.gl,n,r);for(var i=this.getEnabledAttributes(),o=0;o<i.length;o++)t.fresh(RK(i[o]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,n){var r=this._cache,i=r.get("chunks"),o=!1;i||((i=[])[0]={attributeBuffers:[],indicesBuffer:null},r.put("chunks",i),o=!0);var a=i[0],s=a.attributeBuffers,l=a.indicesBuffer;if(t||o){var u=this.getEnabledAttributes(),c={};if(!o)for(var h=0;h<s.length;h++)c[s[h].name]=s[h];for(var d=0;d<u.length;d++){var p,f,g=u[d],m=this.attributes[g];o||(p=c[g]),f=p?p.buffer:e.createBuffer(),r.isDirty(RK(g))&&(e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,m.value,this.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW)),s[d]=new zK(g,m.type,f,m.size,m.semantic)}for(h=d;h<s.length;h++)e.deleteBuffer(s[h].buffer);s.length=d}this.isUseIndices()&&(n||o)&&(l||(l=new VK(e.createBuffer()),a.indicesBuffer=l),l.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW))},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];e.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});Object.defineProperty&&(Object.defineProperty(BK.prototype,"vertexCount",{enumerable:!1,get:function(){var e=this.attributes[this.mainAttribute];return e||(e=this.attributes[this._attributeList[0]]),e&&e.value?e.value.length/e.size:0}}),Object.defineProperty(BK.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),BK.STATIC_DRAW=kY,BK.DYNAMIC_DRAW=zY,BK.STREAM_DRAW=RY,BK.AttributeBuffer=zK,BK.IndicesBuffer=VK,BK.Attribute=kK;var FK=Cq.create,GK=Cq.add,HK=Cq.set,UK=BK.Attribute,WK=BK.extend((function(){return{attributes:{position:new UK("position","float",3,"POSITION"),texcoord0:new UK("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new UK("texcoord1","float",2,"TEXCOORD_1"),normal:new UK("normal","float",3,"NORMAL"),tangent:new UK("tangent","float",4,"TANGENT"),color:new UK("color","float",4,"COLOR"),weight:new UK("weight","float",3,"WEIGHT"),joint:new UK("joint","float",4,"JOINT"),barycentric:new UK("barycentric","float",3,null)},boundingBox:null}}),{mainAttribute:"position",updateBoundingBox:function(){var e=this.boundingBox;e||(e=this.boundingBox=new _K);var t=this.attributes.position.value;if(t&&t.length){var n=e.min,r=e.max,i=n.array,o=r.array;Cq.set(i,t[0],t[1],t[2]),Cq.set(o,t[0],t[1],t[2]);for(var a=3;a<t.length;){var s=t[a++],l=t[a++],u=t[a++];s<i[0]&&(i[0]=s),l<i[1]&&(i[1]=l),u<i[2]&&(i[2]=u),s>o[0]&&(o[0]=s),l>o[1]&&(o[1]=l),u>o[2]&&(o[2]=u)}n._dirty=!0,r._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,n=t.position.value,r=t.normal.value;if(r&&r.length===n.length)for(var i=0;i<r.length;i++)r[i]=0;else r=t.normal.value=new wZ.Float32Array(n.length);for(var o,a,s,l=FK(),u=FK(),c=FK(),h=FK(),d=FK(),p=FK(),f=e?e.length:this.vertexCount,g=0;g<f;){e?(o=e[g++],a=e[g++],s=e[g++]):(o=g++,a=g++,s=g++),HK(l,n[3*o],n[3*o+1],n[3*o+2]),HK(u,n[3*a],n[3*a+1],n[3*a+2]),HK(c,n[3*s],n[3*s+1],n[3*s+2]),Cq.sub(h,l,u),Cq.sub(d,u,c),Cq.cross(p,h,d);for(i=0;i<3;i++)r[3*o+i]=r[3*o+i]+p[i],r[3*a+i]=r[3*a+i]+p[i],r[3*s+i]=r[3*s+i]+p[i]}for(i=0;i<r.length;)HK(p,r[i],r[i+1],r[i+2]),Cq.normalize(p,p),r[i++]=p[0],r[i++]=p[1],r[i++]=p[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.indices,t=this.attributes,n=t.position.value,r=t.normal.value,i=FK(),o=FK(),a=FK(),s=FK(),l=FK(),u=FK();r||(r=t.normal.value=new Float32Array(n.length));for(var c,h,d,p=e?e.length:this.vertexCount,f=0;f<p;){e?(c=e[f++],h=e[f++],d=e[f++]):(c=f++,h=f++,d=f++),HK(i,n[3*c],n[3*c+1],n[3*c+2]),HK(o,n[3*h],n[3*h+1],n[3*h+2]),HK(a,n[3*d],n[3*d+1],n[3*d+2]),Cq.sub(s,i,o),Cq.sub(l,o,a),Cq.cross(u,s,l),Cq.normalize(u,u);for(var g=0;g<3;g++)r[3*c+g]=u[g],r[3*h+g]=u[g],r[3*d+g]=u[g]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var e=this.vertexCount,t=this.attributes;t.tangent.value||(t.tangent.value=new Float32Array(4*e));var n=t.texcoord0.value,r=t.position.value,i=t.tangent.value,o=t.normal.value;if(n){for(var a=[],s=[],l=0;l<e;l++)a[l]=[0,0,0],s[l]=[0,0,0];var u,c,h,d=[0,0,0],p=[0,0,0],f=this.indices,g=f?f.length:this.vertexCount;for(l=0;l<g;){f?(u=f[l++],c=f[l++],h=f[l++]):(u=l++,c=l++,h=l++);var m=n[2*u],v=n[2*c],y=n[2*h],_=n[2*u+1],x=n[2*c+1],b=n[2*h+1],w=r[3*u],S=r[3*c],T=r[3*h],M=r[3*u+1],C=r[3*c+1],D=r[3*h+1],A=r[3*u+2],I=S-w,E=T-w,L=C-M,N=D-M,P=r[3*c+2]-A,O=r[3*h+2]-A,R=v-m,k=y-m,z=x-_,V=b-_,B=1/(R*V-z*k);d[0]=(V*I-z*E)*B,d[1]=(V*L-z*N)*B,d[2]=(V*P-z*O)*B,p[0]=(R*E-k*I)*B,p[1]=(R*N-k*L)*B,p[2]=(R*O-k*P)*B,GK(a[u],a[u],d),GK(a[c],a[c],d),GK(a[h],a[h],d),GK(s[u],s[u],p),GK(s[c],s[c],p),GK(s[h],s[h],p)}var F=FK(),G=FK(),H=FK();for(l=0;l<e;l++){H[0]=o[3*l],H[1]=o[3*l+1],H[2]=o[3*l+2];var U=a[l];Cq.scale(F,H,Cq.dot(H,U)),Cq.sub(F,U,F),Cq.normalize(F,F),Cq.cross(G,H,U),i[4*l]=F[0],i[4*l+1]=F[1],i[4*l+2]=F[2],i[4*l+3]=Cq.dot(G,s[l])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new wZ.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,n=this.getEnabledAttributes(),r={},i=0;i<n.length;i++){r[l=n[i]]=e[l].value,e[l].init(this.indices.length)}for(var o=0,a=0;a<t.length;a++){var s=t[a];for(i=0;i<n.length;i++)for(var l,u=e[l=n[i]].value,c=e[l].size,h=0;h<c;h++)u[o*c+h]=r[l][s*c+h];t[a]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,n=this.indices;if(!t||t.length!==3*n.length){t=e.barycentric.value=new Float32Array(3*n.length);for(var r=0;r<(n?n.length:this.vertexCount/3);)for(var i=0;i<3;i++){t[3*(n?n[r++]:3*r+i)+i]=1}this.dirty()}}},applyTransform:function(e){var t=this.attributes,n=t.position.value,r=t.normal.value,i=t.tangent.value;e=e.array;var o=Mq.create();Mq.invert(o,e),Mq.transpose(o,o);var a=Cq.transformMat4,s=Cq.forEach;s(n,3,0,null,a,e),r&&s(r,3,0,null,a,o),i&&s(i,4,0,null,a,o),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];e.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});WK.STATIC_DRAW=BK.STATIC_DRAW,WK.DYNAMIC_DRAW=BK.DYNAMIC_DRAW,WK.STREAM_DRAW=BK.STREAM_DRAW,WK.AttributeBuffer=BK.AttributeBuffer,WK.IndicesBuffer=BK.IndicesBuffer,WK.Attribute=UK;var jK="uniform vec3 ",XK="uniform float ",YK="@export clay.header.",ZK="@end",qK=":unconfigurable;",KK=[YK+"directional_light",jK+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+qK,jK+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+qK,ZK,YK+"ambient_light",jK+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+qK,ZK,YK+"ambient_sh_light",jK+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+qK,jK+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+qK,"vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}",ZK,YK+"ambient_cubemap_light",jK+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+qK,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+qK,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+qK,ZK,YK+"point_light",jK+"pointLightPosition[POINT_LIGHT_COUNT]"+qK,XK+"pointLightRange[POINT_LIGHT_COUNT]"+qK,jK+"pointLightColor[POINT_LIGHT_COUNT]"+qK,ZK,YK+"spot_light",jK+"spotLightPosition[SPOT_LIGHT_COUNT]"+qK,jK+"spotLightDirection[SPOT_LIGHT_COUNT]"+qK,XK+"spotLightRange[SPOT_LIGHT_COUNT]"+qK,XK+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+qK,XK+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+qK,XK+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+qK,jK+"spotLightColor[SPOT_LIGHT_COUNT]"+qK,ZK].join("\n");bq.import(KK);var $K,JK,QK,e$,t$=SK.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var e=SK.prototype.clone.call(this);return e.color=Array.prototype.slice.call(this.color),e.intensity=this.intensity,e.castShadow=this.castShadow,e.shadowResolution=this.shadowResolution,e}}),n$=function(e,t){this.normal=e||new Bq(0,1,0),this.distance=t||0};n$.prototype={constructor:n$,distanceToPoint:function(e){return Cq.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new Bq);var n=this.distanceToPoint(e);return Cq.scaleAndAdd(t.array,e.array,this.normal.array,-n),t._dirty=!0,t},normalize:function(){var e=1/Cq.len(this.normal.array);Cq.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,n=this.normal.array,r=Cq.dot(t[0].array,n)>this.distance,i=1;i<8;i++)if(Cq.dot(t[i].array,n)>this.distance!=r)return!0},intersectLine:(e$=Cq.create(),function(e,t,n){var r=this.distanceToPoint(e),i=this.distanceToPoint(t);if(r>0&&i>0||r<0&&i<0)return null;var o=this.normal.array,a=this.distance,s=e.array;Cq.sub(e$,t.array,e.array),Cq.normalize(e$,e$);var l=Cq.dot(o,e$);if(0===l)return null;n||(n=new Bq);var u=(Cq.dot(o,s)-a)/l;return Cq.scaleAndAdd(n.array,s,e$,-u),n._dirty=!0,n}),applyTransform:($K=Mq.create(),JK=$q.create(),QK=$q.create(),QK[3]=1,function(e){e=e.array,Cq.scale(QK,this.normal.array,this.distance),$q.transformMat4(QK,QK,e),this.distance=Cq.dot(QK,this.normal.array),Mq.invert($K,e),Mq.transpose($K,$K),JK[3]=0,Cq.copy(JK,this.normal.array),$q.transformMat4(JK,JK,$K),Cq.copy(this.normal.array,JK)}),copy:function(e){Cq.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new n$;return e.copy(this),e}};var r$,i$=Cq.set,o$=Cq.copy,a$=Cq.transformMat4,s$=Math.min,l$=Math.max,u$=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new n$);this.boundingBox=new _K,this.vertices=[];for(e=0;e<8;e++)this.vertices[e]=Cq.fromValues(0,0,0)};u$.prototype={setFromProjection:function(e){var t=this.planes,n=e.array,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],c=n[7],h=n[8],d=n[9],p=n[10],f=n[11],g=n[12],m=n[13],v=n[14],y=n[15];i$(t[0].normal.array,a-r,c-s,f-h),t[0].distance=-(y-g),t[0].normalize(),i$(t[1].normal.array,a+r,c+s,f+h),t[1].distance=-(y+g),t[1].normalize(),i$(t[2].normal.array,a+i,c+l,f+d),t[2].distance=-(y+m),t[2].normalize(),i$(t[3].normal.array,a-i,c-l,f-d),t[3].distance=-(y-m),t[3].normalize(),i$(t[4].normal.array,a-o,c-u,f-p),t[4].distance=-(y-v),t[4].normalize(),i$(t[5].normal.array,a+o,c+u,f+p),t[5].distance=-(y+v),t[5].normalize();var _=this.boundingBox,x=this.vertices;if(0===y){var b=l/r,w=-v/(p-1),S=-v/(p+1),T=-S/l,M=-w/l;_.min.set(-T*b,-T,S),_.max.set(T*b,T,w),i$(x[0],-T*b,-T,S),i$(x[1],-T*b,T,S),i$(x[2],T*b,-T,S),i$(x[3],T*b,T,S),i$(x[4],-M*b,-M,w),i$(x[5],-M*b,M,w),i$(x[6],M*b,-M,w),i$(x[7],M*b,M,w)}else{var C=(-1-g)/r,D=(1-g)/r,A=(1-m)/l,I=(-1-m)/l,E=(-1-v)/p,L=(1-v)/p;_.min.set(Math.min(C,D),Math.min(I,A),Math.min(L,E)),_.max.set(Math.max(D,C),Math.max(A,I),Math.max(E,L));var N=_.min.array,P=_.max.array;i$(x[0],N[0],N[1],N[2]),i$(x[1],N[0],P[1],N[2]),i$(x[2],P[0],N[1],N[2]),i$(x[3],P[0],P[1],N[2]),i$(x[4],N[0],N[1],P[2]),i$(x[5],N[0],P[1],P[2]),i$(x[6],P[0],N[1],P[2]),i$(x[7],P[0],P[1],P[2])}},getTransformedBoundingBox:(r$=Cq.create(),function(e,t){var n=this.vertices,r=t.array,i=e.min,o=e.max,a=i.array,s=o.array,l=n[0];a$(r$,l,r),o$(a,r$),o$(s,r$);for(var u=1;u<8;u++)l=n[u],a$(r$,l,r),a[0]=s$(r$[0],a[0]),a[1]=s$(r$[1],a[1]),a[2]=s$(r$[2],a[2]),s[0]=l$(r$[0],s[0]),s[1]=l$(r$[1],s[1]),s[2]=l$(r$[2],s[2]);return i._dirty=!0,o._dirty=!0,e})};var c$,h$=SK.extend((function(){return{projectionMatrix:new iK,invProjectionMatrix:new iK,viewMatrix:new iK,frustum:new u$}}),(function(){this.update(!0)}),{update:function(e){SK.prototype.update.call(this,e),iK.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),iK.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){iK.copy(this.viewMatrix,e),iK.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){iK.copy(this.projectionMatrix,e),iK.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(c$=$q.create(),function(e,t){var n=void 0!==t?t:new Kq,r=e.array[0],i=e.array[1];return $q.set(c$,r,i,-1,1),$q.transformMat4(c$,c$,this.invProjectionMatrix.array),$q.transformMat4(c$,c$,this.worldTransform.array),Cq.scale(n.origin.array,c$,1/c$[3]),$q.set(c$,r,i,1,1),$q.transformMat4(c$,c$,this.invProjectionMatrix.array),$q.transformMat4(c$,c$,this.worldTransform.array),Cq.scale(c$,c$,1/c$[3]),Cq.sub(n.direction.array,c$,n.origin.array),Cq.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})}),d$=Mq.create(),p$=Mq.create(),f$={};function g$(e){var t=[],n=Object.keys(e);n.sort();for(var r=0;r<n.length;r++){var i=n[r];t.push(i+" "+e[i])}var o=t.join("\n");if(f$[o])return f$[o];var a=xY.genGUID();return f$[o]=a,a}function m$(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}m$.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},m$.prototype.add=function(e,t){t?this.transparent[this._transparentCount++]=e:this.opaque[this._opaqueCount++]=e},m$.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var v$,y$,_$=SK.extend((function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new _K,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new MZ(20)}}),(function(){this._scene=this}),{addToScene:function(e){e instanceof h$?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof t$&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof h$?(t=this._cameraList.indexOf(e))>=0&&this._cameraList.splice(t,1):e instanceof t$&&(t=this.lights.indexOf(e))>=0&&this.lights.splice(t,1),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},n=0;n<e.length;n++){var r=e[n];if(!r.invisible){var i=r.group;t[i]||(t[i]={}),t[i][r.type]=t[i][r.type]||0,t[i][r.type]++}}for(var o in this._lightNumber=t,t)this._lightProgramKeys[o]=g$(t[o]);this._updateLightUniforms()},cloneNode:function(e){var t=e.clone(),n={};return function e(t,r){n[t.__uid__]=r;for(var i=0;i<t._children.length;i++){e(t._children[i],r._children[i])}}(e,t),t.traverse((function(e){e.skeleton&&(e.skeleton=e.skeleton.clone(n)),e.material&&(e.material=e.material.clone())})),t},updateRenderList:function(e,t){var n=e.__uid__,r=this._renderLists.get(n);r||(r=new m$,this._renderLists.put(n,r)),r.startCount(),t&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var i=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,e,i,r,t),r.endCount(),r},getRenderList:function(e){return this._renderLists.get(e.__uid__)},_doUpdateRenderList:function(e,t,n,r,i){if(!e.invisible)for(var o=0;o<e._children.length;o++){var a=e._children[o];if(a.isRenderable()){var s=a.isSkinnedMesh()?d$:a.worldTransform.array,l=a.geometry;Mq.multiplyAffine(p$,t.viewMatrix.array,s),(i&&!l.boundingBox||!this.isFrustumCulled(a,t,p$))&&r.add(a,a.material.transparent||n)}a._children.length>0&&this._doUpdateRenderList(a,t,n,r,i)}},isFrustumCulled:(v$=new _K,y$=new iK,function(e,t,n){var r=e.boundingBox;if(r||(r=e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox),!r)return!1;if(y$.array=n,v$.transformFrom(r,y$),e.castShadow&&this.viewBoundingBoxLastFrame.union(v$),e.frustumCulling){if(!v$.intersectBoundingBox(t.frustum.boundingBox))return!0;y$.array=t.projectionMatrix.array,v$.max.array[2]>0&&v$.min.array[2]<0&&(v$.max.array[2]=-1e-20),v$.applyProjection(y$);var i=v$.min.array,o=v$.max.array;if(o[0]<-1||i[0]>1||o[1]<-1||i[1]>1||o[2]<-1||i[2]>1)return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(x$);var t=this._lightUniforms;for(var n in t)for(var r in t[n])t[n][r].value.length=0;for(var i=0;i<e.length;i++){var o=e[i];if(!o.invisible){n=o.group;for(var r in o.uniformTemplates){var a=o.uniformTemplates[r],s=a.value(o);if(null!=s){t[n]||(t[n]={}),t[n][r]||(t[n][r]={type:"",value:[]});var l=t[n][r];switch(l.type=a.type+"v",a.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+a.type)}}}}}},getLightGroups:function(){var e=[];for(var t in this._lightNumber)e.push(t);return e},getNumberChangedLightGroups:function(){var e=[];for(var t in this._lightNumber)this.isLightNumberChanged(t)&&e.push(t);return e},isLightNumberChanged:function(e){var t=this._previousLightNumber,n=this._lightNumber;for(var r in n[e]){if(!t[e])return!0;if(n[e][r]!==t[e][r])return!0}for(var r in t[e]){if(!n[e])return!0;if(n[e][r]!==t[e][r])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(){function e(e,t,n){for(var r in e){var i=e[r];if("tv"===i.type){if(!t.hasUniform(r))continue;for(var o=[],a=0;a<i.value.length;a++){var s=i.value[a],l=t.takeCurrentTextureSlot(n,s);o.push(l)}t.setUniform(n.gl,"1iv",r,o)}else t.setUniform(n.gl,i.type,r,i.value)}}return function(t,n,r){e(this._lightUniforms[n],t,r),e(this.shadowUniforms,t,r)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function x$(e,t){if(t.castShadow&&!e.castShadow)return!0}var b$=EK.isPowerOfTwo,w$=["px","nx","py","ny","pz","nz"],S$=AK.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{textureType:"textureCube",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,r=this.type;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var i=e.getGLExtension("EXT_texture_filter_anisotropic");(i&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(e.getGLExtension("OES_texture_half_float")||(r=qY));if(this.mipmaps.length)for(var o=this.width,a=this.height,s=0;s<this.mipmaps.length;s++){var l=this.mipmaps[s];this._updateTextureData(t,l,s,o,a,n,r),o/=2,a/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,r),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,n,r,i,o,a){for(var s=0;s<6;s++){var l=w$[s],u=t.image&&t.image[l];u?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,o,a,u):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,r,i,0,o,a,t.pixels&&t.pixels[l])}},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_CUBE_MAP))},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?b$(this.image.px.width)&&b$(this.image.px.height):b$(this.width)&&b$(this.height)},isRenderable:function(){return this.image.px?T$(this.image.px)&&T$(this.image.nx)&&T$(this.image.py)&&T$(this.image.ny)&&T$(this.image.pz)&&T$(this.image.nz):!(!this.width||!this.height)},load:function(e,t){var n=0,r=this;return xY.each(e,(function(e,i){var o=wZ.createImage();t&&(o.crossOrigin=t),o.onload=function(){0===--n&&(r.dirty(),r.trigger("success",r))},o.onerror=function(){n--},n++,o.src=e,r.image[i]=o})),this}});function T$(e){return e.width>0&&e.height>0}Object.defineProperty(S$.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(S$.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});var M$=h$.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=h$.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}}),C$="framebuffer",D$="renderbuffer",A$=D$+"_width",I$=D$+"_height",E$=D$+"_attached",L$="depthtexture_attached",N$=pZ,P$=fZ,O$=vZ,R$=mZ,k$=bY.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new DK,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(N$,this._getFrameBufferGL(e)),this._boundRenderer=e;var n=this._cache;n.put("viewport",e.viewport);var r,i,o=!1;for(var a in this._textures){o=!0;var s=this._textures[a];s&&(r=s.texture.width,i=s.texture.height,this._doAttach(e,s.texture,a,s.target))}this._width=r,this._height=i,!o&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,r,i,1);var l=n.get("attached_textures");if(l)for(var a in l)if(!this._textures[a]){var u=l[a];this._doDetach(t,a,u)}if(!n.get(L$)&&this.depthBuffer){n.miss(D$)&&n.put(D$,t.createRenderbuffer());var c=n.get(D$);r===n.get(A$)&&i===n.get(I$)||(t.bindRenderbuffer(P$,c),t.renderbufferStorage(P$,t.DEPTH_COMPONENT16,r,i),n.put(A$,r),n.put(I$,i),t.bindRenderbuffer(P$,null)),n.get(E$)||(t.framebufferRenderbuffer(N$,O$,P$,c),n.put(E$,!0))}},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer(N$,null),this._boundRenderer=null,this._cache.use(e.__uid__);var t=this._cache.get("viewport");t&&e.setViewport(t),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var n in this._textures){var r=this._textures[n];if(r){var i=r.texture;if(!i.NPOT&&i.useMipmap&&i.minFilter===AK.LINEAR_MIPMAP_LINEAR){var o="textureCube"===i.textureType?uZ:lZ;t.bindTexture(o,i.getWebGLTexture(e)),t.generateMipmap(o),t.bindTexture(o,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(N$)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(C$)&&t.put(C$,e.gl.createFramebuffer()),t.get(C$)},attach:function(e,t,n){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||R$,n=n||lZ;var r,i=this._boundRenderer;if(i&&i.gl){var o=this._cache;o.use(i.__uid__),r=o.get("attached_textures")}var a=this._textures[t];if(!a||a.target!==n||a.texture!==e||!r||null==r[t]){var s=!0;i&&(s=this._doAttach(i,e,t,n),this.viewport||i.setViewport(0,0,e.width,e.height,1)),s&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=n)}},_doAttach:function(e,t,n,r){var i=e.gl,o=t.getWebGLTexture(e),a=this._cache.get("attached_textures");if(a&&a[n]){var s=a[n];if(s.texture===t&&s.target===r)return}var l=!0;if(((n=+n)===O$||n===_Z)&&(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==KY&&t.format!==gZ&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l)){var u=this._cache.get(D$);u&&(i.framebufferRenderbuffer(N$,O$,P$,null),i.deleteRenderbuffer(u),this._cache.put(D$,!1)),this._cache.put(E$,!1),this._cache.put(L$,!0)}return i.framebufferTexture2D(N$,n,r,o,0),a||(a={},this._cache.put("attached_textures",a)),a[n]=a[n]||{},a[n].texture=t,a[n].target=r,l},_doDetach:function(e,t,n){e.framebufferTexture2D(N$,t,n,null,0);var r=this._cache.get("attached_textures");r&&r[t]&&(r[t]=null),t!==O$&&t!==_Z||this._cache.put(L$,!1)},detach:function(e,t){(this._textures[e]=null,this._boundRenderer)&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t))},dispose:function(e){var t=e.gl,n=this._cache;n.use(e.__uid__);var r=n.get(D$);r&&t.deleteRenderbuffer(r);var i=n.get(C$);i&&t.deleteFramebuffer(i),n.deleteContext(e.__uid__),this._textures={}}});k$.DEPTH_ATTACHMENT=O$,k$.COLOR_ATTACHMENT0=R$,k$.STENCIL_ATTACHMENT=yZ,k$.DEPTH_STENCIL_ATTACHMENT=_Z;var z$=["px","nx","py","ny","pz","nz"],V$=bY.extend((function(){var e={position:new Bq,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new M$({fov:90}),nx:new M$({fov:90}),py:new M$({fov:90}),ny:new M$({fov:90}),pz:new M$({fov:90}),nz:new M$({fov:90})};return t.px.lookAt(Bq.POSITIVE_X,Bq.NEGATIVE_Y),t.nx.lookAt(Bq.NEGATIVE_X,Bq.NEGATIVE_Y),t.py.lookAt(Bq.POSITIVE_Y,Bq.POSITIVE_Z),t.ny.lookAt(Bq.NEGATIVE_Y,Bq.NEGATIVE_Z),t.pz.lookAt(Bq.POSITIVE_Z,Bq.NEGATIVE_Y),t.nz.lookAt(Bq.NEGATIVE_Z,Bq.NEGATIVE_Y),e._frameBuffer=new k$,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,n){var r=e.gl;n||t.update();for(var i=this.texture.width,o=2*Math.atan(i/(i-.5))/Math.PI*180,a=0;a<6;a++){var s=z$[a],l=this._cameras[s];if(Bq.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=o,this.shadowMapPass){l.update();var u=t.getBoundingBox();u.applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(e,t,l,!0)}this._frameBuffer.attach(this.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}}),B$=WK.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,n=this.attributes,r=[],i=[],o=[],a=[],s=0;s<=e;s++)for(var l=s/e,u=0;u<=t;u++){var c=u/t;if(r.push([2*c-1,2*l-1,0]),i.push([c,l]),o.push([0,0,1]),u<t&&s<e){var h=u+s*(t+1);a.push([h,h+1,h+t+1]),a.push([h+t+1,h+1,h+t+2])}}n.position.fromArray(r),n.texcoord0.fromArray(i),n.normal.fromArray(o),this.initIndicesFromArray(a),this.boundingBox=new _K,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}}),F$=new iK,G$=WK.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:H$("px",this.depthSegments,this.heightSegments),nx:H$("nx",this.depthSegments,this.heightSegments),py:H$("py",this.widthSegments,this.depthSegments),ny:H$("ny",this.widthSegments,this.depthSegments),pz:H$("pz",this.widthSegments,this.heightSegments),nz:H$("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],n=0,r=0;for(var i in e)n+=e[i].vertexCount,r+=e[i].indices.length;for(var o=0;o<t.length;o++)this.attributes[t[o]].init(n);this.indices=new wZ.Uint16Array(r);var a=0,s=0;for(var i in e){var l=e[i];for(o=0;o<t.length;o++)for(var u=t[o],c=l.attributes[u].value,h=l.attributes[u].size,d="normal"===u,p=0;p<c.length;p++){var f=c[p];this.inside&&d&&(f=-f),this.attributes[u].value[p+h*s]=f}var g=l.indices.length;for(p=0;p<l.indices.length;p++)this.indices[p+a]=s+l.indices[this.inside?g-p-1:p];a+=l.indices.length,s+=l.vertexCount}this.boundingBox=new _K,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function H$(e,t,n){F$.identity();var r=new B$({widthSegments:t,heightSegments:n});switch(e){case"px":iK.translate(F$,F$,Bq.POSITIVE_X),iK.rotateY(F$,F$,Math.PI/2);break;case"nx":iK.translate(F$,F$,Bq.NEGATIVE_X),iK.rotateY(F$,F$,-Math.PI/2);break;case"py":iK.translate(F$,F$,Bq.POSITIVE_Y),iK.rotateX(F$,F$,-Math.PI/2);break;case"ny":iK.translate(F$,F$,Bq.NEGATIVE_Y),iK.rotateX(F$,F$,Math.PI/2);break;case"pz":iK.translate(F$,F$,Bq.POSITIVE_Z);break;case"nz":iK.translate(F$,F$,Bq.NEGATIVE_Z),iK.rotateY(F$,F$,Math.PI)}return r.applyTransform(F$),r}bq.import("@export clay.skybox.vertex\n#define SHADER_NAME skybox\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\n#define PI 3.1415926\nuniform mat4 viewInverse : VIEWINVERSE;\n#ifdef EQUIRECTANGULAR\nuniform sampler2D environmentMap;\n#else\nuniform samplerCube environmentMap;\n#endif\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n#ifdef EQUIRECTANGULAR\n float phi = acos(V.y);\n float theta = atan(-V.x, V.z) + PI * 0.5;\n vec2 uv = vec2(theta / 2.0 / PI, phi / PI);\n vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));\n#else\n #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));\n #else\n vec4 texel = decodeHDR(textureCube(environmentMap, V));\n #endif\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end");var U$=IK.extend((function(){var e=new bq({vertex:bq.source("clay.skybox.vertex"),fragment:bq.source("clay.skybox.fragment")}),t=new WZ({shader:e,depthMask:!1});return{scene:null,geometry:new G$,material:t,environmentMap:null,culling:!1,_dummyCamera:new M$}}),(function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(e){this.scene&&this.detachScene(),e.skybox=this,this.scene=e,e.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(e){this.detachScene(),this.geometry.dispose(e)},setEnvironmentMap:function(e){"texture2D"===e.textureType?(this.material.define("EQUIRECTANGULAR"),e.minFilter=AK.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,n){this.renderSkybox(e,n)},renderSkybox:function(e,t){var n=this._dummyCamera;n.aspect=e.getViewportAspect(),n.fov=t.fov||50,n.updateProjectionMatrix(),iK.invert(n.invProjectionMatrix,n.projectionMatrix),n.worldTransform.copy(t.worldTransform),n.viewMatrix.copy(t.viewMatrix),this.position.copy(t.getWorldPosition()),this.update(),e.gl.disable(e.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],n)}});function W$(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var j$=W$("DXT1"),X$=W$("DXT3"),Y$=W$("DXT5"),Z$=function(e,t){var n=new Int32Array(e,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var r,i,o=n(21),a=n[4],s=n[3],l=512&n[28],u=131072&n[2];switch(o){case j$:r=8,i=AK.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case X$:r=16,i=AK.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Y$:r=16,i=AK.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var c=n[1]+4,h=l?6:1,d=1;u&&(d=Math.max(1,n[7]));for(var p=[],f=0;f<h;f++){var g=a,m=s;p[f]=new PK({width:g,height:m,format:i});for(var v=[],y=0;y<d;y++){var _=Math.max(4,g)/4*Math.max(4,m)/4*r,x=new Uint8Array(e,c,_);c+=_,g*=.5,m*=.5,v[y]=x}p[f].pixels=v[0],u&&(p[f].mipmaps=v)}if(!t)return p[0];t.width=p[0].width,t.height=p[0].height,t.format=p[0].format,t.pixels=p[0].pixels,t.mipmaps=p[0].mipmaps},q$=String.fromCharCode;function K$(e,t,n,r){if(e[3]>0){var i=Math.pow(2,e[3]-128-8+r);t[n+0]=e[0]*i,t[n+1]=e[1]*i,t[n+2]=e[2]*i}else t[n+0]=0,t[n+1]=0,t[n+2]=0;return t[n+3]=1,t}function $$(e,t,n,r){for(var i,o,a=0,s=0,l=r;l>0;)if(e[s][0]=t[n++],e[s][1]=t[n++],e[s][2]=t[n++],e[s][3]=t[n++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var u=e[s][3]<<a>>>0;u>0;u--)i=e[s-1],(o=e[s])[0]=i[0],o[1]=i[1],o[2]=i[2],o[3]=i[3],s++,l--;a+=8}else s++,l--,a=0;return n}function J$(e,t,n,r){if(r<8|r>32767)return $$(e,t,n,r);if(2!=(i=t[n++]))return $$(e,t,n-1,r);if(e[0][1]=t[n++],e[0][2]=t[n++],i=t[n++],(e[0][2]<<8>>>0|i)>>>0!==r)return null;for(var i=0;i<4;i++)for(var o=0;o<r;){var a=t[n++];if(a>128){a=(127&a)>>>0;for(var s=t[n++];a--;)e[o++][i]=s}else for(;a--;)e[o++][i]=t[n++]}return n}var Q$=function(e,t,n){null==n&&(n=0);var r=new Uint8Array(e),i=r.length;if("#?"===function(e,t,n){for(var r="",i=t;i<n;i++)r+=q$(e[i]);return r}(r,0,2)){for(var o=2;o<i&&("\n"!==q$(r[o])||"\n"!==q$(r[o+1]));o++);if(!(o>=i)){o+=2;for(var a="";o<i;o++){var s=q$(r[o]);if("\n"===s)break;a+=s}var l=a.split(" "),u=parseInt(l[1]),c=parseInt(l[3]);if(c&&u){for(var h=o+1,d=[],p=0;p<c;p++){d[p]=[];for(var f=0;f<4;f++)d[p][f]=0}for(var g=new Float32Array(c*u*4),m=0,v=0;v<u;v++){if(!(h=J$(d,r,h,c)))return null;for(p=0;p<c;p++)K$(d[p],g,m,n),m+=4}return t||(t=new PK),t.width=c,t.height=u,t.pixels=g,t.type=AK.FLOAT,t}}}},eJ={loadTexture:function(e,t,n,r){var i;if("function"==typeof t?(r=n=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return i=new PK({width:0,height:0,sRGB:!1}),eJ._fetchTexture(e,(function(e){Q$(e,i,t.exposure),i.dirty(),n&&n(i)}),r),i;e.match(/.dds$/)||"dds"===t.fileType?(i=new PK({width:0,height:0}),eJ._fetchTexture(e,(function(e){Z$(e,i),i.dirty(),n&&n(i)}),r)):((i=new PK).load(e),i.success(n),i.error(r))}else"object"==typeof e&&void 0!==e.px&&((i=new S$).load(e),i.success(n),i.error(r));return i},loadPanorama:function(e,t,n,r,i,o){var a=this;"function"==typeof r?(o=i=r,r={}):r=r||{},eJ.loadTexture(t,r,(function(t){t.flipY=r.flipY||!1,a.panoramaToCubeMap(e,t,n,r),t.dispose(e),i&&i(n)}),o)},panoramaToCubeMap:function(e,t,n,r){var i=new V$,o=new U$({scene:new _$});return o.setEnvironmentMap(t),(r=r||{}).encodeRGBM&&o.material.define("fragment","RGBM_ENCODE"),n.sRGB=t.sRGB,i.texture=n,i.render(e,o.scene),i.texture=null,i.dispose(e),n},heightToNormal:function(e,t){var n=document.createElement("canvas"),r=n.width=e.width,i=n.height=e.height,o=n.getContext("2d");o.drawImage(e,0,0,r,i),t=t||!1;for(var a=o.getImageData(0,0,r,i),s=o.createImageData(r,i),l=0;l<a.data.length;l+=4){if(t){var u=a.data[l],c=a.data[l+1],h=a.data[l+2];if(Math.abs(u-c)+Math.abs(c-h)>20)return console.warn("Given image is not a height map"),e}var d,p,f,g;l%(4*r)==0?(d=a.data[l],f=a.data[l+4]):l%(4*r)==4*(r-1)?(d=a.data[l-4],f=a.data[l]):(d=a.data[l-4],f=a.data[l+4]),l<4*r?(p=a.data[l],g=a.data[l+4*r]):l>r*(i-1)*4?(p=a.data[l-4*r],g=a.data[l]):(p=a.data[l-4*r],g=a.data[l+4*r]),s.data[l]=d-f+127,s.data[l+1]=p-g+127,s.data[l+2]=255,s.data[l+3]=255}return o.putImageData(s,0,0),n},isHeightImage:function(e,t,n){if(!e||!e.width||!e.height)return!1;var r=document.createElement("canvas"),i=r.getContext("2d"),o=t||32;n=n||20,r.width=r.height=o,i.drawImage(e,0,0,o,o);for(var a=i.getImageData(0,0,o,o),s=0;s<a.data.length;s+=4){var l=a.data[s],u=a.data[s+1],c=a.data[s+2];if(Math.abs(l-u)+Math.abs(u-c)>n)return!1}return!0},_fetchTexture:function(e,t,n){wZ.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:n})},createChessboard:function(e,t,n,r){e=e||512,t=t||64,n=n||"black",r=r||"white";var i=Math.ceil(e/t),o=document.createElement("canvas");o.width=e,o.height=e;var a=o.getContext("2d");a.fillStyle=r,a.fillRect(0,0,e,e),a.fillStyle=n;for(var s=0;s<i;s++)for(var l=0;l<i;l++){(l%2?s%2:s%2-1)&&a.fillRect(s*t,l*t,t,t)}return new PK({image:o,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),new PK({image:t})}},tJ=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function nJ(e){return"_on"+e}var rJ=function(e){var t=this;this._texture=new PK({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),PK.prototype.dispose.call(this,e)}}),tJ.forEach((function(e){this[nJ(e)]=function(t){t.triangle&&this._meshes.forEach((function(n){this.dispatchEvent(e,n,t.triangle,t.point)}),this)}}),this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null};rJ.prototype={constructor:rJ,getTexture:function(){return this._texture},setECharts:function(e){this._chart=e;var t=e.getDom();if(t instanceof HTMLCanvasElement){var n=this,r=e.getZr(),i=r.__oldRefreshImmediately||r.refreshImmediately;r.refreshImmediately=function(){i.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},r.__oldRefreshImmediately=i}else console.error("ECharts must init on canvas if it is used as texture."),t=document.createElement("canvas");this._texture.image=t,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var e=new Bq,t=new Bq,n=new Bq,r=new qZ,i=new qZ,o=new qZ,a=new qZ,s=new Bq;return function(l,u,c,h){var d=u.geometry,p=d.attributes.position,f=d.attributes.texcoord0,g=Bq.dot,m=Bq.cross;p.get(c[0],e.array),p.get(c[1],t.array),p.get(c[2],n.array),f.get(c[0],r.array),f.get(c[1],i.array),f.get(c[2],o.array),m(s,t,n);var v=g(e,s),y=g(h,s)/v;m(s,n,e);var _=g(h,s)/v;m(s,e,t);var x=g(h,s)/v;qZ.scale(a,r,y),qZ.scaleAndAdd(a,a,i,_),qZ.scaleAndAdd(a,a,o,x);var b=a.x*this._chart.getWidth(),w=a.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(l,{zrX:b,zrY:w})}}(),attachToMesh:function(e){this._meshes.indexOf(e)>=0||(tJ.forEach((function(t){e.on(t,this[nJ(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),tJ.forEach((function(t){e.off(t,this[nJ(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}};var iJ=h$.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=h$.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});bq.import("\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end");var oJ=new B$,aJ=new IK({geometry:oJ,frustumCulling:!1}),sJ=new iJ,lJ=bY.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new bq(bq.source("clay.compositor.vertex"),this.fragment),t=new WZ({shader:e});t.enableTexturesAll(),this.material=t}),{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||mZ,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var n in this.outputs){var r=this.outputs[n];r&&t.attach(r,n)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var n=e.gl;if(t){this.bind(e,t);var r=e.getGLExtension("EXT_draw_buffers");if(r&&this.outputs){var i=[];for(var o in this.outputs)(o=+o)>=n.COLOR_ATTACHMENT0&&o<=n.COLOR_ATTACHMENT0+8&&i.push(o);r.drawBuffersEXT(i)}}this.trigger("beforerender",this,e);var a=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){a|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(a),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){aJ.material=this.material,e.renderPass([aJ],sJ)},dispose:function(e){}}),uJ={},cJ=["px","nx","py","ny","pz","nz"];uJ.prefilterEnvironmentMap=function(e,t,n,r,i){i&&r||(r=uJ.generateNormalDistribution(),i=uJ.integrateBRDF(e,r));var o=(n=n||{}).width||64,a=n.height||64,s=n.type||t.type,l=new S$({width:o,height:a,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(o,a),c=Math.log(u)/Math.log(2)+1,h=new WZ({shader:new bq({vertex:bq.source("clay.skybox.vertex"),fragment:"#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"})});h.set("normalDistribution",r),n.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&h.define("fragment","RGBM_DECODE");var d,p=new _$;if("texture2D"===t.textureType){var f=new S$({width:o,height:a,type:s===AK.FLOAT?AK.HALF_FLOAT:s});eJ.panoramaToCubeMap(e,t,f,{encodeRGBM:n.decodeRGBM}),t=f}(d=new U$({scene:p,material:h})).material.set("environmentMap",t);var g=new V$({texture:l});n.encodeRGBM&&(s=l.type=AK.UNSIGNED_BYTE);for(var m=new PK({width:o,height:a,type:s}),v=new k$({depthBuffer:!1}),y=wZ[s===AK.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],_=0;_<c;_++){l.mipmaps[_]={pixels:{}},d.material.set("roughness",_/(c-1));for(var x=m.width,b=2*Math.atan(x/(x-.5))/Math.PI*180,w=0;w<cJ.length;w++){var S=new y(m.width*m.height*4);v.attach(m),v.bind(e);var T=g.getCamera(cJ[w]);T.fov=b,e.render(p,T),e.gl.readPixels(0,0,m.width,m.height,AK.RGBA,s,S),v.unbind(e),l.mipmaps[_].pixels[cJ[w]]=S}m.width/=2,m.height/=2,m.dirty()}return v.dispose(e),m.dispose(e),d.dispose(e),r.dispose(e),{environmentMap:l,brdfLookup:i,normalDistribution:r,maxMipmapLevel:c}},uJ.integrateBRDF=function(e,t){t=t||uJ.generateNormalDistribution();var n=new k$({depthBuffer:!1}),r=new lJ({fragment:"#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"}),i=new PK({width:512,height:256,type:AK.HALF_FLOAT,wrapS:AK.CLAMP_TO_EDGE,wrapT:AK.CLAMP_TO_EDGE,minFilter:AK.NEAREST,magFilter:AK.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",t),r.setUniform("viewportSize",[512,256]),r.attachOutput(i),r.render(e,n),n.dispose(e),i},uJ.generateNormalDistribution=function(e,t){for(var n=new PK({width:e=e||256,height:t=t||1024,type:AK.FLOAT,minFilter:AK.NEAREST,magFilter:AK.NEAREST,wrapS:AK.CLAMP_TO_EDGE,wrapT:AK.CLAMP_TO_EDGE,useMipmap:!1}),r=new Float32Array(t*e*4),i=[],o=0;o<e;o++){for(var a=o/e,s=a*a,l=0;l<t;l++){var u=(l<<16|l>>>16)>>>0;u=(((16711935&(u=((252645135&(u=((858993459&(u=((1431655765&u)<<1|(2863311530&u)>>>1)>>>0))<<2|(3435973836&u)>>>2)>>>0))<<4|(4042322160&u)>>>4)>>>0))<<8|(4278255360&u)>>>8)>>>0)/4294967296;var c=Math.sqrt((1-u)/(1+(s*s-1)*u));i[l]=c}for(l=0;l<t;l++){var h=4*(l*e+o),d=(c=i[l],Math.sqrt(1-c*c)),p=l/t,f=2*Math.PI*p;r[h]=d*Math.cos(f),r[h+1]=c,r[h+2]=d*Math.sin(f),r[h+3]=1}}return n.pixels=r,n};var hJ=t$.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){if(e.getGLExtension("EXT_shader_texture_lod")){this._brdfLookup||(this._normalDistribution=uJ.generateNormalDistribution(),this._brdfLookup=uJ.integrateBRDF(e,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var r=uJ.prefilterEnvironmentMap(e,n,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=r.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(e)}}else console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}}),dJ=t$.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new wZ.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,n=0;n<e.coefficients.length;n++)t[n]=e.coefficients[n];return t}}}}),pJ={},fJ=["px","nx","py","ny","pz","nz"];function gJ(e,t){var n=e[0],r=e[1],i=e[2];return 0===t?1:1===t?n:2===t?r:3===t?i:4===t?n*i:5===t?r*i:6===t?n*r:7===t?3*i*i-1:n*n-r*r}var mJ={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};pJ.projectEnvironmentMap=function(e,t,n){var r;(n=n||{}).lod=n.lod||0;var i=new _$,o=64;"texture2D"===t.textureType||(o=t.image&&t.image.px?t.image.px.width:t.width),r=new U$({scene:i,environmentMap:t});var a=Math.ceil(o/Math.pow(2,n.lod)),s=Math.ceil(o/Math.pow(2,n.lod)),l=new PK({width:a,height:s}),u=new k$;r.material.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&r.material.define("fragment","RGBM_DECODE"),r.material.set("lod",n.lod);for(var c=new V$({texture:l}),h={},d=0;d<fJ.length;d++){h[fJ[d]]=new Uint8Array(a*s*4);var p=c.getCamera(fJ[d]);p.fov=90,u.attach(l),u.bind(e),e.render(i,p),e.gl.readPixels(0,0,a,s,AK.RGBA,AK.UNSIGNED_BYTE,h[fJ[d]]),u.unbind(e)}return r.dispose(e),u.dispose(e),l.dispose(e),function(e,t,n,r){for(var i=new wZ.Float32Array(27),o=Cq.create(),a=Cq.create(),s=Cq.create(),l=0;l<9;l++){for(var u=Cq.create(),c=0;c<fJ.length;c++){for(var h=t[fJ[c]],d=Cq.create(),p=0,f=0,g=mJ[fJ[c]],m=0;m<r;m++)for(var v=0;v<n;v++){o[0]=v/(n-1)*2-1,o[1]=m/(r-1)*2-1,o[2]=-1,Cq.normalize(o,o),s[0]=o[g[0]]*g[3],s[1]=o[g[1]]*g[4],s[2]=o[g[2]]*g[5],a[0]=h[f++]/255,a[1]=h[f++]/255,a[2]=h[f++]/255;var y=h[f++]/255*8.12;a[0]*=y,a[1]*=y,a[2]*=y,Cq.scaleAndAdd(d,d,a,gJ(s,l)*-o[2]),p+=-o[2]}Cq.scaleAndAdd(u,u,d,1/p)}i[3*l]=u[0]/6,i[3*l+1]=u[1]/6,i[3*l+2]=u[2]/6}return i}(0,h,a,s)};var vJ=function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},yJ=function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?J(t.dataIndex)?j(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?J(t.name)?j(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},_J=WK.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var e=this.heightSegments,t=this.widthSegments,n=this.attributes.position,r=this.attributes.texcoord0,i=this.attributes.normal,o=(t+1)*(e+1);n.init(o),r.init(o),i.init(o);var a,s,l,u,c,h,d,p,f,g,m,v=o>65535?Uint32Array:Uint16Array,y=this.indices=new v(t*e*6),_=this.radius,x=this.phiStart,b=this.phiLength,w=this.thetaStart,S=this.thetaLength,T=[],M=[],C=0,D=1/(_=this.radius);for(d=0;d<=e;d++)for(h=0;h<=t;h++)u=h/t,c=d/e,a=-_*Math.cos(x+u*b)*Math.sin(w+c*S),s=_*Math.cos(w+c*S),l=_*Math.sin(x+u*b)*Math.sin(w+c*S),T[0]=a,T[1]=s,T[2]=l,M[0]=u,M[1]=c,n.set(C,T),r.set(C,M),T[0]*=D,T[1]*=D,T[2]*=D,i.set(C,T),C++;var A=t+1,I=0;for(d=0;d<e;d++)for(h=0;h<t;h++)f=d*A+h,p=d*A+h+1,m=(d+1)*A+h+1,g=(d+1)*A+h,y[I++]=p,y[I++]=f,y[I++]=m,y[I++]=f,y[I++]=g,y[I++]=m;this.boundingBox=new _K,this.boundingBox.max.set(_,_,_),this.boundingBox.min.set(-_,-_,-_)}}),xJ=t$.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}}}),bJ=t$.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new Bq,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=t$.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}}),wJ=t$.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(e){return e.range}},pointLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=t$.prototype.clone.call(this);return e.range=this.range,e}}),SJ=t$.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(e){return e.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(e){return e.falloffFactor}},spotLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new Bq,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=t$.prototype.clone.call(this);return e.range=this.range,e.umbraAngle=this.umbraAngle,e.penumbraAngle=this.penumbraAngle,e.falloffFactor=this.falloffFactor,e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}}),TJ=function(e,t,n,r){e=e||0,t=t||0,n=n||0,r=r||0,this.array=$q.fromValues(e,t,n,r),this._dirty=!0};TJ.prototype={constructor:TJ,add:function(e){return $q.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n,r){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new TJ(this.x,this.y,this.z,this.w)},copy:function(e){return $q.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return $q.dist(this.array,e.array)},distance:function(e){return $q.distance(this.array,e.array)},div:function(e){return $q.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return $q.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return $q.dot(this.array,e.array)},len:function(){return $q.len(this.array)},length:function(){return $q.length(this.array)},lerp:function(e,t,n){return $q.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return $q.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return $q.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return $q.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return $q.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return $q.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return $q.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return $q.random(this.array,e),this._dirty=!0,this},scale:function(e){return $q.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return $q.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return $q.sqrDist(this.array,e.array)},squaredDistance:function(e){return $q.squaredDistance(this.array,e.array)},sqrLen:function(){return $q.sqrLen(this.array)},squaredLength:function(){return $q.squaredLength(this.array)},sub:function(e){return $q.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return $q.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return $q.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return $q.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var MJ=Object.defineProperty;if(MJ){var CJ=TJ.prototype;MJ(CJ,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),MJ(CJ,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),MJ(CJ,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),MJ(CJ,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}TJ.add=function(e,t,n){return $q.add(e.array,t.array,n.array),e._dirty=!0,e},TJ.set=function(e,t,n,r,i){$q.set(e.array,t,n,r,i),e._dirty=!0},TJ.copy=function(e,t){return $q.copy(e.array,t.array),e._dirty=!0,e},TJ.distance=TJ.dist=function(e,t){return $q.distance(e.array,t.array)},TJ.div=function(e,t,n){return $q.divide(e.array,t.array,n.array),e._dirty=!0,e},TJ.divide=TJ.div,TJ.dot=function(e,t){return $q.dot(e.array,t.array)},TJ.len=function(e){return $q.length(e.array)},TJ.lerp=function(e,t,n,r){return $q.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},TJ.min=function(e,t,n){return $q.min(e.array,t.array,n.array),e._dirty=!0,e},TJ.max=function(e,t,n){return $q.max(e.array,t.array,n.array),e._dirty=!0,e},TJ.mul=function(e,t,n){return $q.multiply(e.array,t.array,n.array),e._dirty=!0,e},TJ.multiply=TJ.mul,TJ.negate=function(e,t){return $q.negate(e.array,t.array),e._dirty=!0,e},TJ.normalize=function(e,t){return $q.normalize(e.array,t.array),e._dirty=!0,e},TJ.random=function(e,t){return $q.random(e.array,t),e._dirty=!0,e},TJ.scale=function(e,t,n){return $q.scale(e.array,t.array,n),e._dirty=!0,e},TJ.scaleAndAdd=function(e,t,n,r){return $q.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},TJ.squaredDistance=TJ.sqrDist=function(e,t){return $q.sqrDist(e.array,t.array)},TJ.squaredLength=TJ.sqrLen=function(e){return $q.sqrLen(e.array)},TJ.sub=function(e,t,n){return $q.subtract(e.array,t.array,n.array),e._dirty=!0,e},TJ.subtract=TJ.sub,TJ.transformMat4=function(e,t,n){return $q.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},TJ.transformQuat=function(e,t,n){return $q.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var DJ={create:function(){var e=new XZ(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new XZ(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},transpose:function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(a=1/a,e[0]=o*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null},adjoint:function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*s+o*l,e[1]=i*s+a*l,e[2]=r*u+o*c,e[3]=i*u+a*c,e}};DJ.mul=DJ.multiply,DJ.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l,e},DJ.scale=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1];return e[0]=r*s,e[1]=i*s,e[2]=o*l,e[3]=a*l,e},DJ.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))},DJ.LDU=function(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]};var AJ=function(){this.array=DJ.create(),this._dirty=!0};AJ.prototype={constructor:AJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new AJ).copy(this)},copy:function(e){return DJ.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return DJ.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return DJ.determinant(this.array)},identity:function(){return DJ.identity(this.array),this._dirty=!0,this},invert:function(){return DJ.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return DJ.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return DJ.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return DJ.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return DJ.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return DJ.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return DJ.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return DJ.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},AJ.adjoint=function(e,t){return DJ.adjoint(e.array,t.array),e._dirty=!0,e},AJ.copy=function(e,t){return DJ.copy(e.array,t.array),e._dirty=!0,e},AJ.determinant=function(e){return DJ.determinant(e.array)},AJ.identity=function(e){return DJ.identity(e.array),e._dirty=!0,e},AJ.invert=function(e,t){return DJ.invert(e.array,t.array),e._dirty=!0,e},AJ.mul=function(e,t,n){return DJ.mul(e.array,t.array,n.array),e._dirty=!0,e},AJ.multiply=AJ.mul,AJ.rotate=function(e,t,n){return DJ.rotate(e.array,t.array,n),e._dirty=!0,e},AJ.scale=function(e,t,n){return DJ.scale(e.array,t.array,n.array),e._dirty=!0,e},AJ.transpose=function(e,t){return DJ.transpose(e.array,t.array),e._dirty=!0,e};var IJ={create:function(){var e=new XZ(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},clone:function(e){var t=new XZ(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=n*o-r*i;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*a)*l,e[5]=(r*a-n*s)*l,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1],h=n[2],d=n[3],p=n[4],f=n[5];return e[0]=r*u+o*c,e[1]=i*u+a*c,e[2]=r*h+o*d,e[3]=i*h+a*d,e[4]=r*p+o*f+s,e[5]=i*p+a*f+l,e}};IJ.mul=IJ.multiply,IJ.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*u,e[1]=i*c+a*u,e[2]=r*-u+o*c,e[3]=i*-u+a*c,e[4]=s,e[5]=l,e},IJ.scale=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1];return e[0]=r*u,e[1]=i*u,e[2]=o*c,e[3]=a*c,e[4]=s,e[5]=l,e},IJ.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=r*u+o*c+s,e[5]=i*u+a*c+l,e},IJ.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+1)};var EJ=function(){this.array=IJ.create(),this._dirty=!0};EJ.prototype={constructor:EJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new EJ).copy(this)},copy:function(e){return IJ.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return IJ.determinant(this.array)},identity:function(){return IJ.identity(this.array),this._dirty=!0,this},invert:function(){return IJ.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return IJ.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return IJ.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return IJ.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return IJ.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return IJ.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return IJ.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return IJ.translate(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},EJ.copy=function(e,t){return IJ.copy(e.array,t.array),e._dirty=!0,e},EJ.determinant=function(e){return IJ.determinant(e.array)},EJ.identity=function(e){return IJ.identity(e.array),e._dirty=!0,e},EJ.invert=function(e,t){return IJ.invert(e.array,t.array),e._dirty=!0,e},EJ.mul=function(e,t,n){return IJ.mul(e.array,t.array,n.array),e._dirty=!0,e},EJ.multiply=EJ.mul,EJ.rotate=function(e,t,n){return IJ.rotate(e.array,t.array,n),e._dirty=!0,e},EJ.scale=function(e,t,n){return IJ.scale(e.array,t.array,n.array),e._dirty=!0,e},EJ.translate=function(e,t,n){return IJ.translate(e.array,t.array,n.array),e._dirty=!0,e};var LJ=function(){this.array=Jq.create(),this._dirty=!0};LJ.prototype={constructor:LJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return Jq.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new LJ).copy(this)},copy:function(e){return Jq.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return Jq.determinant(this.array)},fromMat2d:function(e){return Jq.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return Jq.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return Jq.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return Jq.identity(this.array),this._dirty=!0,this},invert:function(){return Jq.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return Jq.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return Jq.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return Jq.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return Jq.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return Jq.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return Jq.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return Jq.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return Jq.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return Jq.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},LJ.adjoint=function(e,t){return Jq.adjoint(e.array,t.array),e._dirty=!0,e},LJ.copy=function(e,t){return Jq.copy(e.array,t.array),e._dirty=!0,e},LJ.determinant=function(e){return Jq.determinant(e.array)},LJ.identity=function(e){return Jq.identity(e.array),e._dirty=!0,e},LJ.invert=function(e,t){return Jq.invert(e.array,t.array),e},LJ.mul=function(e,t,n){return Jq.mul(e.array,t.array,n.array),e._dirty=!0,e},LJ.multiply=LJ.mul,LJ.fromMat2d=function(e,t){return Jq.fromMat2d(e.array,t.array),e._dirty=!0,e},LJ.fromMat4=function(e,t){return Jq.fromMat4(e.array,t.array),e._dirty=!0,e},LJ.fromQuat=function(e,t){return Jq.fromQuat(e.array,t.array),e._dirty=!0,e},LJ.normalFromMat4=function(e,t){return Jq.normalFromMat4(e.array,t.array),e._dirty=!0,e},LJ.rotate=function(e,t,n){return Jq.rotate(e.array,t.array,n),e._dirty=!0,e},LJ.scale=function(e,t,n){return Jq.scale(e.array,t.array,n.array),e._dirty=!0,e},LJ.transpose=function(e,t){return Jq.transpose(e.array,t.array),e._dirty=!0,e},LJ.translate=function(e,t,n){return Jq.translate(e.array,t.array,n.array),e._dirty=!0,e};var NJ={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){this._animators=this._animators||[];var n;if(e){for(var r=e.split("."),i=this,o=0,a=r.length;o<a;o++)i&&(i=i[r[o]]);i&&(n=i)}else n=this;if(null==n)throw new Error("Target "+e+" not exists");var s=this._animators,l=new Wr(n,t),u=this;return l.during((function(){u.__zr&&u.__zr.refresh()})).done((function(){var e=s.indexOf(l);e>=0&&s.splice(e,1)})),s.push(l),this.__zr&&this.__zr.animation.addAnimator(l),l},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,n=t.length,r=0;r<n;r++)t[r].stop(e);return t.length=0,this},addAnimatorsToZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.addAnimator(this._animators[t])},removeAnimatorsFromZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.removeAnimator(this._animators[t])}},PJ="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\n#ifdef SUPPORT_STANDARD_DERIVATIVES\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 8.12), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 8.12);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end";function OJ(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}Object.assign(SK.prototype,NJ),bq.import(PJ),bq.import(Tq),bq.import("\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"),bq.import("@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"),bq.import("/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),bq.import("@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),bq.import("@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"),bq.import("@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end");var RJ=_$.prototype.addToScene,kJ=_$.prototype.removeFromScene;_$.prototype.addToScene=function(e){if(RJ.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},_$.prototype.removeFromScene=function(e){kJ.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},WZ.prototype.setTextureImage=function(e,t,n,r){if(this.shader){var i,o,a=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(e),(o=t)&&"none"!==o&&(i=zJ.loadTexture(t,n,r,(function(t){s.enableTexture(e),a&&a.refresh()})),s.set(e,i)),i}};var zJ={};zJ.Renderer=zq,zJ.Node=SK,zJ.Mesh=IK,zJ.Shader=bq,zJ.Material=WZ,zJ.Texture=AK,zJ.Texture2D=PK,zJ.Geometry=WK,zJ.SphereGeometry=_J,zJ.PlaneGeometry=B$,zJ.CubeGeometry=G$,zJ.AmbientLight=xJ,zJ.DirectionalLight=bJ,zJ.PointLight=wJ,zJ.SpotLight=SJ,zJ.PerspectiveCamera=M$,zJ.OrthographicCamera=iJ,zJ.Vector2=qZ,zJ.Vector3=Bq,zJ.Vector4=TJ,zJ.Quaternion=lK,zJ.Matrix2=AJ,zJ.Matrix2d=EJ,zJ.Matrix3=LJ,zJ.Matrix4=iK,zJ.Plane=n$,zJ.Ray=Kq,zJ.BoundingBox=_K,zJ.Frustum=u$;var VJ=null;function BJ(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function FJ(e){if((e.wrapS===AK.REPEAT||e.wrapT===AK.REPEAT)&&e.image){var t=BJ(e.width),n=BJ(e.height);if(t!==e.width||n!==e.height){var r=document.createElement("canvas");r.width=t,r.height=n,r.getContext("2d").drawImage(e.image,0,0,t,n),e.image=r}}}zJ.loadTexture=function(e,t,n,r){"function"==typeof n&&(r=n,n={}),n=n||{};for(var i=Object.keys(n).sort(),o="",a=0;a<i.length;a++)o+=i[a]+"_"+n[i[a]]+"_";var s,l=t.__textureCache=t.__textureCache||new Un(20);if((s=e).getZr&&s.setOption){var u=e.__textureid__;if(h=l.get(o+u))h.texture.surface.setECharts(e),r&&r(h.texture);else{var c=new rJ(e);c.onupdate=function(){t.getZr().refresh()},h={texture:c.getTexture()};for(a=0;a<i.length;a++)h.texture[i[a]]=n[i[a]];u=e.__textureid__||"__ecgl_ec__"+h.texture.__uid__,e.__textureid__=u,l.put(o+u,h),r&&r(h.texture)}return h.texture}if(OJ(e)){var h;u=e.__textureid__;if(!(h=l.get(o+u))){h={texture:new zJ.Texture2D({image:e})};for(a=0;a<i.length;a++)h.texture[i[a]]=n[i[a]];u=e.__textureid__||"__ecgl_image__"+h.texture.__uid__,e.__textureid__=u,l.put(o+u,h),FJ(h.texture),r&&r(h.texture)}return h.texture}if(h=l.get(o+e))h.callbacks?h.callbacks.push(r):r&&r(h.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){h={callbacks:[r]};var d=eJ.loadTexture(e,{exposure:n.exposure,fileType:"hdr"},(function(){d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null}));h.texture=d,l.put(o+e,h)}else{for(d=new zJ.Texture2D({image:new Image}),a=0;a<i.length;a++)d[i[a]]=n[i[a]];h={texture:d,callbacks:[r]};var p=d.image;p.onload=function(){d.image=p,FJ(d),d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null},p.crossOrigin="Anonymous",p.src=e,d.image=null!==VJ?VJ:VJ=eJ.createBlank("rgba(255,255,255,0)").image,l.put(o+e,h)}return h.texture},zJ.createAmbientCubemap=function(e,t,n,r){var i=(e=e||{}).texture,o=vJ(e.exposure,1),a=new hJ({intensity:vJ(e.specularIntensity,1)}),s=new dJ({intensity:vJ(e.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return a.cubemap=zJ.loadTexture(i,n,{exposure:o},(function(){if(a.cubemap.flipY=!1,"production"!==process.env.NODE_ENV)var e=Date.now();if(a.prefilter(t,32),"production"!==process.env.NODE_ENV){var n=Date.now()-e;console.log("Prefilter environment map: "+n+"ms")}s.coefficients=pJ.projectEnvironmentMap(t,a.cubemap,{lod:1}),r&&r()})),{specular:a,diffuse:s}},zJ.createBlankTexture=eJ.createBlank,zJ.isImage=OJ,zJ.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},zJ.parseColor=function(e,t){return e instanceof Array?(t||(t=[]),t[0]=e[0],t[1]=e[1],t[2]=e[2],e.length>3?t[3]=e[3]:t[3]=1,t):((t=nr(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255,t)},zJ.directionFromAlphaBeta=function(e,t){var n=e/180*Math.PI+Math.PI/2,r=-t/180*Math.PI+Math.PI/2,i=[],o=Math.sin(n);return i[0]=o*Math.cos(r),i[1]=-Math.cos(n),i[2]=o*Math.sin(r),i},zJ.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096}return t},zJ.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"],zJ.createShader=function(e){"ecgl.shadow"===e&&(e="ecgl.displayShadow");var t=bq.source(e+".vertex"),n=bq.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),n||console.error("Fragment shader of '%s' not exits",e);var r=new bq(t,n);return r.name=e,r},zJ.createMaterial=function(e,t){t instanceof Array||(t=[t]);var n=zJ.createShader(e),r=new WZ({shader:n});return t.forEach((function(e){"string"==typeof e&&r.define(e)})),r},zJ.setMaterialFromModel=function(e,t,n,r){t.autoUpdateTextureStatus=!1;var i=n.getModel(e+"Material"),o=i.get("detailTexture"),a=vJ(i.get("textureTiling"),1),s=vJ(i.get("textureOffset"),0);"number"==typeof a&&(a=[a,a]),"number"==typeof s&&(s=[s,s]);var l=a[0]>1||a[1]>1?zJ.Texture.REPEAT:zJ.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var c=i.get("roughness"),h=i.get("metalness");null!=h?isNaN(h)&&(t.setTextureImage("metalnessMap",h,r,u),h=vJ(i.get("metalnessAdjust"),.5)):h=0,null!=c?isNaN(c)&&(t.setTextureImage("roughnessMap",c,r,u),c=vJ(i.get("roughnessAdjust"),.5)):c=.5;var d=i.get("normalTexture");t.setTextureImage("detailMap",o,r,u),t.setTextureImage("normalMap",d,r,u),t.set({roughness:c,metalness:h,detailUvRepeat:a,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",o,r,u),t.set({detailUvRepeat:a,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",o,r,u),t.set({detailUvRepeat:a,detailUvOffset:s});else if("hatching"===e){var p=i.get("hatchingTextures")||[];p.length<6&&"production"!==process.env.NODE_ENV&&console.error("Invalid hatchingTextures.");for(var f=0;f<6;f++)t.setTextureImage("hatch"+(f+1),p[f],r,{anisotropic:8,wrapS:zJ.Texture.REPEAT,wrapT:zJ.Texture.REPEAT});t.set({detailUvRepeat:a,detailUvOffset:s})}},zJ.updateVertexAnimation=function(e,t,n,r){var i=r.get("animation"),o=r.get("animationDurationUpdate"),a=r.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(i&&t&&o>0&&t.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<e.length;l++)n.geometry.attributes[e[l][0]].value=t.geometry.attributes[e[l][1]].value;n.geometry.dirty(),n.__percent=0,n.material.set("percent",0),n.stopAnimation(),n.animate().when(o,{__percent:1}).during((function(){n.material.set("percent",n.__percent),s&&s.set("percent",n.__percent)})).done((function(){n.ignorePreZ=!1,n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")})).start(a)}else n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")};var GJ=function(e,t){this.id=e,this.zr=t;try{this.renderer=new zq({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(e){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",void console.error(e)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var n=this.dom.style;n.position="absolute",n.left="0",n.top="0",this.views=[],this._picking=new MK({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new tl({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};function HJ(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}GJ.prototype.setUnpainted=function(){},GJ.prototype.addView=function(e){if(e.layer!==this){var t=this._viewsToDispose.indexOf(e);t>=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var n=this.zr;e.scene.traverse((function(e){e.__zr=n,e.addAnimatorsToZr&&e.addAnimatorsToZr(n)}))}},GJ.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(HJ,this),e.layer=null,this._viewsToDispose.push(e))}},GJ.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(HJ,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},GJ.prototype.resize=function(e,t){this.renderer.resize(e,t)},GJ.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},GJ.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},GJ.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},GJ.prototype.needsRefresh=function(){this.zr.refresh()},GJ.prototype.refresh=function(e){this._backgroundColor=e?zJ.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t<this.views.length;t++)this.views[t].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},GJ.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},GJ.prototype._doRender=function(e){this.clear(),this.renderer.saveViewport();for(var t=0;t<this.views.length;t++)this.views[t].render(this.renderer,e);this.renderer.restoreViewport()},GJ.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var UJ=1;function WJ(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function jJ(e,t){for(var n=0;n<t.length;n++)t[n].__used__||t[n].dispose(e)}function XJ(e,t){e.__used__=e.__used__||0,e.__used__++,1===e.__used__&&t.push(e)}function YJ(e,t,n){var r,i;e.traverse((function(e){if(e.isRenderable()){var o=e.geometry,a=e.material;if(a!==r)for(var s=a.getTextureUniforms(),l=0;l<s.length;l++){var u=s[l],c=a.uniforms[u].value;if(c)if(c instanceof AK)XJ(c,t);else if(c instanceof Array)for(var h=0;h<c.length;h++)c[h]instanceof AK&&XJ(c[h],t)}o!==i&&XJ(o,n),r=a,i=o}}));for(var o=0;o<e.lights.length;o++)e.lights[o].cubemap&&XJ(e.lights[o].cubemap,t)}GJ.prototype._startAccumulating=function(e){var t=this;this._stopAccumulating();for(var n=!1,r=0;r<this.views.length;r++)n=this.views[r].needsAccumulate()||n;function i(r){if(t._accumulatingId&&r===t._accumulatingId){for(var o=!0,a=0;a<t.views.length;a++)o=t.views[a].isAccumulateFinished()&&n;o||(t._doRender(!0),e?i(r):dn((function(){i(r)})))}}n&&(this._accumulatingId=UJ++,e?i(t._accumulatingId):this._accumulatingTimeout=setTimeout((function(){i(t._accumulatingId)}),50))},GJ.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(WJ(this._textureList),WJ(this._geometriesList));for(var n=0;n<this.views.length;n++)YJ(this.views[n].scene,e,t);this._textureList&&(jJ(this.renderer,this._textureList),jJ(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},GJ.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(WJ(this._textureList),WJ(this._geometriesList),jJ(this.renderer,this._textureList),jJ(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)},GJ.prototype.onmousedown=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mousedown",e,t),this._dispatchDataEvent("mousedown",e,t)),this._downX=e.offsetX,this._downY=e.offsetY}},GJ.prototype.onmousemove=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY),n=t&&t.target,r=this._hovered;this._hovered=t,r&&n!==r.target&&(r.relatedTarget=n,this._dispatchEvent("mouseout",e,r),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),r&&n===r.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t)}},GJ.prototype.onmouseup=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mouseup",e,t),this._dispatchDataEvent("mouseup",e,t)),this._upX=e.offsetX,this._upY=e.offsetY}},GJ.prototype.onclick=GJ.prototype.dblclick=function(e){if(!e.target||!e.target.__isGLToZRProxy){var t=this._upX-this._downX,n=this._upY-this._downY;if(!(Math.sqrt(t*t+n*n)>20)){e=e.event;var r=this.pickObject(e.offsetX,e.offsetY);r&&(this._dispatchEvent(e.type,e,r),this._dispatchDataEvent(e.type,e,r));var i=this._clickToSetFocusPoint(e);if(i)i.view.setDOFFocusOnPoint(i.distance)&&this.zr.refresh()}}},GJ.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,n=t.viewport,r=this.views.length-1;r>=0;r--){var i=this.views[r];if(i.hasDOF()&&i.containPoint(e.offsetX,e.offsetY)){this._picking.scene=i.scene,this._picking.camera=i.camera,t.viewport=i.viewport;var o=this._picking.pick(e.offsetX,e.offsetY,!0);if(o)return o.view=i,o}}t.viewport=n},GJ.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},GJ.prototype.pickObject=function(e,t){for(var n=[],r=this.renderer,i=r.viewport,o=0;o<this.views.length;o++){var a=this.views[o];a.containPoint(e,t)&&(this._picking.scene=a.scene,this._picking.camera=a.camera,r.viewport=a.viewport,this._picking.pickAll(e,t,n))}return r.viewport=i,n.sort((function(e,t){return e.distance-t.distance})),n[0]},GJ.prototype._dispatchEvent=function(e,t,n){n||(n={});var r=n.target;for(n.cancelBubble=!1,n.event=t,n.type=e,n.offsetX=t.offsetX,n.offsetY=t.offsetY;r&&(r.trigger(e,n),r=r.getParent(),!n.cancelBubble););this._dispatchToView(e,n)},GJ.prototype._dispatchDataEvent=function(e,t,n){var r=n&&n.target,i=r&&r.dataIndex,o=r&&r.seriesIndex,a=r&&r.eventData,s=!1,l=this._zrEventProxy;l.x=t.offsetX,l.y=t.offsetY,l.update();var u={target:l};const c=vl(l);"mousemove"===e&&(null!=i?i!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(c.dataIndex=this._lastDataIndex,c.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0):null!=a&&a!==this._lastEventData&&(null!=this._lastEventData&&(c.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0),this._lastEventData=a,this._lastDataIndex=i,this._lastSeriesIndex=o),c.eventData=a,c.dataIndex=i,c.seriesIndex=o,(null!=a||parseInt(i,10)>=0&&parseInt(o,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),s&&this.zr.handler.dispatchToElement(u,"mouseover",t))},GJ.prototype._dispatchToView=function(e,t){for(var n=0;n<this.views.length;n++)this.views[n].containPoint(t.offsetX,t.offsetY)&&this.views[n].trigger(e,t)},Object.assign(GJ.prototype,vY);var ZJ=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function qJ(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,r=e[t].emphasis;n&&(e[t]=n),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r)}}function KJ(e){e&&(e instanceof Array||(e=[e]),W(e,(function(e){if(e.axisLabel){var t=e.axisLabel;Object.assign(t,t.textStyle),t.textStyle=null}})))}function $J(e){this._layers={},this._zr=e}$J.prototype.update=function(e,t){var n=this,r=t.getZr();if(r.getWidth()&&r.getHeight()){for(var i in this._layers)this._layers[i].removeViewsAll();e.eachComponent((function(n,r){if("series"!==n){var i=t.getViewOfComponentModel(r),s=r.coordinateSystem;if(i.__ecgl__){if(s){if(!s.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+r.id);l=s.viewGL}else{if(!r.viewGL)return void console.error("Can't find viewGL of component "+r.id);l=s.viewGL}var l=s.viewGL,u=o(r);u.addView(l),i.afterRender&&i.afterRender(r,e,t,u),a(i.groupGL,r.get("silent"))}}})),e.eachSeries((function(n){var r=t.getViewOfSeriesModel(n),i=n.coordinateSystem;if(r.__ecgl__){if(i&&!i.viewGL&&!r.viewGL)return void console.error("Can't find viewGL of series "+r.id);var s=i&&i.viewGL||r.viewGL,l=o(n);l.addView(s),r.afterRender&&r.afterRender(n,e,t,l),a(r.groupGL,n.get("silent"))}}))}else console.warn("Dom has no width or height");function o(e){var t;r.setSleepAfterStill(0),t=(e.coordinateSystem&&e.coordinateSystem.model,e.get("zlevel"));var i=n._layers,o=i[t];if(!o){if(o=i[t]=new GJ("gl-"+t,r),r.painter.isSingleCanvas()){o.virtual=!0;var a=new Zs({z:1e4,style:{image:o.renderer.canvas},silent:!0});o.__hostImage=a,r.add(a)}r.painter.insertLayer(t,o)}return o.__hostImage&&o.__hostImage.setStyle({width:o.renderer.getWidth(),height:o.renderer.getHeight()}),o}function a(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}},Hy((function(e){var t=e.getZr(),n=t.painter.dispose;t.painter.dispose=function(){"function"==typeof this.eachOtherLayer&&this.eachOtherLayer((function(e){e instanceof GJ&&e.dispose()})),n.call(this)},t.painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),n=e.pixelRatio||this.dpr;t.width=this.getWidth()*n,t.height=this.getHeight()*n;var r=t.getContext("2d");r.dpr=n,r.clearRect(0,0,t.width,t.height),e.backgroundColor&&(r.fillStyle=e.backgroundColor,r.fillRect(0,0,t.width,t.height));var i,o=this.storage.getDisplayList(!0),a={},s=this;function l(e,t){var n,i=s._zlevelList;null==e&&(e=-1/0);for(var o=0;o<i.length;o++){var a=i[o],l=s._layers[a];if(!l.__builtin__&&a>e&&a<t){n=l;break}}n&&n.renderToCanvas&&(r.save(),n.renderToCanvas(r),r.restore())}for(var u={ctx:r},c=0;c<o.length;c++){var h=o[c];h.zlevel!==i&&(l(i,h.zlevel),i=h.zlevel),this._doPaintEl(h,u,!0,null,a)}return l(i,1/0),t}})),Uy((function(e,t){var n=t.getZr();(n.__egl=n.__egl||new $J(n)).update(e,t)})),Fy((function(e){W(e.series,(function(t){F(ZJ,t.type)>=0&&(!function(e){qJ(e,"itemStyle"),qJ(e,"lineStyle"),qJ(e,"areaStyle"),qJ(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),KJ(e.xAxis3D),KJ(e.yAxis3D),KJ(e.zAxis3D),KJ(e.grid3D),qJ(e.geo3D)}));var JJ={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(e){e=e||{},this.option.viewControl=this.option.viewControl||{},null!=e.alpha&&(this.option.viewControl.alpha=e.alpha),null!=e.beta&&(this.option.viewControl.beta=e.beta),null!=e.distance&&(this.option.viewControl.distance=e.distance),null!=e.center&&(this.option.viewControl.center=e.center)}},QJ={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},eQ={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}},tQ=$d.extend({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});R(tQ.prototype,JJ),R(tQ.prototype,QJ),R(tQ.prototype,eQ);var nQ=vJ,rQ={left:0,middle:1,right:2};function iQ(e){return e instanceof Array||(e=[e,e]),e}var oQ=bY.extend((function(){return{zr:null,viewGL:null,_center:new Bq,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new qZ,_panVelocity:new qZ,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(e){this[e]=this[e].bind(this)}),this)}),{init:function(){var e=this.zr;e&&(e.on("mousedown",this._mouseDownHandler),e.on("globalout",this._mouseUpHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("pinch",this._pinchHandler),e.animation.on("frame",this._update),e.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var e=this.zr;e&&(e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("pinch",this._pinchHandler),e.off("globalout",this._mouseUpHandler),e.dom.removeEventListener("contextmenu",this._contextMenuHandler),e.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(e){this._distance=e,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(e){this._orthoSize=e,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(e){e=Math.max(Math.min(this.maxAlpha,e),this.minAlpha),this._theta=e/180*Math.PI,this._needsUpdate=!0},setBeta:function(e){e=Math.max(Math.min(this.maxBeta,e),this.minBeta),this._phi=-e/180*Math.PI,this._needsUpdate=!0},setCenter:function(e){this._center.setArray(e)},setViewGL:function(e){this.viewGL=e},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(e,t){var n=(t=t||{}).baseDistance||0,r=t.baseOrthoSize||1,i=e.get("projection");"perspective"!==i&&"orthographic"!==i&&"isometric"!==i&&("production"!==process.env.NODE_ENV&&console.error("Unkown projection type %s, use perspective projection instead.",i),i="perspective"),this._projection=i,this.viewGL.setProjection(i);var o=e.get("distance")+n,a=e.get("orthographicSize")+r;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(t){this[t[0]]=nQ(e.get(t[0]),t[1])}),this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=r,this.maxOrthographicSize+=r;var s=e.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(t){l[t]=nQ(e.get(t),s&&s.get(t))}));var u=nQ(t.alpha,e.get("alpha"))||0,c=nQ(t.beta,e.get("beta"))||0,h=nQ(t.center,e.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:c,center:h,distance:o,orthographicSize:a,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(o),this.setAlpha(u),this.setBeta(c),this.setCenter(h),this.setOrthographicSize(a)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){"production"!==process.env.NODE_ENV&&(null==rQ[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==rQ[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection))},animateTo:function(e){var t=this.zr,n=this,r={},i={};return null!=e.distance&&(r.distance=this.getDistance(),i.distance=e.distance),null!=e.orthographicSize&&(r.orthographicSize=this.getOrthographicSize(),i.orthographicSize=e.orthographicSize),null!=e.alpha&&(r.alpha=this.getAlpha(),i.alpha=e.alpha),null!=e.beta&&(r.beta=this.getBeta(),i.beta=e.beta),null!=e.center&&(r.center=this.getCenter(),i.center=e.center),this._addAnimator(t.animation.animate(r).when(e.duration||1e3,i).during((function(){null!=r.alpha&&n.setAlpha(r.alpha),null!=r.beta&&n.setBeta(r.beta),null!=r.distance&&n.setDistance(r.distance),null!=r.center&&n.setCenter(r.center),null!=r.orthographicSize&&n.setOrthographicSize(r.orthographicSize),n._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e<this._animators.length;e++)this._animators[e].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(e){if(this._rotating){var t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),n=this._orthoSize,r=n/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-r/2,t.right=r/2,t.top=n/2,t.bottom=-n/2},_updatePan:function(e){var t=this._panVelocity,n=this._distance,r=this.getCamera(),i=r.worldTransform.y,o=r.worldTransform.x;this._center.scaleAndAdd(o,-t.x*n/200).scaleAndAdd(i,-t.y*n/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new Bq,n=this._theta+Math.PI/2,r=this._phi+Math.PI/2,i=Math.sin(n);t.x=i*Math.cos(r),t.y=-Math.cos(n),t.z=i*Math.sin(r),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout((function(){t._rotating=!0}),1e3*e))},_vectorDamping:function(e,t){var n=e.len();(n*=t)<1e-4&&(n=0),e.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),n=Math.atan2(e.x,e.z);this._theta=t,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,n=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===rQ[this.rotateMouseButton]?this._mode="rotate":e.event.button===rQ[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy||this._isAnimating())){var t=iQ(this.panSensitivity),n=iQ(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(0!==t){var n,r=e.offsetX,i=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(r,i))n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done((function(){var n=t.indexOf(e);n>=0&&t.splice(n,1)})),e}});Object.defineProperty(oQ.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});var aQ={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var n in t)e||!t[n].value?t[n].value=[]:t[n].value=Array.prototype.slice.call(t[n].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},sQ={vec2:ZZ,vec3:Cq,vec4:$q,mat2:DJ,mat2d:IJ,mat3:Jq,mat4:Mq,quat:rK},lQ=sQ.vec3,uQ=[[0,0],[1,1]],cQ=WK.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new WK.Attribute("position","float",3,"POSITION"),positionPrev:new WK.Attribute("positionPrev","float",3),positionNext:new WK.Attribute("positionNext","float",3),prevPositionPrev:new WK.Attribute("prevPositionPrev","float",3),prevPosition:new WK.Attribute("prevPosition","float",3),prevPositionNext:new WK.Attribute("prevPositionNext","float",3),offset:new WK.Attribute("offset","float",1),color:new WK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,r){return 1/(lQ.dist(e,t)+lQ.dist(n,t)+lQ.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(uQ)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(uQ)},getPolylineVertexCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,n,r,i,o){null==o&&(o=1);var a=e[0],s=e[1],l=e[2],u=t[0],c=t[1],h=t[2],d=n[0],p=n[1],f=n[2],g=r[0],m=r[1],v=r[2],y=this._getCubicCurveApproxStep(e,t,n,r),_=y*y,x=_*y,b=3*y,w=3*_,S=6*_,T=6*x,M=a-2*u+d,C=s-2*c+p,D=l-2*h+f,A=3*(u-d)-a+g,I=3*(c-p)-s+m,E=3*(h-f)-l+v,L=a,N=s,P=l,O=(u-a)*b+M*w+A*x,R=(c-s)*b+C*w+I*x,k=(h-l)*b+D*w+E*x,z=M*S+A*T,V=C*S+I*T,B=D*S+E*T,F=A*T,G=I*T,H=E*T,U=0,W=0,j=Math.ceil(1/y),X=new Float32Array(3*(j+1)),Y=(X=[],0);for(W=0;W<j+1;W++)X[Y++]=L,X[Y++]=N,X[Y++]=P,L+=O,N+=R,P+=k,O+=z,R+=V,k+=B,z+=F,V+=G,B+=H,(U+=y)>1&&(L=O>0?Math.min(L,g):Math.max(L,g),N=R>0?Math.min(N,m):Math.max(N,m),P=k>0?Math.min(P,v):Math.max(P,v));return this.addPolyline(X,i,o)},addLine:function(e,t,n,r){return this.addPolyline([e,t],n,r)},addPolyline:function(e,t,n,r,i){if(e.length){var o="number"!=typeof e[0];if(null==i&&(i=o?e.length:e.length/3),!(i<2)){null==r&&(r=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var a,s,l=(o="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===i,u=this.attributes.position,c=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,p=this.attributes.offset,f=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=r;m<i;m++){if(o)a=e[m],s=l?t[m]:t;else{var v=3*m;if((a=a||[])[0]=e[v],a[1]=e[v+1],a[2]=e[v+2],l){var y=4*m;(s=s||[])[0]=t[y],s[1]=t[y+1],s[2]=t[y+2],s[3]=t[y+3]}else s=t}if(this.useNativeLine?m>1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m<i-1&&(c.set(g+2,a),c.set(g+3,a)),m>0&&(h.set(g-2,a),h.set(g-1,a)),u.set(g,a),u.set(g+1,a),d.set(g,s),d.set(g+1,s),p.set(g,n/2),p.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,a),g++;else if(m>0){var _=3*this._triangleOffset;(f=this.indices)[_]=g-4,f[_+1]=g-3,f[_+2]=g-2,f[_+3]=g-3,f[_+4]=g-1,f[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*i;c.copy(x,x+2),c.copy(x+1,x+3),h.copy(b-1,b-3),h.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],r=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});function hQ(e,t,n,r,i,o,a){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=r,this.height=i,this.offsetX=t,this.offsetY=n,this.dpr=a,this.gap=o}function dQ(e){(e=e||{}).width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=null==e.gap?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new PK({image:t,flipY:!1});var n=this;this._zr=qi(t);var r=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){r.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new hQ(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}function pQ(){}V(cQ.prototype,aQ),hQ.prototype={constructor:hQ,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,n){var r=e.getBoundingRect();null==t&&(t=r.width),null==n&&(n=r.height),t*=this.dpr,n*=this.dpr,this._fitElement(e,t,n);var i=this._x,o=this._y,a=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(i+t+l>a&&(i=this._x=0,o+=this._rowHeight+l,this._y=o,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,n),o+n+l>s)return null;e.x+=this.offsetX*this.dpr+i,e.y+=this.offsetY*this.dpr+o,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[i/a+u[0],o/s+u[1]],[(i+t)/a+u[0],(o+n)/s+u[1]]]},_fitElement:function(e,t,n){var r=e.getBoundingRect(),i=t/r.width,o=n/r.height;e.x=-r.x*i,e.y=-r.y*o,e.scaleX=i,e.scaleY=o,e.update()}},dQ.prototype={clear:function(){for(var e=0;e<this._textureAtlasNodes.length;e++)this._textureAtlasNodes[e].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var e=4096/this._dpr,t=this._textureAtlasNodes.length,n=t*this._nodeWidth%e,r=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(r>=e)){var i=(n+this._nodeWidth)*this._dpr,o=(r+this._nodeHeight)*this._dpr;try{this._zr.resize({width:i,height:o})}catch(e){this._canvas.width=i,this._canvas.height=o}var a=new hQ(this._zr,n,r,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(a),a}"production"!==process.env.NODE_ENV&&console.error("Too much labels. Some will be ignored.")},add:function(e,t,n){if(this._coords[e.id])return"production"!==process.env.NODE_ENV&&console.warn("Element already been add"),this._coords[e.id];var r=this._getCurrentNode().add(e,t,n);if(!r){var i=this._expand();if(!i)return;r=i.add(e,t,n)}return this._coords[e.id]=r,r},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]},dispose:function(){this._zr.dispose()}},pQ.prototype={constructor:pQ,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new zJ.DirectionalLight({shadowBias:.005}),this.ambientLight=new zJ.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,n=this.ambientLight,r=e.getModel("light"),i=r.getModel("main"),o=r.getModel("ambient");t.intensity=i.get("intensity"),n.intensity=o.get("intensity"),t.color=zJ.parseColor(i.get("color")).slice(0,3),n.color=zJ.parseColor(o.get("color")).slice(0,3);var a=i.get("alpha")||0,s=i.get("beta")||0;t.position.setArray(zJ.directionFromAlphaBeta(a,s)),t.lookAt(zJ.Vector3.ZERO),t.castShadow=i.get("shadow"),t.shadowResolution=zJ.getShadowResolution(i.get("shadowQuality"))},updateAmbientCubemap:function(e,t,n){var r=t.getModel("light.ambientCubemap"),i=r.get("texture");if(i){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[i];if(!o){var a=this;o=this._cubemapLightsCache[i]=zJ.createAmbientCubemap(r.option,e,n,(function(){a._isSkyboxFromAmbientCubemap&&a._skybox.setEnvironmentMap(o.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,n){var r=t.get("environment"),i=this;var o=(i._skybox=i._skybox||new U$,i._skybox);if(r&&"none"!==r)if("auto"===r)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var a=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(a),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof r&&r.colorStops||"string"==typeof r&&nr(r)){this._isSkyboxFromAmbientCubemap=!1;var s=new zJ.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(s);var l=s.image=document.createElement("canvas");l.width=l.height=16,Ev(l.getContext("2d"),new tl({shape:{x:0,y:0,width:16,height:16},style:{fill:r}})),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;s=zJ.loadTexture(r,n,{anisotropic:8,flipY:!1});o.setEnvironmentMap(s),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var u=t.coordinateSystem;if(this._skybox)if(!u||!u.viewGL||"auto"===r||r.match&&r.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var c=u.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[c]("fragment","SRGB_DECODE")}}};var fQ=sQ.vec3,gQ=WK.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new WK.Attribute("position","float",3,"POSITION"),normal:new WK.Attribute("normal","float",3,"NORMAL"),color:new WK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,n=this.getQuadVertexCount()*e,r=this.getQuadTriangleCount()*e;this.vertexCount!==n&&(t.position.init(n),t.normal.init(n),t.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=fQ.create(),t=fQ.create(),n=fQ.create(),r=[0,3,1,3,2,1];return function(i,o){var a=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;fQ.sub(e,i[1],i[0]),fQ.sub(t,i[2],i[1]),fQ.cross(n,e,t),fQ.normalize(n,n);for(var u=0;u<4;u++)a.set(this._vertexOffset+u,i[u]),l.set(this._vertexOffset+u,o),s.set(this._vertexOffset+u,n);var c=3*this._faceOffset;for(u=0;u<6;u++)this.indices[c+u]=r[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});V(gQ.prototype,aQ);var mQ=vJ,vQ={x:0,y:2,z:1};function yQ(e,t,n){this.rootNode=new zJ.Node;var r=new zJ.Mesh({geometry:new cQ({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),i=new zJ.Mesh({geometry:new gQ,material:n,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(i),this.rootNode.add(r),this.faceInfo=e,this.plane=new zJ.Plane,this.linesMesh=r,this.quadsMesh=i}yQ.prototype.update=function(e,t,n){var r=e.coordinateSystem,i=[r.getAxis(this.faceInfo[0]),r.getAxis(this.faceInfo[1])],o=this.linesMesh.geometry,a=this.quadsMesh.geometry;o.convertToDynamicArray(!0),a.convertToDynamicArray(!0),this._updateSplitLines(o,i,e,n),this._udpateSplitAreas(a,i,e,n),o.convertToTypedArray(),a.convertToTypedArray();var s=r.getAxis(this.faceInfo[2]);!function(e,t,n,r){var i=[0,0,0],o=r<0?n.getExtentMin():n.getExtentMax();i[vQ[n.dim]]=o,e.position.setArray(i),e.rotation.identity(),t.distance=-Math.abs(o),t.normal.set(0,0,0),"x"===n.dim?(e.rotation.rotateY(r*Math.PI/2),t.normal.x=-r):"z"===n.dim?(e.rotation.rotateX(-r*Math.PI/2),t.normal.y=-r):(r>0&&e.rotation.rotateY(Math.PI),t.normal.z=-r)}(this.rootNode,this.plane,s,this.faceInfo[3])},yQ.prototype._updateSplitLines=function(e,t,n,r){var i=r.getDevicePixelRatio();t.forEach((function(r,o){var a=r.model,s=t[1-o].getExtent();if(!r.scale.isBlank()){var l=a.getModel("splitLine",n.getModel("splitLine"));if(l.get("show")){var u=l.getModel("lineStyle"),c=u.get("color"),h=mQ(u.get("opacity"),1),d=mQ(u.get("width"),1);c=J(c)?c:[c];for(var p=r.getTicksCoords({tickModel:l}),f=0,g=0;g<p.length;g++){var m=p[g].coord,v=zJ.parseColor(c[f%c.length]);v[3]*=h;var y=[0,0,0],_=[0,0,0];y[o]=_[o]=m,y[1-o]=s[0],_[1-o]=s[1],e.addLine(y,_,v,d*i),f++}}}}))},yQ.prototype._udpateSplitAreas=function(e,t,n,r){t.forEach((function(r,i){var o=r.model,a=t[1-i].getExtent();if(!r.scale.isBlank()){var s=o.getModel("splitArea",n.getModel("splitArea"));if(s.get("show")){var l=s.getModel("areaStyle"),u=l.get("color"),c=mQ(l.get("opacity"),1);u=J(u)?u:[u];for(var h=r.getTicksCoords({tickModel:s,clamp:!0}),d=0,p=[0,0,0],f=[0,0,0],g=0;g<h.length;g++){var m=h[g].coord,v=[0,0,0],y=[0,0,0];if(v[i]=y[i]=m,v[1-i]=a[0],y[1-i]=a[1],0!==g){var _=zJ.parseColor(u[d%u.length]);_[3]*=c,e.addQuad([p,v,y,f],_),p=v,f=y,d++}else p=v,f=y}}}}))};var _Q=[0,1,2,0,2,3],xQ=WK.extend((function(){return{attributes:{position:new WK.Attribute("position","float",3,"POSITION"),texcoord:new WK.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new WK.Attribute("offset","float",2),color:new WK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){this._spriteCount=e;var t=4*e,n=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==n&&(this.indices=t>65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(e,t,n,r,i){var o,a,s,l;switch(null==n&&(n="left"),null==r&&(r="top"),i=i||0,n){case"left":o=i,s=t[0]+i;break;case"center":case"middle":o=-t[0]/2,s=t[0]/2;break;case"right":o=-t[0]-i,s=-i}switch(r){case"bottom":a=i,l=t[1]+i;break;case"middle":a=-t[1]/2,l=t[1]/2;break;case"top":a=-t[1]-i,l=-i}var u=4*e,c=this.attributes.offset;c.set(u,[o,l]),c.set(u+1,[s,l]),c.set(u+2,[s,a]),c.set(u+3,[o,a])},addSprite:function(e,t,n,r,i,o){var a=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,n,r,i,o);for(var s=0;s<_Q.length;s++)this.indices[3*this._faceOffset+s]=_Q[s]+a;return this._faceOffset+=2,this._vertexOffset+=4,a/4},setSprite:function(e,t,n,r,i,o,a){for(var s=4*e,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,t);var c=l.texcoord;c.set(s,[r[0][0],r[0][1]]),c.set(s+1,[r[1][0],r[0][1]]),c.set(s+2,[r[1][0],r[1][1]]),c.set(s+3,[r[0][0],r[1][1]]),this.setSpriteAlign(e,n,i,o,a)}});V(xQ.prototype,aQ);zJ.Shader.import("@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end");var bQ=zJ.Mesh.extend((function(){return{geometry:new xQ({dynamic:!0}),material:new zJ.Material({shader:zJ.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}})),wQ=vJ,SQ={x:0,y:2,z:1};function TQ(e,t){var n=new zJ.Mesh({geometry:new cQ({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),r=new bQ;r.material.depthMask=!1;var i=new zJ.Node;i.add(n),i.add(r),this.rootNode=i,this.dim=e,this.linesMesh=n,this.labelsMesh=r,this.axisLineCoords=null,this.labelElements=[]}var MQ={x:"y",y:"x",z:"y"};TQ.prototype.update=function(e,t,n){var r=e.coordinateSystem.getAxis(this.dim),i=this.linesMesh.geometry,o=this.labelsMesh.geometry;i.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var a=r.model,s=r.getExtent(),l=n.getDevicePixelRatio(),u=a.getModel("axisLine",e.getModel("axisLine")),c=a.getModel("axisTick",e.getModel("axisTick")),h=a.getModel("axisLabel",e.getModel("axisLabel")),d=u.get("lineStyle.color");if(u.get("show")){var p=u.getModel("lineStyle"),f=[0,0,0];(T=[0,0,0])[M=SQ[r.dim]]=s[0],f[M]=s[1],this.axisLineCoords=[T,f];var g=zJ.parseColor(d),m=wQ(p.get("width"),1),v=wQ(p.get("opacity"),1);g[3]*=v,i.addLine(T,f,g,m*l)}if(c.get("show")){var y=c.getModel("lineStyle"),_=zJ.parseColor(wQ(y.get("color"),d));m=wQ(y.get("width"),1);_[3]*=wQ(y.get("opacity"),1);for(var x=r.getTicksCoords(),b=c.get("length"),w=0;w<x.length;w++){var S=x[w].coord,T=[0,0,0],M=(f=[0,0,0],SQ[r.dim]),C=SQ[MQ[r.dim]];T[M]=f[M]=S,f[C]=b,i.addLine(T,f,_,m*l)}}this.labelElements=[];l=n.getDevicePixelRatio();if(h.get("show")){x=r.getTicksCoords();var D=a.get("data"),A=h.get("margin"),I=r.getViewLabels();for(w=0;w<I.length;w++){var E=I[w].tickValue,L=I[w].formattedLabel,N=I[w].rawLabel,P=(S=r.dataToCoord(E),[0,0,0]);M=SQ[r.dim],C=SQ[MQ[r.dim]];P[M]=P[M]=S,P[C]=A;var O=h;D&&D[E]&&D[E].textStyle&&(O=new Fh(D[E].textStyle,h,a.ecModel));var R=wQ(O.get("color"),d),k=new il({style:yh(O,{text:L,fill:"function"==typeof R?R("category"===r.type?N:"value"===r.type?E+"":E,w):R,verticalAlign:"top",align:"left"})}),z=t.add(k),V=k.getBoundingRect();o.addSprite(P,[V.width*l,V.height*l],z),this.labelElements.push(k)}}if(a.get("name")){var B=a.getModel("nameTextStyle"),F=(P=[0,0,0],M=SQ[r.dim],C=SQ[MQ[r.dim]],wQ(B.get("color"),d)),G=B.get("borderColor");m=B.get("borderWidth");P[M]=P[M]=(s[0]+s[1])/2,P[C]=a.get("nameGap");k=new il({style:yh(B,{text:a.get("name"),fill:F,stroke:G,lineWidth:m})}),z=t.add(k),V=k.getBoundingRect();o.addSprite(P,[V.width*l,V.height*l],z),k.__idx=this.labelElements.length,this.nameLabelElement=k}this.labelsMesh.material.set("textureAtlas",t.getTexture()),this.labelsMesh.material.set("uvScale",t.getCoordsScale()),i.convertToTypedArray(),o.convertToTypedArray()},TQ.prototype.setSpriteAlign=function(e,t,n){for(var r=n.getDevicePixelRatio(),i=this.labelsMesh.geometry,o=0;o<this.labelElements.length;o++){var a=this.labelElements[o].getBoundingRect();i.setSpriteAlign(o,[a.width*r,a.height*r],e,t)}var s=this.nameLabelElement;if(s){a=s.getBoundingRect();i.setSpriteAlign(s.__idx,[a.width*r,a.height*r],e,t),i.dirty()}this.textAlign=e,this.textVerticalAlign=t};var CQ="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",DQ=vJ;zJ.Shader.import(CQ);var AQ={x:0,y:2,z:1},IQ=Xg.extend({type:"grid3D",__ecgl__:!0,init:function(e,t){var n=new zJ.Material({shader:zJ.createShader("ecgl.color"),depthMask:!1,transparent:!0}),r=new zJ.Material({shader:zJ.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new zJ.Node,this._control=new oQ({zr:t.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(e){var t=new yQ(e,r,n);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new TQ(e,r);return this.groupGL.add(t.rootNode),t}),this);var i=t.getDevicePixelRatio();this._axisLabelSurface=new dQ({width:256,height:256,devicePixelRatio:i}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new zJ.Mesh({geometry:new cQ({useNativeLine:!1}),material:r,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new dQ({width:128,height:128,devicePixelRatio:i}),this._axisPointerLabelsMesh=new bQ({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new zJ.Node,this._sceneHelper=new pQ,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,n){this._model=e,this._api=n;var r=e.coordinateSystem;r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=e.getModel("viewControl");i.setFromViewControlModel(o,0),this._axisLabelSurface.clear(),i.off("update"),e.get("show")&&(this._faces.forEach((function(r){r.update(e,t,n)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,n)}),this)),i.on("update",this._onCameraChange.bind(this,e,n),this),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},showAxisPointer:function(e,t,n,r){this._doShowAxisPointer(),this._updateAxisPointer(r.value)},hideAxisPointer:function(e,t,n,r){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem.viewGL;e.get("show")&&e.get("axisPointer.show")?t.on("mousemove",this._updateAxisPointerOnMousePosition,this):t.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,n=this._model.coordinateSystem,r=n.viewGL,i=r.castRay(e.offsetX,e.offsetY,new zJ.Ray),o=0;o<this._faces.length;o++){var a=this._faces[o];if(!a.rootNode.invisible){a.plane.normal.dot(r.camera.worldTransform.z)<0&&a.plane.normal.negate();var s=i.intersectPlane(a.plane);if(s){var l=n.getAxis(a.faceInfo[0]),u=n.getAxis(a.faceInfo[1]),c=AQ[a.faceInfo[0]],h=AQ[a.faceInfo[1]];l.contain(s.array[c])&&u.contain(s.array[h])&&(t=s)}}}if(t){var d=n.pointToData(t.array,[],!0);this._updateAxisPointer(d),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var n=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new zJ.Vector3;e.update();for(var n=0;n<this._faces.length/2;n++){for(var r=[],i=0;i<2;i++){this._faces[2*n+i].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),r[i]=t.z}var o=r[0]>r[1]?0:1,a=this._faces[2*n+o],s=this._faces[2*n+1-o];a.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),n=e.getAxis("y"),r=e.getAxis("z"),i=r.getExtentMax(),o=r.getExtentMin(),a=t.getExtentMin(),s=t.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),c=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,p=this._faces,f=p[4].rootNode.invisible?u:l,g=p[2].rootNode.invisible?i:o,m=p[0].rootNode.invisible?a:s,v=p[2].rootNode.invisible?i:o,y=p[0].rootNode.invisible?s:a,_=p[4].rootNode.invisible?u:l;c.rotation.identity(),h.rotation.identity(),d.rotation.identity(),p[4].rootNode.invisible&&(this._axes[0].flipped=!0,c.rotation.rotateX(Math.PI)),p[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),p[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),c.position.set(0,g,f),h.position.set(m,v,0),d.position.set(y,0,_),c.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new zJ.Vector4,new zJ.Vector4],n=new zJ.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(r){var i=r.axisLineCoords;r.labelsMesh.geometry;for(var o=0;o<t.length;o++)t[o].setArray(i[o]),t[o].w=1,t[o].transformMat4(r.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),t[o].x/=t[o].w,t[o].y/=t[o].w;var a,s,l=t[1].x-t[0].x,u=t[1].y-t[0].y,c=(t[1].x+t[0].x)/2,h=(t[1].y+t[0].y)/2;Math.abs(u/l)<.5?(a="center",s=h>n.y?"bottom":"top"):(s="middle",a=c>n.x?"left":"right"),r.setSpriteAlign(a,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,n=t.dataToPoint(e),r=this._axisPointerLineMesh.geometry,i=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function a(e){return vJ(e.model.get("axisPointer.show"),i.get("show"))}function s(e){var t=e.model.getModel("axisPointer",i).getModel("lineStyle"),n=zJ.parseColor(t.get("color")),r=DQ(t.get("width"),1),o=DQ(t.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:r}}r.convertToDynamicArray(!0);for(var l=0;l<this._faces.length;l++){var u=this._faces[l];if(!u.rootNode.invisible){for(var c=u.faceInfo,h=c[3]<0?t.getAxis(c[2]).getExtentMin():t.getAxis(c[2]).getExtentMax(),d=AQ[c[2]],p=0;p<2;p++){var f=c[p],g=c[1-p],m=t.getAxis(f),v=t.getAxis(g);if(a(m)){var y=AQ[f],_=AQ[g];(w=[0,0,0])[y]=(b=[0,0,0])[y]=n[y],w[d]=b[d]=h,w[_]=v.getExtentMin(),b[_]=v.getExtentMax();var x=s(m);r.addLine(w,b,x.color,x.lineWidth*o)}}if(a(t.getAxis(c[2]))){var b,w=n.slice();(b=n.slice())[d]=h;x=s(t.getAxis(c[2]));r.addLine(w,b,x.color,x.lineWidth*o)}}}r.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(e){var t=this._model,n=this._axisPointerLabelsMesh,r=this._axisPointerLabelsSurface,i=t.coordinateSystem,o=t.getModel("axisPointer");n.geometry.convertToDynamicArray(!0),r.clear();var a={x:"y",y:"x",z:"y"};this._axes.forEach((function(t,s){var l=i.getAxis(t.dim),u=l.model.getModel("axisPointer",o),c=u.getModel("label"),h=u.get("lineStyle.color");if(c.get("show")&&u.get("show")){var d=e[s],p=c.get("formatter"),f=l.scale.getLabel({value:d});if(null!=p)f=p(f,e);else if("interval"===l.scale.type||"log"===l.scale.type){var g=oo(l.scale.getTicks()[0]);f=d.toFixed(g+2)}var m=c.get("color"),v=new il({style:yh(c,{text:f,fill:m||h,align:"left",verticalAlign:"top"})}),y=r.add(v),_=v.getBoundingRect(),x=this._api.getDevicePixelRatio(),b=t.rootNode.position.toArray();b[AQ[a[t.dim]]]+=(t.flipped?-1:1)*c.get("margin"),b[AQ[t.dim]]=l.dataToCoord(e[s]),n.geometry.addSprite(b,[_.width*x,_.height*x],y,t.textAlign,t.textVerticalAlign)}}),this),r.getZr().refreshImmediately(),n.material.set("uvScale",r.getCoordsScale()),n.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._axisLabelSurface.dispose(),this._axisPointerLabelsSurface.dispose()}});function EQ(e){MM.call(this,e),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}function LQ(e,t,n){Eb.call(this,e,t,n)}EQ.prototype={constructor:EQ,model:null,containPoint:function(e){return this.getAxis("x").contain(e[0])&&this.getAxis("y").contain(e[2])&&this.getAxis("z").contain(e[1])},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])&&this.getAxis("z").containData(e[2])},dataToPoint:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],n),t[2]=this.getAxis("y").dataToCoord(e[1],n),t[1]=this.getAxis("z").dataToCoord(e[2],n),t},pointToData:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],n),t[1]=this.getAxis("y").coordToData(e[2],n),t[2]=this.getAxis("z").coordToData(e[1],n),t}},G(EQ,MM),LQ.prototype={constructor:LQ,getExtentMin:function(){var e=this._extent;return Math.min(e[0],e[1])},getExtentMax:function(){var e=this._extent;return Math.max(e[0],e[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},G(LQ,Eb);var NQ=function(){this._pool={},this._allocatedTextures=[]};NQ.prototype={constructor:NQ,get:function(e){var t=RQ(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var n=this._pool[t];if(!n.length){var r=new PK(e);return this._allocatedTextures.push(r),r}return n.pop()},put:function(e){var t=RQ(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]),this._pool[t].push(e)},clear:function(e){for(var t=0;t<this._allocatedTextures.length;t++)this._allocatedTextures[t].dispose(e);this._pool={},this._allocatedTextures=[]}};var PQ={width:512,height:512,type:WY,format:QY,wrapS:hZ,wrapT:hZ,minFilter:sZ,magFilter:rZ,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},OQ=Object.keys(PQ);function RQ(e){xY.defaultsWithPropList(e,PQ,OQ),function(e){var t=(n=e.width,r=e.height,!(n&n-1||r&r-1));var n,r;e.format===KY&&(e.useMipmap=!1);t&&e.useMipmap||(e.minFilter==iZ||e.minFilter==aZ?e.minFilter=nZ:e.minFilter!=sZ&&e.minFilter!=oZ||(e.minFilter=rZ));t||(e.wrapS=hZ,e.wrapT=hZ)}(e);for(var t="",n=0;n<OQ.length;n++){t+=e[OQ[n]].toString()}return t}var kQ=["px","nx","py","ny","pz","nz"];function zQ(e,t,n){return"alphaMap"===n?e.material.get("diffuseMap"):"alphaCutoff"===n?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:"uvRepeat"===n?e.material.get("uvRepeat"):"uvOffset"===n?e.material.get("uvOffset"):t.get(n)}function VQ(e,t){var n=e.material,r=t.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)}bq.import("@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nuniform vec2 uvRepeat = vec2(1.0, 1.0);\nuniform vec2 uvOffset = vec2(0.0, 0.0);\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n v_ViewPosition = worldViewProjection * P;\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end");var BQ,FQ,GQ,HQ,UQ,WQ,jQ,XQ=bY.extend((function(){return{softShadow:XQ.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new k$,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new NQ}}),(function(){this._gaussianPassH=new lJ({fragment:bq.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new lJ({fragment:bq.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new lJ({fragment:bq.source("clay.sm.debug_depth")})}),{render:function(e,t,n,r){n||(n=t.getMainCamera()),this.trigger("beforerender",this,e,t,n),this._renderShadowPass(e,t,n,r),this.trigger("afterrender",this,e,t,n)},renderDebug:function(e,t){e.saveClear();var n=e.viewport,r=0,i=t||n.width/4,o=i;for(var a in this.softShadow===XQ.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[a];e.setViewport(r,0,i*s.width/s.height,o),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(e),r+=i*s.width/s.height}e.setViewport(n),e.restoreClear()},_updateReceivers:function(e,t){if(t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===XQ.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?t.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var n=this;t.traverse((function(t){t.isRenderable()&&n._updateReceivers(e,t)}));for(var r=0;r<t.lights.length;r++){var i=t.lights[r];i.castShadow&&!i.invisible&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(e,t,n,r){for(var i in this._shadowMapNumber)this._shadowMapNumber[i]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var o=e.gl;if(r||t.update(),n&&n.update(),t.updateLights(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,o.enable(o.DEPTH_TEST),o.depthMask(!0),o.disable(o.BLEND),o.clearColor(1,1,1,1);for(var a,s=[],l=[],u=[],c=[],h=[],d=[],p=0;p<this._lightsCastShadow.length;p++){var f=this._lightsCastShadow[p];if("DIRECTIONAL_LIGHT"===f.type){if(a){console.warn("Only one direectional light supported with shadow cascade");continue}if(f.shadowCascade>4){console.warn("Support at most 4 cascade");continue}f.shadowCascade>1&&(a=f),this.renderDirectionalLightShadow(e,t,n,f,h,c,u)}else"SPOT_LIGHT"===f.type?this.renderSpotLightShadow(e,t,f,l,s):"POINT_LIGHT"===f.type&&this.renderPointLightShadow(e,t,f,d);this._shadowMapNumber[f.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(p=0;p<this._receivers.length;p++){(y=this._receivers[p].material).fragmentDefines[v]!==m&&(m>0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}}for(p=0;p<this._receivers.length;p++){var y=this._receivers[p].material;a?y.define("fragment","SHADOW_CASCADE",a.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var _=t.shadowUniforms;if(u.length>0){var x=u.map(T);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:c,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},a){var b=h.slice(),w=h.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),c.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var S=s.map(T);(_=t.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:S,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function T(e){return e.height}},renderDirectionalLightShadow:(BQ=new u$,FQ=new iK,GQ=new _K,HQ=new iK,UQ=new iK,WQ=new iK,jQ=new iK,function(e,t,n,r,i,o,a){var s=this._getDepthMaterial(r),l={getMaterial:function(e){return e.shadowDepthMaterial||s},isMaterialChanged:VQ,getUniform:zQ,ifRender:function(e){return e.castShadow},sortCompare:zq.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var u=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(u).applyTransform(n.viewMatrix)}var c=Math.min(-t.viewBoundingBoxLastFrame.min.z,n.far),h=Math.max(-t.viewBoundingBoxLastFrame.max.z,n.near),d=this._getDirectionalLightCamera(r,t,n),p=WQ.array;jQ.copy(d.projectionMatrix),Mq.invert(UQ.array,d.worldTransform.array),Mq.multiply(UQ.array,UQ.array,n.worldTransform.array),Mq.multiply(p,jQ.array,UQ.array);for(var f=[],g=n instanceof M$,m=(n.near+n.far)/(n.near-n.far),v=2*n.near*n.far/(n.near-n.far),y=0;y<=r.shadowCascade;y++){var _=h*Math.pow(c/h,y/r.shadowCascade),x=h+(c-h)*y/r.shadowCascade,b=_*r.cascadeSplitLogFactor+x*(1-r.cascadeSplitLogFactor);f.push(b),i.push(-(-b*m+v)/-b)}var w=this._getTexture(r,r.shadowCascade);a.push(w);var S=e.viewport,T=e.gl;for(this._frameBuffer.attach(w),this._frameBuffer.bind(e),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT),y=0;y<r.shadowCascade;y++){var M=f[y],C=f[y+1];g?Mq.perspective(FQ.array,n.fov/180*Math.PI,n.aspect,M,C):Mq.ortho(FQ.array,n.left,n.right,n.bottom,n.top,M,C),BQ.setFromProjection(FQ),BQ.getTransformedBoundingBox(GQ,UQ),GQ.applyProjection(jQ);var D=GQ.min.array,A=GQ.max.array;D[0]=Math.max(D[0],-1),D[1]=Math.max(D[1],-1),A[0]=Math.min(A[0],1),A[1]=Math.min(A[1],1),HQ.ortho(D[0],A[0],D[1],A[1],1,-1),d.projectionMatrix.multiplyLeft(HQ);var I=r.shadowResolution||512;e.setViewport((r.shadowCascade-y-1)*I,0,I,I,1);var E=t.updateRenderList(d);e.renderPass(E.opaque,d,l),this.softShadow===XQ.VSM&&this._gaussianFilter(e,w,w.width);var L=new iK;L.copy(d.viewMatrix).multiplyLeft(d.projectionMatrix),o.push(L.array),d.projectionMatrix.copy(jQ)}this._frameBuffer.unbind(e),e.setViewport(S)}),renderSpotLightShadow:function(e,t,n,r,i){var o=this._getTexture(n),a=this._getSpotLightCamera(n),s=e.gl;this._frameBuffer.attach(o),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var l=this._getDepthMaterial(n),u={getMaterial:function(e){return e.shadowDepthMaterial||l},isMaterialChanged:VQ,getUniform:zQ,ifRender:function(e){return e.castShadow},sortCompare:zq.opaqueSortCompare},c=t.updateRenderList(a);e.renderPass(c.opaque,a,u),this._frameBuffer.unbind(e),this.softShadow===XQ.VSM&&this._gaussianFilter(e,o,o.width);var h=new iK;h.copy(a.worldTransform).invert().multiplyLeft(a.projectionMatrix),i.push(o),r.push(h.array)},renderPointLightShadow:function(e,t,n,r){var i=this._getTexture(n),o=e.gl;r.push(i);var a=this._getDepthMaterial(n),s={getMaterial:function(e){return e.shadowDepthMaterial||a},getUniform:zQ,sortCompare:zq.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new _K,c=n.getWorldPosition().array,h=new _K,d=n.range;h.min.setArray(c),h.max.setArray(c);var p=new Bq(d,d,d);h.max.add(p),h.min.sub(p);var f={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};t.traverse((function(e){if(e.isRenderable()&&e.castShadow){var t=e.geometry;if(!t.boundingBox){for(var n=0;n<kQ.length;n++)l[kQ[n]].push(e);return}if(u.transformFrom(t.boundingBox,e.worldTransform),!u.intersectBoundingBox(h))return;u.updateVertices();for(n=0;n<kQ.length;n++)f[kQ[n]]=!1;for(n=0;n<8;n++){var r=u.vertices[n],i=r[0]-c[0],o=r[1]-c[1],a=r[2]-c[2],s=Math.abs(i),d=Math.abs(o),p=Math.abs(a);s>d?s>p?f[i>0?"px":"nx"]=!0:f[a>0?"pz":"nz"]=!0:d>p?f[o>0?"py":"ny"]=!0:f[a>0?"pz":"nz"]=!0}for(n=0;n<kQ.length;n++)f[kQ[n]]&&l[kQ[n]].push(e)}}));for(var g=0;g<6;g++){var m=kQ[g],v=this._getPointLightCamera(n,m);this._frameBuffer.attach(i,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+g),this._frameBuffer.bind(e),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),e.renderPass(l[m],v,s)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t=this._lightMaterials[e.__uid__],n="POINT_LIGHT"===e.type;if(!t){var r=n?"clay.sm.distance.":"clay.sm.depth.";t=new WZ({precision:this.precision,shader:new bq(bq.source(r+"vertex"),bq.source(r+"fragment"))}),this._lightMaterials[e.__uid__]=t}return null!=e.shadowSlopeScale&&t.setUniform("slopeScale",e.shadowSlopeScale),null!=e.shadowBias&&t.setUniform("bias",e.shadowBias),this.softShadow===XQ.VSM?t.define("fragment","USE_VSM"):t.undefine("fragment","USE_VSM"),n&&(t.set("lightPosition",e.getWorldPosition().array),t.set("range",e.range)),t},_gaussianFilter:function(e,t,n){var r={width:n,height:n,type:AK.FLOAT},i=this._texturePool.get(r);this._frameBuffer.attach(i),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",n),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",i),this._gaussianPassV.setUniform("textureHeight",n),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(i)},_getTexture:function(e,t){var n=e.__uid__,r=this._textures[n],i=e.shadowResolution||512;return t=t||1,r||((r="POINT_LIGHT"===e.type?new S$:new PK).width=i*t,r.height=i,this.softShadow===XQ.VSM?(r.type=AK.FLOAT,r.anisotropic=4):(r.minFilter=nZ,r.magFilter=nZ,r.useMipmap=!1),this._textures[n]=r),r},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new M$,nx:new M$,py:new M$,ny:new M$,pz:new M$,nz:new M$});var n=this._lightCameras.point[t];switch(n.far=e.range,n.fov=90,n.position.set(0,0,0),t){case"px":n.lookAt(Bq.POSITIVE_X,Bq.NEGATIVE_Y);break;case"nx":n.lookAt(Bq.NEGATIVE_X,Bq.NEGATIVE_Y);break;case"py":n.lookAt(Bq.POSITIVE_Y,Bq.POSITIVE_Z);break;case"ny":n.lookAt(Bq.NEGATIVE_Y,Bq.NEGATIVE_Z);break;case"pz":n.lookAt(Bq.POSITIVE_Z,Bq.NEGATIVE_Y);break;case"nz":n.lookAt(Bq.NEGATIVE_Z,Bq.NEGATIVE_Y)}return e.getWorldPosition(n.position),n.update(),n},_getDirectionalLightCamera:function(){var e=new iK,t=new _K,n=new _K;return function(r,i,o){this._lightCameras.directional||(this._lightCameras.directional=new iJ);var a=this._lightCameras.directional;t.copy(i.viewBoundingBoxLastFrame),t.intersection(o.frustum.boundingBox),a.position.copy(t.min).add(t.max).scale(.5).transformMat4(o.worldTransform),a.rotation.copy(r.rotation),a.scale.copy(r.scale),a.updateWorldTransform(),iK.invert(e,a.worldTransform),iK.multiply(e,e,o.worldTransform),n.copy(t).applyTransform(e);var s=n.min.array,l=n.max.array;return a.position.set((s[0]+l[0])/2,(s[1]+l[1])/2,l[2]).transformMat4(a.worldTransform),a.near=0,a.far=-s[2]+l[2],isNaN(this.lightFrustumBias)?a.far*=4:a.far+=this.lightFrustumBias,a.left=s[0],a.right=l[0],a.top=l[1],a.bottom=s[1],a.update(!0),a}}(),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new M$);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),Mq.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t=e.gl||e;for(var n in this._frameBuffer&&this._frameBuffer.dispose(t),this._textures)this._textures[n].dispose(t);this._texturePool.clear(e.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var r=0;r<this._receivers.length;r++){var i=this._receivers[r];if(i.material){var o=i.material;o.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),o.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),o.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),o.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});XQ.VSM=1,XQ.PCF=2;var YQ=bY.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(e,t){var n,r,i=this.outputs[e],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n=o.width instanceof Function?o.width.call(this,t):o.width,r=o.height instanceof Function?o.height.call(this,t):o.height,a.width===n&&a.height===r||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),a.width=n,a.height=r,a},setParameter:function(e,t){},getParameter:function(e){},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},render:function(){},getOutput:function(e,t){if(null==t)return t=e,this._outputTextures[t];var n=this.outputs[t];return n?this._rendered?n.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(n.parameters||{})),this._prevOutputTextures[t]):(this.render(e),this._outputTextures[t]):void 0},removeReference:function(e){(this._outputReferences[e]--,0===this._outputReferences[e])&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},link:function(e,t,n){this.inputLinks[e]={node:t,pin:n},t.outputLinks[n]||(t.outputLinks[n]=[]),t.outputLinks[n].push({node:this,pin:e}),this.pass.material.enableTexture(e)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(e){if(!this._rendering){for(var t in this._rendering=!0,this.inputLinks){var n=this.inputLinks[t];n.node.updateReference(n.pin)}this._rendering=!1}e&&this._outputReferences[e]++},beforeFrame:function(){for(var e in this._rendered=!1,this.outputLinks)this._outputReferences[e]=0},afterFrame:function(){for(var e in this.outputLinks){if(this._outputReferences[e]>0)this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}}}),ZQ=bY.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t<this.nodes.length;t++)if(this.nodes[t].name===e)return this.nodes[t]},update:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].clear();for(e=0;e<this.nodes.length;e++){var t=this.nodes[e];if(t.inputs)for(var n in t.inputs)if(t.inputs[n])if(!t.pass||t.pass.material.isUniformEnabled(n)){var r=t.inputs[n],i=this.findPin(r);i?t.link(n,i.node,i.pin):"string"==typeof r?console.warn("Node "+r+" not exist"):console.warn("Pin of "+r.node+"."+r.pin+" not exist")}else console.warn("Pin "+t.name+"."+n+" not used.")}},findPin:function(e){var t;if(("string"==typeof e||e instanceof YQ)&&(e={node:e}),"string"==typeof e.node)for(var n=0;n<this.nodes.length;n++){var r=this.nodes[n];r.name===e.node&&(t=r)}else t=e.node;if(t){var i=e.pin;if(i||t.outputs&&(i=Object.keys(t.outputs)[0]),t.outputs[i])return{node:t,pin:i}}}}),qQ=ZQ.extend((function(){return{_outputs:[],_texturePool:new NQ,_frameBuffer:new k$({depthBuffer:!1})}}),{addNode:function(e){ZQ.prototype.addNode.call(this,e),e._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var n=0;n<this.nodes.length;n++)this.nodes[n].outputs||this._outputs.push(this.nodes[n])}for(n=0;n<this.nodes.length;n++)this.nodes[n].beforeFrame();for(n=0;n<this._outputs.length;n++)this._outputs[n].updateReference();for(n=0;n<this._outputs.length;n++)this._outputs[n].render(e,t);for(n=0;n<this.nodes.length;n++)this.nodes[n].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}}),KQ=YQ.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new k$}),{render:function(e){this._rendering=!0;var t,n=e.gl;if(this.trigger("beforerender"),this.outputs){var r=this.frameBuffer;for(var i in this.outputs){var o=this.updateParameter(i,e),a=this.outputs[i],s=this._compositor.allocateTexture(o);this._outputTextures[i]=s,"string"==typeof(c=a.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),r.attach(s,c)}r.bind(e);var l=e.getGLExtension("EXT_draw_buffers");if(l){var u=[];for(var c in this.outputs)(c=parseInt(c))>=n.COLOR_ATTACHMENT0&&c<=n.COLOR_ATTACHMENT0+8&&u.push(c);l.drawBuffersEXT(u)}e.saveClear(),e.clearBit=MY|DY,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),r.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}}),$Q=YQ.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),JQ=YQ.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var e=new lJ({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var n=e.gl;for(var r in this.inputLinks){var i=(h=this.inputLinks[r]).node.getOutput(e,h.pin);this.pass.setUniform(r,i)}if(this.outputs){this.pass.outputs={};var o={};for(var a in this.outputs){var s=this.updateParameter(a,e);isNaN(s.width)&&this.updateParameter(a,e);var l=this.outputs[a],u=this._compositor.allocateTexture(s);this._outputTextures[a]=u,"string"==typeof(c=l.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),o[c]=u}for(var c in this._compositor.getFrameBuffer().bind(e),o)this._compositor.getFrameBuffer().attach(o[c],c);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var r in this.inputLinks){var h;(h=this.inputLinks[r]).node.removeReference(h.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var n,r,i=this.outputs[e],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n="function"==typeof o.width?o.width.call(this,t):o.width,r="function"==typeof o.height?o.height.call(this,t):o.height,n=Math.ceil(n),r=Math.ceil(r),a.width===n&&a.height===r||this._outputTextures[e]&&this._outputTextures[e].dispose(t),a.width=n,a.height=r,a},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){(this._outputReferences[e]--,0===this._outputReferences[e])&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},clear:function(){YQ.prototype.clear.call(this),this.pass.material.disableTexturesAll()}}),QQ="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",e0="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",t0="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",n0="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",r0="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",i0="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",o0="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",a0="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",s0="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";!function(e){e.import("@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"),e.import(QQ),e.import("@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"),e.import(e0),e.import("@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"),e.import(t0),e.import(n0),e.import(r0),e.import(i0),e.import(o0),e.import("@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"),e.import(a0),e.import(s0)}(bq);var l0=/^#source\((.*?)\)/;function u0(e,t){var n=new qQ;t=t||{};var r={textures:{},parameters:{}};for(var i in e.parameters){var o=e.parameters[i];r.parameters[i]=p0(o)}return function(e,t,n,r){if(!e.textures)return void r({});var i={},o=0,a=!1,s=n.textureRootPath;xY.each(e.textures,(function(e,t){var n,l=e.path,u=p0(e.parameters);if(Array.isArray(l)&&6===l.length)s&&(l=l.map((function(e){return xY.relative2absolute(e,s)}))),n=new S$(u);else{if("string"!=typeof l)return;s&&(l=xY.relative2absolute(l,s)),n=new PK(u)}n.load(l),o++,n.once("success",(function(){i[t]=n,0===--o&&(r(i),a=!0)}))})),0!==o||a||r(i)}(e,0,t,(function(i){r.textures=i,function(){for(var i=0;i<e.nodes.length;i++){var o=c0(e.nodes[i],r,t);o&&n.addNode(o)}}()})),n}function c0(e,t,n){var r,i,o,a,s=e.type||"filter";if("filter"===s){var l=e.shader.trim(),u=l0.exec(l);if(u?r=bq.source(u[1].trim()):"#"===l.charAt(0)&&(r=t.shaders[l.substr(1)]),r||(r=l),!r)return}if(e.inputs)for(var c in i={},e.inputs)"string"==typeof e.inputs[c]?i[c]=e.inputs[c]:i[c]={node:e.inputs[c].node,pin:e.inputs[c].pin};if(e.outputs)for(var c in o={},e.outputs){var h=e.outputs[c];o[c]={},null!=h.attachment&&(o[c].attachment=h.attachment),null!=h.keepLastFrame&&(o[c].keepLastFrame=h.keepLastFrame),null!=h.outputLastFrame&&(o[c].outputLastFrame=h.outputLastFrame),h.parameters&&(o[c].parameters=p0(h.parameters))}if(a="scene"===s?new KQ({name:e.name,scene:n.scene,camera:n.camera,outputs:o}):"texture"===s?new $Q({name:e.name,outputs:o}):new JQ({name:e.name,shader:r,inputs:i,outputs:o})){if(e.parameters)for(var c in e.parameters){"string"==typeof(d=e.parameters[c])?"#"===(d=d.trim()).charAt(0)?d=t.textures[d.substr(1)]:a.on("beforerender",f0(c,g0(d))):"function"==typeof d&&a.on("beforerender",d),a.setParameter(c,d)}if(e.defines&&a.pass)for(var c in e.defines){var d=e.defines[c];a.pass.material.define("fragment",c,d)}}return a}function h0(e,t){return e}function d0(e,t){return t}function p0(e){var t={};if(!e)return t;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(n){var r=e[n];null!=r&&("string"==typeof r&&(r=AK[r]),t[n]=r)}));var n=e.scale||1;return["width","height"].forEach((function(r){if(null!=e[r]){var i=e[r];"string"==typeof i?(i=i.trim(),t[r]=function(e,t,n){return n=n||1,function(e){var r=e.getDevicePixelRatio(),i=e.getWidth()*n,o=e.getHeight()*n;return t(i,o,r)}}(0,g0(i),n)):t[r]=i}})),t.width||(t.width=h0),t.height||(t.height=d0),null!=e.useMipmap&&(t.useMipmap=e.useMipmap),t}function f0(e,t){return function(n){var r=n.getDevicePixelRatio(),i=n.getWidth(),o=n.getHeight(),a=t(i,o,r);this.setParameter(e,a)}}function g0(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var n=new Function("width","height","dpr","return "+t[1]);return n(1,1),n}catch(e){throw new Error("Invalid expression.")}}function m0(e,t){for(var n=0,r=1/t,i=e;i>0;)n+=r*(i%t),i=Math.floor(i/t),r/=t;return n}function v0(e){for(var t=new Uint8Array(e*e*4),n=0,r=new Bq,i=0;i<e;i++)for(var o=0;o<e;o++)r.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[n++]=255*(.5*r.x+.5),t[n++]=255*(.5*r.y+.5),t[n++]=0,t[n++]=255;return t}function y0(e){return new PK({pixels:v0(e),wrapS:AK.REPEAT,wrapT:AK.REPEAT,width:e,height:e})}function _0(e,t,n){var r=new Float32Array(3*e);t=t||0;for(var i=0;i<e;i++){var o=m0(i+t,2)*(n?1:2)*Math.PI,a=m0(i+t,3)*Math.PI,s=Math.random(),l=Math.cos(o)*Math.sin(a)*s,u=Math.cos(a)*s,c=Math.sin(o)*Math.sin(a)*s;r[3*i]=l,r[3*i+1]=u,r[3*i+2]=c}return r}function x0(e){e=e||{},this._ssaoPass=new lJ({fragment:bq.source("ecgl.ssao.estimate")}),this._blurPass=new lJ({fragment:bq.source("ecgl.ssao.blur")}),this._framebuffer=new k$({depthBuffer:!1}),this._ssaoTexture=new PK,this._blurTexture=new PK,this._blurTexture2=new PK,this._depthTex=e.depthTexture,this._normalTex=e.normalTexture,this.setNoiseSize(4),this.setKernelSize(e.kernelSize||12),null!=e.radius&&this.setParameter("radius",e.radius),null!=e.power&&this.setParameter("power",e.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}bq.import("@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"),x0.prototype.setDepthTexture=function(e){this._depthTex=e},x0.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},x0.prototype.update=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),o=this._ssaoPass,a=this._blurPass;o.setUniform("kernel",this._kernels[n%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new iK;iK.transpose(s,t.worldTransform),o.setUniform("projection",t.projectionMatrix.array),o.setUniform("projectionInv",t.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,c=this._blurTexture2;l.width=r/2,l.height=i/2,u.width=r,u.height=i,c.width=r,c.height=i,this._framebuffer.attach(l),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),o.render(e),a.setUniform("textureSize",[r/2,i/2]),a.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(u),a.setUniform("direction",0),a.setUniform("ssaoTexture",l),a.render(e),this._framebuffer.attach(c),a.setUniform("textureSize",[r,i]),a.setUniform("direction",1),a.setUniform("ssaoTexture",u),a.render(e),this._framebuffer.unbind(e);var h=e.clearColor;e.gl.clearColor(h[0],h[1],h[2],h[3])},x0.prototype.getTargetTexture=function(){return this._blurTexture2},x0.prototype.setParameter=function(e,t){"noiseTexSize"===e?this.setNoiseSize(t):"kernelSize"===e?this.setKernelSize(t):"intensity"===e?this._ssaoPass.material.set("intensity",t):this._ssaoPass.setUniform(e,t)},x0.prototype.setKernelSize=function(e){this._kernelSize=e,this._ssaoPass.material.define("fragment","KERNEL_SIZE",e),this._kernels=this._kernels||[];for(var t=0;t<30;t++)this._kernels[t]=_0(e,t*e,!!this._normalTex)},x0.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=v0(e),t.width=t.height=e,t.dirty()):(t=y0(e),this._ssaoPass.setUniform("noiseTex",y0(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},x0.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)};function b0(e){e=e||{},this._ssrPass=new lJ({fragment:bq.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new lJ({fragment:bq.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new lJ({fragment:bq.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new lJ({fragment:bq.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new PK({type:AK.HALF_FLOAT}),this._texture2=new PK({type:AK.HALF_FLOAT}),this._texture3=new PK({type:AK.HALF_FLOAT}),this._prevTexture=new PK({type:AK.HALF_FLOAT}),this._currentTexture=new PK({type:AK.HALF_FLOAT}),this._frameBuffer=new k$({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}bq.import("@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"),b0.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var n=e&&t;this._ssrPass.material[n?"enableTexture":"disableTexture"]("specularCubemap")},b0.prototype.update=function(e,t,n,r){var i=e.getWidth(),o=e.getHeight(),a=this._ssrTexture,s=this._texture2,l=this._texture3;a.width=this._prevTexture.width=this._currentTexture.width=i/this._downScale,a.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,s.width=l.width=i,s.height=l.height=o;var u=this._frameBuffer,c=this._ssrPass,h=this._blurPass1,d=this._blurPass2,p=this._blendPass,f=new iK,g=new iK;iK.transpose(f,t.worldTransform),iK.transpose(g,t.viewMatrix),c.setUniform("sourceTexture",n),c.setUniform("projection",t.projectionMatrix.array),c.setUniform("projectionInv",t.invProjectionMatrix.array),c.setUniform("toViewSpace",f.array),c.setUniform("toWorldSpace",g.array),c.setUniform("nearZ",t.near);var m=r/this._totalSamples*this._samplePerFrame;if(c.setUniform("jitterOffset",m),c.setUniform("sampleOffset",r*this._samplePerFrame),h.setUniform("textureSize",[a.width,a.height]),d.setUniform("textureSize",[i,o]),d.setUniform("sourceTexture",n),h.setUniform("projection",t.projectionMatrix.array),d.setUniform("projection",t.projectionMatrix.array),u.attach(a),u.bind(e),c.render(e),this._physicallyCorrect&&(u.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",a),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),u.attach(s),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:a),h.render(e),u.attach(l),d.setUniform("texture",s),d.render(e),u.unbind(e),this._physicallyCorrect){var v=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=v}},b0.prototype.getTargetTexture=function(){return this._texture3},b0.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},b0.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=uJ.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},b0.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},b0.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},b0.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)};var w0=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925];function S0(e,t,n,r,i){var o=e.gl;t.setUniform(o,"1i",n,i),o.activeTexture(o.TEXTURE0+i),r.isRenderable()?r.bind(e):r.unbind(e)}function T0(e,t,n,r,i){var o,a,s,l,u=e.gl;return function(i,c,h){if(!l||l.material!==i.material){var d=i.material,p=i.__program,f=d.get("roughness");null==f&&(f=1);var g=d.get("normalMap")||t,m=d.get("roughnessMap"),v=d.get("bumpMap"),y=d.get("uvRepeat"),_=d.get("uvOffset"),x=d.get("detailUvRepeat"),b=d.get("detailUvOffset"),w=!!v&&d.isTextureEnabled("bumpMap"),S=!!m&&d.isTextureEnabled("roughnessMap"),T=d.isDefined("fragment","DOUBLE_SIDED");v=v||n,m=m||r,h!==c?(c.set("normalMap",g),c.set("bumpMap",v),c.set("roughnessMap",m),c.set("useBumpMap",w),c.set("useRoughnessMap",S),c.set("doubleSide",T),null!=y&&c.set("uvRepeat",y),null!=_&&c.set("uvOffset",_),null!=x&&c.set("detailUvRepeat",x),null!=b&&c.set("detailUvOffset",b),c.set("roughness",f)):(p.setUniform(u,"1f","roughness",f),o!==g&&S0(e,p,"normalMap",g,0),a!==v&&v&&S0(e,p,"bumpMap",v,1),s!==m&&m&&S0(e,p,"roughnessMap",m,2),null!=y&&p.setUniform(u,"2f","uvRepeat",y),null!=_&&p.setUniform(u,"2f","uvOffset",_),null!=x&&p.setUniform(u,"2f","detailUvRepeat",x),null!=b&&p.setUniform(u,"2f","detailUvOffset",b),p.setUniform(u,"1i","useBumpMap",+w),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+T)),o=g,a=v,s=m,l=i}}}function M0(e){this._depthTex=new PK({format:AK.DEPTH_COMPONENT,type:AK.UNSIGNED_INT}),this._normalTex=new PK({type:AK.HALF_FLOAT}),this._framebuffer=new k$,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,k$.DEPTH_ATTACHMENT),this._normalMaterial=new WZ({shader:new bq(bq.source("ecgl.normal.vertex"),bq.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=eJ.createBlank("#000"),this._defaultBumpMap=eJ.createBlank("#000"),this._defaultRoughessMap=eJ.createBlank("#000"),this._debugPass=new lJ({fragment:bq.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}function C0(e){e=e||{},this._edgePass=new lJ({fragment:bq.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new PK({type:AK.HALF_FLOAT}),this._frameBuffer=new k$,this._frameBuffer.attach(this._targetTexture)}bq.import("@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"),M0.prototype.getDepthTexture=function(){return this._depthTex},M0.prototype.getNormalTexture=function(){return this._normalTex},M0.prototype.update=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),o=this._depthTex,a=this._normalTex,s=this._normalMaterial;o.width=r,o.height=i,a.width=r,a.height=i;var l=t.getRenderList(n).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,n,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:T0(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},M0.prototype.renderDebug=function(e){this._debugPass.render(e)},M0.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},C0.prototype.update=function(e,t,n,r){var i=e.getWidth(),o=e.getHeight(),a=this._targetTexture;a.width=i,a.height=o;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[i,o]),this._edgePass.setUniform("texture",n),this._edgePass.render(e),s.unbind(e)},C0.prototype.getTargetTexture=function(){return this._targetTexture},C0.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},C0.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};var D0={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]};function A0(e,t){return{color:{parameters:{width:e,height:t}}}}bq.import(QQ),bq.import(e0),bq.import(t0),bq.import(n0),bq.import(r0),bq.import(i0),bq.import(o0),bq.import(a0),bq.import(s0),bq.import("@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"),bq.import("@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end");var I0=["composite","FXAA"];function E0(){this._width,this._height,this._dpr,this._sourceTexture=new PK({type:AK.HALF_FLOAT}),this._depthTexture=new PK({format:AK.DEPTH_COMPONENT,type:AK.UNSIGNED_INT}),this._framebuffer=new k$,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,k$.DEPTH_ATTACHMENT),this._normalPass=new M0,this._compositor=u0(D0);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(e){return this._compositor.getNodeByName(e)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=I0.map((function(e){return this._compositor.getNodeByName(e)}),this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new x0(n),this._ssrPass=new b0(n),this._edgePass=new C0(n)}function L0(e){for(var t=[],n=0;n<30;n++)t.push([m0(n,2),m0(n,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new PK,this._sourceFb=new k$,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new PK,this._outputTex=new PK;var r=this._blendPass=new lJ({fragment:bq.source("clay.compositor.blend")});r.material.disableTexturesAll(),r.material.enableTexture(["texture1","texture2"]),this._blendFb=new k$({depthBuffer:!1}),this._outputPass=new lJ({fragment:bq.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(e){e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}}function N0(e){e=e||"perspective",this.layer=null,this.scene=new _$,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new E0,this._temporalSS=new L0,this._shadowMapPass=new XQ;for(var t=[],n=0,r=0;r<30;r++){for(var i=[],o=0;o<6;o++)i.push(4*m0(n,2)-2),i.push(4*m0(n,3)-2),n++;t.push(i)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n)}),this)}E0.prototype.resize=function(e,t,n){e*=n=n||1,t*=n;var r=this._sourceTexture,i=this._depthTexture;r.width=e,r.height=t,i.width=e,i.height=t;var o={getWidth:function(){return e},getHeight:function(){return t},getDevicePixelRatio:function(){return n}};function a(e,t){if("function"==typeof e[t]){var n=e[t].__original||e[t];e[t]=function(e){return n.call(this,o)},e[t].__original=n}}this._compositor.nodes.forEach((function(e){for(var t in e.outputs){var n=e.outputs[t].parameters;n&&(a(n,"width"),a(n,"height"))}for(var r in e.parameters)a(e.parameters,r)})),this._width=e,this._height=t,this._dpr=n},E0.prototype.getWidth=function(){return this._width},E0.prototype.getHeight=function(){return this._height},E0.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},E0.prototype._getPrevNode=function(e){for(var t=I0.indexOf(e.name)-1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t-=1,n=this._finalNodesChain[t];return n},E0.prototype._getNextNode=function(e){for(var t=I0.indexOf(e.name)+1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t+=1,n=this._finalNodesChain[t];return n},E0.prototype._addChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(e.inputs.texture=t.name,n?(e.outputs=A0(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},E0.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(n?(t.outputs=A0(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},E0.prototype.updateNormal=function(e,t,n,r){this._ifRenderNormalPass()&&this._normalPass.update(e,t,n)},E0.prototype.updateSSAO=function(e,t,n,r){this._ssaoPass.update(e,n,r)},E0.prototype.enableSSAO=function(){this._enableSSAO=!0},E0.prototype.disableSSAO=function(){this._enableSSAO=!1},E0.prototype.enableSSR=function(){this._enableSSR=!0},E0.prototype.disableSSR=function(){this._enableSSR=!1},E0.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},E0.prototype.getSourceFrameBuffer=function(){return this._framebuffer},E0.prototype.getSourceTexture=function(){return this._sourceTexture},E0.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},E0.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},E0.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},E0.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},E0.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},E0.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},E0.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},E0.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},E0.prototype.enableEdge=function(){this._enableEdge=!0},E0.prototype.disableEdge=function(){this._enableEdge=!1},E0.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},E0.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var n={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unkown SSAO parameter "+e)}},E0.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].setParameter("blurRadius",t);break;case"quality":var r={low:4,medium:8,high:16,ultra:32}[t]||8;this._dofBlurKernelSize=r;for(n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].pass.material.define("POISSON_KERNEL_SIZE",r);this._dofBlurKernel=new Float32Array(2*r);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unkown DOF parameter "+e)}},E0.prototype.setSSRParameter=function(e,t){if(null!=t)switch(e){case"quality":var n={low:10,medium:15,high:30,ultra:80}[t]||20,r={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",n),this._ssrPass.setParameter("pixelStride",r);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-t,1),0));break;case"physical":this.setPhysicallyCorrectSSR(t);break;default:console.warn("Unkown SSR parameter "+e)}},E0.prototype.setPhysicallyCorrectSSR=function(e){this._ssrPass.setPhysicallyCorrect(e)},E0.prototype.setEdgeColor=function(e){var t=zJ.parseColor(e);this._edgePass.setParameter("edgeColor",t)},E0.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},E0.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:zJ.Texture.NEAREST,magFilter:zJ.Texture.NEAREST,flipY:!1})},E0.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},E0.prototype.isSSREnabled=function(){return this._enableSSR},E0.prototype.composite=function(e,t,n,r,i){var o=this._sourceTexture,a=o;this._enableEdge&&(this._edgePass.update(e,n,o,i),o=a=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,n,o,i),a=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=a,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=i%Math.floor(w0.length/2/l),c=0;c<2*l;c++)s[c]=w0[c+u*l*2];for(c=0;c<this._dofBlurNodes.length;c++)this._dofBlurNodes[c].setParameter("percent",i/30),this._dofBlurNodes[c].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",n.near),this._cocNode.setParameter("zFar",n.far),this._compositor.render(e,r)},E0.prototype.dispose=function(e){this._sourceTexture.dispose(e),this._depthTexture.dispose(e),this._framebuffer.dispose(e),this._compositor.dispose(e),this._normalPass.dispose(e),this._ssaoPass.dispose(e)},L0.prototype={constructor:L0,jitterProjection:function(e,t){var n=e.viewport,r=n.devicePixelRatio||e.getDevicePixelRatio(),i=n.width*r,o=n.height*r,a=this._haltonSequence[this._frame%this._haltonSequence.length],s=new iK;s.array[12]=(2*a[0]-1)/i,s.array[13]=(2*a[1]-1)/o,iK.mul(t.projectionMatrix,s,t.projectionMatrix),iK.invert(t.invProjectionMatrix,t.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(e,t){this._prevFrameTex.width=e,this._prevFrameTex.height=t,this._outputTex.width=e,this._outputTex.height=t,this._sourceTex.width=e,this._sourceTex.height=t,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(e,t,n){var r=this._blendPass;0===this._frame?(r.setUniform("weight1",0),r.setUniform("weight2",1)):(r.setUniform("weight1",.9),r.setUniform("weight2",.1)),r.setUniform("texture1",this._prevFrameTex),r.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),r.render(e),this._blendFb.unbind(e),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var i=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=i,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}},N0.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof M$||(this.camera=new M$,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof iJ||(this.camera=new iJ,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},N0.prototype.setViewport=function(e,t,n,r,i){this.camera instanceof M$&&(this.camera.aspect=n/r),i=i||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=n,this.viewport.height=r,this.viewport.devicePixelRatio=i,this._compositor.resize(n*i,r*i),this._temporalSS.resize(n*i,r*i)},N0.prototype.containPoint=function(e,t){var n=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=n.x&&t>=n.y&&e<=n.x+n.width&&t<=n.y+n.height};var P0=new qZ;function O0(e,t){var n=Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=e.get("boxWidth"),i=e.get("boxHeight"),o=e.get("boxDepth");"production"!==process.env.NODE_ENV&&["x","y","z"].forEach((function(t){if(!this.getAxis(t))throw new Error("Grid"+e.id+" don't have "+t+"Axis")}),this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-i/2,i/2),this.size=[r,i,o]}function R0(e,t){var n={};e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();["x","y","z"].forEach((function(e){t.mapDimensionsAll(e,!0).forEach((function(r){!function(e,t){n[e]=n[e]||[1/0,-1/0],n[e][0]=Math.min(t[0],n[e][0]),n[e][1]=Math.max(t[1],n[e][1])}(e,t.getDataExtent(r,!0))}))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(t){e.eachComponent(t,(function(e){var r=t.charAt(0),i=e.getReferringComponents("grid3D").models[0],o=i.coordinateSystem;if(o===this){var a=o.getAxis(r);if(a)"production"!==process.env.NODE_ENV&&console.warn("Can't have two %s in one grid3D",t);else{(a=new LQ(r,Jx(n[r]||[1/0,-1/0],e))).type=e.get("type");var s="category"===a.type;a.onBand=s&&e.get("boundaryGap"),a.inverse=e.get("inverse"),e.axis=a,a.model=e,a.getLabelModel=function(){return e.getModel("axisLabel",i.getModel("axisLabel"))},a.getTickModel=function(){return e.getModel("axisTick",i.getModel("axisTick"))},o.addAxis(a)}}}),this)}),this),this.resize(this.model,t)}N0.prototype.castRay=function(e,t,n){var r=this.layer.renderer,i=r.viewport;return r.viewport=this.viewport,r.screenToNDC(e,t,P0),this.camera.castRay(P0,n),r.viewport=i,n},N0.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t<e.transparent.length;t++){var n=e.transparent[t].geometry;n.needsSortVerticesProgressively&&n.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),n.needsSortTrianglesProgressively&&n.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},N0.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},N0.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},N0.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"===e&&(e=this._enablePostEffect),e},N0.prototype.hasDOF=function(){return this._enableDOF},N0.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},N0.prototype._doRender=function(e,t,n){var r=this.scene,i=this.camera;n=n||0,this._updateTransparent(e,r,i,n),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,r,i,!0)),this._updateShadowPCFKernel(n);var o,a=e.clearColor;(e.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,i),this._compositor.updateNormal(e,r,i,this._temporalSS.getFrame())),this._updateSSAO(e,r,i,this._temporalSS.getFrame()),this._enablePostEffect)?((o=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(r,i,!0,!0),o.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,r,i,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,r,i,null,0))):this.needsTemporalSS()&&t?((o=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(r,i,!0,!0),e.restoreClear(),o.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(r,i,!0,!0))},N0.prototype._updateTransparent=function(e,t,n,r){for(var i=new Bq,o=new iK,a=n.getWorldPosition(),s=t.getRenderList(n).transparent,l=0;l<s.length;l++){var u=s[l],c=u.geometry;iK.invert(o,u.worldTransform),Bq.transformMat4(i,a,o),c.needsSortTriangles&&c.needsSortTriangles()&&c.doSortTriangles(i,r),c.needsSortVertices&&c.needsSortVertices()&&c.doSortVertices(i,r)}},N0.prototype._updateSSAO=function(e,t,n){var r=this._enableSSAO&&this._enablePostEffect;r&&this._compositor.updateSSAO(e,t,n,this._temporalSS.getFrame());for(var i=t.getRenderList(n),o=0;o<i.opaque.length;o++){var a=i.opaque[o];a.renderNormal&&a.material[r?"enableTexture":"disableTexture"]("ssaoMap"),r&&a.material.set("ssaoMap",this._compositor.getSSAOTexture())}},N0.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],n=this.scene.getRenderList(this.camera).opaque,r=0;r<n.length;r++)n[r].receiveShadow&&(n[r].material.set("pcfKernel",t),n[r].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},N0.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},N0.prototype.setPostEffect=function(e,t){var n=this._compositor;this._enablePostEffect=e.get("enable");var r=e.getModel("bloom"),i=e.getModel("edge"),o=e.getModel("DOF",e.getModel("depthOfField")),a=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),s=e.getModel("SSR",e.getModel("screenSpaceReflection")),l=e.getModel("FXAA"),u=e.getModel("colorCorrection");r.get("enable")?n.enableBloom():n.disableBloom(),o.get("enable")?n.enableDOF():n.disableDOF(),s.get("enable")?n.enableSSR():n.disableSSR(),u.get("enable")?n.enableColorCorrection():n.disableColorCorrection(),i.get("enable")?n.enableEdge():n.disableEdge(),l.get("enable")?n.enableFXAA():n.disableFXAA(),this._enableDOF=o.get("enable"),this._enableSSAO=a.get("enable"),this._enableSSAO?n.enableSSAO():n.disableSSAO(),n.setBloomIntensity(r.get("intensity")),n.setEdgeColor(i.get("color")),n.setColorLookupTexture(u.get("lookupTexture"),t),n.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(e){n.setSSAOParameter(e,a.get(e))})),["quality","maxRoughness","physical"].forEach((function(e){n.setSSRParameter(e,s.get(e))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(e){n.setDOFParameter(e,o.get(e))})),["brightness","contrast","saturation"].forEach((function(e){n.setColorCorrection(e,u.get(e))}))},N0.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},N0.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},N0.prototype.isLinearSpace=function(){return this._enablePostEffect},N0.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),n=0;n<t.length;n++)e.add(t[n]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},N0.prototype.add=function(e){this.rootNode.add(e)},N0.prototype.remove=function(e){this.rootNode.remove(e)},N0.prototype.removeAll=function(e){this.rootNode.removeAll(e)},Object.assign(N0.prototype,vY);var k0={dimensions:EQ.prototype.dimensions,create:function(e,t){var n=[];e.eachComponent("grid3D",(function(e){e.__viewGL=e.__viewGL||new N0;var t=new EQ;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,n.push(t),t.resize=O0,t.update=R0}));var r=["xAxis3D","yAxis3D","zAxis3D"];return e.eachSeries((function(t){if("cartesian3D"===t.get("coordinateSystem")){if(null==(i=t.getReferringComponents("grid3D").models[0])){var n=function(e,t){return r.map((function(n){var r=e.getReferringComponents(n).models[0];if(null==r&&(r=t.getComponent(n)),"production"!==process.env.NODE_ENV&&!r)throw new Error(n+' "'+vJ(e.get(n+"Index"),e.get(n+"Id"),0)+'" not found');return r}))}(t,e),i=n[0].getCoordSysModel();n.forEach((function(e){var t=e.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!t)throw new Error('grid3D "'+vJ(e.get("gridIndex"),e.get("gridId"),0)+'" not found');if(t!==i)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}}))}var o=i.coordinateSystem;t.coordinateSystem=o}})),n}},z0=$d.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});Qx(z0);var V0={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},B0=R({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},V0),F0=R({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},V0),G0=V({scale:!0,min:"dataMin",max:"dataMax"},F0),H0=V({logBase:10},F0);H0.scale=!0;var U0={categoryAxis3D:B0,valueAxis3D:F0,timeAxis3D:G0,logAxis3D:H0},W0=["value","category","time","log"];function j0(e,t){return t.type||(t.data?"category":"value")}i_((function(e){e.registerComponentModel(tQ),e.registerComponentView(IQ),e.registerCoordinateSystem("grid3D",k0),["x","y","z"].forEach((function(t){!function(e,t,n,r,i){W0.forEach((function(o){var a=n.extend({type:t+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(e,n){R(e,n.getTheme().get(o+"Axis3D")),R(e,this.getDefaultOption()),e.type=r(t,e)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=W_.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:R(O(U0[o+"Axis3D"]),i,!0)});e.registerComponentModel(a)})),e.registerSubTypeDefaulter(t+"Axis3D",$(r,t))}(e,t,z0,j0,{name:t.toUpperCase()});const n=e.ComponentView.extend({type:t+"Axis3D"});e.registerComponentView(n)})),e.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"grid3D",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(e,t){})),e.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(e,t){}))}));var X0={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}},Y0={getFilledRegions:function(e,t){var n,r=(e||[]).slice();if("string"==typeof t?n=(t=e_(t))&&t.geoJson:t&&t.features&&(n=t),!n)return"production"!==process.env.NODE_ENV&&(console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),n.features||console.error("Invalid GeoJSON for map3D")),[];for(var i={},o=n.features,a=0;a<r.length;a++)i[r[a].name]=r[a];for(a=0;a<o.length;a++){var s=o[a].properties.name;i[s]||r.push({name:s})}return r},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}},Z0=$d.extend({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=N_(e.data||[],{coordDimensions:["value"],encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),n=new L_(t,this);n.initData(e.regions);var r={};n.each((function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i})),this._regionModelMap=r,this._data=n},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new Fh(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),n=this.coordinateSystem.getRegion(t);return n?n.geometries:[]},getFormattedLabel:function(e,t){var n=this._data.getName(e),r=this.getRegionModel(e),i=r.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==i&&(i=r.get(["label","formatter"]));var o={name:n};if("function"==typeof i)return o.status=t,i(o);if("string"==typeof i){var a=o.seriesName;return i.replace("{a}",null!=a?a:"")}return n},defaultOption:{regions:[]}});function q0(e,t,n){n=n||2;var r,i,o,a,s,l,u,c=t&&t.length,h=c?t[0]*n:e.length,d=K0(e,0,h,n,!0),p=[];if(!d)return p;if(c&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i<o;i++)(a=K0(e,t[i]*r,i<o-1?t[i+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(a1(a));for(s.sort(r1),i=0;i<s.length;i++)i1(s[i],n),n=$0(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(l=e[f+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);u=Math.max(o-r,a-i)}return J0(d,p,n,r,i,u),p}function K0(e,t,n,r,i){var o,a;if(i===v1(e,t,n,r)>0)for(o=t;o<n;o+=r)a=f1(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=f1(o,e[o],e[o+1],a);return a&&c1(a,a.next)&&(g1(a),a=a.next),a}function $0(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!c1(r,r.next)&&0!==u1(r.prev,r,r.next))r=r.next;else{if(g1(r),(r=t=r.prev)===r.next)return null;n=!0}}while(n||r!==t);return t}function J0(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=o1(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,u=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?e1(e,r,i,o):Q0(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),g1(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?J0(e=t1(e,t,n),t,n,r,i,o,2):2===a&&n1(e,t,n,r,i,o):J0($0(e),t,n,r,i,o,1);break}}}function Q0(e){var t=e.prev,n=e,r=e.next;if(u1(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(s1(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&u1(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function e1(e,t,n,r){var i=e.prev,o=e,a=e.next;if(u1(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=o1(s,l,t,n,r),d=o1(u,c,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&s1(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&u1(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&s1(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&u1(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function t1(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!c1(i,o)&&h1(i,r,r.next,o)&&d1(i,o)&&d1(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),g1(r),g1(r.next),r=e=o),r=r.next}while(r!==e);return r}function n1(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&l1(a,s)){var l=p1(a,s);return a=$0(a,a.next),l=$0(l,l.next),J0(a,t,n,r,i,o),void J0(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function r1(e,t){return e.x-t.x}function i1(e,t){if(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 s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n.prev;var l,u=n,c=n.x,h=n.y,d=1/0;r=n.next;for(;r!==u;)i>=r.x&&r.x>=c&&i!==r.x&&s1(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&((l=Math.abs(o-r.y)/(i-r.x))<d||l===d&&r.x>n.x)&&d1(r,e)&&(n=r,d=l),r=r.next;return n}(e,t),t){var n=p1(t,e);$0(n,n.next)}}function o1(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 a1(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function s1(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function l1(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&&h1(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&d1(e,t)&&d1(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{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}while(n!==e);return r}(e,t)}function u1(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function c1(e,t){return e.x===t.x&&e.y===t.y}function h1(e,t,n,r){return!!(c1(e,t)&&c1(n,r)||c1(e,r)&&c1(n,t))||u1(e,t,n)>0!=u1(e,t,r)>0&&u1(n,r,e)>0!=u1(n,r,t)>0}function d1(e,t){return u1(e.prev,e,e.next)<0?u1(e,t,e.next)>=0&&u1(e,e.prev,t)>=0:u1(e,t,e.prev)<0||u1(e,e.next,t)<0}function p1(e,t){var n=new m1(e.i,e.x,e.y),r=new m1(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function f1(e,t,n,r){var i=new m1(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function g1(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 m1(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 v1(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 y1(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _1(e,t,n,r,i){var o=n,a=e[t];y1(e,t,r);for(var s=n;s<r;s++)i(e[s],a)<0&&(y1(e,s,o),o++);return y1(e,r,o),o}function x1(e,t,n,r){if(n<r){var i=_1(e,Math.floor((n+r)/2),n,r,t);x1(e,t,n,i-1),x1(e,t,i+1,r)}}function b1(){this._parts=[]}R(Z0.prototype,Y0),R(Z0.prototype,JJ),R(Z0.prototype,QJ),R(Z0.prototype,eQ),R(Z0.prototype,X0),q0.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(v1(e,0,o,n));if(i)for(var s=0,l=t.length;s<l;s++){var u=t[s]*n,c=s<l-1?t[s+1]*n:e.length;a-=Math.abs(v1(e,u,c,n))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*n,p=r[s+1]*n,f=r[s+2]*n;h+=Math.abs((e[d]-e[f])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[f+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},b1.prototype.step=function(e,t,n){var r=e.length;if(0===n){this._parts=[],this._sorted=!1;var i=Math.floor(r/2);this._parts.push({pivot:i,left:0,right:r-1}),this._currentSortPartIdx=0}if(!this._sorted){var o=this._parts;if(0===o.length)return this._sorted=!0,!0;if(o.length<512){for(var a=0;a<o.length;a++)o[a].pivot=_1(e,o[a].pivot,o[a].left,o[a].right,t);var s=[];for(a=0;a<o.length;a++){var l=o[a].left;(u=o[a].pivot-1)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var u;l=o[a].pivot+1;(u=o[a].right)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}o=this._parts=s}else for(a=0;a<Math.floor(o.length/10);a++){var c=o.length-1-this._currentSortPartIdx;if(x1(e,t,o[c].left,o[c].right),this._currentSortPartIdx++,this._currentSortPartIdx===o.length)return this._sorted=!0,!0}return!1}},b1.sort=x1;var w1=sQ.vec3,S1=w1.create(),T1=w1.create(),M1=w1.create(),C1={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(e,t){var n=this.indices;if(0===t){var r=this.attributes.position;e=e.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var i,o=0,a=0;a<n.length;){r.get(n[a++],S1),r.get(n[a++],T1),r.get(n[a++],M1);var s=w1.sqrDist(S1,e),l=w1.sqrDist(T1,e),u=w1.sqrDist(M1,e),c=Math.min(s,l);c=Math.min(c,u),3===a?(i=c,c=0):c-=i,this._triangleZList[o++]=c}}var h=this._sortedTriangleIndices;for(a=0;a<h.length;a++)h[a]=a;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(a=0;a<3;a++)this._progressiveQuickSort(3*t+a);var d=this._indicesTmp,p=this._triangleZListTmp,f=this._triangleZList;for(a=0;a<this.triangleCount;a++){var g=3*h[a],m=3*a;d[m++]=n[g++],d[m++]=n[g++],d[m]=n[g],p[a]=f[h[a]]}var v=this._indicesTmp;this._indicesTmp=this.indices,this.indices=v;v=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=v,this.dirtyIndices()},_simpleSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):b1.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;this._quickSort=this._quickSort||new b1,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}};function D1(e,t){const n=e.getItemVisual(t,"style");if(n){return n[e.getVisual("drawType")]}}function A1(e,t){const n=e.getItemVisual(t,"style");return n&&n.opacity}function I1(e,t,n){this._labelsMesh=new bQ,this._labelTextureSurface=new dQ({width:512,height:512,devicePixelRatio:n.getDevicePixelRatio(),onupdate:function(){n.getZr().refresh()}}),this._api=n,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}I1.prototype.getLabelPosition=function(e,t,n){return[0,0,0]},I1.prototype.getLabelDistance=function(e,t,n){return 0},I1.prototype.getMesh=function(){return this._labelsMesh},I1.prototype.updateData=function(e,t,n){null==t&&(t=0),null==n&&(n=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===n-t||(this._labelsVisibilitiesBits=new Uint8Array(n-t));for(var r=["label","show"],i=["emphasis","label","show"],o=t;o<n;o++){var a=e.getItemModel(o),s=a.get(r),l=a.get(i);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[o-t]=u}this._start=t,this._end=n,this._data=e},I1.prototype.updateLabels=function(e){if(this._data){for(var t=(e=e||[]).length>0,n={},r=0;r<e.length;r++)n[e[r]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var i=["label"],o=["emphasis","label"],a=this._data.hostModel,s=this._data,l=a.getModel(i),u=a.getModel(o,l),c={left:"right",right:"left",top:"center",bottom:"center"},h={left:"middle",right:"middle",top:"bottom",bottom:"top"},d=this._start;d<this._end;d++){var p=!1;if(t&&n[d]&&(p=!0),this._labelsVisibilitiesBits[d-this._start]&(p?2:1)){var f=s.getItemModel(d).getModel(p?o:i,p?u:l),g=f.get("distance")||0,m=f.get("position"),v=this._api.getDevicePixelRatio(),y=a.getFormattedLabel(d,p?"emphasis":"normal");if(null==y||""===y)return;var _=new il({style:yh(f,{text:y,fill:f.get("color")||D1(s,d)||"#000",align:"left",verticalAlign:"top",opacity:vJ(f.get("opacity"),A1(s,d),1)})}),x=_.getBoundingRect();x.height*=1.2;var b=this._labelTextureSurface.add(_),w=c[m]||"center",S=h[m]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(d,m,g),[x.width*v,x.height*v],b,w,S,this.getLabelDistance(d,m,g)*v)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},I1.prototype.dispose=function(){this._labelTextureSurface.dispose()};var E1=sQ.vec3;function L1(e){this.rootNode=new zJ.Node,this._triangulationResults={},this._shadersMap=zJ.COMMON_SHADERS.filter((function(e){return"shadow"!==e})).reduce((function(e,t){return e[t]=zJ.createShader("ecgl."+t),e}),{}),this._linesShader=zJ.createShader("ecgl.meshLines3D");var t={};zJ.COMMON_SHADERS.forEach((function(e){t[e]=new zJ.Material({shader:zJ.createShader("ecgl."+e)})})),this._groundMaterials=t,this._groundMesh=new zJ.Mesh({geometry:new zJ.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new I1(512,512,e),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=e}zJ.Shader.import(CQ),L1.prototype={constructor:L1,extrudeY:!0,update:function(e,t,n,r,i){var o=e.getData();null==r&&(r=0),null==i&&(i=o.count()),this._startIndex=r,this._endIndex=i-1,this._triangulation(e,r,i);var a=this._getShader(e.get("shading"));this._prepareMesh(e,a,n,r,i),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,n,r,i);var s=e.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(e,s,n);var l=this;this._labelsBuilder.updateData(o,r,i),this._labelsBuilder.getLabelPosition=function(e,t,n){var r=o.getName(e),i=n;if("geo3D"===s.type){var a=s.getRegion(r);return a?(c=a.getCenter(),s.dataToPoint([c[0],c[1],i])):[NaN,NaN,NaN]}var u=l._triangulationResults[e-l._startIndex],c=l.extrudeY?[(u.max[0]+u.min[0])/2,u.max[1]+i,(u.max[2]+u.min[2])/2]:[(u.max[0]+u.min[0])/2,(u.max[1]+u.min[1])/2,u.max[2]+i]},this._data=o,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){var e=this;var t=function(){var t=new zJ.Mesh({name:"Polygon",material:new zJ.Material({shader:e._shadersMap.lambert}),geometry:new zJ.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0});return Object.assign(t.geometry,C1),t}(),n=new zJ.Mesh({material:new zJ.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new cQ({useNativeLine:!1})});this.rootNode.add(t),this.rootNode.add(n),t.material.define("both","VERTEX_COLOR"),t.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=t,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return t||("production"!==process.env.NODE_ENV&&console.warn("Unkown shading "+e),t=this._shadersMap.lambert),t.__shading=e,t},_prepareMesh:function(e,t,n,r,i){for(var o=0,a=0,s=0,l=0,u=r;u<i;u++){var c=this._getRegionPolygonInfo(u),h=this._getRegionLinesInfo(u,e,this._linesMesh.geometry);o+=c.vertexCount,a+=c.triangleCount,s+=h.vertexCount,l+=h.triangleCount}var d=this._polygonMesh,p=d.geometry;["position","normal","texcoord0","color"].forEach((function(e){p.attributes[e].init(o)})),p.indices=o>65535?new Uint32Array(3*a):new Uint16Array(3*a),d.material.shader!==t&&d.material.attachShader(t,!0),zJ.setMaterialFromModel(t.__shading,d.material,e,n),s>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(l)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(i-r))},_updateRegionMesh:function(e,t,n,r){for(var i=e.getData(),o=0,a=0,s=!1,l=this._polygonMesh,u=this._linesMesh,c=n;c<r;c++){var h=e.getRegionModel(c),d=h.getModel("itemStyle"),p=vJ(D1(i,c),d.get("color"),"#fff"),f=vJ(A1(i,c),d.get("opacity"),1),g=zJ.parseColor(p),m=zJ.parseColor(d.get("borderColor"));g[3]*=f,m[3]*=f;var v=g[3]<.99;l.material.set("color",[1,1,1,1]),s=s||v;for(var y=vJ(h.get("height",!0),e.get("regionHeight")),_=this._updatePolygonGeometry(e,l.geometry,c,y,o,a,g),x=o;x<_.vertexOffset;x++)this._dataIndexOfVertex[x]=c;this._vertexRangeOfDataIndex[2*(c-n)]=o,this._vertexRangeOfDataIndex[2*(c-n)+1]=_.vertexOffset,o=_.vertexOffset,a=_.triangleOffset;var b=d.get("borderWidth"),w=b>0;w&&(b*=t.getDevicePixelRatio(),this._updateLinesGeometry(u.geometry,e,c,y,b,e.coordinateSystem.transform)),u.invisible=!w,u.material.set({color:m})}(l=this._polygonMesh).material.transparent=s,l.material.depthMask=!s,l.geometry.updateBoundingBox(),l.frontFace=this.extrudeY?zJ.Mesh.CCW:zJ.Mesh.CW,l.material.get("normalMap")&&l.geometry.generateTangents(),l.seriesIndex=e.seriesIndex,l.on("mousemove",this._onmousemove,this),l.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var n=zJ.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),r=vJ(t.get("lineStyle.width"),1),i=this._polygonMesh;i.geometry.generateBarycentric(),i.material.define("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",n),i.material.set("wireframeLineWidth",r)}},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t),this._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,n){var r=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!r.get("show",!0),!this._groundMesh.invisible){var i=e.get("shading"),o=this._groundMaterials[i];o||("production"!==process.env.NODE_ENV&&console.warn("Unkown shading "+i),o=this._groundMaterials.lambert),zJ.setMaterialFromModel(i,o,r,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",zJ.parseColor(r.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,n){this._triangulationResults=[];for(var r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0],o=e.coordinateSystem,a=t;a<n;a++){for(var s=[],l=e.getRegionPolygonCoords(a),u=0;u<l.length;u++){var c=l[u].exterior,h=l[u].interiors,d=[],p=[];if(!(c.length<3)){for(var f=0,g=0;g<c.length;g++){var m=c[g];d[f++]=m[0],d[f++]=m[1]}for(g=0;g<h.length;g++)if(!(h[g].length<3)){for(var v=d.length/2,y=0;y<h[g].length;y++){m=h[g][y];d.push(m[0]),d.push(m[1])}p.push(v)}var _=q0(d,p),x=new Float64Array(d.length/2*3),b=[],w=[1/0,1/0,1/0],S=[-1/0,-1/0,-1/0],T=0;for(g=0;g<d.length;)E1.set(b,d[g++],0,d[g++]),o&&o.transform&&E1.transformMat4(b,b,o.transform),E1.min(w,w,b),E1.max(S,S,b),x[T++]=b[0],x[T++]=b[1],x[T++]=b[2];E1.min(r,r,w),E1.max(i,i,S),s.push({points:x,indices:_,min:w,max:S})}}this._triangulationResults.push(s)}this._geoBoundingBox=[r,i]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],n=0,r=0,i=0;i<t.length;i++)n+=t[i].points.length/3,r+=t[i].indices.length/3;return{vertexCount:2*n+4*n,triangleCount:2*r+2*n}},_updatePolygonGeometry:function(e,t,n,r,i,o,a){var s=e.get("projectUVOnGround"),l=t.attributes.position,u=t.attributes.normal,c=t.attributes.texcoord0,h=t.attributes.color,d=this._triangulationResults[n-this._startIndex],p=h.value&&a,f=t.indices,g=this.extrudeY?1:2,m=this.extrudeY?2:1,v=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],y=E1.mul([],this._geoBoundingBox[0],v),_=E1.mul([],this._geoBoundingBox[1],v),x=Math.max(_[0]-y[0],_[2]-y[2]);function b(e,t,n){var r=i;!function(e,t){for(var n=e.points,r=n.length,o=[],s=[],u=0;u<r;u+=3)o[0]=n[u],o[g]=t,o[m]=n[u+2],s[0]=(n[u]*v[0]-y[0])/x,s[1]=(n[u+2]*v[m]-y[2])/x,l.set(i,o),p&&h.set(i,a),c.set(i++,s)}(e,t);for(var s=e.indices.length,u=0;u<s;u++)f[3*o+u]=e.indices[u]+r;o+=e.indices.length/3}for(var w=this.extrudeY?[0,1,0]:[0,0,1],S=E1.negate([],w),T=0;T<d.length;T++){var M=i,C=d[T];b(C,0),b(C,r);for(var D=C.points.length/3,A=0;A<D;A++)u.set(M+A,S),u.set(M+A+D,w);var I=[0,3,1,1,3,2],E=[[],[],[],[]],L=[],N=[],P=[],O=[],R=0;for(A=0;A<D;A++){for(var k=(A+1)%D,z=(C.points[3*k]-C.points[3*A])*v[0],V=(C.points[3*k+2]-C.points[3*A+2])*v[m],B=Math.sqrt(z*z+V*V),F=0;F<4;F++){var G=0===F||3===F,H=3*(G?A:k);E[F][0]=C.points[H],E[F][g]=F>1?r:0,E[F][m]=C.points[H+2],l.set(i+F,E[F]),s?(O[0]=(C.points[H]*v[0]-y[0])/x,O[1]=(C.points[H+2]*v[m]-y[m])/x):(O[0]=(G?R:R+B)/x,O[1]=(E[F][g]*v[g]-y[g])/x),c.set(i+F,O)}E1.sub(L,E[1],E[0]),E1.sub(N,E[3],E[0]),E1.cross(P,L,N),E1.normalize(P,P);for(F=0;F<4;F++)u.set(i+F,P),p&&h.set(i+F,a);for(F=0;F<6;F++)f[3*o+F]=I[F]+i;i+=4,o+=2,R+=B}}return t.dirty(),{vertexOffset:i,triangleOffset:o}},_getRegionLinesInfo:function(e,t,n){var r=0,i=0;t.getRegionModel(e).getModel("itemStyle").get("borderWidth")>0&&t.getRegionPolygonCoords(e).forEach((function(e){var t=e.exterior,o=e.interiors;r+=n.getPolylineVertexCount(t),i+=n.getPolylineTriangleCount(t);for(var a=0;a<o.length;a++)r+=n.getPolylineVertexCount(o[a]),i+=n.getPolylineTriangleCount(o[a])}),this);return{vertexCount:r,triangleCount:i}},_updateLinesGeometry:function(e,t,n,r,i,o){function a(e){for(var t=new Float64Array(3*e.length),n=0,i=[],a=0;a<e.length;a++)i[0]=e[a][0],i[1]=r+.1,i[2]=e[a][1],o&&E1.transformMat4(i,i,o),t[n++]=i[0],t[n++]=i[1],t[n++]=i[2];return t}var s=[1,1,1,1];t.getRegionPolygonCoords(n).forEach((function(t){var n=t.exterior,r=t.interiors;e.addPolyline(a(n),s,i);for(var o=0;o<r.length;o++)e.addPolyline(a(r[o]),s,i)}))},highlight:function(e){var t=this._data;if(t){var n=t.getItemModel(e).getModel(["emphasis","itemStyle"]),r=n.get("color"),i=vJ(n.get("opacity"),A1(t,e),1);if(null==r)r=ir(D1(t,e),-.4);null==i&&(i=A1(t,e));var o=zJ.parseColor(r);o[3]*=i,this._setColorOfDataIndex(t,e,o)}},downplay:function(e){var t=this._data;if(t){var n=t.getItemModel(e),r=vJ(D1(t,e),n.get(["itemStyle","color"]),"#fff"),i=vJ(A1(t,e),n.get(["itemStyle","opacity"]),1),o=zJ.parseColor(r);o[3]*=i,this._setColorOfDataIndex(t,e,o)}},dispose:function(){this._labelsBuilder.dispose()},_setColorOfDataIndex:function(e,t,n){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var r=this._vertexRangeOfDataIndex[2*t];r<this._vertexRangeOfDataIndex[2*t+1];r++)this._polygonMesh.geometry.attributes.color.set(r,n);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}};var N1=Xg.extend({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new L1(t),this.groupGL=new zJ.Node,this._lightRoot=new zJ.Node,this._sceneHelper=new pQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new oQ({zr:t.getZr()}),this._control.init()},render:function(e,t,n){this.groupGL.add(this._geo3DBuilder.rootNode);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=e.getModel("viewControl");i.setFromViewControlModel(o,0),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,n,0,e.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")})),i.off("update"),i.on("update",(function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,geo3DId:e.id})})),i.update()}},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},dispose:function(){this._control.dispose(),this._geo3DBuilder.dispose()}}),P1={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var O1=sQ.vec3,R1=sQ.mat4,k1=[dD,function(e,t){if("world"===e){var n=P1[t.name];if(n){var r=[n[0],n[1]];t.setCenter(r)}}}];function z1(e,t,n,r,i){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(n,r,i),this.transform=R1.identity(new Float64Array(16)),this.invTransform=R1.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}function V1(e,t){var n=Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=this.getGeoBoundingRect(),i=r.width/r.height*(e.get("aspectScale")||.75),o=e.get("boxWidth"),a=e.get("boxDepth"),s=e.get("boxHeight");null==s&&(s=5),isNaN(o)&&isNaN(a)&&(o=100),isNaN(a)?a=o/i:isNaN(o)&&(o=a/i),this.setSize(o,s,a),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(s-this.regionHeight,0))}function B1(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this&&"series.map3D"!==e.type){var t=e.getData(),r=e.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=t.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}}),this),isFinite(n[1]-n[0])){var r=Jx(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new Eb("altitude",r),this.resize(this.model,t)}}if(z1.prototype={constructor:z1,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,n){var r=pb;try{this.regions=e?r(e):[]}catch(e){throw"Invalid geoJson format\n"+e}t=t||{},n=n||{};for(var i=this.regions,o={},a=0;a<i.length;a++){var s=i[a].name;s=n[s]||s,i[a].name=s,o[s]=i[a],this.addGeoCoord(s,i[a].getCenter());var l=t[s];l&&i[a].transformTo(l.left,l.top,l.width,l.height)}this._regionsMap=o,this._geoRect=null,k1.forEach((function(e){e(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e,t=this.regions,n=0;n<t.length;n++){var r=t[n].getBoundingRect();(e=e||r.clone()).union(r)}return this._geoRect=e||new jt(0,0,0,0)},addGeoCoord:function(e,t){this._nameCoordMap[e]=t},getRegion:function(e){return this._regionsMap[e]},getRegionByCoord:function(e){for(var t=this.regions,n=0;n<t.length;n++)if(t[n].contain(e))return t[n]},setSize:function(e,t,n){this.size=[e,t,n];var r=this.getGeoBoundingRect(),i=e/r.width,o=-n/r.height,a=-e/2-r.x*i,s=n/2-r.y*o,l=this.extrudeY?[a,0,s]:[a,s,0],u=this.extrudeY?[i,1,o]:[i,o,1],c=this.transform;R1.identity(c),R1.translate(c,c,l),R1.scale(c,c,u),R1.invert(this.invTransform,c)},dataToPoint:function(e,t){t=t||[];var n=this.extrudeY?1:2,r=this.extrudeY?2:1,i=e[2];return isNaN(i)&&(i=0),t[0]=e[0],t[r]=e[1],this.altitudeAxis?t[n]=this.altitudeAxis.dataToCoord(i):t[n]=0,t[n]+=this.regionHeight,O1.transformMat4(t,t,this.transform),t},pointToData:function(e,t){}},"production"!==process.env.NODE_ENV)var F1=function(e){console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")};var G1=0,H1={dimensions:z1.prototype.dimensions,create:function(e,t){var n=[];if(!e_)throw new Error("geo3D component depends on geo component");function r(e,r){var i=H1.createGeo3D(e);e.__viewGL=e.__viewGL||new N0,i.viewGL=e.__viewGL,e.coordinateSystem=i,i.model=e,n.push(i),i.resize=V1,i.resize(e,t),i.update=B1}return e.eachComponent("geo3D",(function(e,t){r(e)})),e.eachSeriesByType("map3D",(function(e,t){var n=e.get("coordinateSystem");null==n&&(n="geo3D"),"geo3D"===n&&r(e)})),e.eachSeries((function(t){if("geo3D"===t.get("coordinateSystem")){if("series.map3D"===t.type)return;var n=t.getReferringComponents("geo3D").models[0];if(n||(n=e.getComponent("geo3D")),!n)throw new Error('geo "'+vJ(t.get("geo3DIndex"),t.get("geo3DId"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n},createGeo3D:function(e){var t,n=e.get("map");if("string"==typeof n?(t=n,n=e_(n)):n&&n.features&&(n={geoJson:n}),"production"!==process.env.NODE_ENV&&(n||F1(n),!n.geoJson.features))throw new Error("Invalid GeoJSON for map3D");return null==t&&(t="GEO_ANONYMOUS_"+G1++),new z1(t+G1++,t,n&&n.geoJson,n&&n.specialAreas,e.get("nameMap"))}};function U1(e){e.registerComponentModel(Z0),e.registerComponentView(N1),e.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"geo3D",query:e},(function(t){t.setView(e)}))})),e.registerCoordinateSystem("geo3D",H1)}function W1(e,t){e.id=e.id||e.name||t+""}i_(U1);var j1=$d.extend({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){j1.superApply(this,"init",arguments),W(this.option.layers,(function(e,t){R(e,this.defaultLayerOption),W1(e,t)}),this)},mergeOption:function(e){var t=this.option.layers;function n(e){return X(e,(function(e,t,n){return W1(t,n),e[t.id]=t,e}),{})}if(this.option.layers=null,j1.superApply(this,"mergeOption",arguments),t&&t.length){var r=n(e.layers),i=n(t);for(var o in r)i[o]?R(i[o],r[o],!0):t.push(e.layers[o]);this.option.layers=t}W(this.option.layers,(function(e){R(e,this.defaultLayerOption)}),this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},atmosphere:{show:!1,offset:5,color:"#ffffff",glowPower:6,innerGlowPower:2},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var e=this.getDisplacementTexture(),t=this.get("displacementScale");return e&&"none"!==e||(t=0),t},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});R(j1.prototype,JJ),R(j1.prototype,QJ),R(j1.prototype,eQ),R(j1.prototype,X0);var X1=Math.PI,Y1=Math.sin,Z1=Math.cos,q1=Math.tan,K1=Math.asin,$1=Math.atan2,J1=X1/180;var Q1=23.4397*J1;function e2(e,t){return $1(Y1(e)*Z1(Q1)-q1(t)*Y1(Q1),Z1(e))}function t2(e,t,n){return $1(Y1(e),Z1(e)*Y1(t)-q1(n)*Z1(t))}function n2(e,t,n){return K1(Y1(t)*Y1(n)+Z1(t)*Z1(n)*Z1(e))}function r2(e){var t,n,r=function(e){return J1*(357.5291+.98560028*e)}(e),i=function(e){return e+J1*(1.9148*Y1(e)+.02*Y1(2*e)+3e-4*Y1(3*e))+102.9372*J1+X1}(r);return{dec:(t=i,n=0,K1(Y1(n)*Z1(Q1)+Z1(n)*Y1(Q1)*Y1(t))),ra:e2(i,0)}}var i2={};i2.getPosition=function(e,t,n){var r=J1*-n,i=J1*t,o=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),a=r2(o),s=function(e,t){return J1*(280.16+360.9856235*e)-t}(o,r)-a.ra;return{azimuth:t2(s,i,a.dec),altitude:n2(s,i,a.dec)}};zJ.Shader.import(PJ),zJ.Shader.import("@export ecgl.atmosphere.vertex\nattribute vec3 position: POSITION;\nattribute vec3 normal : NORMAL;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n\n\n@export ecgl.atmosphere.fragment\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform float glowPower;\nuniform vec3 glowColor;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor = vec4(glowColor, intensity * intensity);\n}\n@end");var o2=Xg.extend({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new zJ.Node,this._sphereGeometry=new zJ.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new zJ.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new zJ.PlaneGeometry,this._earthMesh=new zJ.Mesh({renderNormal:!0}),this._atmosphereMesh=new zJ.Mesh,this._atmosphereGeometry=new zJ.SphereGeometry({widthSegments:80,heightSegments:40}),this._atmosphereMaterial=new zJ.Material({shader:new zJ.Shader(zJ.Shader.source("ecgl.atmosphere.vertex"),zJ.Shader.source("ecgl.atmosphere.fragment")),transparent:!0}),this._atmosphereMesh.geometry=this._atmosphereGeometry,this._atmosphereMesh.material=this._atmosphereMaterial,this._atmosphereMesh.frontFace=zJ.Mesh.CW,this._lightRoot=new zJ.Node,this._sceneHelper=new pQ,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._atmosphereMesh),this.groupGL.add(this._earthMesh),this._control=new oQ({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,n){var r=e.coordinateSystem,i=e.get("shading");r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL),this._sceneHelper.setScene(r.viewGL.scene),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var a="ecgl."+i;o.material&&o.material.shader.name===a||(o.material=zJ.createMaterial(a)),zJ.setMaterialFromModel(i,o.material,e,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=o.material.get(e);t&&(t.flipY=!1)})),o.material.set("color",zJ.parseColor(e.get("baseColor")));var s=.99*r.radius;if(o.scale.set(s,s,s),e.get("atmosphere.show")){o.material.define("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!1,this._atmosphereMaterial.setUniforms({glowPower:e.get("atmosphere.glowPower")||6,glowColor:e.get("atmosphere.color")||"#ffffff"}),o.material.setUniforms({glowPower:e.get("atmosphere.innerGlowPower")||2,glowColor:e.get("atmosphere.color")||"#ffffff"});var l=e.get("atmosphere.offset")||5;this._atmosphereMesh.scale.set(s+l,s+l,s+l)}else o.material.undefine("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!0;var u=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var c=o.material.setTextureImage("bumpMap",e.get("heightTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,n),this._displaceVertices(e,n),this._updateViewControl(e,n),this._updateLayers(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},_updateLayers:function(e,t){var n=e.coordinateSystem,r=e.get("layers"),i=n.radius,o=[],a=[],s=[],l=[];W(r,(function(e){var r=new Fh(e),u=r.get("type"),c=zJ.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8});if(c.surface&&c.surface.attachToMesh(this._earthMesh),"blend"===u){var h=r.get("blendTo"),d=vJ(r.get("intensity"),1);"emission"===h?(s.push(c),l.push(d)):(o.push(c),a.push(d))}else{var p=r.get("id"),f=this._layerMeshes[p];f||(f=this._layerMeshes[p]=new zJ.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===r.get("shading")?(f.material=f.__lambertMaterial||new zJ.Material({autoUpdateTextureStatus:!1,shader:zJ.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),f.__lambertMaterial=f.material):(f.material=f.__colorMaterial||new zJ.Material({autoUpdateTextureStatus:!1,shader:zJ.createShader("ecgl.color"),transparent:!0,depthMask:!1}),f.__colorMaterial=f.material),f.material.enableTexture("diffuseMap");var g=r.get("distance"),m=i+(null==g?n.radius/100:g);f.scale.set(m,m,m),i=m;var v=this._blankTexture||(this._blankTexture=zJ.createBlankTexture("rgba(255, 255, 255, 0)"));f.material.set("diffuseMap",v),zJ.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(f),f.material.set("diffuseMap",e),t.getZr().refresh()})),r.get("show")?this.groupGL.add(f):this.groupGL.remove(f)}}),this);var u=this._earthMesh.material;u.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),u.define("fragment","LAYER_EMISSIVEMAP_COUNT",s.length),u.set("layerDiffuseMap",o),u.set("layerDiffuseIntensity",a),u.set("layerEmissiveMap",s),u.set("layerEmissionIntensity",l);var c=e.getModel("debug.wireframe");if(c.get("show")){u.define("both","WIREFRAME_TRIANGLE");var h=zJ.parseColor(c.get("lineStyle.color")||"rgba(0,0,0,0.5)"),d=vJ(c.get("lineStyle.width"),1);u.set("wireframeLineWidth",d),u.set("wireframeLineColor",h)}else u.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var n=e.coordinateSystem,r=e.getModel("viewControl");n.viewGL.camera;var i=this;var o=this._control;o.setViewGL(n.viewGL);var a,s,l=r.get("targetCoord");null!=l&&(s=l[0]+90,a=l[1]),o.setFromViewControlModel(r,{baseDistance:n.radius,alpha:a,beta:s}),o.off("update"),o.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-n.radius,center:o.getCenter(),from:i.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var n=e.get("displacementQuality"),r=e.get("debug.wireframe.show"),i=e.coordinateSystem;if(e.isDisplacementChanged()||n!==this._displacementQuality||r!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=r;var o=this._sphereGeometry,a={low:100,medium:200,high:400,ultra:800}[n]||200,s=a/2;(o.widthSegments!==a||r)&&(o.widthSegments=a,o.heightSegments=s,o.build()),this._doDisplaceVertices(o,i),r&&o.generateBarycentric()}},_doDisplaceVertices:function(e,t){var n=e.attributes.position.value,r=e.attributes.texcoord0.value,i=e.__originalPosition;i&&i.length===n.length||((i=new Float32Array(n.length)).set(n),e.__originalPosition=i);for(var o=t.displacementWidth,a=t.displacementHeight,s=t.displacementData,l=0;l<e.vertexCount;l++){var u=3*l,c=2*l,h=i[u+1],d=i[u+2],p=i[u+3],f=r[c++],g=r[c++],m=Math.round(f*(o-1)),v=Math.round(g*(a-1)),y=s?s[v*o+m]:0;n[u+1]=h+h*y,n[u+2]=d+d*y,n[u+3]=p+p*y}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e,t){var n=this._earthMesh;this._sceneHelper.updateLight(e);var r=this._sceneHelper.mainLight,i=e.get("light.main.time")||new Date,o=i2.getPosition(fo(i),0,0),a=Math.cos(o.altitude);r.position.y=-a*Math.cos(o.azimuth),r.position.x=Math.sin(o.altitude),r.position.z=a*Math.sin(o.azimuth),r.lookAt(n.getWorldPosition())},dispose:function(e,t){this.groupGL.removeAll(),this._control.dispose()}}),a2=sQ.vec3;function s2(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}function l2(e,t){var n=Wd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio()),this.radius=e.get("globeRadius");var r=e.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function u2(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),r=e.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=t.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}}),this),isFinite(n[1]-n[0])){var r=Jx(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new Eb("altitude",r),this.resize(this.model,t)}}s2.prototype={constructor:s2,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},_getDisplacementScale:function(e,t){var n=(e+180)/360*(this.displacementWidth-1),r=(90-t)/180*(this.displacementHeight-1),i=Math.round(n)+Math.round(r)*this.displacementWidth;return this.displacementData[i]},dataToPoint:function(e,t){var n=e[0],r=e[1],i=e[2]||0,o=this.radius;this.displacementData&&(o*=1+this._getDisplacementScale(n,r)),this.altitudeAxis&&(o+=this.altitudeAxis.dataToCoord(i)),n=n*Math.PI/180,r=r*Math.PI/180;var a=Math.cos(r)*o;return(t=t||[])[0]=-a*Math.cos(n+Math.PI),t[1]=Math.sin(r)*o,t[2]=a*Math.sin(n+Math.PI),t},pointToData:function(e,t){var n=e[0],r=e[1],i=e[2],o=a2.len(e);n/=o,r/=o,i/=o;var a=Math.asin(r),s=Math.atan2(i,-n);s<0&&(s=2*Math.PI+s);var l=180*a/Math.PI,u=180*s/Math.PI-180;return(t=t||[])[0]=u,t[1]=l,t[2]=o-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}};var c2={dimensions:s2.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("globe",(function(e){e.__viewGL=e.__viewGL||new N0;var r=new s2;r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,n.push(r),r.resize=l2,r.resize(e,t),r.update=u2})),e.eachSeries((function(t){if("globe"===t.get("coordinateSystem")){var n=t.getReferringComponents("globe").models[0];if(n||(n=e.getComponent("globe")),!n)throw new Error('globe "'+vJ(t.get("globe3DIndex"),t.get("globe3DId"),0)+'" not found');var r=n.coordinateSystem;t.coordinateSystem=r}})),e.eachComponent("globe",(function(e,n){var r=e.coordinateSystem,i=e.getDisplacementTexture(),o=e.getDisplacemenScale();if(e.isDisplacementChanged()){if(e.hasDisplacement()){var a=!0;zJ.loadTexture(i,t,(function(n){var r=function(e,t){var n=document.createElement("canvas"),r=n.getContext("2d"),i=e.width,o=e.height;n.width=i,n.height=o,r.drawImage(e,0,0,i,o);for(var a=r.getImageData(0,0,i,o).data,s=new Float32Array(a.length/4),l=0;l<a.length/4;l++){var u=a[4*l];s[l]=u/255*t}return{data:s,width:i,height:o}}(n.image,o);e.setDisplacementData(r.data,r.width,r.height),a||t.dispatchAction({type:"globeUpdateDisplacment"})})),a=!1}else r.setDisplacementData(null,0,0);r.setDisplacementData(e.displacementData,e.displacementWidth,e.displacementHeight)}})),n}};i_((function(e){e.registerComponentModel(j1),e.registerComponentView(o2),e.registerCoordinateSystem("globe",c2),e.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"globe",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(e,t){}))}));var h2=["zoom","center","pitch","bearing"],d2=$d.extend({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var e=this;return h2.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMapboxCameraOption:function(e){null!=e&&h2.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=e}});function p2(e,t){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}R(d2.prototype,QJ),R(d2.prototype,eQ),p2.prototype.setUnpainted=function(){},p2.prototype.resize=function(){this._mapbox.resize()},p2.prototype.getMapbox=function(){return this._mapbox},p2.prototype.clear=function(){},p2.prototype.refresh=function(){this._mapbox.resize()};var f2=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];p2.prototype._initEvents=function(){var e=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},f2.forEach((function(t){this._handlers[t]=function(t){var n={};for(var r in t)n[r]=t[r];n.bubbles=!1;var i=new t.constructor(t.type,n);e.dispatchEvent(i)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},p2.prototype.dispose=function(){f2.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this)};var g2="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end";zJ.Shader.import(g2);var m2=Xg.extend({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var n=t.getZr();this._zrLayer=new p2("mapbox3D",n),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new zJ.Node,this._sceneHelper=new pQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMapbox(),i=this._dispatchInteractAction.bind(this,t,r);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(e){r.on(e,i)})),this._groundMesh=new zJ.Mesh({geometry:new zJ.PlaneGeometry,material:new zJ.Material({shader:new zJ.Shader({vertex:zJ.Shader.source("ecgl.displayShadow.vertex"),fragment:zJ.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(e,t,n){var r=this._zrLayer.getMapbox(),i=e.get("style"),o=JSON.stringify(i);o!==this._oldStyleStr&&i&&r.setStyle(i),this._oldStyleStr=o,r.setCenter(e.get("center")),r.setZoom(e.get("zoom")),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMapbox(r);var a=e.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(e),a.viewGL.setPostEffect(e.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._mapbox3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){e.dispatchAction({type:"mapbox3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var e=this._mapbox3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new zJ.Plane(new zJ.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new zJ.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new zJ.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}}),v2=sQ.mat4,y2=512,_2=.6435011087932844,x2=Math.PI,b2=.1;function w2(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom,this.maxPitch=60,this.zoomOffset=0}function S2(){w2.apply(this,arguments)}function T2(e,t,n){function r(e,t){var n=t.getWidth(),r=t.getHeight(),i=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,r,i),this.width=n,this.height=r,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function i(e,t){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),r=e.coordDimToDataDim("alt")[0];if(r){var i=t.getDataExtent(r,!0);n[0]=Math.min(n[0],i[0]),n[1]=Math.max(n[1],i[1])}}}),this),isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}return{dimensions:t.prototype.dimensions,create:function(o,a){var s=[];return o.eachComponent(e,(function(e){var n=e.__viewGL;n||(n=e.__viewGL=new N0).setRootNode(new zJ.Node);var o=new t;o.viewGL=e.__viewGL,o.resize=r,o.resize(e,a),s.push(o),e.coordinateSystem=o,o.model=e,o.update=i})),o.eachSeries((function(t){if(t.get("coordinateSystem")===e){var n=t.getReferringComponents(e).models[0];if(n||(n=o.getComponent(e)),!n)throw new Error(e+' "'+vJ(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n&&n(s,o,a),s}}}w2.prototype={constructor:w2,dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(e){this.bearing=e.bearing,this.pitch=e.pitch,this.center=e.center,this.zoom=e.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,y2)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var e=.5/Math.tan(_2/2)*this.height*b2,t=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,n=_2/2,r=Math.PI/2+t,i=Math.sin(n)*e/Math.sin(Math.PI-r-n),o=1.1*(Math.cos(Math.PI/2-t)*i+e);this.pitch>50&&(o=1e3);var a=[];v2.perspective(a,_2,this.width/this.height,1,o),this.viewGL.camera.projectionMatrix.setArray(a),this.viewGL.camera.decomposeProjectionMatrix();a=v2.identity([]);var s=this.dataToPoint(this.center);v2.scale(a,a,[1,-1,1]),v2.translate(a,a,[0,0,-e]),v2.rotateX(a,a,t),v2.rotateZ(a,a,-this.bearing/180*Math.PI),v2.translate(a,a,[-s[0]*this.getScale()*b2,-s[1]*this.getScale()*b2,0]),this.viewGL.camera.viewMatrix.array=a;var l=[];v2.invert(l,a),this.viewGL.camera.worldTransform.array=l,this.viewGL.camera.decomposeWorldTransform();var u,c=y2*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var h=this.altitudeExtent[1]-this.altitudeExtent[0];u=this.boxHeight/h*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else u=c/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*b2;this.viewGL.rootNode.scale.set(this.getScale()*b2,this.getScale()*b2,u)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*y2,t)},projectOnTileWithScale:function(e,t,n){var r=e[0],i=e[1]*x2/180,o=t*(r*x2/180+x2)/(2*x2),a=t*(x2-Math.log(Math.tan(x2/4+.5*i)))/(2*x2);return(n=n||[])[0]=o,n[1]=a,n},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*y2,t)},unprojectOnTileWithScale:function(e,t,n){var r=e[0],i=e[1],o=r/t*(2*x2)-x2,a=2*(Math.atan(Math.exp(x2-i/t*(2*x2)))-x2/4);return(n=n||[])[0]=180*o/x2,n[1]=180*a/x2,n},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,y2,t))[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}},S2.prototype=new w2,S2.prototype.constructor=S2,S2.prototype.type="mapbox3D";var M2=T2("mapbox3D",S2,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMapboxCameraOption())}))}));i_((function(e){e.registerComponentModel(d2),e.registerComponentView(m2),e.registerCoordinateSystem("mapbox3D",M2),e.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))}));var C2=["zoom","center","pitch","bearing"],D2=$d.extend({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return C2.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMaptalksCameraOption:function(e){null!=e&&C2.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});function A2(e,t,n,r){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:n,zoom:r,doubleClickZoom:!1,fog:!1}),this._initEvents()}R(D2.prototype,QJ),R(D2.prototype,eQ),A2.prototype.setUnpainted=function(){},A2.prototype.resize=function(){this._maptalks.checkSize()},A2.prototype.getMaptalks=function(){return this._maptalks},A2.prototype.clear=function(){},A2.prototype.refresh=function(){this._maptalks.checkSize()};var I2=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];A2.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},I2.forEach((function(t){this._handlers[t]=function(n){var r={};for(var i in n)r[i]=n[i];r.bubbles=!1;var o=new n.constructor(n.type,r);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(o):e.firstElementChild.dispatchEvent(o)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},A2.prototype.dispose=function(){I2.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()},zJ.Shader.import(g2);var E2=Xg.extend({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new zJ.Mesh({geometry:new zJ.PlaneGeometry,material:new zJ.Material({shader:new zJ.Shader({vertex:zJ.Shader.source("ecgl.displayShadow.vertex"),fragment:zJ.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var n=t.getZr();this._zrLayer=new A2("maptalks3D",n,e.get("center"),e.get("zoom")),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new zJ.Node,this._sceneHelper=new pQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMaptalks(),i=this._dispatchInteractAction.bind(this,t,r);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend","animating"].forEach((function(e){r.on(e,i)}))},render:function(e,t,n){this._zrLayer||this._initMaptalksLayer(e,n);var r=this._zrLayer.getMaptalks(),i=e.get("urlTemplate"),o=r.getBaseLayer();i!==this._oldUrlTemplate&&(o?o.setOptions({urlTemplate:i,attribution:e.get("attribution")}):(o=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:i,subdomains:["a","b","c"],attribution:e.get("attribution")}),r.setBaseLayer(o))),this._oldUrlTemplate=i,r.setCenter(e.get("center")),r.setZoom(e.get("zoom"),{animation:!1}),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMaptalks(r);var a=e.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(e),a.viewGL.setPostEffect(e.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){var r;e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:(r=t.getResolution(),19-Math.log(r/L2)/Math.LN2+1),center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new zJ.Plane(new zJ.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new zJ.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new zJ.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}});const L2=12756274*Math.PI/(256*Math.pow(2,20));function N2(){w2.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}N2.prototype=new w2,N2.prototype.constructor=N2,N2.prototype.type="maptalks3D";var P2=T2("maptalks3D",N2,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMaptalksCameraOption())}))}));i_((function(e){e.registerComponentModel(D2),e.registerComponentView(E2),e.registerCoordinateSystem("maptalks3D",P2),e.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"maptalks3D",query:e},(function(t){t.setMaptalksCameraOption(e)}))}))}));var O2=sQ.vec3,R2=$x.isDimensionStacked;function k2(e,t,n){for(var r=e.getDataExtent(t),i=e.getDataExtent(n),o=r[1]-r[0]||r[0],a=i[1]-i[0]||i[0],s=new Uint8Array(2500),l=0;l<e.count();l++){var u=e.get(t,l),c=e.get(n,l),h=Math.floor((u-r[0])/o*49),d=50*Math.floor((c-i[0])/a*49)+h;s[d]=s[d]||1}var p=0;for(l=0;l<s.length;l++)s[l]&&p++;return p/s.length}var z2=sQ.vec3,V2=$x.isDimensionStacked;function B2(e,t){var n=V2(e,t[2]);return{dimension:n?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:n}}function F2(e){e.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,n=t&&t.type;if("globe"===n)!function(e,t){var n=e.getData(),r=e.get("minHeight")||0,i=e.get("barSize"),o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==i){var a=t.radius*Math.PI,s=k2(n,o[0],o[1]);i=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else J(i)||(i=[i,i]);var l=B2(n,o);n.each(o,(function(e,o,a,s){var u=n.get(l.dimension,s),c=l.isStacked?u-a:t.altitudeAxis.scale.getExtent()[0],h=Math.max(t.altitudeAxis.dataToCoord(a),r),d=t.dataToPoint([e,o,c]),p=t.dataToPoint([e,o,u]),f=z2.sub([],p,d);z2.normalize(f,f);var g=[i[0],h,i[1]];n.setItemLayout(s,[d,f,g])})),n.setLayout("orient",Bq.UP.array)}(e,t);else if("cartesian3D"===n)!function(e,t){var n=e.getData(),r=e.get("barSize");if(null==r){var i,o,a=t.size,s=t.getAxis("x"),l=t.getAxis("y");i="category"===s.type?.7*s.getBandWidth():.6*Math.round(a[0]/Math.sqrt(n.count())),o="category"===l.type?.7*l.getBandWidth():.6*Math.round(a[1]/Math.sqrt(n.count())),r=[i,o]}else J(r)||(r=[r,r]);var u=t.getAxis("z").scale.getExtent(),c=function(e){var t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}(u),h=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),d=R2(n,h[2]),p=d?n.getCalculationInfo("stackResultDimension"):h[2];n.each(h,(function(e,i,o,a){var s=n.get(p,a),l=d?s-o:c?0:u[0],h=t.dataToPoint([e,i,l]),f=t.dataToPoint([e,i,s]),g=O2.dist(h,f),m=[0,f[1]<h[1]?-1:1,0];0===Math.abs(g)&&(g=.1);var v=[r[0],g,r[1]];n.setItemLayout(a,[h,m,v])})),n.setLayout("orient",[1,0,0])}(e,t);else if("geo3D"===n)!function(e,t){var n=e.getData(),r=e.get("barSize"),i=e.get("minHeight")||0,o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==r){var a=Math.min(t.size[0],t.size[2]),s=k2(n,o[0],o[1]);r=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else J(r)||(r=[r,r]);var l=[0,1,0],u=B2(n,o);n.each(o,(function(e,o,a,s){var c=n.get(u.dimension,s),h=u.isStacked?c-a:t.altitudeAxis.scale.getExtent()[0],d=Math.max(t.altitudeAxis.dataToCoord(a),i),p=t.dataToPoint([e,o,h]),f=[r[0],d,r[1]];n.setItemLayout(s,[p,l,f])})),n.setLayout("orient",[1,0,0])}(e,t);else if("mapbox3D"===n||"maptalks3D"===n)!function(e,t){var n=e.getData(),r=e.coordDimToDataDim("lng")[0],i=e.coordDimToDataDim("lat")[0],o=e.coordDimToDataDim("alt")[0],a=e.get("barSize"),s=e.get("minHeight")||0;if(null==a){var l=n.getDataExtent(r),u=n.getDataExtent(i),c=t.dataToPoint([l[0],u[0]]),h=t.dataToPoint([l[1],u[1]]),d=Math.min(Math.abs(c[0]-h[0]),Math.abs(c[1]-h[1]))||1,p=k2(n,r,i);a=[d/Math.sqrt(n.count()/p),d/Math.sqrt(n.count()/p)]}else J(a)||(a=[a,a]),a[0]/=t.getScale()/16,a[1]/=t.getScale()/16;var f=[0,0,1],g=[r,i,o],m=B2(n,g);n.each(g,(function(e,r,i,o){var l=n.get(m.dimension,o),u=m.isStacked?l-i:0,c=t.dataToPoint([e,r,u]),h=t.dataToPoint([e,r,l]),d=Math.max(h[2]-c[2],s),p=[a[0],d,a[1]];n.setItemLayout(o,[c,f,p])})),n.setLayout("orient",[1,0,0])}(e,t);else if("production"!==process.env.NODE_ENV)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.")}))}))}var G2={};function H2(e,t,n){var r=e.getData(),i=e.getRawValue(t),o=J(i)?function(e){var i=[],o=function(e,t){var n=[];return W(e.dimensions,(function(r){var i=e.getDimensionInfo(r),o=i.otherDims[t];null!=o&&!1!==o&&(n[o]=i.name)})),n}(r,"tooltip");function a(e,t){var o=r.getDimensionInfo(t);if(o&&!1!==o.otherDims.tooltip){var a=o.type,s="- "+(o.tooltipName||o.name)+": "+("ordinal"===a?e+"":"time"===a?n?"":kd("yyyy/MM/dd hh:mm:ss",e):Ad(e));s&&i.push(dt(s))}}return o.length?W(o,(function(e){a(r.get(e,t),e)})):W(e,a),"<br/>"+i.join("<br/>")}(i):dt(Ad(i)),a=r.getName(t),s=D1(r,t);re(s)&&s.colorStops&&(s=(s.colorStops[0]||{}).color);var l=Rd(s=s||"transparent"),u=e.name;return"\0-"===u&&(u=""),u=u?dt(u)+(n?": ":"<br/>"):"",n?l+u+o:u+l+(a?dt(a)+": "+o:o)}function U2(e,t,n){n=n||e.getSource();var r=t||Yy(e.get("coordinateSystem"))||["x","y","z"],i=N_(n,{dimensionsDefine:n.dimensionsDefine||e.get("dimensions"),encodeDefine:n.encodeDefine||e.get("encode"),coordDimensions:r.map((function(t){var n=e.getReferringComponents(t+"Axis3D").models[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&i.forEach((function(t){if(r.indexOf(t.coordDim)>=0){var n=e.getReferringComponents(t.coordDim+"Axis3D").models[0];n&&"category"===n.get("type")&&(t.ordinalMeta=n.getOrdinalMeta())}}));var o=$x.enableDataStack(e,i,{byIndex:!0,stackedCoordDimension:"z"}),a=new L_(i,e);return a.setCalculationInfo(o),a.initData(n),a}G2.getFormattedLabel=function(e,t,n,r,i){n=n||"normal";var o=e.getData(r).getItemModel(t),a=e.getDataParams(t,r);null!=i&&a.value instanceof Array&&(a.value=a.value[i]);var s,l=o.get("normal"===n?["label","formatter"]:["emphasis","label","formatter"]);return null==l&&(l=o.get(["label","formatter"])),"function"==typeof l?(a.status=n,s=l(a)):"string"==typeof l&&(s=Od(l,a)),s},G2.normalizeToArray=function(e){return e instanceof Array?e:null==e?[]:[e]};var W2=Vg.extend({type:"series.bar3D",dependencies:["globe"],visualStyleAccessPathvisu:"itemStyle",getInitialData:function(e,t){return U2(this)},getFormattedLabel:function(e,t,n,r){var i=G2.getFormattedLabel(this,e,t,n,r);return null==i&&(i=this.getData().get("z",e)),i},formatTooltip:function(e){return H2(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});R(W2.prototype,X0);var j2,X2,Y2,Z2,q2,K2,$2,J2,Q2=sQ.vec3,e3=sQ.mat3,t3=WK.extend((function(){return{attributes:{position:new WK.Attribute("position","float",3,"POSITION"),normal:new WK.Attribute("normal","float",3,"NORMAL"),color:new WK.Attribute("color","float",4,"COLOR"),prevPosition:new WK.Attribute("prevPosition","float",3),prevNormal:new WK.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,n=this.getBarVertexCount()*e,r=this.getBarTriangleCount()*e;this.vertexCount!==n&&(this.attributes.position.init(n),t?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){return(4*e+3+1)*(2*e+1)*2+4},setColor:function(e,t){for(var n=this.getBarVertexCount(),r=n*(e+1),i=n*e;i<r;i++)this.attributes.color.set(i,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=Q2.create,t=Q2.scaleAndAdd,n=e(),r=e(),i=e(),o=e(),a=e(),s=e(),l=e(),u=[],c=[],h=0;h<8;h++)u[h]=e();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],p=[0,1,2,0,2,3],f=[];for(h=0;h<d.length;h++)for(var g=d[h],m=0;m<2;m++){for(var v=[],y=0;y<3;y++)v.push(g[p[3*m+y]]);f.push(v)}return function(e,h,g,m,v,y){var _=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(e,h,g,m,this.bevelSize,this.bevelSegments,v);else{Q2.copy(i,h),Q2.normalize(i,i),Q2.cross(o,g,i),Q2.normalize(o,o),Q2.cross(r,i,o),Q2.normalize(o,o),Q2.negate(a,r),Q2.negate(s,i),Q2.negate(l,o),t(u[0],e,r,m[0]/2),t(u[0],u[0],o,m[2]/2),t(u[1],e,r,m[0]/2),t(u[1],u[1],l,m[2]/2),t(u[2],e,a,m[0]/2),t(u[2],u[2],l,m[2]/2),t(u[3],e,a,m[0]/2),t(u[3],u[3],o,m[2]/2),t(n,e,i,m[1]),t(u[4],n,r,m[0]/2),t(u[4],u[4],o,m[2]/2),t(u[5],n,r,m[0]/2),t(u[5],u[5],l,m[2]/2),t(u[6],n,a,m[0]/2),t(u[6],u[6],l,m[2]/2),t(u[7],n,a,m[0]/2),t(u[7],u[7],o,m[2]/2);var x=this.attributes;if(this.enableNormal){c[0]=r,c[1]=a,c[2]=i,c[3]=s,c[4]=o,c[5]=l;for(var b=this._vertexOffset,w=0;w<d.length;w++){for(var S=3*this._triangleOffset,T=0;T<6;T++)this.indices[S++]=b+p[T];b+=4,this._triangleOffset+=2}for(w=0;w<d.length;w++){var M=c[w];for(T=0;T<4;T++){var C=d[w][T];x.position.set(this._vertexOffset,u[C]),x.normal.set(this._vertexOffset,M),x.color.set(this._vertexOffset++,v)}}}else{for(w=0;w<f.length;w++){for(S=3*this._triangleOffset,T=0;T<3;T++)this.indices[S+T]=f[w][T]+this._vertexOffset;this._triangleOffset++}for(w=0;w<u.length;w++)x.position.set(this._vertexOffset,u[w]),x.color.set(this._vertexOffset++,v)}}var D=this._vertexOffset;for(w=_;w<D;w++)this._dataIndices[w]=y}}(),_addBevelBar:(j2=Q2.create(),X2=Q2.create(),Y2=Q2.create(),Z2=e3.create(),q2=[],K2=[1,-1,-1,1],$2=[1,1,-1,-1],J2=[2,0],function(e,t,n,r,i,o,a){Q2.copy(X2,t),Q2.normalize(X2,X2),Q2.cross(Y2,n,X2),Q2.normalize(Y2,Y2),Q2.cross(j2,X2,Y2),Q2.normalize(Y2,Y2),Z2[0]=j2[0],Z2[1]=j2[1],Z2[2]=j2[2],Z2[3]=X2[0],Z2[4]=X2[1],Z2[5]=X2[2],Z2[6]=Y2[0],Z2[7]=Y2[1],Z2[8]=Y2[2],i=Math.min(r[0],r[2])/2*i;for(var s=0;s<3;s++)q2[s]=Math.max(r[s]-2*i,0);var l=(r[0]-q2[0])/2,u=(r[1]-q2[1])/2,c=(r[2]-q2[2])/2,h=[],d=[],p=this._vertexOffset,f=[];for(s=0;s<2;s++){f[s]=f[s]=[];for(var g=0;g<=o;g++)for(var m=0;m<4;m++){(0===g&&0===s||1===s&&g===o)&&f[s].push(p);for(var v=0;v<=o;v++){var y=v/o*Math.PI/2+Math.PI/2*m,_=g/o*Math.PI/2+Math.PI/2*s;d[0]=l*Math.cos(y)*Math.sin(_),d[1]=u*Math.cos(_),d[2]=c*Math.sin(y)*Math.sin(_),h[0]=d[0]+K2[m]*q2[0]/2,h[1]=d[1]+u+J2[s]*q2[1]/2,h[2]=d[2]+$2[m]*q2[2]/2,Math.abs(l-u)<1e-6&&Math.abs(u-c)<1e-6||(d[0]/=l*l,d[1]/=u*u,d[2]/=c*c),Q2.normalize(d,d),Q2.transformMat3(h,h,Z2),Q2.transformMat3(d,d,Z2),Q2.add(h,h,e),this.attributes.position.set(p,h),this.enableNormal&&this.attributes.normal.set(p,d),this.attributes.color.set(p,a),p++}}}var x=4*o+3,b=2*o+1,w=x+1;for(m=0;m<b;m++)for(s=0;s<=x;s++){var S=m*w+s+this._vertexOffset,T=m*w+(s+1)%w+this._vertexOffset,M=(m+1)*w+(s+1)%w+this._vertexOffset,C=(m+1)*w+s+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[M,S,T]),this.setTriangleIndices(this._triangleOffset++,[M,C,S])}this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][2],f[0][1]]),this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][3],f[0][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][1],f[1][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][2],f[1][3]]),this._vertexOffset=p})});V(t3.prototype,aQ),V(t3.prototype,C1);var n3=sQ.vec3,r3=Kg.extend({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this._api=t,this._labelsBuilder=new I1(256,256,t);var n=this;this._labelsBuilder.getLabelPosition=function(e,t,r){if(n._data){var i=n._data.getItemLayout(e),o=i[0],a=i[1],s=i[2][1];return n3.scaleAndAdd([],o,a,r+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,n){var r=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=r,this._barMesh||(this._barMesh=new zJ.Mesh({geometry:new t3,shadowDepthMaterial:new zJ.Material({shader:new zJ.Shader(zJ.Shader.source("ecgl.sm.depth.vertex"),zJ.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===e.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var i=e.coordinateSystem;if(this._doRender(e,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[o]("fragment","SRGB_DECODE")}this._data=e.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(e)},_updateAnimation:function(e){zJ.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var n=e.getData(),r=e.get("shading"),i="color"!==r,o=this,a=this._barMesh,s="ecgl."+r;a.material&&a.material.shader.name===s||(a.material=zJ.createMaterial(s,["VERTEX_COLOR"])),zJ.setMaterialFromModel(r,a.material,e,t),a.geometry.enableNormal=i,a.geometry.resetOffset();var l=e.get("bevelSize"),u=e.get("bevelSmoothness");a.geometry.bevelSegments=u,a.geometry.bevelSize=l;var c=[],h=new Float32Array(4*n.count()),d=0,p=0,f=!1;n.each((function(e){if(n.hasValue(e)){var t=D1(n,e),r=A1(n,e);null==r&&(r=1),zJ.parseColor(t,c),c[3]*=r,h[d++]=c[0],h[d++]=c[1],h[d++]=c[2],h[d++]=c[3],c[3]>0&&(p++,c[3]<.99&&(f=!0))}})),a.geometry.setBarCount(p);var g=n.getLayout("orient"),m=this._barIndexOfData=new Int32Array(n.count());p=0;n.each((function(e){if(n.hasValue(e)){var t=n.getItemLayout(e),r=t[0],i=t[1],a=t[2],s=4*e;c[0]=h[s++],c[1]=h[s++],c[2]=h[s++],c[3]=h[s++],c[3]>0&&(o._barMesh.geometry.addBar(r,i,g,a,c,e),m[e]=p++)}else m[e]=-1})),a.geometry.dirty(),a.geometry.updateBoundingBox();var v=a.material;v.transparent=f,v.depthMask=!f,a.geometry.sortTriangles=f,this._initHandler(e,t)},_initHandler:function(e,t){var n=e.getData(),r=this._barMesh,i="cartesian3D"===e.coordinateSystem.type;r.seriesIndex=e.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var a=r.geometry.getDataIndexOfVertex(e.triangle[0]);a!==o&&(this._downplay(o),this._highlight(a),this._labelsBuilder.updateLabels([a]),i&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",a),n.get("y",a),n.get("z",a,!0)]})),o=a,r.dataIndex=a}),this),r.on("mouseout",(function(e){this._downplay(o),this._labelsBuilder.updateLabels(),o=-1,r.dataIndex=-1,i&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=t.getItemModel(e).getModel("emphasis.itemStyle"),i=r.get("color"),o=r.get("opacity");if(null==i)i=ir(D1(t,e),-.4);null==o&&(o=A1(t,e));var a=zJ.parseColor(i);a[3]*=o,this._barMesh.geometry.setColor(n,a),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=D1(t,e),i=A1(t,e),o=zJ.parseColor(r);o[3]*=i,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,i){var o=t.getData(),a=yJ(o,i),s=this;null!=a?W(G2.normalizeToArray(a),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):o.each((function(t){"highlight"===e?s._highlight(t):s._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this._labelsBuilder.dispose(),this.groupGL.removeAll()}});i_((function(e){e.registerChartView(r3),e.registerSeriesModel(W2),F2(e),e.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))}));var i3=Vg.extend({type:"series.line3D",dependencies:["grid3D"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){return U2(this)},formatTooltip:function(e){return H2(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}}),o3=sQ.vec3;zJ.Shader.import(CQ);var a3=Kg.extend({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this._api=t},render:function(e,t,n){var r=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=r,this._line3DMesh||(this._line3DMesh=new zJ.Mesh({geometry:new cQ({useNativeLine:!1,sortTriangles:!0}),material:new zJ.Material({shader:zJ.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var i=e.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(e,n),this._data=e.getData(),this._camera=i.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var n=e.getData(),r=this._line3DMesh;r.geometry.resetOffset();var i=n.getLayout("points"),o=[],a=new Float32Array(i.length/3*4),s=0,l=!1;n.each((function(e){var t=D1(n,e),r=A1(n,e);null==r&&(r=1),zJ.parseColor(t,o),o[3]*=r,a[s++]=o[0],a[s++]=o[1],a[s++]=o[2],a[s++]=o[3],o[3]<.99&&(l=!0)})),r.geometry.setVertexCount(r.geometry.getPolylineVertexCount(i)),r.geometry.setTriangleCount(r.geometry.getPolylineTriangleCount(i)),r.geometry.addPolyline(i,a,vJ(e.get("lineStyle.width"),1)),r.geometry.dirty(),r.geometry.updateBoundingBox();var u=r.material;u.transparent=l,u.depthMask=!l;var c=e.getModel("debug.wireframe");c.get("show")?(r.geometry.createAttribute("barycentric","float",3),r.geometry.generateBarycentric(),r.material.set("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",zJ.parseColor(c.get("lineStyle.color")||"rgba(0,0,0,0.5)")),r.material.set("wireframeLineWidth",vJ(c.get("lineStyle.width"),1))):r.material.set("both","WIREFRAME_TRIANGLE"),this._points=i,this._initHandler(e,t)},_updateAnimation:function(e){zJ.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var n=e.getData(),r=e.coordinateSystem,i=this._line3DMesh,o=-1;i.seriesIndex=e.seriesIndex,i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(e){var a=r.pointToData(e.point.array),s=n.indicesOfNearest("x",a[0])[0];s!==o&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",s),n.get("y",s),n.get("z",s)]}),i.dataIndex=s),o=s}),this),i.on("mouseout",(function(e){o=-1,i.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new iK,t=this._camera;iK.multiply(e,t.projectionMatrix,t.viewMatrix);var n=this._positionNDC,r=this._points,i=r.length/3;n&&n.length/2===i||(n=this._positionNDC=new Float32Array(2*i));for(var o=[],a=0;a<i;a++){var s=3*a,l=2*a;o[0]=r[s],o[1]=r[s+1],o[2]=r[s+2],o[3]=1,o3.transformMat4(o,o,e.array),n[l]=o[0]/o[3],n[l+1]=o[1]/o[3]}},_pick:function(e,t,n,r,i,o){var a=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,u=.5*n.viewport.width,c=.5*n.viewport.height;e=(e+1)*u,t=(t+1)*c;for(var h=1;h<a.length/2;h++){var d=(a[2*(h-1)]+1)*u,p=(a[2*(h-1)+1]+1)*c,f=(a[2*h]+1)*u,g=(a[2*h+1]+1)*c;if(Ts(d,p,f,g,s,e,t))l=(d-e)*(d-e)+(p-t)*(p-t)<(f-e)*(f-e)+(g-t)*(g-t)?h-1:h}if(l>=0){var m=3*l,v=new Bq(this._points[m],this._points[m+1],this._points[m+2]);o.push({dataIndex:l,point:v,pointWorld:v.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(v)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});i_((function(e){e.registerChartView(a3),e.registerSeriesModel(i3),e.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),n=e.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void("production"!==process.env.NODE_ENV&&console.error("line3D needs cartesian3D coordinateSystem"));var r=new Float32Array(3*t.count()),i=[],o=[],a=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n&&t.each(a,(function(e,t,a,s){i[0]=e,i[1]=t,i[2]=a,n.dataToPoint(i,o),r[3*s]=o[0],r[3*s+1]=o[1],r[3*s+2]=o[2]})),t.setLayout("points",r)}}))}))}));var s3=Vg.extend({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(e,t){return U2(this)},getFormattedLabel:function(e,t,n,r){var i=G2.getFormattedLabel(this,e,t,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,e)}return i},formatTooltip:function(e){return H2(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}});function l3(e,t,n){(t=t||document.createElement("canvas")).width=e,t.height=e;var r=t.getContext("2d");return n&&n(r),t}var u3={getMarginByStyle:function(e){var t=e.minMargin||0,n=0;e.stroke&&"none"!==e.stroke&&(n=null==e.lineWidth?1:e.lineWidth);var r=e.shadowBlur||0,i=e.shadowOffsetX||0,o=e.shadowOffsetY||0,a={};return a.left=Math.max(n/2,-i+r,t),a.right=Math.max(n/2,i+r,t),a.top=Math.max(n/2,-o+r,t),a.bottom=Math.max(n/2,o+r,t),a},createSymbolSprite:function(e,t,n,r){var i=function(e,t,n,r){J(t)||(t=[t,t]);var i=u3.getMarginByStyle(n,r),o=t[0]+i.left+i.right,a=t[1]+i.top+i.bottom,s=lv(e,0,0,t[0],t[1]),l=Math.max(o,a);s.x=i.left,s.y=i.top,o>a?s.y+=(l-a)/2:s.x+=(l-o)/2;var u=s.getBoundingRect();return s.x-=u.x,s.y-=u.y,s.setStyle(n),s.update(),s.__size=l,s}(e,t,n),o=u3.getMarginByStyle(n);return{image:l3(i.__size,r,(function(e){Ev(e,i)})),margin:o}},createSDFFromCanvas:function(e,t,n,r){return l3(t,r,(function(t){var r=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,n){var r=t.width,i=t.height,o=e.canvas.width,a=e.canvas.height,s=r/o,l=i/a;function u(e){return e<128?1:-1}function c(e,o){var a=1/0;e=Math.floor(e*s);for(var c=(o=Math.floor(o*l))*r+e,h=u(t.data[4*c]),d=Math.max(o-n,0);d<Math.min(o+n,i);d++)for(var p=Math.max(e-n,0);p<Math.min(e+n,r);p++){c=d*r+p;var f=p-e,g=d-o;if(h!==u(t.data[4*c])){var m=f*f+g*g;m<a&&(a=m)}}return h*Math.sqrt(a)}for(var h=e.createImageData(o,a),d=0;d<a;d++)for(var p=0;p<o;p++){var f=c(p,d)/n*.5+.5,g=4*(d*o+p);h.data[g++]=255*(1-f),h.data[g++]=255*(1-f),h.data[g++]=255*(1-f),h.data[g++]=255}return h}(t,r,n),0,0)}))},createSimpleSprite:function(e,t){return l3(e,t,(function(t){var n=e/2;t.beginPath(),t.arc(n,n,60,0,2*Math.PI,!1),t.closePath();var r=t.createRadialGradient(n,n,0,n,n,n);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=r,t.fill()}))}},c3=sQ.vec3,h3={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(e,t){var n=this.indices,r=c3.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var i=0;i<n.length;i++)n[i]=i}if(0===t){var o,a=this.attributes.position,s=(e=e.array,0);this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount));for(i=0;i<this.vertexCount;i++){a.get(i,r);var l=c3.sqrDist(r,e);isNaN(l)&&(l=1e7,s++),0===i?(o=l,l=0):l-=o,this._zList[i]=l}this._noneCount=s}if(this.vertexCount<2e4)0===t&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(i=0;i<3;i++)this._progressiveQuickSort(3*t+i);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,n=this.indices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):b1.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._zList,n=this.indices;this._quickSort=this._quickSort||new b1,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}},d3=sQ.vec4;zJ.Shader.import("@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end");var p3=zJ.Mesh.extend((function(){var e=new zJ.Geometry({dynamic:!0,attributes:{color:new zJ.Geometry.Attribute("color","float",4,"COLOR"),position:new zJ.Geometry.Attribute("position","float",3,"POSITION"),size:new zJ.Geometry.Attribute("size","float",1),prevPosition:new zJ.Geometry.Attribute("prevPosition","float",3),prevSize:new zJ.Geometry.Attribute("prevSize","float",1)}});Object.assign(e,h3);var t=new zJ.Material({shader:zJ.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var n=new zJ.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",n),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:zJ.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,n,r,i,o){var a=this._positionNDC;if(a)for(var s=n.viewport,l=2/s.width,u=2/s.height,c=this.geometry.vertexCount-1;c>=0;c--){var h,d=a[2*(h=this.geometry.indices?this.geometry.indices[c]:c)],p=a[2*h+1],f=this.geometry.attributes.size.get(h)/this.sizeScale/2;if(e>d-f*l&&e<d+f*l&&t>p-f*u&&t<p+f*u){var g=new zJ.Vector3,m=new zJ.Vector3;this.geometry.attributes.position.get(h,g.array),zJ.Vector3.transformMat4(m,g,this.worldTransform),o.push({vertexIndex:h,point:g,pointWorld:m,target:this,distance:m.distance(r.getWorldPosition())})}}},updateNDCPosition:function(e,t,n){var r=this._positionNDC,i=this.geometry;r&&r.length/2===i.vertexCount||(r=this._positionNDC=new Float32Array(2*i.vertexCount));for(var o=d3.create(),a=0;a<i.vertexCount;a++)i.attributes.position.get(a,o),o[3]=1,d3.transformMat4(o,o,e.array),d3.scale(o,o,1/o[3]),r[2*a]=o[0],r[2*a+1]=o[1]}});function f3(e,t){this.rootNode=new zJ.Node,this.is2D=e,this._labelsBuilder=new I1(256,256,t),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=t,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}f3.prototype={constructor:f3,highlightOnMouseover:!0,update:function(e,t,n,r,i){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var a=e.getData();if(null==r&&(r=0),null==i&&(i=a.count()),this._startDataIndex=r,this._endDataIndex=i-1,!this._mesh){var s=this._prevMesh&&this._prevMesh.material;this._mesh=new p3({renderOrder:10,frustumCulling:!1}),s&&(this._mesh.material=s)}s=this._mesh.material;var l=this._mesh.geometry,u=l.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var c=this._getSymbolInfo(e,r,i),h=n.getDevicePixelRatio(),d=e.getModel("itemStyle").getItemStyle(),p=e.get("large"),f=1;c.maxSize>2?(f=this._updateSymbolSprite(e,d,c,h),s.enableTexture("sprite")):s.disableTexture("sprite"),u.position.init(i-r);var g=[];if(p){s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR");var m=function(e){const t=e.getVisual("style");if(t)return t[e.getVisual("drawType")]}(a),v=function(e){return e.getVisual("style").opacity}(a);zJ.parseColor(m,g),g[3]*=v,s.set({color:g,u_Size:c.maxSize*this._sizeScale})}else s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),u.size.init(i-r),u.color.init(i-r),this._originalOpacity=new Float32Array(i-r);for(var y=a.getLayout("points"),_=u.position.value,x=0;x<i-r;x++){var b=3*x,w=2*x;if(this.is2D?(_[b]=y[w],_[b+1]=y[w+1],_[b+2]=-10):(_[b]=y[b],_[b+1]=y[b+1],_[b+2]=y[b+2]),!p){m=D1(a,x),v=A1(a,x);zJ.parseColor(m,g),g[3]*=v,u.color.set(x,g),g[3];var S=a.getItemVisual(x,"symbolSize");S=S instanceof Array?Math.max(S[0],S[1]):S,isNaN(S)&&(S=0),u.size.value[x]=S*f*this._sizeScale,this._originalOpacity[x]=g[3]}}this._mesh.sizeScale=f,l.updateBoundingBox(),l.dirty(),this._updateMaterial(e,d);var T=e.coordinateSystem;T&&T.viewGL&&s[T.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE");p||this._updateLabelBuilder(e,r,i),this._updateHandler(e,t,n),this._updateAnimation(e),this._api=n},getPointsMesh:function(){return this._mesh},updateLabels:function(e){this._labelsBuilder.updateLabels(e)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},dispose:function(){this._labelsBuilder.dispose()},_updateSymbolSprite:function(e,t,n,r){n.maxSize=Math.min(2*n.maxSize,200);var i,o,a=[];return n.aspect>1?(a[0]=n.maxSize,a[1]=n.maxSize/n.aspect):(a[1]=n.maxSize,a[0]=n.maxSize*n.aspect),a[0]=a[0]||1,a[1]=a[1]||1,this._symbolType===n.type&&(i=this._symbolSize,o=a,i&&o&&i[0]===o[0]&&i[1]===o[1])&&this._lineWidth===t.lineWidth||(u3.createSymbolSprite(n.type,a,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(a[0]/2,10)},this._spriteImageCanvas),u3.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=a,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/n.maxSize*r},_updateMaterial:function(e,t){var n="lighter"===e.get("blendMode")?zJ.additiveBlend:null,r=this._mesh.material;r.blend=n,r.set("lineWidth",t.lineWidth/20);var i=zJ.parseColor(t.stroke);r.set("strokeColor",i),r.transparent=!0,r.depthMask=!1,r.depthTest=!this.is2D,r.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,n){var r=e.getData(),i=this._mesh.geometry,o=i.attributes.position.value,a=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(r,t,n),this._labelsBuilder.getLabelPosition=function(e,n,r){var i=3*(e-t);return[o[i],o[i+1],o[i+2]]},this._labelsBuilder.getLabelDistance=function(e,n,r){return i.attributes.size.get(e-t)/a/2+r},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){zJ.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,n){var r,i=e.getData(),o=this._mesh,a=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(r=e.coordinateSystem.model),o.seriesIndex=e.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",(function(t){var u=t.vertexIndex+a._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(i,s),this.highlight(i,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get(e.coordDimToDataDim("x")[0],u),i.get(e.coordDimToDataDim("y")[0],u),i.get(e.coordDimToDataDim("z")[0],u)],grid3DIndex:r.componentIndex})),o.dataIndex=u,s=u}),this),o.on("mouseout",(function(e){var t=e.vertexIndex+a._startDataIndex;this.highlightOnMouseover&&(this.downplay(i,t),this._labelsBuilder.updateLabels()),s=-1,o.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:r.componentIndex})}),this)},updateLayout:function(e,t,n){var r=e.getData();if(this._mesh){var i=this._mesh.geometry.attributes.position.value,o=r.getLayout("points");if(this.is2D)for(var a=0;a<o.length/2;a++){var s=3*a,l=2*a;i[s]=o[l],i[s+1]=o[l+1],i[s+2]=-10}else for(a=0;a<o.length;a++)i[a]=o[a];this._mesh.geometry.dirty(),n.getZr().refresh()}},updateView:function(e){if(this._mesh){var t=new iK;iK.mul(t,e.viewMatrix,this._mesh.worldTransform),iK.mul(t,e.projectionMatrix,t),this._mesh.updateNDCPosition(t,this.is2D,this._api)}},highlight:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=e.getItemModel(t).getModel("emphasis.itemStyle"),r=n.get("color"),i=n.get("opacity");if(null==r)r=ir(D1(e,t),-.4);null==i&&(i=A1(e,t));var o=zJ.parseColor(r);o[3]*=i,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,o),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=D1(e,t),r=A1(e,t),i=zJ.parseColor(n);i[3]*=r,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,i),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,n=0;n<t.vertexCount;n++){var r=this._originalOpacity[n]*e;t.attributes.color.value[4*n+3]=r}t.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(e){this._mesh&&this._setPositionTextureToMesh(this._mesh,e),this._positionTexture=e},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(e){if(e!==this._sizeScale){if(this._mesh){var t=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",t/this._sizeScale*e);var n=this._mesh.geometry.attributes;if(n.size.value)for(var r=0;r<n.size.value.length;r++)n.size.value[r]=n.size.value[r]/this._sizeScale*e}this._sizeScale=e}},_setPositionTextureToMesh:function(e,t){t&&e.material.set("positionTexture",t),e.material[t?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(e,t,n){if(e.get("large"))return(h=vJ(e.get("symbolSize"),1))instanceof Array?(l=Math.max(h[0],h[1]),r=h[0]/h[1]):(l=h,r=1),{maxSize:h,type:e.get("symbol"),aspect:r};for(var r,i=e.getData(),o=!1,a=i.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=t;u<n;u++){var c,h=i.getItemVisual(u,"symbolSize"),d=i.getItemVisual(u,"symbol");if(h instanceof Array)c=h[0]/h[1],l=Math.max(Math.max(h[0],h[1]),l);else{if(isNaN(h))continue;c=1,l=Math.max(h,l)}"production"!==process.env.NODE_ENV&&(null!=r&&Math.abs(c-r)>.05&&(o=!0),d!==a&&(s=!0)),a=d,r=c}return"production"!==process.env.NODE_ENV&&(o&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored.")),{maxSize:l,type:a,aspect:r}}};var g3=Kg.extend({type:"scatter3D",hasSymbolVisual:!0,__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,n){if(this.groupGL.removeAll(),e.getData().count()){var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;var i=this._pointsBuilderList[0];i||(i=this._pointsBuilderList[0]=new f3(!1,n)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),i.update(e,t,n),i.updateView(r.viewGL.camera)}else if("production"!==process.env.NODE_ENV)throw new Error("Invalid coordinate system")}},incrementalPrepareRender:function(e,t,n){var r=e.coordinateSystem;if(r&&r.viewGL)r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;else if("production"!==process.env.NODE_ENV)throw new Error("Invalid coordinate system");this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,n,r){if(!(e.end<=e.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new f3(!1,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),i.update(t,n,r,e.start,e.end),i.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(e){e.updateView(this._camera)}),this)},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,i){var o=t.getData(),a=yJ(o,i),s="highlight"===e;null!=a?W(G2.normalizeToArray(a),(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];s?n.highlight(o,e):n.downplay(o,e)}}),this):o.each((function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];s?n.highlight(o,e):n.downplay(o,e)}}))},dispose:function(){this._pointsBuilderList.forEach((function(e){e.dispose()})),this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});i_((function(e){e.registerChartView(g3),e.registerSeriesModel(s3),e.registerLayout({seriesType:"scatter3D",reset:function(e){var t=e.coordinateSystem;if(t){var n=t.dimensions;if(n.length<3)return void("production"!==process.env.NODE_ENV&&console.error("scatter3D needs 3D coordinateSystem"));var r=n.map((function(t){return e.coordDimToDataDim(t)[0]})),i=[],o=[];return{progress:function(e,n){for(var a=new Float32Array(3*(e.end-e.start)),s=e.start;s<e.end;s++){var l=3*(s-e.start);i[0]=n.get(r[0],s),i[1]=n.get(r[1],s),i[2]=n.get(r[2],s),t.dataToPoint(i,o),a[l]=o[0],a[l+1]=o[1],a[l+2]=o[2]}n.setLayout("points",a)}}}}})}));var m3=sQ.vec3,v3=sQ.vec2,y3=m3.normalize,_3=m3.cross,x3=m3.sub,b3=m3.add,w3=m3.create,S3=w3(),T3=w3(),M3=w3(),C3=w3(),D3=[],A3=[];function I3(e,t){v3.copy(D3,e[0]),v3.copy(A3,e[1]);var n=[],r=n[0]=w3(),i=n[1]=w3(),o=n[2]=w3(),a=n[3]=w3();t.dataToPoint(D3,r),t.dataToPoint(A3,a),y3(S3,r),x3(T3,a,r),y3(T3,T3),_3(M3,T3,S3),y3(M3,M3),_3(T3,S3,M3),b3(i,S3,T3),y3(i,i),y3(S3,a),x3(T3,r,a),y3(T3,T3),_3(M3,T3,S3),y3(M3,M3),_3(T3,S3,M3),b3(o,S3,T3),y3(o,o),b3(C3,r,a),y3(C3,C3);var s=m3.dot(r,C3),l=m3.dot(C3,i),u=(Math.max(m3.len(r),m3.len(a))-s)/l*2;return m3.scaleAndAdd(i,r,i,u),m3.scaleAndAdd(o,a,o,u),n}function E3(e,t){for(var n=new Float32Array(3*e.length),r=0,i=[],o=0;o<e.length;o++)t.dataToPoint(e[o],i),n[r++]=i[0],n[r++]=i[1],n[r++]=i[2];return n}function L3(e){var t=[];return e.each((function(n){var r=e.getItemModel(n),i=r.option instanceof Array?r.option:r.getShallow("coords",!0);if("production"!==process.env.NODE_ENV&&!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");t.push(i)})),{coordsList:t}}function N3(e,t,n){var r=e.getData(),i=e.get("polyline"),o=L3(r);r.setLayout("lineType",i?"polyline":"cubicBezier"),r.each((function(e){var a=o.coordsList[e],s=i?E3(a,t):function(e,t,n){var r=[],i=r[0]=m3.create(),o=r[1]=m3.create(),a=r[2]=m3.create(),s=r[3]=m3.create();t.dataToPoint(e[0],i),t.dataToPoint(e[1],s);var l=m3.dist(i,s);return m3.lerp(o,i,s,.3),m3.lerp(a,i,s,.3),m3.scaleAndAdd(o,o,n,Math.min(.1*l,10)),m3.scaleAndAdd(a,a,n,Math.min(.1*l,10)),r}(a,t,n);r.setItemLayout(e,s)}))}function P3(e,t){e.eachSeriesByType("lines3D",(function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,t){var n=e.getData(),r=e.get("polyline");n.setLayout("lineType",r?"polyline":"cubicBezier");var i=L3(n);n.each((function(e){var o=i.coordsList[e],a=r?E3:I3;n.setItemLayout(e,a(o,t))}))}(e,t):"geo3D"===t.type?N3(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||N3(e,t,[0,0,1])}))}var O3=Vg.extend({type:"series.lines3D",dependencies:["globe"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){var n=new L_(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}}),R3=sQ.vec3;zJ.Shader.import("@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end");var k3=zJ.Mesh.extend((function(){var e=new zJ.Material({shader:new zJ.Shader(zJ.Shader.source("ecgl.trail2.vertex"),zJ.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new cQ({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}}),{updateData:function(e,t,n){var r=e.hostModel,i=this.geometry,o=r.getModel("effect"),a=o.get("trailWidth")*t.getDevicePixelRatio(),s=o.get("trailLength"),l=r.get("effect.constantSpeed"),u=1e3*r.get("effect.period"),c=null!=l;"production"!==process.env.NODE_ENV&&(this.getScene()||console.error("TrailMesh must been add to scene before updateData")),c?this.material.set("speed",l/1e3):this.material.set("period",u),this.material[c?"define":"undefine"]("vertex","CONSTANT_SPEED");var h=r.get("polyline");i.trailLength=s,this.material.set("trailLength",s),i.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){i.attributes[e].value=n.attributes[e].value}));["dist","distAll","start","offset","color"].forEach((function(e){i.attributes[e].init(i.vertexCount)})),i.indices=n.indices;var d=[],p=o.get("trailColor"),f=o.get("trailOpacity"),g=null!=p,m=null!=f;this.updateWorldTransform();var v=this.worldTransform.x.len(),y=this.worldTransform.y.len(),_=this.worldTransform.z.len(),x=0,b=0;e.each((function(t){var r=e.getItemLayout(t),o=m?f:A1(e,t),s=D1(e,t);null==o&&(o=1),(d=zJ.parseColor(g?p:s,d))[3]*=o;for(var l=h?n.getPolylineVertexCount(r):n.getCubicCurveVertexCount(r[0],r[1],r[2],r[3]),w=0,S=[],T=[],M=x;M<x+l;M++)i.attributes.position.get(M,S),S[0]*=v,S[1]*=y,S[2]*=_,M>x&&(w+=R3.dist(S,T)),i.attributes.dist.set(M,w),R3.copy(T,S);b=Math.max(b,w);var C=Math.random()*(c?w:u);for(M=x;M<x+l;M++)i.attributes.distAll.set(M,w),i.attributes.start.set(M,C),i.attributes.offset.set(M,(n.attributes.offset.get(M)>0?1:-1)*a/2),i.attributes.color.set(M,d);x+=l})),this.material.set("spotSize",.1*b*s),this.material.set("spotIntensity",o.get("spotIntensity")),i.dirty()},setAnimationTime:function(e){this.material.set("time",e)}});zJ.Shader.import(CQ);var z3=Kg.extend({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this._meshLinesMaterial=new zJ.Material({shader:zJ.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new zJ.Mesh({geometry:new cQ,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new k3},render:function(e,t,n){this.groupGL.add(this._linesMesh);var r=e.coordinateSystem,i=e.getData();if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._updateLines(e,t,n);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var a=this._trailMesh;if(a.stopAnimation(),e.get("effect.show")){this.groupGL.add(a),a.updateData(i,n,this._linesMesh.geometry),a.__time=a.__time||0;var s=36e5;this._curveEffectsAnimator=a.animate("",{loop:!0}).when(s,{__time:s}).during((function(){a.setAnimationTime(a.__time)})).start()}else this.groupGL.remove(a),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?zJ.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var e=this._curveEffectsAnimator;e&&(e.isPaused()?e.resume():e.pause())},_updateLines:function(e,t,n){var r=e.getData(),i=e.coordinateSystem,o=this._linesMesh.geometry,a=e.get("polyline");o.expandLine=!0;var s=function(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}(i);o.segmentScale=s/20;var l="lineStyle.width".split("."),u=n.getDevicePixelRatio();r.each((function(e){var t=r.getItemModel(e).get(l);null==t&&(t=1),r.setItemVisual(e,"lineWidth",t)})),o.useNativeLine=!1;var c=0,h=0;r.each((function(e){var t=r.getItemLayout(e);a?(c+=o.getPolylineVertexCount(t),h+=o.getPolylineTriangleCount(t)):(c+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),h+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),o.setVertexCount(c),o.setTriangleCount(h),o.resetOffset();var d=[];r.each((function(e){var t=r.getItemLayout(e),n=D1(r,e),i=A1(r,e),s=r.getItemVisual(e,"lineWidth")*u;null==i&&(i=1),(d=zJ.parseColor(n,d))[3]*=i,a?o.addPolyline(t,d,s):o.addCubicCurve(t[0],t[1],t[2],t[3],d,s)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});function V3(e,t){for(var n=[],r=0;r<t.length;r++)n.push(e.dataToPoint(t[r]));return n}i_((function(e){e.registerChartView(z3),e.registerSeriesModel(O3),e.registerLayout(P3),e.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),e.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),e.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))}));var B3=Vg.extend({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getItemModel(e),r=n.option instanceof Array?n.option:n.getShallow("coords");n.get("multiPolygon")||(r=[r]);for(var i=[],o=0;o<r.length;o++){for(var a=[],s=1;s<r[o].length;s++)a.push(V3(t,r[o][s]));i.push({exterior:V3(t,r[o][0]),interiors:a})}return i},getInitialData:function(e){var t=new L_(["value"],this);return t.hasItemOption=!1,t.initData(e.data,[],(function(e,n,r,i){if(e instanceof Array)return NaN;t.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),t},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});R(B3.prototype,X0);var F3=Kg.extend({type:"polygons3D",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll();var r=e.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL);var i=this._geo3DBuilderList[0];i||((i=new L1(n)).extrudeY="mapbox3D"!==r.type&&"maptalks3D"!==r.type,this._geo3DBuilderList[0]=i),this._updateShaderDefines(r,i),i.update(e,t,n),this._geo3DBuilderList.length=1,this.groupGL.add(i.rootNode)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll();var r=e.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,n,r){var i=this._geo3DBuilderList[this._currentStep],o=t.coordinateSystem;i||((i=new L1(r)).extrudeY="mapbox3D"!==o.type&&"maptalks3D"!==o.type,this._geo3DBuilderList[this._currentStep]=i),i.update(t,n,r,e.start,e.end),this.groupGL.add(i.rootNode),this._updateShaderDefines(o,i),this._currentStep++},_updateShaderDefines:function(e,t){var n=e.viewGL.isLinearSpace()?"define":"undefine";t.rootNode.traverse((function(t){t.material&&(t.material[n]("fragment","SRGB_DECODE"),"mapbox3D"!==e.type&&"maptalks3D"!==e.type||(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1)))}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll(),this._geo3DBuilderList.forEach((function(e){e.dispose()}))}});i_((function(e){e.registerChartView(F3),e.registerSeriesModel(B3)}));var G3=Vg.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(e){return H2(this,e)},getInitialData:function(e,t){var n=e.data;function r(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function i(e){var t=oo;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!n)if(e.parametric){var o=e.parametricEquation||{},a=o.u||{},s=o.v||{};["u","v"].forEach((function(e){r(o[e])||"production"!==process.env.NODE_ENV&&console.error("Invalid parametricEquation.%s",e)})),["x","y","z"].forEach((function(e){"function"==typeof o[e]||"production"!==process.env.NODE_ENV&&console.error("parametricEquation.%s needs to be function",e)}));var l=Math.floor((a.max+a.step-a.min)/a.step),u=Math.floor((s.max+s.step-s.min)/s.step);n=new Float32Array(l*u*5);var c=i(a),h=i(s);for(S=0,T=0;T<u;T++)for(M=0;M<l;M++){var d=M*a.step+a.min,p=T*s.step+s.min,f=no(Math.min(d,a.max),c),g=no(Math.min(p,s.max),h);C=o.x(f,g),D=o.y(f,g),E=o.z(f,g);n[S++]=C,n[S++]=D,n[S++]=E,n[S++]=f,n[S++]=g}}else{var m=e.equation||{},v=m.x||{},y=m.y||{};if(["x","y"].forEach((function(e){r(m[e])||"production"!==process.env.NODE_ENV&&console.error("Invalid equation.%s",e)})),"function"!=typeof m.z)return void("production"!==process.env.NODE_ENV&&console.error("equation.z needs to be function"));var _=Math.floor((v.max+v.step-v.min)/v.step),x=Math.floor((y.max+y.step-y.min)/y.step);n=new Float32Array(_*x*3);for(var b=i(v),w=i(y),S=0,T=0;T<x;T++)for(var M=0;M<_;M++){var C=M*v.step+v.min,D=T*y.step+y.min,A=no(Math.min(C,v.max),b),I=no(Math.min(D,y.max),w),E=m.z(A,I);n[S++]=A,n[S++]=I,n[S++]=E}}var L=["x","y","z"];return e.parametric&&L.push("u","v"),U2(this,L,n)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});R(G3.prototype,X0);var H3=sQ.vec3;function U3(e){return isNaN(e[0])||isNaN(e[1])||isNaN(e[2])}var W3=Kg.extend({type:"surface",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node},render:function(e,t,n){var r=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=r,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var i=e.coordinateSystem,o=e.get("shading"),a=e.getData(),s="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===s||(this._surfaceMesh.material=zJ.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),zJ.setMaterialFromModel(o,this._surfaceMesh.material,e,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var l=i.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[l]("fragment","SRGB_DECODE")}var u=e.get("parametric"),c=e.get("dataShape");c||(c=this._getDataShape(a,u),"production"!==process.env.NODE_ENV&&e.get("data")&&console.warn("dataShape is not provided. Guess it is ",c));var h=e.getModel("wireframe"),d=h.get("lineStyle.width"),p=h.get("show")&&d>0;this._updateSurfaceMesh(this._surfaceMesh,e,c,p);var f=this._surfaceMesh.material;p?(f.define("WIREFRAME_QUAD"),f.set("wireframeLineWidth",d),f.set("wireframeLineColor",zJ.parseColor(h.get("lineStyle.color")))):f.undefine("WIREFRAME_QUAD"),this._initHandler(e,n),this._updateAnimation(e)},_updateAnimation:function(e){zJ.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new zJ.Mesh({geometry:new zJ.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new zJ.Material({shader:new zJ.Shader(zJ.Shader.source("ecgl.sm.depth.vertex"),zJ.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),Object.assign(e.geometry,C1),e},_initHandler:function(e,t){var n=e.getData(),r=this._surfaceMesh,i=e.coordinateSystem;r.seriesIndex=e.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var a=function(e,t){for(var n=1/0,i=-1,o=[],a=0;a<e.length;a++){r.geometry.attributes.position.get(e[a],o);var s=H3.dist(t.array,o);s<n&&(n=s,i=e[a])}return i}(e.triangle,e.point);if(a>=0){var s=[];r.geometry.attributes.position.get(a,s);for(var l=i.pointToData(s),u=1/0,c=-1,h=[],d=0;d<n.count();d++){h[0]=n.get("x",d),h[1]=n.get("y",d),h[2]=n.get("z",d);var p=H3.squaredDistance(h,l);p<u&&(c=d,u=p)}c!==o&&t.dispatchAction({type:"grid3DShowAxisPointer",value:l}),o=c,r.dataIndex=c}else r.dataIndex=-1}),this),r.on("mouseout",(function(e){o=-1,r.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(e,t,n,r){var i=e.geometry,o=t.getData(),a=o.getLayout("points"),s=0;o.each((function(e){o.hasValue(e)||s++}));var l=s||r,u=i.attributes.position,c=i.attributes.normal,h=i.attributes.texcoord0,d=i.attributes.barycentric,p=i.attributes.color,f=n[0],g=n[1],m="color"!==t.get("shading");if(l){var v=(f-1)*(g-1)*4;u.init(v),r&&d.init(v)}else u.value=new Float32Array(a);p.init(i.vertexCount),h.init(i.vertexCount);var y=[0,3,1,1,3,2],_=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],x=i.indices=new(i.vertexCount>65535?Uint32Array:Uint16Array)((f-1)*(g-1)*6),b=function(e,t,n){n[1]=e*g+t,n[0]=e*g+t+1,n[3]=(e+1)*g+t+1,n[2]=(e+1)*g+t},w=!1;if(l){var S=[],T=[],M=0;m?c.init(i.vertexCount):c.value=null;for(var C=[[],[],[]],D=[],A=[],I=H3.create(),E=function(e,t,n){var r=3*t;return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n},L=new Float32Array(a.length),N=new Float32Array(a.length/3*4),P=0;P<o.count();P++)if(o.hasValue(P)){var O=zJ.parseColor(D1(o,P));null!=(j=A1(o,P))&&(O[3]*=j),O[3]<.99&&(w=!0);for(var R=0;R<4;R++)N[4*P+R]=O[R]}var k=[1e7,1e7,1e7];for(P=0;P<f-1;P++)for(var z=0;z<g-1;z++){var V=4*(P*(g-1)+z);b(P,z,S);var B=!1;for(R=0;R<4;R++)E(a,S[R],T),U3(T)&&(B=!0);for(R=0;R<4;R++)B?u.set(V+R,k):(E(a,S[R],T),u.set(V+R,T)),r&&d.set(V+R,_[R]);for(R=0;R<6;R++)x[M++]=y[R]+V;if(m&&!B)for(R=0;R<2;R++){for(var F=3*R,G=0;G<3;G++){E(a,W=S[y[F]+G],C[G])}H3.sub(D,C[0],C[1]),H3.sub(A,C[1],C[2]),H3.cross(I,D,A);for(G=0;G<3;G++){var H=3*S[y[F]+G];L[H]=L[H]+I[0],L[H+1]=L[H+1]+I[1],L[H+2]=L[H+2]+I[2]}}}if(m)for(P=0;P<L.length/3;P++)E(L,P,I),H3.normalize(I,I),L[3*P]=I[0],L[3*P+1]=I[1],L[3*P+2]=I[2];O=[];var U=[];for(P=0;P<f-1;P++)for(z=0;z<g-1;z++){V=4*(P*(g-1)+z);b(P,z,S);for(R=0;R<4;R++){for(G=0;G<4;G++)O[G]=N[4*S[R]+G];p.set(V+R,O),m&&(E(L,S[R],I),c.set(V+R,I));var W=S[R];U[0]=W%g/(g-1),U[1]=Math.floor(W/g)/(f-1),h.set(V+R,U)}0}}else{for(U=[],P=0;P<o.count();P++){U[0]=P%g/(g-1),U[1]=Math.floor(P/g)/(f-1);var j;O=zJ.parseColor(D1(o,P));null!=(j=A1(o,P))&&(O[3]*=j),O[3]<.99&&(w=!0),p.set(P,O),h.set(P,U)}S=[];var X=0;for(P=0;P<f-1;P++)for(z=0;z<g-1;z++){b(P,z,S);for(R=0;R<6;R++)x[X++]=S[y[R]]}m?i.generateVertexNormals():c.value=null}e.material.get("normalMap")&&i.generateTangents(),i.updateBoundingBox(),i.dirty(),e.material.transparent=w,e.material.depthMask=!w},_getDataShape:function(e,t){for(var n=-1/0,r=0,i=0,o=0,a=!1,s=t?"u":"x",l=e.count(),u=0;u<l;u++){var c=e.get(s,u);c<n&&(o&&o!==i&&"production"!==process.env.NODE_ENV&&(a=!0),o=i,i=0,r++),n=c,i++}if(r&&1!==i||(a=!0),!a)return[r+1,i];for(var h=Math.floor(Math.sqrt(l));h>0;){if(Math.floor(l/h)===l/h)return[h,l/h];h--}return[h=Math.floor(Math.sqrt(l)),h]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function j3(e,t){for(var n=[],r=0;r<t.length;r++)n.push(e.dataToPoint(t[r]));return n}i_((function(e){e.registerChartView(W3),e.registerSeriesModel(G3),e.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&"cartesian3D"===t.type||"production"!==process.env.NODE_ENV&&console.error("Surface chart only support cartesian3D coordinateSystem");var n=e.getData(),r=new Float32Array(3*n.count()),i=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var o=t.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n.each(o,(function(e,o,a,s){var l;l=n.hasValue(s)?t.dataToPoint([e,o,a]):i,r[3*s]=l[0],r[3*s+1]=l[1],r[3*s+2]=l[2]}))}n.setLayout("points",r)}))}))}));var X3=Vg.extend({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualStyleAccessPath:"itemStyle",optionUpdated:function(e){e=e||{};var t=this.get("coordinateSystem");if(null!=t&&"geo3D"!==t){if("production"!==process.env.NODE_ENV){var n=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(t){null!=e[t]&&n.push(t)})),n.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",n.join(", "),t)}this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(e){e.data=this.getFilledRegions(e.data,e.map);var t=N_(e.data,{coordDimensions:["value"]}),n=new L_(t,this);n.initData(e.data);var r={};return n.each((function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i})),this._regionModelMap=r,n},formatTooltip:function(e){return H2(this,e)},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new Fh(null,this)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getName(e);if(t.transform)return(r=t.getRegion(n))?r.geometries:[];this._geo||(this._geo=H1.createGeo3D(this));for(var r=this._geo.getRegion(n),i=[],o=0;o<r.geometries.length;o++){var a=r.geometries[o],s=[],l=j3(t,a.exterior);if(s&&s.length)for(var u=0;u<a.interiors.length;u++)s.push(j3(t,s[u]));i.push({interiors:s,exterior:l})}return i},getFormattedLabel:function(e,t){var n=G2.getFormattedLabel(this,e,t);return null==n&&(n=this.getData().getName(e)),n},defaultOption:{coordinateSystem:"geo3D",data:null}});R(X3.prototype,Y0),R(X3.prototype,JJ),R(X3.prototype,QJ),R(X3.prototype,eQ),R(X3.prototype,X0);var Y3=Kg.extend({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new L1(t),this.groupGL=new zJ.Node},render:function(e,t,n){var r=e.coordinateSystem;if(r&&r.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),r.viewGL.add(this.groupGL),"geo3D"===r.type){this._sceneHelper||(this._sceneHelper=new pQ,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var i=this._control;i||(i=this._control=new oQ({zr:n.getZr()}),this._control.init());var o=e.getModel("viewControl");i.setViewGL(r.viewGL),i.setFromViewControlModel(o,0),i.off("update"),i.on("update",(function(){n.dispatchAction({type:"map3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),from:this.uid,map3DId:e.id})})),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),e.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(e,t,n,0,e.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")}))}},afterRender:function(e,t,n,r){var i=r.renderer,o=e.coordinateSystem;o&&"geo3D"===o.type&&(this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n))},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._geo3DBuilder.dispose()}});i_((function(e){U1(e),e.registerChartView(Y3),e.registerSeriesModel(X3),e.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"series",subType:"map3D",query:e},(function(t){t.setView(e)}))}))}));var Z3=Vg.extend({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(){return Kx(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}});function q3(e){this.viewGL=e}q3.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=[1,0,0,1,0,0],this.updateTransform(e,t)},q3.prototype.updateTransform=function(e,t){var n=e.coordinateSystem;n.getRoamTransform&&(Pt(this._viewTransform,n.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},q3.prototype.dataToPoint=function(e,t,n){n=e.dataToPoint(t,null,n);var r=this._viewTransform;r&&Ke(n,n,r)},q3.prototype.removeTransformInPoint=function(e){return this._viewTransform&&Ke(e,e,this._viewTransform),e},q3.prototype.getZoom=function(){if(this._viewTransform){var e=this._viewTransform;return 1/Math.max(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]))}return 1},q3.prototype._setCameraTransform=function(e){var t=this.viewGL.camera;t.position.set(e[4],e[5],0),t.scale.set(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]),1)},q3.prototype._updateCamera=function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var r=this.viewGL.camera;r.left=r.top=0,r.bottom=t,r.right=e,r.near=0,r.far=100};var K3=Kg.extend({type:"scatterGL",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this.viewGL=new N0("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new q3(this.viewGL)},render:function(e,t,n){if(this.groupGL.removeAll(),this._glViewHelper.reset(e,n),e.getData().count()){var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new f3(!0,n)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),r.update(e,t,n),this.viewGL.setPostEffect(e.getModel("postEffect"),n)}},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){if(!(e.end<=e.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new f3(!0,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),i.setSizeScale(this._sizeScale),i.update(t,n,r,e.start,e.end),r.getZr().refresh(),this._currentStep++}},updateTransform:function(e,t,n){if(e.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(e,n);var r=this._glViewHelper.getZoom(),i=Math.max((e.get("zoomScale")||0)*(r-1)+1,0);this._sizeScale=i,this._pointsBuilderList.forEach((function(e){e.setSizeScale(i)}))}},_removeTransformInPoints:function(e){if(e)for(var t=[],n=0;n<e.length;n+=2)t[0]=e[n],t[1]=e[n+1],this._glViewHelper.removeTransformInPoint(t),e[n]=t[0],e[n+1]=t[1]},dispose:function(){this.groupGL.removeAll(),this._pointsBuilderList.forEach((function(e){e.dispose()}))},remove:function(){this.groupGL.removeAll()}});i_((function(e){e.registerChartView(K3),e.registerSeriesModel(Z3),e.registerLayout({seriesType:"scatterGL",reset:function(e){var t,n=e.coordinateSystem,r=e.getData();if(n){var i=n.dimensions.map((function(e){return r.mapDimension(e)})).slice(0,2),o=[];1===i.length?t=function(e){for(var t=new Float32Array(2*(e.end-e.start)),o=e.start;o<e.end;o++){var a=2*(o-e.start),s=r.get(i[0],o),l=n.dataToPoint(s);t[a]=l[0],t[a+1]=l[1]}r.setLayout("points",t)}:2===i.length&&(t=function(e){for(var t=new Float32Array(2*(e.end-e.start)),a=e.start;a<e.end;a++){var s=2*(a-e.start),l=r.get(i[0],a),u=r.get(i[1],a);o[0]=l,o[1]=u,o=n.dataToPoint(o),t[s]=o[0],t[s+1]=o[1]}r.setLayout("points",t)})}return{progress:t}}})}));var $3=Vg.extend({type:"series.graphGL",visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,init:function(e){$3.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){$3.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,n,r){var i=G2.getFormattedLabel(this,e,t,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,e)}return i},getInitialData:function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=this;return function(e,t,n,r,i){for(var o=new NE(r),a=0;a<e.length;a++)o.addNode(vJ(e[a].id,e[a].name,a),a);var s,l=[],u=[],c=0;for(a=0;a<t.length;a++){var h=t[a],d=h.source,p=h.target;o.addEdge(d,p,c)&&(u.push(h),l.push(vJ(h.id,d+" > "+p)),c++)}var f=N_(e,{coordDimensions:["value"]});(s=new L_(f,n)).initData(e);var g=new L_(["value"],n);return g.initData(u,l),i(s,g),xA({mainData:s,struct:o,structAttr:"graph",datas:{node:s,edge:g},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}(r,n,this,!0,(function(e,n){e.wrapMethod("getItemModel",(function(e){const t=i._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));const r=t.getModel([]).getModel;function o(e,t){const n=r.call(this,e,t);return n.resolveParentPath=a,n}function a(e){if(e&&("label"===e[0]||"label"===e[1])){const t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}n.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=a,e.getModel=o,e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(e,n),o=r.graph.getEdgeByIndex(e),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),l=dt(l.join(" > ")),i.value&&(l+=" : "+dt(i.value)),l}return $3.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:Object.assign({value:0},e)})),t=new L_(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t<e.length/2;t++){var n=e[2*t],r=e[2*t+1],i=this.getData().getRawDataItem(t);i.x=n,i.y=r}},isAnimationEnabled:function(){return $3.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}}),J3=sQ.vec2,Q3=[[0,0],[1,1]],e5=WK.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new WK.Attribute("position","float",2,"POSITION"),normal:new WK.Attribute("normal","float",2),offset:new WK.Attribute("offset","float",1),color:new WK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.offset.init(e),t.normal.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,r){return 1/(J3.dist(e,t)+J3.dist(n,t)+J3.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(Q3)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(Q3)},getPolylineVertexCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,n,r,i,o){null==o&&(o=1);var a=e[0],s=e[1],l=t[0],u=t[1],c=n[0],h=n[1],d=r[0],p=r[1],f=this._getCubicCurveApproxStep(e,t,n,r),g=f*f,m=g*f,v=3*f,y=3*g,_=6*g,x=6*m,b=a-2*l+c,w=s-2*u+h,S=3*(l-c)-a+d,T=3*(u-h)-s+p,M=a,C=s,D=(l-a)*v+b*y+S*m,A=(u-s)*v+w*y+T*m,I=b*_+S*x,E=w*_+T*x,L=S*x,N=T*x,P=0,O=0,R=Math.ceil(1/f),k=new Float32Array(3*(R+1)),z=(k=[],0);for(O=0;O<R+1;O++)k[z++]=M,k[z++]=C,M+=D,C+=A,D+=I,A+=E,I+=L,E+=N,(P+=f)>1&&(M=D>0?Math.min(M,d):Math.max(M,d),C=A>0?Math.min(C,p):Math.max(C,p));this.addPolyline(k,i,o)},addLine:function(e,t,n,r){this.addPolyline([e,t],n,r)},addPolyline:function(){var e=J3.create(),t=J3.create(),n=J3.create(),r=J3.create(),i=[],o=[],a=[];return function(s,l,u,c,h){if(s.length){var d="number"!=typeof s[0];if(null==h&&(h=d?s.length:s.length/2),!(h<2)){null==c&&(c=0),null==u&&(u=1),this._itemVertexOffsets.push(this._vertexOffset);for(var p,f=d?"number"!=typeof l[0]:l.length/4===h,g=this.attributes.position,m=this.attributes.color,v=this.attributes.offset,y=this.attributes.normal,_=this.indices,x=this._vertexOffset,b=0;b<h;b++){if(d)i=s[b+c],p=f?l[b+c]:l;else{var w=2*b+c;if((i=i||[])[0]=s[w],i[1]=s[w+1],f){var S=4*b+c;(p=p||[])[0]=l[S],p[1]=l[S+1],p[2]=l[S+2],p[3]=l[S+3]}else p=l}if(this.useNativeLine)b>1&&(g.copy(x,x-1),m.copy(x,x-1),x++);else{var T;if(b<h-1){if(d)J3.copy(o,s[b+1]);else{w=2*(b+1)+c;(o=o||[])[0]=s[w],o[1]=s[w+1]}if(b>0){J3.sub(e,i,a),J3.sub(t,o,i),J3.normalize(e,e),J3.normalize(t,t),J3.add(r,e,t),J3.normalize(r,r);var M=u/2*Math.min(1/J3.dot(e,r),2);n[0]=-r[1],n[1]=r[0],T=M}else J3.sub(e,o,i),J3.normalize(e,e),n[0]=-e[1],n[1]=e[0],T=u/2}else J3.sub(e,i,a),J3.normalize(e,e),n[0]=-e[1],n[1]=e[0],T=u/2;y.set(x,n),y.set(x+1,n),v.set(x,T),v.set(x+1,-T),J3.copy(a,i),g.set(x,i),g.set(x+1,i),m.set(x,p),m.set(x+1,p),x+=2}if(this.useNativeLine)m.set(x,p),g.set(x,i),x++;else if(b>0){var C=3*this._faceOffset;(_=this.indices)[C]=x-4,_[C+1]=x-3,_[C+2]=x-2,_[C+3]=x-3,_[C+4]=x-1,_[C+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}}(),setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],r=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,t);this.dirty("color")}});V(e5.prototype,aQ);zJ.Shader.import("@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end");var t5={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function n5(e){var t={type:zJ.Texture.FLOAT,minFilter:zJ.Texture.NEAREST,magFilter:zJ.Texture.NEAREST};this._positionSourceTex=new zJ.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new zJ.Texture2D(t),this._positionPrevTex=new zJ.Texture2D(t),this._forceTex=new zJ.Texture2D(t),this._forcePrevTex=new zJ.Texture2D(t),this._weightedSumTex=new zJ.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new zJ.Texture2D(t),this._globalSpeedPrevTex=new zJ.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new lJ({fragment:zJ.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new lJ({fragment:zJ.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new lJ({fragment:zJ.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new lJ({fragment:zJ.Shader.source("clay.compositor.output")});var n=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new zJ.Mesh({geometry:new zJ.Geometry({attributes:{node1:new zJ.Geometry.Attribute("node1","float",2),node2:new zJ.Geometry.Attribute("node2","float",2),weight:new zJ.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new zJ.Material({transparent:!0,shader:zJ.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:zJ.Mesh.POINTS}),this._weightedSumMesh=new zJ.Mesh({geometry:new zJ.Geometry({attributes:{node:new zJ.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new zJ.Material({transparent:!0,shader:zJ.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:zJ.Mesh.POINTS}),this._framebuffer=new k$({depthBuffer:!1}),this._dummyCamera=new zJ.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}n5.prototype.updateOption=function(e){for(var t in t5)this[t]=t5[t];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,e)for(var t in t5)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var r=this._positionSourceTex.pixels,i=0;i<this._nodes.length;i++)r[4*i+2]=(this._nodes[i].degree||0)+1},n5.prototype._updateGravityCenter=function(e){var t=this._nodes,n=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var r=[1/0,1/0],i=[-1/0,-1/0],o=0;o<t.length;o++)r[0]=Math.min(t[o].x,r[0]),r[1]=Math.min(t[o].y,r[1]),i[0]=Math.max(t[o].x,i[0]),i[1]=Math.max(t[o].y,i[1]);this._gravityCenter=[.5*(r[0]+i[0]),.5*(r[1]+i[1])]}for(o=0;o<n.length;o++){var a=n[o].node1,s=n[o].node2;t[a].degree=(t[a].degree||0)+1,t[s].degree=(t[s].degree||0)+1}},n5.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var n=Math.ceil(Math.sqrt(e.length)),r=n,i=new Float32Array(n*r*4);this._resize(n,r);for(var o=0,a=0;a<e.length;a++){var s=e[a];i[o++]=s.x||0,i[o++]=s.y||0,i[o++]=s.mass||1,i[o++]=s.size||1}this._positionSourceTex.pixels=i;var l=this._edgeForceMesh.geometry,u=t.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var c=[];for(a=0;a<t.length;a++){var h=l.attributes,d=t[a].weight;null==d&&(d=1),h.node1.set(a,this.getNodeUV(t[a].node1,c)),h.node2.set(a,this.getNodeUV(t[a].node2,c)),h.weight.set(a,d),h.node1.set(a+u,this.getNodeUV(t[a].node2,c)),h.node2.set(a+u,this.getNodeUV(t[a].node1,c)),h.weight.set(a+u,d)}var p=this._weightedSumMesh.geometry;p.attributes.node.init(e.length);for(a=0;a<e.length;a++)p.attributes.node.set(a,this.getNodeUV(a,c));l.dirty(),p.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[n,r]),this._inited=!1,this._frame=0},n5.prototype.getNodes=function(){return this._nodes},n5.prototype.getEdges=function(){return this._edges},n5.prototype.step=function(e){this._inited||(this._initFromSource(e),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(e);var t=this._nodeRepulsionPass;t.setUniform("strongGravityMode",this.strongGravityMode),t.setUniform("gravity",this.gravity),t.setUniform("gravityCenter",this._gravityCenter),t.setUniform("scaling",this.scaling),t.setUniform("preventOverlap",this.preventOverlap),t.setUniform("positionTex",this._positionPrevTex),t.render(e);var n=this._edgeForceMesh;n.material.set("linLogMode",this.linLogMode),n.material.set("edgeWeightInfluence",this.edgeWeightInfluence),n.material.set("preventOverlap",this.preventOverlap),n.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT),e.gl.enable(e.gl.BLEND);var r=this._weightedSumMesh;r.material.set("positionTex",this._positionPrevTex),r.material.set("forceTex",this._forceTex),r.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([r],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var i=this._globalSpeedPass;i.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),i.setUniform("weightedSumTex",this._weightedSumTex),i.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),i.render(e);var o=this._positionPass;this._framebuffer.attach(this._positionTex),o.setUniform("globalSpeedTex",this._globalSpeedTex),o.setUniform("positionTex",this._positionPrevTex),o.setUniform("forceTex",this._forceTex),o.setUniform("forcePrevTex",this._forcePrevTex),o.render(e),this._framebuffer.unbind(e),this._swapTexture()},n5.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1);for(var r=0;r<t;r++)this.step(e);n&&n()},n5.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},n5.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,r=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(r-1)||0,t},n5.prototype.getNodePosition=function(e,t){var n=this._positionArr,r=this._positionTex.width,i=this._positionTex.height,o=r*i;n&&n.length===4*o||(n=this._positionArr=new Float32Array(4*o)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,r,i,e.gl.RGBA,e.gl.FLOAT,n),this._framebuffer.unbind(e),t||(t=new Float32Array(2*this._nodes.length));for(var a=0;a<this._nodes.length;a++)t[2*a]=n[4*a],t[2*a+1]=n[4*a+1];return t},n5.prototype.getTextureData=function(e,t){var n=this["_"+t+"Tex"],r=n.width,i=n.height;this._framebuffer.bind(e),this._framebuffer.attach(n);var o=new Float32Array(r*i*4);return e.gl.readPixels(0,0,r,i,e.gl.RGBA,e.gl.FLOAT,o),this._framebuffer.unbind(e),o},n5.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},n5.prototype.isFinished=function(e){return this._frame>e},n5.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e;e=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=e;e=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},n5.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},n5.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=e,this[n].height=t,this[n].dirty()}),this)},n5.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)};var r5=function(){var e=function(){return new Float32Array(2)},t=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},n=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},r=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},i=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},o=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},a=function(e,t){return e[0]=t[0],e[1]=t[1],e},s=function(e,t,n){return e[0]=t,e[1]=n,e};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function c(){this.position=new Float32Array(2),this.force=e(),this.forcePrev=e(),this.mass=1,this.inDegree=0,this.outDegree=0}function h(e,t){this.source=e,this.target=t,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=e(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},u.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},u.findSubRegion=function(e,t){for(var n=0;n<this.nSubRegions;n++){var r=this.subRegions[n];if(r.contain(e,t))return r}},u.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=e&&this.bbox[1]<=t&&this.bbox[3]>=t},u.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},u._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new l,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},u._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,o=(n[2]-n[0])/2,a=(n[3]-n[1])/2,s=e.position[0]>=r?1:0,l=e.position[1]>=i?1:0;(t=this._newSubRegion()).setBBox(s*o+n[0],l*a+n[1],(s+1)*o+n[0],(l+1)*a+n[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass};var p=d.prototype;p.initNodes=function(e,t,n){var r=t.length;this.nodes.length=0;for(var i=void 0!==n,o=0;o<r;o++){var a=new c;a.position[0]=e[2*o],a.position[1]=e[2*o+1],a.mass=t[o],i&&(a.size=n[o]),this.nodes.push(a)}this._massArr=t,this._swingingArr=new Float32Array(r),i&&(this._sizeArr=n)},p.initEdges=function(e,t){var n=e.length/2;this.edges.length=0;for(var r=0;r<n;r++){var i=e[2*r],o=e[2*r+1],a=this.nodes[i],s=this.nodes[o];if(!a||!s)return void console.error("Node not exists, try initNodes before initEdges");a.outDegree++,s.inDegree++;var l=new h(a,s);t&&(l.weight=t[r]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var e=0;e<this.nodes.length;e++){(t=this.nodes[e]).mass=t.inDegree+t.outDegree+1}else for(e=0;e<this.nodes.length;e++){var t;(t=this.nodes[e]).mass=this._massArr[e]}},p.update=function(){var o=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<o;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<o;l++){var u=this.nodes[l];a(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<o;l++){var c=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,c);else for(var h=l+1;h<o;h++){var d=this.nodes[h];this.applyNodeToNodeRepulsion(c,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(c):this.applyNodeGravity(c))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var p=0,f=0,g=e();for(l=0;l<o;l++){u=this.nodes[l];p+=(v=t(u.force,u.forcePrev))*u.mass,i(g,u.force,u.forcePrev),f+=.5*n(g)*u.mass,this._swingingArr[l]=v}var m=this.jitterTolerence*this.jitterTolerence*f/p;this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m;for(l=0;l<o;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),_=n(u.force);_>0&&(y=Math.min(_*y,10)/_,r(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=function(){var t=e();return function(e,n){if(e.node)this.applyNodeToNodeRepulsion(e.node,n,!0);else{o(t,n.position,e.centerOfMass);var i=t[0]*t[0]+t[1]*t[1];if(i>this.barnesHutTheta*e.size*e.size){var a=this.scaling*n.mass*e.mass/i;r(n.force,n.force,t,a)}else for(var s=0;s<e.nSubRegions;s++)this.applyRegionToNodeRepulsion(e.subRegions[s],n)}}}(),p.applyNodeToNodeRepulsion=function(){var t=e();return function(e,n,i){if(e!=n){o(t,e.position,n.position);var a=t[0]*t[0]+t[1]*t[1];if(0!==a){var s;if(this.preventOverlap){var l=Math.sqrt(a);if((l=l-e.size-n.size)>0)s=this.scaling*e.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*e.mass*n.mass}}else s=this.scaling*e.mass*n.mass/a;r(e.force,e.force,t,s),r(n.force,n.force,t,-s)}}}}(),p.applyEdgeAttraction=function(){var t=e();return function(e){var i=e.source,a=e.target;o(t,i.position,a.position);var s,l,u=n(t);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-i.size-a.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,r(i.force,i.force,t,l),r(a.force,a.force,t,-l))}}(),p.applyNodeGravity=function(){var t=e();return function(e){o(t,this.gravityCenter,e.position);var i=n(t);r(e.force,e.force,t,this.gravity*e.mass/(i+1))}}(),p.applyNodeStrongGravity=function(){var t=e();return function(e){o(t,this.gravityCenter,e.position),r(e.force,e.force,t,this.gravity*e.mass)}}(),p.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,r=-1/0,i=0;i<this.nodes.length;i++){var o=this.nodes[i].position;e=Math.min(e,o[0]),t=Math.min(t,o[1]),n=Math.max(n,o[0]),r=Math.max(r,o[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r},p.getGlobalSpeed=function(){return this._globalSpeed};var f=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(f=new d).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),f.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(f)for(var t in e.data.config)f[t]=e.data.config[t];break;case"update":var n=e.data.steps;if(f){for(var r=0;r<n;r++)f.update();var i=f.nodes.length,o=new Float32Array(2*i);for(r=0;r<i;r++){var a=f.nodes[r];o[2*r]=a.position[0],o[2*r+1]=a.position[1]}self.postMessage({buffer:o.buffer,globalSpeed:f.getGlobalSpeed()},[o.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:f.getGlobalSpeed()},[s.buffer])}}}}.toString();r5=r5.slice(r5.indexOf("{")+1,r5.lastIndexOf("}"));var i5={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},o5=function(e){for(var t in i5)this[t]=i5[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new PK({type:AK.FLOAT,flipY:!1,minFilter:AK.NEAREST,magFilter:AK.NEAREST})};o5.prototype.initData=function(e,t){var n=new Blob([r5]),r=window.URL.createObjectURL(n);this._worker=new Worker(r),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var i=e.length,o=t.length,a=new Float32Array(2*i),s=new Float32Array(i),l=new Float32Array(i),u=new Float32Array(2*o),c=new Float32Array(o),h=0;h<e.length;h++){var d=e[h];a[2*h]=d.x,a[2*h+1]=d.y,s[h]=null==d.mass?1:d.mass,l[h]=null==d.size?1:d.size}for(h=0;h<t.length;h++){var p=t[h],f=p.node1,g=p.node2;u[2*h]=f,u[2*h+1]=g,c[h]=null==p.weight?1:p.weight}var m=Math.ceil(Math.sqrt(e.length)),v=m,y=new Float32Array(m*v*4),_=this._positionTex;_.width=m,_.height=v,_.pixels=y,this._worker.postMessage({cmd:"init",nodesPosition:a,nodesMass:s,nodesSize:l,edges:u,edgesWeight:c}),this._globalSpeed=1/0},o5.prototype.updateOption=function(e){var t={};for(var n in i5)t[n]=i5[n];var r=this._nodes,i=this._edges,o=r.length;if(t.jitterTolerence=o>5e4?10:o>5e3?1:.1,t.scaling=o>100?2:10,t.barnesHutOptimize=o>1e3,e)for(var n in i5)null!=e[n]&&(t[n]=e[n]);if(!t.gravityCenter){for(var a=[1/0,1/0],s=[-1/0,-1/0],l=0;l<r.length;l++)a[0]=Math.min(r[l].x,a[0]),a[1]=Math.min(r[l].y,a[1]),s[0]=Math.max(r[l].x,s[0]),s[1]=Math.max(r[l].y,s[1]);t.gravityCenter=[.5*(a[0]+s[0]),.5*(a[1]+s[1])]}for(l=0;l<i.length;l++){var u=i[l].node1,c=i[l].node2;r[u].degree=(r[u].degree||0)+1,r[c].degree=(r[c].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},o5.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=n,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},o5.prototype._$onupdate=function(e){if(!this._disposed){var t=new Float32Array(e.data.buffer);this._globalSpeed=e.data.globalSpeed,this._positionArr=t,this._updateTexture(t),this._onupdate&&this._onupdate()}},o5.prototype.getNodePositionTexture=function(){return this._positionTex},o5.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,r=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(r-1),t},o5.prototype.getNodes=function(){return this._nodes},o5.prototype.getEdges=function(){return this._edges},o5.prototype.isFinished=function(e){return this._frame>e},o5.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n<this._positionArr.length;n++)t[n]=this._positionArr[n];return t},o5.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,n=0,r=0;r<e.length;)t[n++]=e[r++],t[n++]=e[r++],t[n++]=1,t[n++]=1;this._positionTex.dirty()},o5.prototype.dispose=function(e){this._disposed=!0,this._worker=null};var a5=bY.extend((function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}}),(function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)}),{init:function(){var e=this.zr;e.on("mousedown",this._mouseDownHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("globalout",this._mouseUpHandler),e.animation.on("frame",this._update)},setTarget:function(e){this._target=e},setZoom:function(e){this._zoom=Math.max(Math.min(e,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(e){this._dx=e[0],this._dy=e[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var e=this._target,t=this._zoom;e.position.x=this._dx,e.position.y=this._dy,e.scale.set(t,t,t),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(e){if(!e.target){var t=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(t,n)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var r=this._convertPos(t,n);this._x=r.x,this._y=r.y}}},_convertPos:function(e,t){var n=this.viewGL.camera,r=this.viewGL.viewport;return{x:(e-r.x)/r.width*(n.right-n.left)+n.left,y:(t-r.y)/r.height*(n.bottom-n.top)+n.top}},_mouseMoveHandler:function(e){var t=this._convertPos(e.offsetX,e.offsetY);this._dx+=t.x-this._x,this._dy+=t.y-this._y,this._x=t.x,this._y=t.y,this._needsUpdate=!0},_mouseUpHandler:function(e){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(e){var t=(e=e.event).wheelDelta||-e.detail;if(0!==t){var n=e.offsetX,r=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(n,r)){var i=t>0?1.1:.9,o=Math.max(Math.min(this._zoom*i,this.maxZoom),this.minZoom);i=o/this._zoom;var a=this._convertPos(n,r),s=(a.x-this._dx)*(i-1),l=(a.y-this._dy)*(i-1);this._dx-=s,this._dy-=l,this._zoom=o,this._needsUpdate=!0}}},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}}),s5=sQ.vec2;zJ.Shader.import("@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end");var l5=1,u5=Kg.extend({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this.viewGL=new N0("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new f3(!0,t),this._forceEdgesMesh=new zJ.Mesh({material:new zJ.Material({shader:zJ.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new zJ.Geometry({attributes:{node:new zJ.Geometry.Attribute("node","float",2),color:new zJ.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:zJ.Mesh.LINES}),this._edgesMesh=new zJ.Mesh({material:new zJ.Material({shader:zJ.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new e5({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new a5({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=n,this._initLayout(e,t,n),this._pointsBuilder.update(e,t,n),this._forceLayoutInstance instanceof n5||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(vJ(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var r=this._pointsBuilder.getPointsMesh();if(r.off("mousemove",this._mousemoveHandler),r.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var i=e.get("focusNodeAdjacencyOn");"click"===i?n.getZr().on("click",this._clickHandler):"mouseover"===i?(r.on("mousemove",this._mousemoveHandler,this),r.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):"production"!==process.env.NODE_ENV&&console.warn("Unkown focusNodeAdjacencyOn value s"+i)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var n=this._forceEdgesMesh.geometry,r=t.getEdgeData(),i=0,o=this._forceLayoutInstance,a=2*r.count();n.attributes.node.init(a),n.attributes.color.init(a),r.each((function(t){var a=e[t];n.attributes.node.set(i,o.getNodeUV(a.node1)),n.attributes.node.set(i+1,o.getNodeUV(a.node2));var s=D1(r,a.dataIndex),l=zJ.parseColor(s);l[3]*=vJ(A1(r,a.dataIndex),1),n.attributes.color.set(i,l),n.attributes.color.set(i+1,l),i+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,n=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var r=[],i=[],o=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(a){var s=e.graph.getEdgeByIndex(a),l=2*s.node1.dataIndex,u=2*s.node2.dataIndex;r[0]=n[l],r[1]=n[l+1],i[0]=n[u],i[1]=n[u+1];var c=D1(e,s.dataIndex),h=zJ.parseColor(c);h[3]*=vJ(A1(e,s.dataIndex),1);var d=e.getItemModel(s.dataIndex),p=vJ(d.get(o),1)*this._api.getDevicePixelRatio();t.addLine(r,i,h,p);for(var f=0;f<4;f++)this._originalEdgeColors[4*s.dataIndex+f]=h[f];this._edgeIndicesMap[s.dataIndex]=a}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),n=[],r=0;r<e.count();r++)this._forceLayoutInstance.getNodeUV(r,n),t.geometry.attributes.position.set(r,n);t.geometry.dirty("position")},_initLayout:function(e,t,n){var r=e.get("layout"),i=e.getGraph(),o=Wd(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()});"force"===r&&("production"!==process.env.NODE_ENV&&console.warn("Currently only forceAtlas2 layout supported."),r="forceAtlas2"),this.stopLayout(e,t,n,{beforeLayout:!0});var a=e.getData(),s=e.getData();if("forceAtlas2"===r){var l=e.getModel("forceAtlas2"),u=this._forceLayoutInstance,c=[],h=[],d=a.getDataExtent("value"),p=s.getDataExtent("value"),f=vJ(l.get("edgeWeight"),1),g=vJ(l.get("nodeWeight"),1);"number"==typeof f&&(f=[f,f]),"number"==typeof g&&(g=[g,g]);var m=0,v={},y=new Float32Array(2*a.count());if(i.eachNode((function(e){var t,n,r=e.dataIndex,i=a.get("value",r);if(a.hasItemOption){var s=a.getItemModel(r);t=s.get("x"),n=s.get("y")}null==t&&(t=o.x+Math.random()*o.width,n=o.y+Math.random()*o.height),y[2*m]=t,y[2*m+1]=n,v[e.id]=m++;var l=eo(i,d,g);isNaN(l)&&(l=isNaN(g[0])?1:g[0]),c.push({x:t,y:n,mass:l,size:a.getItemVisual(r,"symbolSize")})})),a.setLayout("points",y),i.eachEdge((function(e){var t=e.dataIndex,n=eo(a.get("value",t),p,f);isNaN(n)&&(n=isNaN(f[0])?1:f[0]),h.push({node1:v[e.node1.id],node2:v[e.node2.id],weight:n,dataIndex:t})})),!u){var _=l.get("GPU");this._forceLayoutInstance&&((!_||this._forceLayoutInstance instanceof n5)&&(_||this._forceLayoutInstance instanceof o5)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),u=this._forceLayoutInstance=_?new n5:new o5}u.initData(c,h),u.updateOption(l.option),this._updateForceEdgesGeometry(u.getEdges(),e),this._updatePositionTexture(),n.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else{y=new Float32Array(2*a.count()),m=0;i.eachNode((function(e){var t,n,r=e.dataIndex;if(a.hasItemOption){var i=a.getItemModel(r);t=i.get("x"),n=i.get("y")}y[m++]=t,y[m++]=n})),a.setLayout("points",y),this._updateAfterLayout(e,t,n)}},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(e,t,n,r){if(!r||null==r.from||r.from===this.uid){var i=this.viewGL,o=(n=this._api,this._forceLayoutInstance),a=this._model.getData(),s=this._model.getModel("forceAtlas2");if(o){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(e.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=l5++,c=s.getShallow("maxSteps"),h=s.getShallow("steps"),d=0,p=Math.max(2*h,20),f=function(t){if(t===l._layoutId)return o.isFinished(c)?(n.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:a.getLayout("points"),from:l.uid})):void o.update(i.layer.renderer,h,(function(){l._updatePositionTexture(),(d+=h)>=p&&(l._syncNodePosition(e),d=0),n.getZr().refresh(),dn((function(){f(t)}))}))};dn((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(i.layer.renderer),l._forceLayoutInstanceToDispose=null),f(u)})),this._layouting=!0}}else"production"!==process.env.NODE_ENV&&console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,n,r){r&&null!=r.from&&r.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(r&&r.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,n,r){var i=this._model.getData();this._downplayAll();var o=r.dataIndex,a=i.graph,s=[],l=a.getNodeByIndex(o);s.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&s.push(e.node1),e.node2!==l&&s.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(e){this._pointsBuilder.highlight(i,e.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(e){return e.dataIndex})));var u=[];l.edges.forEach((function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),u.push(e))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(e,t,n,r){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),n=zJ.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),r=vJ(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);n[3]*=r,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(e){this._downplayEdge(e.dataIndex)}),this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:function(){var e=[];return function(t,n){this._getColor(t,e),e[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var n=0;n<4;n++)t[n]=this._originalEdgeColors[4*e+n];return t},_fadeOutEdgesAll:function(e){this._model.getData().graph.eachEdge((function(t){this._setEdgeFade(t.dataIndex,e)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var n=this.viewGL.camera,r=e.getData().getLayout("points"),i=s5.create(1/0,1/0),o=s5.create(-1/0,-1/0),a=[],s=0;s<r.length;)a[0]=r[s++],a[1]=r[s++],s5.min(i,i,a),s5.max(o,o,a);var l=(o[1]+i[1])/2,u=(o[0]+i[0])/2;if(!(u>n.left&&u<n.right&&l<n.bottom&&l>n.top)){var c=Math.max(o[0]-i[0],10),h=c/t.getWidth()*t.getHeight();c*=1.4,h*=1.4,i[0]-=.2*c,n.left=i[0],n.top=l-h/2,n.bottom=l+h/2,n.right=c+i[0],n.near=0,n.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1,this._pointsBuilder.dispose()},remove:function(){this.groupGL.removeAll(),this._control.dispose()}});function c5(e){return e instanceof Array||(e=[e,e]),e}i_((function(e){function t(){}e.registerChartView(u5),e.registerSeriesModel($3),e.registerVisual((function(e){const t={};e.eachSeriesByType("graphGL",(function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each((function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),n.setItemVisual(r,"style",s);var l=["symbol","symbolSize","symbolKeepAspect"];for(let e=0;e<l.length;e++){var u=a.getShallow(l[e],!0);null!=u&&n.setItemVisual(r,l[e],u)}})),n.count()&&r.each((function(e){let t=r.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=i["ec-"+t]);var o=n.getItemVisual(t,"style");z(r.ensureUniqueItemVisual(e,"style"),o);var a=["symbol","symbolSize","symbolKeepAspect"];for(let i=0;i<a.length;i++)r.setItemVisual(e,a[i],n.getItemVisual(t,a[i]))}}))}))})),e.registerVisual((function(e){e.eachSeriesByType("graphGL",(function(e){var t=e.getGraph(),n=e.getEdgeData(),r=c5(e.get("edgeSymbol")),i=c5(e.get("edgeSymbolSize"));n.setVisual("drawType","stroke"),n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),o=c5(r.getShallow("symbol",!0)),a=c5(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(z(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])}))}))})),e.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},t),e.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},t),e.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},t),e.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},t)}));var h5=Vg.extend({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualStyleAccessPath:"itemStyle",getInitialData:function(e,t){var n=this.get("coordinateSystem"),r="geo"===n?["lng","lat"]:Yy(n)||["x","y"];if("production"!==process.env.NODE_ENV&&r.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");r.push("vx","vy");var i=N_(this.getSource(),{coordDimensions:r,encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),o=new L_(i,this);return o.initData(this.getSource()),o},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}}),d5=WK.extend((function(){return{dynamic:!0,attributes:{position:new WK.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,n=4*e,r=2*e;this.vertexCount!==n&&t.position.init(n),this.triangleCount!==r&&(this.indices=0===r?null:this.vertexCount>65535?new Uint32Array(3*r):new Uint16Array(3*r))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}});bq.import("@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n");var p5=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new PK({type:AK.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};p5.prototype={constructor:p5,init:function(){var e={type:AK.FLOAT,minFilter:AK.NEAREST,magFilter:AK.NEAREST,useMipmap:!1};this._spawnTexture=new PK(e),this._particleTexture0=new PK(e),this._particleTexture1=new PK(e),this._frameBuffer=new k$({depthBuffer:!1}),this._particlePass=new lJ({fragment:bq.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new lJ({fragment:bq.source("clay.compositor.downsample")});var t=new IK({renderOrder:10,material:new WZ({shader:new bq(bq.source("ecgl.vfParticle.renderPoints.vertex"),bq.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:IK.POINTS,geometry:new WK({dynamic:!0,mainAttribute:"texcoord0"})}),n=new IK({renderOrder:10,material:new WZ({shader:new bq(bq.source("ecgl.vfParticle.renderLines.vertex"),bq.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new d5,culling:!1}),r=new IK({material:new WZ({shader:new bq(bq.source("ecgl.color.vertex"),bq.source("ecgl.color.fragment"))}),geometry:new B$});r.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=r,this._camera=new iJ,this._thisFrameTexture=new PK,this._lastFrameTexture=new PK},setParticleDensity:function(e,t){for(var n=new Float32Array(4*(e*t)),r=0,i=this.particleLife,o=0;o<e;o++)for(var a=0;a<t;a++,r++){n[4*r]=Math.random(),n[4*r+1]=Math.random(),n[4*r+2]=Math.random();var s=(i[1]-i[0])*Math.random()+i[0];n[4*r+3]=s}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=n,this._particleTexture0.width=this._particleTexture1.width=e,this._particleTexture0.height=this._particleTexture1.height=t,this._particlePass.setUniform("textureSize",[e,t])},_setPointsGeometry:function(e,t){var n=e*t,r=this._particlePointsMesh.geometry,i=r.attributes;i.texcoord0.init(n);for(var o=0,a=0;a<e;a++)for(var s=0;s<t;s++,o++)i.texcoord0.value[2*o]=a/e,i.texcoord0.value[2*o+1]=s/t;r.dirty()},_setLineGeometry:function(e,t){var n=e*t,r=this._getParticleMesh().geometry;r.setLineCount(n),r.resetOffset();for(var i=0;i<e;i++)for(var o=0;o<t;o++)r.addLine([i/e,o/t]);r.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,n,r){var i=this._getParticleMesh(),o=this._frameBuffer,a=this._particlePass;r&&this._updateDownsampleTextures(e,t),i.material.set("size",this._particleSize*this._supersampling),i.material.set("color",this.particleColor),a.setUniform("speedScaling",this.particleSpeedScaling),o.attach(this._particleTexture1),a.setUniform("firstFrameTime",r?(this.particleLife[1]+this.particleLife[0])/2:0),a.setUniform("particleTexture",this._particleTexture0),a.setUniform("deltaTime",n),a.setUniform("elapsedTime",this._elapsedTime),a.render(e,o),i.material.set("particleTexture",this._particleTexture1),i.material.set("prevParticleTexture",this._particleTexture0),o.attach(this._thisFrameTexture),o.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),e.renderPass([s,i],this._camera),o.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=n},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var n=0,r=this._thisFrameTexture,i=t[n];i;)this._frameBuffer.attach(i),this._downsamplePass.setUniform("texture",r),this._downsamplePass.setUniform("textureSize",[r.width,r.height]),this._downsamplePass.render(e,this._frameBuffer),r=i,i=t[++n]},getSurfaceTexture:function(){var e=this._downsampleTextures;return e.length>0?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new PK),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var n=t.getContext("2d");return n.fillStyle="#fff",n.arc(e/2,e/2,e/2,0,2*Math.PI),n.fill(),t}(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){this._getParticleMesh().material.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var n=this._downsampleTextures,r=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),i=2,o=this._width*this._supersampling,a=this._height*this._supersampling,s=0;s<r;s++)n[s]=n[s]||new PK,n[s].width=o/i,n[s].height=a/i,i*=2;for(;s<n.length;s++)n[s].dispose(e);n.length=r},_swapTexture:function(){var e=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=e;e=this._thisFrameTexture;this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=e},dispose:function(e){e.disposeFrameBuffer(this._frameBuffer),e.disposeTexture(this.vectorFieldTexture),e.disposeTexture(this._spawnTexture),e.disposeTexture(this._particleTexture0),e.disposeTexture(this._particleTexture1),e.disposeTexture(this._thisFrameTexture),e.disposeTexture(this._lastFrameTexture),e.disposeGeometry(this._particleLinesMesh.geometry),e.disposeGeometry(this._particlePointsMesh.geometry),e.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&e.disposeTexture(this._spriteTexture),this._particlePass.dispose(e),this._downsamplePass.dispose(e),this._downsampleTextures.forEach((function(t){t.dispose(e)}))}};var f5=Kg.extend({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new N0("orthographic"),this.groupGL=new zJ.Node,this.viewGL.add(this.groupGL),this._particleSurface=new p5;var n=new zJ.Mesh({geometry:new zJ.PlaneGeometry,material:new zJ.Material({shader:new zJ.Shader({vertex:zJ.Shader.source("ecgl.color.vertex"),fragment:zJ.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(e,t,n){var r=this._particleSurface;r.setParticleType(e.get("particleType")),r.setSupersampling(e.get("supersampling")),this._updateData(e,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var i=vJ(e.get("particleDensity"),128);r.setParticleDensity(i,i);var o=this._planeMesh,a=+new Date,s=this,l=!0;o.__percent=0,o.stopAnimation(),o.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-a,20);a+=t,s._renderer&&(r.update(s._renderer,n,t/1e3,l),o.material.set("diffuseMap",r.getSurfaceTexture())),l=!1})).start();var u=e.getModel("itemStyle"),c=zJ.parseColor(u.get("color"));c[3]*=vJ(u.get("opacity"),1),o.material.set("color",c),r.setColorTextureImage(e.get("colorTexture"),n),r.setParticleSize(e.get("particleSize")),r.particleSpeedScaling=e.get("particleSpeed"),r.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,n){this._updateData(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._renderer=i},_updateData:function(e,t){var n=e.coordinateSystem,r=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),i=e.getData(),o=i.getDataExtent(r[0]),a=i.getDataExtent(r[1]),s=e.get("gridWidth"),l=e.get("gridHeight");if(null==s||"auto"===s){var u=(o[1]-o[0])/(a[1]-a[0]);s=Math.round(Math.sqrt(u*i.count()))}null!=l&&"auto"!==l||(l=Math.ceil(i.count()/s));var c=this._particleSurface.vectorFieldTexture,h=c.pixels;if(h&&h.length===l*s*4)for(var d=0;d<h.length;d++)h[d]=0;else h=c.pixels=new Float32Array(s*l*4);var p=0,f=1/0,g=new Float32Array(2*i.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];i.each([r[0],r[1],"vx","vy"],(function(e,t,r,i){var o=n.dataToPoint([e,t]);g[m++]=o[0],g[m++]=o[1],v[0][0]=Math.min(o[0],v[0][0]),v[0][1]=Math.min(o[1],v[0][1]),v[1][0]=Math.max(o[0],v[1][0]),v[1][1]=Math.max(o[1],v[1][1]);var a=Math.sqrt(r*r+i*i);p=Math.max(p,a),f=Math.min(f,a)})),i.each(["vx","vy"],(function(e,t,n){var r=Math.round((g[2*n]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),i=4*((l-1-Math.round((g[2*n+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+r);h[i]=e/p*.5+.5,h[i+1]=t/p*.5+.5,h[i+3]=1})),c.width=s,c.height=l,"bmap"===e.get("coordinateSystem")&&this._fillEmptyPixels(c),c.dirty(),this._updatePlanePosition(v[0],v[1],e,t),this._updateGradientTexture(i.getVisual("visualMeta"),[f,p])},_fillEmptyPixels:function(e){var t=e.pixels,n=e.width,r=e.height;function i(e,i,o){e=Math.max(Math.min(e,n-1),0);var a=4*((i=Math.max(Math.min(i,r-1),0))*(n-1)+e);return 0!==t[a+3]&&(o[0]=t[a],o[1]=t[a+1],!0)}function o(e,t,n){n[0]=e[0]+t[0],n[1]=e[1]+t[1]}for(var a=[],s=[],l=[],u=[],c=[],h=0,d=0;d<r;d++)for(var p=0;p<n;p++){var f=4*(d*(n-1)+p);0===t[f+3]&&(h=a[0]=a[1]=0,i(p-1,d,s)&&(h++,o(s,a,a)),i(p+1,d,l)&&(h++,o(l,a,a)),i(p,d-1,u)&&(h++,o(u,a,a)),i(p,d+1,c)&&(h++,o(c,a,a)),a[0]/=h,a[1]/=h,t[f]=a[0],t[f+1]=a[1]),t[f+3]=1}},_updateGradientTexture:function(e,t){if(e&&e.length){this._gradientTexture=this._gradientTexture||new zJ.Texture2D({image:document.createElement("canvas")});var n=this._gradientTexture,r=n.image;r.width=200,r.height=1;var i=r.getContext("2d"),o=i.createLinearGradient(0,.5,r.width,.5);e[0].stops.forEach((function(e){var n;t[1]===t[0]?n=0:(n=e.value/t[1],n=Math.min(Math.max(n,0),1)),o.addColorStop(n,e.color)})),i.fillStyle=o,i.fillRect(0,0,r.width,r.height),n.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,n,r){var i=this._limitInViewportAndFullFill(e,t,n,r);e=i.leftTop,t=i.rightBottom,this._particleSurface.setRegion(i.region),this._planeMesh.position.set((e[0]+t[0])/2,r.getHeight()-(e[1]+t[1])/2,0);var o=t[0]-e[0],a=t[1]-e[1];this._planeMesh.scale.set(o/2,a/2,1),this._particleSurface.resize(Math.max(Math.min(o,2048),1),Math.max(Math.min(a,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,n,r){var i=[Math.max(e[0],0),Math.max(e[1],0)],o=[Math.min(t[0],r.getWidth()),Math.min(t[1],r.getHeight())];if("bmap"===n.get("coordinateSystem")){var a=n.getData().getDataExtent(n.coordDimToDataDim("lng")[0]);Math.floor(a[1]-a[0])>=359&&(i[0]>0&&(i[0]=0),o[0]<r.getWidth()&&(o[0]=r.getWidth()))}var s=t[0]-e[0],l=t[1]-e[1],u=o[0]-i[0],c=o[1]-i[1];return{leftTop:i,rightBottom:o,region:[(i[0]-e[0])/s,1-c/l-(i[1]-e[1])/l,u/s,c/l]}},_updateCamera:function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var r=this.viewGL.camera;r.left=r.bottom=0,r.top=t,r.right=e,r.near=0,r.far=100,r.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}});i_((function(e){e.registerChartView(f5),e.registerSeriesModel(h5)}));var g5=Vg.extend({type:"series.linesGL",dependencies:["grid","geo"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",streamEnabled:!0,init:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),g5.superApply(this,"init",arguments)},mergeOption:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),g5.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Me(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Me(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+2*i],t[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(e);for(i=0;i<o.length;i++)t[i]=t[i]||[],t[i][0]=o[i][0],t[i][1]=o[i][1];return o.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var n=e.length,r=new Uint32Array(n),i=new Float64Array(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=e[l++];r[a++]=o+t,r[a++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(i[o++]=h,i[o++]=d,l>n&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var n=new L_(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}),m5=Kg.extend({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new zJ.Node,this.viewGL=new N0("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new q3(this.viewGL),this._nativeLinesShader=zJ.createShader("ecgl.lines3D"),this._meshLinesShader=zJ.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n);var r=this._linesMeshes[0];r||(r=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(r),this._updateLinesMesh(e,r,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){var i=this._linesMeshes[this._currentStep];i||(i=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=i),this._updateLinesMesh(t,i,e.start,e.end),this.groupGL.add(i),r.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,n){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,n)},_createLinesMesh:function(e){return new zJ.Mesh({$ignorePicking:!0,material:new zJ.Material({shader:zJ.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new e5({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:zJ.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,n,r){var i=e.getData();t.material.blend="lighter"===e.get("blendMode")?zJ.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,a=e.get("polyline"),s=t.geometry,l=e.coordinateSystem,u=vJ(e.get("lineStyle.width"),1);u>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=zJ.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=zJ.Mesh.LINES),n=n||0,r=r||i.count(),s.resetOffset();var c=0,h=0,d=[],p=[],f=[],g=[],m=[],v=.3,y=.7;function _(){p[0]=d[0]*y+g[0]*v-(d[1]-g[1])*o,p[1]=d[1]*y+g[1]*v-(g[0]-d[0])*o,f[0]=d[0]*v+g[0]*y-(d[1]-g[1])*o,f[1]=d[1]*v+g[1]*y-(g[0]-d[0])*o}if(a||0!==o)for(var x=n;x<r;x++)if(a){var b=e.getLineCoordsCount(x);c+=s.getPolylineVertexCount(b),h+=s.getPolylineTriangleCount(b)}else e.getLineCoords(x,m),this._glViewHelper.dataToPoint(l,m[0],d),this._glViewHelper.dataToPoint(l,m[1],g),_(),c+=s.getCubicCurveVertexCount(d,p,f,g),h+=s.getCubicCurveTriangleCount(d,p,f,g);else{var w=r-n;c+=w*s.getLineVertexCount(),h+=w*s.getLineVertexCount()}s.setVertexCount(c),s.setTriangleCount(h);var S=n,T=[];for(x=n;x<r;x++){zJ.parseColor(D1(i,S),T);var M=vJ(A1(i,S),1);T[3]*=M;b=e.getLineCoords(x,m);for(var C=0;C<b;C++)this._glViewHelper.dataToPoint(l,m[C],m[C]);a?s.addPolyline(m,T,u,0,b):0!==o?(d=m[0],g=m[1],_(),s.addCubicCurve(d,p,f,g,T,u)):s.addPolyline(m,T,u,0,2),S++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});i_((function(e){e.registerChartView(m5),e.registerSeriesModel(g5)}));const v5=({className:e="",style:n={},extraOption:r={},lineStyles:i={},pointsStyles:s={},pointsData:l=[],linesData:u=[],globeOption:c={}})=>{const h=t(null),[d,p]=o();return a((()=>{const e=Ry(h.current);p(e);const t=KX(e.resize,500),n=()=>{t()};return globalThis.addEventListener("resize",n),()=>{globalThis.removeEventListener("resize",n)}}),[]),a((()=>{if(d){const e=[];e.push(Object.assign({type:"lines3D",name:"lines3D",effect:{show:!0,trailWidth:2,trailLength:.15,trailOpacity:1,trailColor:"rgb(30, 30, 60)"},lineStyle:{width:5,color:"rgb(50, 50, 150)",opacity:.3},blendMode:"lighter",data:u},i)),e.push(Object.assign({type:"scatter3D",coordinateSystem:"globe",zlevel:3,rippleEffect:{brushType:"stroke"},label:{fontSize:8,show:!0,position:"right",formatter:"{b}"},itemStyle:{normal:{color:"#f5f802"}},data:l},s)),d.setOption(Object.assign({backgroundColor:"#000",baseColor:"#000",shading:"realistic",globe:Object.assign({environment:"https://img.alicdn.com/imgextra/i2/O1CN017x8UE61p6wqej1Y0c_!!6000000005312-0-tps-2048-1024.jpg",heightTexture:"https://img.alicdn.com/imgextra/i2/O1CN01BB16kM1ILFttfdYZg_!!6000000000876-0-tps-4096-2048.jpg",baseTexture:"https://img.alicdn.com/imgextra/i4/O1CN01fs70Dq25ElSd8mU6C_!!6000000007495-0-tps-5400-2700.jpg",shading:"lambert",light:{ambient:{intensity:1},main:{intensity:.1}},viewControl:{autoRotate:!0,distance:2e3}},c),series:e},r));const t=setTimeout((()=>{d.resize()}),500);return()=>{clearTimeout(t)}}}),[d,r,c,i,u,l,s]),vU.jsx(iX,{ref:h,className:e,style:n})};export{v5 as EarthChart,dY as WinChart,oX as WinChartType,dY as default,cU as echarts};