AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.114
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/leo/ui/lib/chart/5/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/leo/ui/lib/chart/5/echarts.esm.min.js
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/


/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function __spreadArrays(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i}var Browser=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.weChat=!1},Env=function(){this.browser=new Browser,this.node=!1,this.wxa=!1,this.worker=!1,this.canvasSupported=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1},env=new Env;function detect(e,t){var n=t.browser,i=e.match(/Firefox\/([\d.]+)/),r=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(e);i&&(n.firefox=!0,n.version=i[1]),r&&(n.ie=!0,n.version=r[1]),a&&(n.edge=!0,n.version=a[1]),o&&(n.weChat=!0),t.canvasSupported=!!document.createElement("canvas").getContext,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}"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(env.wxa=!0,env.canvasSupported=!0,env.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(env.worker=!0,env.canvasSupported=!0):"undefined"==typeof navigator?(env.node=!0,env.canvasSupported=!0,env.svgSupported=!0):detect(navigator.userAgent,env);var BUILTIN_OBJECT={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},TYPED_ARRAY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},objToString=Object.prototype.toString,arrayProto=Array.prototype,nativeForEach=arrayProto.forEach,nativeFilter=arrayProto.filter,nativeSlice=arrayProto.slice,nativeMap=arrayProto.map,ctorFunction=function(){}.constructor,protoFunction=ctorFunction?ctorFunction.prototype:null,methods={};function $override(e,t){methods[e]=t}var idStart=2311;function guid(){return idStart++}function logError(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"undefined"!=typeof console&&console.error.apply(console,e)}function clone(e){if(null==e||"object"!=typeof e)return e;var t=e,n=objToString.call(e);if("[object Array]"===n){if(!isPrimitive(e)){t=[];for(var i=0,r=e.length;i<r;i++)t[i]=clone(e[i])}}else if(TYPED_ARRAY[n]){if(!isPrimitive(e)){var a=e.constructor;if(a.from)t=a.from(e);else{t=new a(e.length);for(i=0,r=e.length;i<r;i++)t[i]=clone(e[i])}}}else if(!BUILTIN_OBJECT[n]&&!isPrimitive(e)&&!isDom(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=clone(e[o]));return t}function merge(e,t,n){if(!isObject(t)||!isObject(e))return n?clone(t):e;for(var i in t)if(t.hasOwnProperty(i)){var r=e[i],a=t[i];!isObject(a)||!isObject(r)||isArray(a)||isArray(r)||isDom(a)||isDom(r)||isBuiltInObject(a)||isBuiltInObject(r)||isPrimitive(a)||isPrimitive(r)?!n&&i in e||(e[i]=clone(t[i])):merge(r,a,n)}return e}function mergeAll(e,t){for(var n=e[0],i=1,r=e.length;i<r;i++)n=merge(n,e[i],t);return n}function extend(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function defaults(e,t,n){for(var i=keys(t),r=0;r<i.length;r++){var a=i[r];(n?null!=t[a]:null==e[a])&&(e[a]=t[a])}return e}var createCanvas=function(){return methods.createCanvas()};function indexOf(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n}return-1}function inherits(e,t){var n=e.prototype;function i(){}for(var r in i.prototype=t.prototype,e.prototype=new i,n)n.hasOwnProperty(r)&&(e.prototype[r]=n[r]);e.prototype.constructor=e,e.superClass=t}function mixin(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(t),r=0;r<i.length;r++){var a=i[r];"constructor"!==a&&(n?null!=t[a]:null==e[a])&&(e[a]=t[a])}else defaults(e,t,n)}function isArrayLike(e){return!!e&&("string"!=typeof e&&"number"==typeof e.length)}function each(e,t,n){if(e&&t)if(e.forEach&&e.forEach===nativeForEach)e.forEach(t,n);else if(e.length===+e.length)for(var i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(n,e[a],a,e)}function map(e,t,n){if(!e)return[];if(!t)return slice(e);if(e.map&&e.map===nativeMap)return e.map(t,n);for(var i=[],r=0,a=e.length;r<a;r++)i.push(t.call(n,e[r],r,e));return i}function reduce(e,t,n,i){if(e&&t){for(var r=0,a=e.length;r<a;r++)n=t.call(i,n,e[r],r,e);return n}}function filter(e,t,n){if(!e)return[];if(!t)return slice(e);if(e.filter&&e.filter===nativeFilter)return e.filter(t,n);for(var i=[],r=0,a=e.length;r<a;r++)t.call(n,e[r],r,e)&&i.push(e[r]);return i}function find(e,t,n){if(e&&t)for(var i=0,r=e.length;i<r;i++)if(t.call(n,e[i],i,e))return e[i]}function keys(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}function bindPolyfill(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return function(){return e.apply(t,n.concat(nativeSlice.call(arguments)))}}methods.createCanvas=function(){return document.createElement("canvas")};var bind=protoFunction&&isFunction(protoFunction.bind)?protoFunction.call.bind(protoFunction.bind):bindPolyfill;function curry(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(nativeSlice.call(arguments)))}}function isArray(e){return Array.isArray?Array.isArray(e):"[object Array]"===objToString.call(e)}function isFunction(e){return"function"==typeof e}function isString(e){return"string"==typeof e}function isStringSafe(e){return"[object String]"===objToString.call(e)}function isNumber(e){return"number"==typeof e}function isObject(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function isBuiltInObject(e){return!!BUILTIN_OBJECT[objToString.call(e)]}function isTypedArray(e){return!!TYPED_ARRAY[objToString.call(e)]}function isDom(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function isGradientObject(e){return null!=e.colorStops}function isPatternObject(e){return null!=e.image}function isRegExp(e){return"[object RegExp]"===objToString.call(e)}function eqNaN(e){return e!=e}function retrieve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,i=e.length;n<i;n++)if(null!=e[n])return e[n]}function retrieve2(e,t){return null!=e?e:t}function retrieve3(e,t,n){return null!=e?e:null!=t?t:n}function slice(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return nativeSlice.apply(e,t)}function normalizeCssArray(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 assert(e,t){if(!e)throw new Error(t)}function trim(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var primitiveKey="__ec_primitive__";function setAsPrimitive(e){e[primitiveKey]=!0}function isPrimitive(e){return e[primitiveKey]}var HashMap=function(){function e(t){this.data={};var n=isArray(t);this.data={};var i=this;function r(e,t){n?i.set(e,t):i.set(t,e)}t instanceof e?t.each(r):t&&each(t,r)}return e.prototype.get=function(e){return this.data.hasOwnProperty(e)?this.data[e]:null},e.prototype.set=function(e,t){return this.data[e]=t},e.prototype.each=function(e,t){for(var n in this.data)this.data.hasOwnProperty(n)&&e.call(t,this.data[n],n)},e.prototype.keys=function(){return keys(this.data)},e.prototype.removeKey=function(e){delete this.data[e]},e}();function createHashMap(e){return new HashMap(e)}function concatArray(e,t){for(var n=new e.constructor(e.length+t.length),i=0;i<e.length;i++)n[i]=e[i];var r=e.length;for(i=0;i<t.length;i++)n[i+r]=t[i];return n}function createObject(e,t){var n;if(Object.create)n=Object.create(e);else{var i=function(){};i.prototype=e,n=new i}return t&&extend(n,t),n}function hasOwn(e,t){return e.hasOwnProperty(t)}function noop(){}var zrUtil=Object.freeze({__proto__:null,$override:$override,guid:guid,logError:logError,clone:clone,merge:merge,mergeAll:mergeAll,extend:extend,defaults:defaults,createCanvas:createCanvas,indexOf:indexOf,inherits:inherits,mixin:mixin,isArrayLike:isArrayLike,each:each,map:map,reduce:reduce,filter:filter,find:find,keys:keys,bind:bind,curry:curry,isArray:isArray,isFunction:isFunction,isString:isString,isStringSafe:isStringSafe,isNumber:isNumber,isObject:isObject,isBuiltInObject:isBuiltInObject,isTypedArray:isTypedArray,isDom:isDom,isGradientObject:isGradientObject,isPatternObject:isPatternObject,isRegExp:isRegExp,eqNaN:eqNaN,retrieve:retrieve,retrieve2:retrieve2,retrieve3:retrieve3,slice:slice,normalizeCssArray:normalizeCssArray,assert:assert,trim:trim,setAsPrimitive:setAsPrimitive,isPrimitive:isPrimitive,HashMap:HashMap,createHashMap:createHashMap,concatArray:concatArray,createObject:createObject,hasOwn:hasOwn,noop:noop});function create(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function copy(e,t){return e[0]=t[0],e[1]=t[1],e}function clone$1(e){return[e[0],e[1]]}function set(e,t,n){return e[0]=t,e[1]=n,e}function add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function scaleAndAdd(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e}function sub(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function len(e){return Math.sqrt(lenSquare(e))}var length=len;function lenSquare(e){return e[0]*e[0]+e[1]*e[1]}var lengthSquare=lenSquare;function mul(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function div(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function dot(e,t){return e[0]*t[0]+e[1]*t[1]}function scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function normalize(e,t){var n=len(t);return 0===n?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function distance(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var dist=distance;function distanceSquare(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var distSquare=distanceSquare;function negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}function lerp(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e}function applyTransform(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[2]*r+n[4],e[1]=n[1]*i+n[3]*r+n[5],e}function min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}var vector=Object.freeze({__proto__:null,create:create,copy:copy,clone:clone$1,set:set,add:add,scaleAndAdd:scaleAndAdd,sub:sub,len:len,length:length,lenSquare:lenSquare,lengthSquare:lengthSquare,mul:mul,div:div,dot:dot,scale:scale,normalize:normalize,distance:distance,dist:dist,distanceSquare:distanceSquare,distSquare:distSquare,negate:negate,lerp:lerp,applyTransform:applyTransform,min:min,max:max}),Param=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},Draggable=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&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Param(t,e),"dragstart",e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,i=e.offsetY,r=n-this._x,a=i-this._y;this._x=n,this._y=i,t.drift(r,a,e),this.handler.dispatchToElement(new Param(t,e),"drag",e.event);var o=this.handler.findHover(n,i,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new Param(s,e),"dragleave",e.event),o&&o!==s&&this.handler.dispatchToElement(new Param(o,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new Param(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Param(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),Eventful=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,i){this._$handlers||(this._$handlers={});var r=this._$handlers;if("function"==typeof t&&(i=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;null!=t&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),r[e]||(r[e]=[]);for(var o=0;o<r[e].length;o++)if(r[e][o].h===n)return this;var s={h:n,query:t,ctx:i||this,callAtLast:n.zrEventfulCallAtLast},l=r[e].length-1,u=r[e][l];return u&&u.callAtLast?r[e].splice(l,0,s):r[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 i=[],r=0,a=n[e].length;r<a;r++)n[e][r].h!==t&&i.push(n[e][r]);n[e]=i}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 i=this._$handlers[e],r=this._$eventProcessor;if(i)for(var a=t.length,o=i.length,s=0;s<o;s++){var l=i[s];if(!r||!r.filter||null==l.query||r.filter(e,l.query))switch(a){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 r&&r.afterTrigger&&r.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){if(!this._$handlers)return this;var t=this._$handlers[e],n=this._$eventProcessor;if(t)for(var i=arguments,r=i.length,a=i[r-1],o=t.length,s=0;s<o;s++){var l=t[s];if(!n||!n.filter||null==l.query||n.filter(e,l.query))switch(r){case 0:l.h.call(a);break;case 1:l.h.call(a,i[0]);break;case 2:l.h.call(a,i[0],i[1]);break;default:l.h.apply(a,i.slice(1,r-1))}}return n&&n.afterTrigger&&n.afterTrigger(e),this},e}(),LN2=Math.log(2);function determinant(e,t,n,i,r,a){var o=i+"-"+r,s=e.length;if(a.hasOwnProperty(o))return a[o];if(1===t){var l=Math.round(Math.log((1<<s)-1&~r)/LN2);return e[n][l]}for(var u=i|1<<n,c=n+1;i&1<<c;)c++;for(var h=0,p=0,d=0;p<s;p++){var f=1<<p;f&r||(h+=(d%2?-1:1)*e[n][p]*determinant(e,t-1,c,u,r|f,a),d++)}return a[o]=h,h}function buildTransformer(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]]],i={},r=determinant(n,8,0,0,0,i);if(0!==r){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)null==a[s]&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*determinant(n,7,0===o?1:0,1<<o,1<<s,i)/r*t[o];return function(e,t,n){var i=t*a[6]+n*a[7]+1;e[0]=(t*a[0]+n*a[1]+a[2])/i,e[1]=(t*a[3]+n*a[4]+a[5])/i}}}var EVENT_SAVED_PROP="___zrEVENTSAVED",_calcOut=[];function transformLocalCoord(e,t,n,i,r){return transformCoordWithViewport(_calcOut,t,i,r,!0)&&transformCoordWithViewport(e,n,_calcOut[0],_calcOut[1])}function transformCoordWithViewport(e,t,n,i,r){if(t.getBoundingClientRect&&env.domSupported&&!isCanvasEl(t)){var a=t[EVENT_SAVED_PROP]||(t[EVENT_SAVED_PROP]={}),o=preparePointerTransformer(prepareCoordMarkers(t,a),a,r);if(o)return o(e,n,i),!0}return!1}function prepareCoordMarkers(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var i=["left","right"],r=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=a%2,l=(a>>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),e.appendChild(o),n.push(o)}return n}function preparePointerTransformer(e,t,n){for(var i=n?"invTrans":"trans",r=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,p=c.left,d=c.top;o.push(p,d),l=l&&a&&p===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&r?r:(t.srcCoords=o,t[i]=n?buildTransformer(s,o):buildTransformer(o,s))}function isCanvasEl(e){return"CANVAS"===e.nodeName.toUpperCase()}var isDomLevel2="undefined"!=typeof window&&!!window.addEventListener,MOUSE_EVENT_REG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_calcOut$1=[];function clientToLocal(e,t,n,i){return n=n||{},i||!env.canvasSupported?calculateZrXY(e,t,n):env.browser.firefox&&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):calculateZrXY(e,t,n),n}function calculateZrXY(e,t,n){if(env.domSupported&&e.getBoundingClientRect){var i=t.clientX,r=t.clientY;if(isCanvasEl(e)){var a=e.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=r-a.top)}if(transformCoordWithViewport(_calcOut$1,e,i,r))return n.zrX=_calcOut$1[0],void(n.zrY=_calcOut$1[1])}n.zrX=n.zrY=0}function getNativeEvent(e){return e||window.event}function normalizeEvent(e,t,n){if(null!=(t=getNativeEvent(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];r&&clientToLocal(e,r,t,n)}else{clientToLocal(e,t,t,n);var a=getWheelDeltaMayPolyfill(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return null==t.which&&void 0!==o&&MOUSE_EVENT_REG.test(t.type)&&(t.which=1&o?1:2&o?3:4&o?2:0),t}function getWheelDeltaMayPolyfill(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;return null==n||null==i?t:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}function addEventListener(e,t,n,i){isDomLevel2?e.addEventListener(t,n,i):e.attachEvent("on"+t,n)}function removeEventListener(e,t,n,i){isDomLevel2?e.removeEventListener(t,n,i):e.detachEvent("on"+t,n)}var stop=isDomLevel2?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};function isMiddleOrRightButtonOnMouseUpDown(e){return 2===e.which||3===e.which}var GestureMgr=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 i=e.touches;if(i){for(var r={points:[],touches:[],target:t,event:e},a=0,o=i.length;a<o;a++){var s=i[a],l=clientToLocal(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},e.prototype._recognize=function(e){for(var t in recognizers)if(recognizers.hasOwnProperty(t)){var n=recognizers[t](this._track,e);if(n)return n}},e}();function dist$1(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}function center(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}var recognizers={pinch:function(e,t){var n=e.length;if(n){var i=(e[n-1]||{}).points,r=(e[n-2]||{}).points||i;if(r&&r.length>1&&i&&i.length>1){var a=dist$1(i)/dist$1(r);!isFinite(a)&&(a=1),t.pinchScale=a;var o=center(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}},SILENT="silent";function makeEventPacket(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:stopEvent}}function stopEvent(){stop(this.event)}var EmptyProxy=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return __extends(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Eventful),HoveredResult=function(e,t){this.x=e,this.y=t},handlerNames=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Handler=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a._hovered=new HoveredResult(0,0),a.storage=t,a.painter=n,a.painterRoot=r,i=i||new EmptyProxy,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Draggable(a),a}return __extends(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(each(handlerNames,(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,i=isOutsideBoundary(this,t,n),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=i?new HoveredResult(t,n):this.findHover(t,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl,n=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!n&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new HoveredResult(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 i=(e=e||{}).target;if(!i||!i.silent){for(var r="on"+t,a=makeEventPacket(t,e,n);i&&(i[r]&&(a.cancelBubble=!!i[r].call(i,a)),i.trigger(t,a),i=i.__hostTarget?i.__hostTarget:i.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[r]&&e[r].call(e,a),e.trigger&&e.trigger(t,a)})))}},t.prototype.findHover=function(e,t,n){for(var i=this.storage.getDisplayList(),r=new HoveredResult(e,t),a=i.length-1;a>=0;a--){var o=void 0;if(i[a]!==n&&!i[a].ignore&&(o=isHover(i[a],e,t))&&(!r.topTarget&&(r.topTarget=i[a]),o!==SILENT)){r.target=i[a];break}}return r},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new GestureMgr);var n=this._gestureMgr;"start"===t&&n.clear();var i=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),i){var r=i.type;e.gestureEvent=r;var a=new HoveredResult;a.target=i.target,this.dispatchToElement(a,r,i.event)}},t}(Eventful);function isHover(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var i=e,r=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,n))return!1;i.silent&&(r=!0)}var s=i.__hostTarget;i=s||i.parent}return!r||SILENT}return!1}function isOutsideBoundary(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}function create$1(){return[1,0,0,1,0,0]}function identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function copy$1(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 mul$1(e,t,n){var i=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],o=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]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function translate(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 rotate(e,t,n){var i=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=i*c+o*u,e[1]=-i*u+o*c,e[2]=r*c+s*u,e[3]=-r*u+c*s,e[4]=c*a+u*l,e[5]=c*l-u*a,e}function scale$1(e,t,n){var i=n[0],r=n[1];return e[0]=t[0]*i,e[1]=t[1]*r,e[2]=t[2]*i,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*r,e}function invert(e,t){var n=t[0],i=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=n*o-a*i;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*r)*l,e[5]=(a*r-n*s)*l,e):null}function clone$2(e){var t=create$1();return copy$1(t,e),t}each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Handler.prototype[e]=function(t){var n,i,r=t.zrX,a=t.zrY,o=isOutsideBoundary(this,r,a);if("mouseup"===e&&o||(i=(n=this.findHover(r,a)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));var matrix=Object.freeze({__proto__:null,create:create$1,identity:identity,copy:copy$1,mul:mul$1,translate:translate,rotate:rotate,scale:scale$1,invert:invert,clone:clone$2}),mIdentity=identity,EPSILON=5e-5;function isNotAroundZero(e){return e>EPSILON||e<-EPSILON}var scaleTmp=[],tmpTransform=[],originTransform=create$1(),abs=Math.abs,Transformable=function(){function e(){}return 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.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return isNotAroundZero(this.rotation)||isNotAroundZero(this.x)||isNotAroundZero(this.y)||isNotAroundZero(this.scaleX-1)||isNotAroundZero(this.scaleY-1)},e.prototype.updateTransform=function(){var e=this.parent,t=e&&e.transform,n=this.needLocalTransform(),i=this.transform;n||t?(i=i||create$1(),n?this.getLocalTransform(i):mIdentity(i),t&&(n?mul$1(i,e.transform,i):copy$1(i,e.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&mIdentity(i)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(scaleTmp);var n=scaleTmp[0]<0?-1:1,i=scaleTmp[1]<0?-1:1,r=((scaleTmp[0]-n)*t+n)/scaleTmp[0]||0,a=((scaleTmp[1]-i)*t+i)/scaleTmp[1]||0;e[0]*=r,e[1]*=r,e[2]*=a,e[3]*=a}this.invTransform=this.invTransform||create$1(),invert(this.invTransform,e)},e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},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];isNotAroundZero(t-1)&&(t=Math.sqrt(t)),isNotAroundZero(n-1)&&(n=Math.sqrt(n)),e[0]<0&&(t=-t),e[3]<0&&(n=-n),this.rotation=Math.atan2(-e[1]/n,e[0]/t),t<0&&n<0&&(this.rotation+=Math.PI,t=-t,n=-n),this.x=e[4],this.y=e[5],this.scaleX=t,this.scaleY=n}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(mul$1(tmpTransform,e.invTransform,t),t=tmpTransform);var n=this.originX,i=this.originY;(n||i)&&(originTransform[4]=n,originTransform[5]=i,mul$1(tmpTransform,t,originTransform),tmpTransform[4]-=n,tmpTransform[5]-=i,t=tmpTransform),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],i=this.invTransform;return i&&applyTransform(n,n,i),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&applyTransform(n,n,i),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&abs(e[0]-1)>1e-10&&abs(e[3]-1)>1e-10?Math.sqrt(abs(e[0]*e[3]-e[2]*e[1])):1},e.getLocalTransform=function(e,t){mIdentity(t=t||[]);var n=e.originX||0,i=e.originY||0,r=e.scaleX,a=e.scaleY,o=e.rotation||0,s=e.x,l=e.y;return t[4]-=n,t[5]-=i,t[0]*=r,t[1]*=a,t[2]*=r,t[3]*=a,t[4]*=r,t[5]*=a,o&&rotate(t,t,o),t[4]+=n,t[5]+=i,t[4]+=s,t[5]+=l,t},e.initDefaultProps=function(){var t=e.prototype;t.x=0,t.y=0,t.scaleX=1,t.scaleY=1,t.originX=0,t.originY=0,t.rotation=0,t.globalScaleRatio=1}(),e}(),easing={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,i=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.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-easing.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*easing.bounceIn(2*e):.5*easing.bounceOut(2*e-1)+.5}},Clip=function(){function e(e){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}return e.prototype.step=function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),!this._paused){var n=(e-this._startTime-this._pausedTime)/this._life;n<0&&(n=0),n=Math.min(n,1);var i=this.easing,r="string"==typeof i?easing[i]:i,a="function"==typeof r?r(n):n;if(this.onframe&&this.onframe(a),1===n){if(!this.loop)return!0;this._restart(e),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=t},e.prototype._restart=function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e}(),Entry=function(e){this.value=e},LinkedList=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Entry(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}(),LRU=function(){function e(e){this._list=new LinkedList,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,r=null;if(null==i[e]){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Entry(t),o.key=e,n.insertEntry(o),i[e]=o}return r},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}(),kCSSColorTable={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 clampCssByte(e){return(e=Math.round(e))<0?0:e>255?255:e}function clampCssAngle(e){return(e=Math.round(e))<0?0:e>360?360:e}function clampCssFloat(e){return e<0?0:e>1?1:e}function parseCssInt(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?clampCssByte(parseFloat(t)/100*255):clampCssByte(parseInt(t,10))}function parseCssFloat(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?clampCssFloat(parseFloat(t)/100):clampCssFloat(parseFloat(t))}function cssHueToRgb(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 lerpNumber(e,t,n){return e+(t-e)*n}function setRgba(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function copyRgba(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var colorCache=new LRU(20),lastRemovedArr=null;function putToCache(e,t){lastRemovedArr&&copyRgba(lastRemovedArr,t),lastRemovedArr=colorCache.put(e,lastRemovedArr||t.slice())}function parse(e,t){if(e){t=t||[];var n=colorCache.get(e);if(n)return copyRgba(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in kCSSColorTable)return copyRgba(t,kCSSColorTable[i]),putToCache(e,t),t;var r,a=i.length;if("#"===i.charAt(0))return 4===a||5===a?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(setRgba(t,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===a?parseInt(i.slice(4),16)/15:1),putToCache(e,t),t):void setRgba(t,0,0,0,1):7===a||9===a?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(setRgba(t,(16711680&r)>>16,(65280&r)>>8,255&r,9===a?parseInt(i.slice(7),16)/255:1),putToCache(e,t),t):void setRgba(t,0,0,0,1):void 0;var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===a){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?setRgba(t,+u[0],+u[1],+u[2],1):setRgba(t,0,0,0,1);c=parseCssFloat(u.pop());case"rgb":return 3!==u.length?void setRgba(t,0,0,0,1):(setRgba(t,parseCssInt(u[0]),parseCssInt(u[1]),parseCssInt(u[2]),c),putToCache(e,t),t);case"hsla":return 4!==u.length?void setRgba(t,0,0,0,1):(u[3]=parseCssFloat(u[3]),hsla2rgba(u,t),putToCache(e,t),t);case"hsl":return 3!==u.length?void setRgba(t,0,0,0,1):(hsla2rgba(u,t),putToCache(e,t),t);default:return}}setRgba(t,0,0,0,1)}}function hsla2rgba(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=parseCssFloat(e[1]),r=parseCssFloat(e[2]),a=r<=.5?r*(i+1):r+i-r*i,o=2*r-a;return setRgba(t=t||[],clampCssByte(255*cssHueToRgb(o,a,n+1/3)),clampCssByte(255*cssHueToRgb(o,a,n)),clampCssByte(255*cssHueToRgb(o,a,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function rgba2hsla(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,p=((s-a)/6+l/2)/l;i===s?t=p-h:r===s?t=1/3+c-p:a===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var d=[360*t,n,u];return null!=e[3]&&d.push(e[3]),d}}function lift(e,t){var n=parse(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return stringify(n,4===n.length?"rgba":"rgb")}}function toHex(e){var t=parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function fastLerp(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),o=t[r],s=t[a],l=i-r;return n[0]=clampCssByte(lerpNumber(o[0],s[0],l)),n[1]=clampCssByte(lerpNumber(o[1],s[1],l)),n[2]=clampCssByte(lerpNumber(o[2],s[2],l)),n[3]=clampCssFloat(lerpNumber(o[3],s[3],l)),n}}var fastMapToColor=fastLerp;function lerp$1(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),o=parse(t[r]),s=parse(t[a]),l=i-r,u=stringify([clampCssByte(lerpNumber(o[0],s[0],l)),clampCssByte(lerpNumber(o[1],s[1],l)),clampCssByte(lerpNumber(o[2],s[2],l)),clampCssFloat(lerpNumber(o[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:a,value:i}:u}}var mapToColor=lerp$1;function modifyHSL(e,t,n,i){var r=parse(e);if(e)return r=rgba2hsla(r),null!=t&&(r[0]=clampCssAngle(t)),null!=n&&(r[1]=parseCssFloat(n)),null!=i&&(r[2]=parseCssFloat(i)),stringify(hsla2rgba(r),"rgba")}function modifyAlpha(e,t){var n=parse(e);if(n&&null!=t)return n[3]=clampCssFloat(t),stringify(n,"rgba")}function stringify(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 lum(e,t){var n=parse(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}function random(){return"rgb("+Math.round(255*Math.random())+","+Math.round(255*Math.random())+","+Math.round(255*Math.random())+")"}var color=Object.freeze({__proto__:null,parse:parse,lift:lift,toHex:toHex,fastLerp:fastLerp,fastMapToColor:fastMapToColor,lerp:lerp$1,mapToColor:mapToColor,modifyHSL:modifyHSL,modifyAlpha:modifyAlpha,stringify:stringify,lum:lum,random:random}),arraySlice=Array.prototype.slice;function interpolateNumber(e,t,n){return(t-e)*n+e}function step(e,t,n){return n>.5?t:e}function interpolate1DArray(e,t,n,i){for(var r=t.length,a=0;a<r;a++)e[a]=interpolateNumber(t[a],n[a],i)}function interpolate2DArray(e,t,n,i){for(var r=t.length,a=r&&t[0].length,o=0;o<r;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=interpolateNumber(t[o][s],n[o][s],i)}}function add1DArray(e,t,n,i){for(var r=t.length,a=0;a<r;a++)e[a]=t[a]+n[a]*i;return e}function add2DArray(e,t,n,i){for(var r=t.length,a=r&&t[0].length,o=0;o<r;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=t[o][s]+n[o][s]*i}return e}function fillArray(e,t,n){var i=e,r=t;if(i.push&&r.push){var a=i.length,o=r.length;if(a!==o)if(a>o)i.length=o;else for(var s=a;s<o;s++)i.push(1===n?r[s]:arraySlice.call(r[s]));var l=i[0]&&i[0].length;for(s=0;s<i.length;s++)if(1===n)isNaN(i[s])&&(i[s]=r[s]);else for(var u=0;u<l;u++)isNaN(i[s][u])&&(i[s][u]=r[s][u])}}function is1DArraySame(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function catmullRomInterpolate(e,t,n,i,r,a,o){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*o+(-3*(t-n)-2*s-l)*a+s*r+t}function catmullRomInterpolate1DArray(e,t,n,i,r,a,o,s){for(var l=t.length,u=0;u<l;u++)e[u]=catmullRomInterpolate(t[u],n[u],i[u],r[u],a,o,s)}function catmullRomInterpolate2DArray(e,t,n,i,r,a,o,s){for(var l=t.length,u=t[0].length,c=0;c<l;c++){e[c]||(e[1]=[]);for(var h=0;h<u;h++)e[c][h]=catmullRomInterpolate(t[c][h],n[c][h],i[c][h],r[c][h],a,o,s)}}function cloneValue(e){if(isArrayLike(e)){var t=e.length;if(isArrayLike(e[0])){for(var n=[],i=0;i<t;i++)n.push(arraySlice.call(e[i]));return n}return arraySlice.call(e)}return e}function rgba2String(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function guessArrayDim(e){return isArrayLike(e&&e[0])?2:1}var _ctx,_cachedFont,tmpRgba=[0,0,0,0],Track=function(){function e(e){this.keyframes=[],this.maxTime=0,this.arrDim=0,this.interpolable=!0,this._needsSort=!1,this._isAllValueEqual=!0,this._lastFrame=0,this._lastFramePercent=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._isAllValueEqual&&this.keyframes.length>=2&&this.interpolable},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t){e>=this.maxTime?this.maxTime=e:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(isArrayLike(t)){var r=guessArrayDim(t);if(i>0&&this.arrDim!==r)return void(this.interpolable=!1);if(1===r&&"number"!=typeof t[0]||2===r&&"number"!=typeof t[0][0])return void(this.interpolable=!1);if(i>0){var a=n[i-1];this._isAllValueEqual&&(1===r&&is1DArraySame(t,a.value)||(this._isAllValueEqual=!1))}this.arrDim=r}else{if(this.arrDim>0)return void(this.interpolable=!1);if("string"==typeof t){var o=parse(t);o?(t=o,this.isValueColor=!0):this.interpolable=!1}else if("number"!=typeof t)return void(this.interpolable=!1);if(this._isAllValueEqual&&i>0){a=n[i-1];(this.isValueColor&&!is1DArraySame(a.value,t)||a.value!==t)&&(this._isAllValueEqual=!1)}}var s={time:e,value:t,percent:0};return this.keyframes.push(s),s},e.prototype.prepare=function(e){var t=this.keyframes;this._needsSort&&t.sort((function(e,t){return e.time-t.time}));for(var n=this.arrDim,i=t.length,r=t[i-1],a=0;a<i;a++)t[a].percent=t[a].time/this.maxTime,n>0&&a!==i-1&&fillArray(t[a].value,r.value,n);if(e&&this.needsAnimate()&&e.needsAnimate()&&n===e.arrDim&&this.isValueColor===e.isValueColor&&!e._finished){this._additiveTrack=e;var o=t[0].value;for(a=0;a<i;a++)0===n?this.isValueColor?t[a].additiveValue=add1DArray([],t[a].value,o,-1):t[a].additiveValue=t[a].value-o:1===n?t[a].additiveValue=add1DArray([],t[a].value,o,-1):2===n&&(t[a].additiveValue=add2DArray([],t[a].value,o,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,i=null!=this._additiveTrack,r=i?"additiveValue":"value",a=this.keyframes,o=this.keyframes.length,s=this.propName,l=this.arrDim,u=this.isValueColor;if(t<0)n=0;else if(t<this._lastFramePercent){for(n=Math.min(this._lastFrame+1,o-1);n>=0&&!(a[n].percent<=t);n--);n=Math.min(n,o-2)}else{for(n=this._lastFrame;n<o&&!(a[n].percent>t);n++);n=Math.min(n-1,o-2)}var c=a[n+1],h=a[n];if(h&&c){this._lastFrame=n,this._lastFramePercent=t;var p=c.percent-h.percent;if(0!==p){var d=(t-h.percent)/p,f=i?this._additiveValue:u?tmpRgba:e[s];if((l>0||u)&&!f&&(f=this._additiveValue=[]),this.useSpline){var g=a[n][r],m=a[0===n?n:n-1][r],y=a[n>o-2?o-1:n+1][r],v=a[n>o-3?o-1:n+2][r];if(l>0)1===l?catmullRomInterpolate1DArray(f,m,g,y,v,d,d*d,d*d*d):catmullRomInterpolate2DArray(f,m,g,y,v,d,d*d,d*d*d);else if(u)catmullRomInterpolate1DArray(f,m,g,y,v,d,d*d,d*d*d),i||(e[s]=rgba2String(f));else{var _=void 0;_=this.interpolable?catmullRomInterpolate(m,g,y,v,d,d*d,d*d*d):y,i?this._additiveValue=_:e[s]=_}}else if(l>0)1===l?interpolate1DArray(f,h[r],c[r],d):interpolate2DArray(f,h[r],c[r],d);else if(u)interpolate1DArray(f,h[r],c[r],d),i||(e[s]=rgba2String(f));else{_=void 0;_=this.interpolable?interpolateNumber(h[r],c[r],d):step(h[r],c[r],d),i?this._additiveValue=_:e[s]=_}i&&this._addToTarget(e)}}}},e.prototype._addToTarget=function(e){var t=this.arrDim,n=this.propName,i=this._additiveValue;0===t?this.isValueColor?(parse(e[n],tmpRgba),add1DArray(tmpRgba,tmpRgba,i,1),e[n]=rgba2String(tmpRgba)):e[n]=e[n]+i:1===t?add1DArray(e[n],e[n],i,1):2===t&&add2DArray(e[n],e[n],i,1)},e}(),Animator=function(){function e(e,t,n){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&n?logError("Can' use additive animation on looped animation."):this._additiveAnimators=n}return e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t){return this.whenWithKeys(e,t,keys(t))},e.prototype.whenWithKeys=function(e,t,n){for(var i=this._tracks,r=0;r<n.length;r++){var a=n[r],o=i[a];if(!o){o=i[a]=new Track(a);var s=void 0,l=this._getAdditiveTrack(a);if(l){var u=l.keyframes[l.keyframes.length-1];s=u&&u.value,l.isValueColor&&s&&(s=rgba2String(s))}else s=this._target[a];if(null==s)continue;0!==e&&o.addKeyframe(0,cloneValue(s)),this._trackKeys.push(a)}o.addKeyframe(e,cloneValue(t[a]))}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._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneList;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._abortedList;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 i=0;i<n.length;i++){var r=n[i].getTrack(e);r&&(t=r)}return t},e.prototype.start=function(e,t){if(!(this._started>0)){this._started=1;for(var n=this,i=[],r=0;r<this._trackKeys.length;r++){var a=this._trackKeys[r],o=this._tracks[a],s=this._getAdditiveTrack(a),l=o.keyframes;if(o.prepare(s),o.needsAnimate())i.push(o);else if(!o.interpolable){var u=l[l.length-1];u&&(n._target[o.propName]=u.value)}}if(i.length||t){var c=new Clip({life:this._maxTime,loop:this._loop,delay:this._delay,onframe:function(e){n._started=2;var t=n._additiveAnimators;if(t){for(var r=!1,a=0;a<t.length;a++)if(t[a]._clip){r=!0;break}r||(n._additiveAnimators=null)}for(a=0;a<i.length;a++)i[a].step(n._target,e);var o=n._onframeList;if(o)for(a=0;a<o.length;a++)o[a](n._target,e)},ondestroy:function(){n._doneCallback()}});this._clip=c,this.animation&&this.animation.addClip(c),e&&"spline"!==e&&(c.easing=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._onframeList||(this._onframeList=[]),this._onframeList.push(e)),this},e.prototype.done=function(e){return e&&(this._doneList||(this._doneList=[]),this._doneList.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedList||(this._abortedList=[]),this._abortedList.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,i=this._trackKeys,r=0;r<e.length;r++){var a=n[e[r]];a&&(t?a.step(this._target,1):1===this._started&&a.step(this._target,0),a.setFinished())}var o=!0;for(r=0;r<i.length;r++)if(!n[i[r]].isFinished()){o=!1;break}return o&&this._abortedCallback(),o},e.prototype.saveFinalToTarget=function(e,t){if(e){t=t||this._trackKeys;for(var n=0;n<t.length;n++){var i=t[n],r=this._tracks[i];if(r&&!r.isFinished()){var a=r.keyframes,o=a[a.length-1];if(o){var s=cloneValue(o.value);r.isValueColor&&(s=rgba2String(s)),e[i]=s}}}}},e.prototype.__changeFinalValue=function(e,t){t=t||keys(e);for(var n=0;n<t.length;n++){var i=t[n],r=this._tracks[i];if(r){var a=r.keyframes;if(a.length>1){var o=a.pop();r.addKeyframe(o.time,e[i]),r.prepare(r.getAdditiveTrack())}}}},e}(),Point=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,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var r=1-i;e.x=r*t.x+i*n.x,e.y=r*t.y+i*n.y},e}(),mathMin=Math.min,mathMax=Math.max,lt=new Point,rb=new Point,lb=new Point,rt=new Point,minTv=new Point,maxTv=new Point,BoundingRect=function(){function e(e,t,n,i){n<0&&isFinite(n)&&(e+=n,n=-n),i<0&&isFinite(i)&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=mathMin(e.x,this.x),n=mathMin(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=mathMax(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=mathMax(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,i=e.height/t.height,r=create$1();return translate(r,r,[-t.x,-t.y]),scale$1(r,r,[n,i]),translate(r,r,[e.x,e.y]),r},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this,r=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,c=t.y,h=t.y+t.height,p=!(a<l||u<r||s<c||h<o);if(n){var d=1/0,f=0,g=Math.abs(a-l),m=Math.abs(u-r),y=Math.abs(s-c),v=Math.abs(h-o),_=Math.min(g,m),x=Math.min(y,v);a<l||u<r?_>f&&(f=_,g<m?Point.set(maxTv,-g,0):Point.set(maxTv,m,0)):_<d&&(d=_,g<m?Point.set(minTv,g,0):Point.set(minTv,-m,0)),s<c||h<o?x>f&&(f=x,y<v?Point.set(maxTv,0,-y):Point.set(maxTv,0,v)):_<d&&(d=_,y<v?Point.set(minTv,0,y):Point.set(minTv,0,-v))}return n&&Point.copy(n,p?minTv:maxTv),p},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,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],a=i[3],o=i[4],s=i[5];return t.x=n.x*r+o,t.y=n.y*a+s,t.width=n.width*r,t.height=n.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}lt.x=lb.x=n.x,lt.y=rt.y=n.y,rb.x=rt.x=n.x+n.width,rb.y=lb.y=n.y+n.height,lt.transform(i),rt.transform(i),rb.transform(i),lb.transform(i),t.x=mathMin(lt.x,rb.x,lb.x,rt.x),t.y=mathMin(lt.y,rb.y,lb.y,rt.y);var l=mathMax(lt.x,rb.x,lb.x,rt.x),u=mathMax(lt.y,rb.y,lb.y,rt.y);t.width=l-t.x,t.height=u-t.y}else t!==n&&e.copy(t,n)},e}(),textWidthCache={},DEFAULT_FONT="12px sans-serif";function defaultMeasureText(e,t){return _ctx||(_ctx=createCanvas().getContext("2d")),_cachedFont!==t&&(_cachedFont=_ctx.font=t||DEFAULT_FONT),_ctx.measureText(e)}var methods$1={measureText:defaultMeasureText};function getWidth(e,t){var n=textWidthCache[t=t||DEFAULT_FONT];n||(n=textWidthCache[t]=new LRU(500));var i=n.get(e);return null==i&&(i=methods$1.measureText(e,t).width,n.put(e,i)),i}function innerGetBoundingRect(e,t,n,i){var r=getWidth(e,t),a=getLineHeight(t),o=adjustTextX(0,r,n),s=adjustTextY(0,a,i);return new BoundingRect(o,s,r,a)}function getBoundingRect(e,t,n,i){var r=((e||"")+"").split("\n");if(1===r.length)return innerGetBoundingRect(r[0],t,n,i);for(var a=new BoundingRect(0,0,0,0),o=0;o<r.length;o++){var s=innerGetBoundingRect(r[o],t,n,i);0===o?a.copy(s):a.union(s)}return a}function adjustTextX(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function adjustTextY(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function getLineHeight(e){return getWidth("国",e)}function parsePercent(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function calculateTextPosition(e,t,n){var i=t.position||"inside",r=null!=t.distance?t.distance:5,a=n.height,o=n.width,s=a/2,l=n.x,u=n.y,c="left",h="top";if(i instanceof Array)l+=parsePercent(i[0],n.width),u+=parsePercent(i[1],n.height),c=null,h=null;else switch(i){case"left":l-=r,u+=s,c="right",h="middle";break;case"right":l+=r+o,u+=s,h="middle";break;case"top":l+=o/2,u-=r,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+r,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=r,u+=s,h="middle";break;case"insideRight":l+=o-r,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=r,c="center";break;case"insideBottom":l+=o/2,u+=a-r,c="center",h="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=o-r,u+=r,c="right";break;case"insideBottomLeft":l+=r,u+=a-r,h="bottom";break;case"insideBottomRight":l+=o-r,u+=a-r,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var dpr=1;"undefined"!=typeof window&&(dpr=Math.max(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var devicePixelRatio=dpr,DARK_MODE_THRESHOLD=.4,DARK_LABEL_COLOR="#333",LIGHT_LABEL_COLOR="#ccc",LIGHTER_LABEL_COLOR="#eee",PRESERVED_NORMAL_STATE="__zr_normal__",PRIMARY_STATES_KEYS=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],DEFAULT_ANIMATABLE_MAP={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},tmpTextPosCalcRes={},tmpBoundingRect=new BoundingRect(0,0,0,0),Element=function(){function e(e){this.id=guid(),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 i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[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,i=n.local,r=t.attachedTransform,a=void 0,o=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.x=t.x,r.y=t.y,r.originX=t.originX,r.originY=t.originY,r.rotation=t.rotation,r.scaleX=t.scaleX,r.scaleY=t.scaleY,null!=n.position){var u=tmpBoundingRect;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(tmpTextPosCalcRes,n,u):calculateTextPosition(tmpTextPosCalcRes,n,u),r.x=tmpTextPosCalcRes.x,r.y=tmpTextPosCalcRes.y,a=tmpTextPosCalcRes.align,o=tmpTextPosCalcRes.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,p=void 0;"center"===c?(h=.5*u.width,p=.5*u.height):(h=parsePercent(c[0],u.width),p=parsePercent(c[1],u.height)),l=!0,r.originX=-r.x+h+(i?0:u.x),r.originY=-r.y+p+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[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,y=void 0,v=void 0;f&&this.canBeInsideText()?(m=n.insideFill,y=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(m),v=!0)):(m=n.outsideFill,y=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(m),v=!0)),(m=m||"#000")===g.fill&&y===g.stroke&&v===g.autoStroke&&a===g.align&&o===g.verticalAlign||(s=!0,g.fill=m,g.stroke=y,g.autoStroke=v,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),s&&t.dirtyStyle(),t.markRedraw()}},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()?LIGHT_LABEL_COLOR:DARK_LABEL_COLOR},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&parse(t);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*i+(r?0:255)*(1-i);return n[3]=1,stringify(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||{},extend(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(isObject(e))for(var n=keys(e),i=0;i<n.length;i++){var r=n[i];this.attrKV(r,e[r])}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 i=this.animators[n],r=i.__fromStateTransition;if(!r||r===PRESERVED_NORMAL_STATE){var a=i.targetName,o=a?t[a]:t;i.saveFinalToTarget(o)}}},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,PRIMARY_STATES_KEYS)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var i=0;i<n.length;i++){var r=n[i];null==e[r]||r in t||(t[r]=this[r])}},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(PRESERVED_NORMAL_STATE,!1,e)},e.prototype.useState=function(t,n,i){var r=t===PRESERVED_NORMAL_STATE;if(this.hasState()||!r){var a=this.currentStates,o=this.stateTransition;if(!(indexOf(a,t)>=0)||!n&&1!==a.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!(!s||!s.hoverLayer);return l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,n,!i&&!this.__inHover&&o&&o.duration>0,o),this._textContent&&this._textContent.useState(t,n),this._textGuide&&this._textGuide.useState(t,n),r?(this.currentStates=[],this._normalState={}):n?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~e.REDARAW_BIT),s}logError("State "+t+" not exists.")}}},e.prototype.useStates=function(t,n){if(t.length){var i=[],r=this.currentStates,a=t.length,o=a===r.length;if(o)for(var s=0;s<a;s++)if(t[s]!==r[s]){o=!1;break}if(o)return;for(s=0;s<a;s++){var l=t[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,t)),u||(u=this.states[l]),u&&i.push(u)}var c=!(!i[a-1]||!i[a-1].hoverLayer);c&&this._toggleHoverLayerFlag(!0);var h=this._mergeStates(i),p=this.stateTransition;this.saveCurrentToNormalState(h),this._applyStateObj(t.join(","),h,this._normalState,!1,!n&&!this.__inHover&&p&&p.duration>0,p),this._textContent&&this._textContent.useStates(t),this._textGuide&&this._textGuide.useStates(t),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~e.REDARAW_BIT)}else this.clearStates()},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=indexOf(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 i=this.currentStates.slice(),r=indexOf(i,e),a=indexOf(i,t)>=0;r>=0?a?i.splice(r,1):i[r]=t:n&&!a&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i<e.length;i++){var r=e[i];extend(n,r),r.textConfig&&extend(t=t||{},r.textConfig)}return t&&(n.textConfig=t),n},e.prototype._applyStateObj=function(e,t,n,i,r,a){var o=!(t&&i);t&&t.textConfig?(this.textConfig=extend({},i?this.textConfig:n.textConfig),extend(this.textConfig,t.textConfig)):o&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<PRIMARY_STATES_KEYS.length;u++){var c=PRIMARY_STATES_KEYS[u],h=r&&DEFAULT_ANIMATABLE_MAP[c];t&&null!=t[c]?h?(l=!0,s[c]=t[c]):this[c]=t[c]:o&&null!=n[c]&&(h?(l=!0,s[c]=n[c]):this[c]=n[c])}if(!r)for(u=0;u<this.animators.length;u++){var p=this.animators[u],d=p.targetName;p.__changeFinalValue(d?(t||n)[d]:t||n)}l&&this._transitionState(e,s,a)},e.prototype._attachComponent=function(e){if(e.__zr&&!e.__hostTarget)throw new Error("Text element has been added to zrender.");if(e===this)throw new Error("Recursive component attachment.");var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this},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(),e.__zr&&!e.__hostTarget)throw new Error("Text element has been added to zrender.");e.attachedTransform=new Transformable,this._attachComponent(e),this._textContent=e,this.markRedraw()}},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),extend(this.textConfig,e),this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.attachedTransform=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|=e.REDARAW_BIT;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.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){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){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){var n=e?this[e]:this;if(n){var i=new Animator(n,t);return this.addAnimator(i,e),i}logError('Property "'+e+'" is not existed in element '+this.id)},e.prototype.addAnimator=function(e,t){var n=this.__zr,i=this;e.during((function(){i.updateDuringAnimation(t)})).done((function(){var t=i.animators,n=indexOf(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,i=n.length,r=[],a=0;a<i;a++){var o=n[a];e&&e!==o.scope?r.push(o):o.stop(t)}return this.animators=r,this},e.prototype.animateTo=function(e,t,n){animateTo(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){animateTo(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,i){for(var r=animateTo(this,t,n,i),a=0;a<r.length;a++)r[a].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.REDARAW_BIT=1,e.initDefaultProps=function(){var t=e.prototype;t.type="element",t.name="",t.ignore=!1,t.silent=!1,t.isGroup=!1,t.draggable=!1,t.dragging=!1,t.ignoreClip=!1,t.__inHover=!1,t.__dirty=e.REDARAW_BIT;var n={};function i(e,t,i){n[e+t+i]||(console.warn("DEPRECATED: '"+e+"' has been deprecated. use '"+t+"', '"+i+"' instead"),n[e+t+i]=!0)}function r(e,n,r,a){function o(e,t){Object.defineProperty(t,0,{get:function(){return e[r]},set:function(t){e[r]=t}}),Object.defineProperty(t,1,{get:function(){return e[a]},set:function(t){e[a]=t}})}Object.defineProperty(t,e,{get:function(){(i(e,r,a),this[n])||o(this,this[n]=[]);return this[n]},set:function(t){i(e,r,a),this[r]=t[0],this[a]=t[1],this[n]=t,o(this,t)}})}Object.defineProperty&&(!env.browser.ie||env.browser.version>8)&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),e}();function animateTo(e,t,n,i,r){var a=[];animateToShallow(e,"",e,t,n=n||{},i,a,r);var o=a.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--o<=0&&(s?l&&l():u&&u())},h=function(){--o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&n.during&&a[0].during((function(e,t){n.during(t)}));for(var p=0;p<a.length;p++){var d=a[p];c&&d.done(c),h&&d.aborted(h),d.start(n.easing,n.force)}return a}function copyArrShallow(e,t,n){for(var i=0;i<n;i++)e[i]=t[i]}function is2DArray(e){return isArrayLike(e[0])}function copyValue(e,t,n){if(isArrayLike(t[n]))if(isArrayLike(e[n])||(e[n]=[]),isTypedArray(t[n])){var i=t[n].length;e[n].length!==i&&(e[n]=new t[n].constructor(i),copyArrShallow(e[n],t[n],i))}else{var r=t[n],a=e[n],o=r.length;if(is2DArray(r))for(var s=r[0].length,l=0;l<o;l++)a[l]?copyArrShallow(a[l],r[l],s):a[l]=Array.prototype.slice.call(r[l]);else copyArrShallow(a,r,o);a.length=r.length}else e[n]=t[n]}function animateToShallow(e,t,n,i,r,a,o,s){for(var l=[],u=[],c=keys(i),h=r.duration,p=r.delay,d=r.additive,f=r.setToFinal,g=!isObject(a),m=0;m<c.length;m++){if(null!=n[A=c[m]]&&null!=i[A]&&(g||a[A]))if(isObject(i[A])&&!isArrayLike(i[A])){if(t){s||(n[A]=i[A],e.updateDuringAnimation(t));continue}animateToShallow(e,A,n[A],i[A],r,a&&a[A],o,s)}else l.push(A),u.push(A);else s||(n[A]=i[A],e.updateDuringAnimation(t),u.push(A))}var y=l.length;if(y>0||r.force&&!o.length){for(var v=e.animators,_=[],x=0;x<v.length;x++)v[x].targetName===t&&_.push(v[x]);if(!d&&_.length)for(x=0;x<_.length;x++){if(_[x].stopTracks(u)){var S=indexOf(v,_[x]);v.splice(S,1)}}var b=void 0,T=void 0,M=void 0;if(s){T={},f&&(b={});for(x=0;x<y;x++){T[A=l[x]]=n[A],f?b[A]=i[A]:n[A]=i[A]}}else if(f){M={};for(x=0;x<y;x++){var A;M[A=l[x]]=cloneValue(n[A]),copyValue(n,i,A)}}var I=new Animator(n,!1,d?_:null);I.targetName=t,r.scope&&(I.scope=r.scope),f&&b&&I.whenWithKeys(0,b,l),M&&I.whenWithKeys(0,M,l),I.whenWithKeys(null==h?500:h,s?T:i,l).delay(p||0),e.addAnimator(I,t),o.push(I)}}mixin(Element,Eventful),mixin(Element,Transformable);var DEFAULT_MIN_MERGE=32,DEFAULT_MIN_GALLOPING=7;function minRunLength(e){for(var t=0;e>=DEFAULT_MIN_MERGE;)t|=1&e,e>>=1;return e+t}function makeAscendingRun(e,t,n,i){var r=t+1;if(r===n)return 1;if(i(e[r++],e[t])<0){for(;r<n&&i(e[r],e[r-1])<0;)r++;reverseRun(e,t,r)}else for(;r<n&&i(e[r],e[r-1])>=0;)r++;return r-t}function reverseRun(e,t,n){for(n--;t<n;){var i=e[t];e[t++]=e[n],e[n--]=i}}function binaryInsertionSort(e,t,n,i,r){for(i===t&&i++;i<n;i++){for(var a,o=e[i],s=t,l=i;s<l;)r(o,e[a=s+l>>>1])<0?l=a:s=a+1;var u=i-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]=o}}function gallopLeft(e,t,n,i,r,a){var o=0,s=0,l=1;if(a(e,t[n+r])>0){for(s=i-r;l<s&&a(e,t[n+r+l])>0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;l<s&&a(e,t[n+r-l])<=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o<l;){var c=o+(l-o>>>1);a(e,t[n+c])>0?o=c+1:l=c}return l}function gallopRight(e,t,n,i,r,a){var o=0,s=0,l=1;if(a(e,t[n+r])<0){for(s=r+1;l<s&&a(e,t[n+r-l])<0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=i-r;l<s&&a(e,t[n+r+l])>=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o<l;){var c=o+(l-o>>>1);a(e,t[n+c])<0?l=c:o=c+1}return l}function TimSort(e,t){var n,i,r=DEFAULT_MIN_GALLOPING,a=0;e.length;var o=[];function s(s){var l=n[s],u=i[s],c=n[s+1],h=i[s+1];i[s]=u+h,s===a-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),a--;var p=gallopRight(e[c],e,l,u,0,t);l+=p,0!==(u-=p)&&0!==(h=gallopLeft(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,i,a,s){var l=0;for(l=0;l<i;l++)o[l]=e[n+l];var u=0,c=a,h=n;if(e[h++]=e[c++],0==--s){for(l=0;l<i;l++)e[h+l]=o[u+l];return}if(1===i){for(l=0;l<s;l++)e[h+l]=e[c+l];return void(e[h+s]=o[u])}var p,d,f,g=r;for(;;){p=0,d=0,f=!1;do{if(t(e[c],o[u])<0){if(e[h++]=e[c++],d++,p=0,0==--s){f=!0;break}}else if(e[h++]=o[u++],p++,d=0,1==--i){f=!0;break}}while((p|d)<g);if(f)break;do{if(0!==(p=gallopRight(e[c],o,u,i,0,t))){for(l=0;l<p;l++)e[h+l]=o[u+l];if(h+=p,u+=p,(i-=p)<=1){f=!0;break}}if(e[h++]=e[c++],0==--s){f=!0;break}if(0!==(d=gallopLeft(o[u],e,c,s,0,t))){for(l=0;l<d;l++)e[h+l]=e[c+l];if(h+=d,c+=d,0===(s-=d)){f=!0;break}}if(e[h++]=o[u++],1==--i){f=!0;break}g--}while(p>=DEFAULT_MIN_GALLOPING||d>=DEFAULT_MIN_GALLOPING);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l<s;l++)e[h+l]=e[c+l];e[h+s]=o[u]}else{if(0===i)throw new Error;for(l=0;l<i;l++)e[h+l]=o[u+l]}}(l,u,c,h):function(n,i,a,s){var l=0;for(l=0;l<s;l++)o[l]=e[a+l];var u=n+i-1,c=s-1,h=a+s-1,p=0,d=0;if(e[h--]=e[u--],0==--i){for(p=h-(s-1),l=0;l<s;l++)e[p+l]=o[l];return}if(1===s){for(d=(h-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)e[d+l]=e[p+l];return void(e[h]=o[c])}var f=r;for(;;){var g=0,m=0,y=!1;do{if(t(o[c],e[u])<0){if(e[h--]=e[u--],g++,m=0,0==--i){y=!0;break}}else if(e[h--]=o[c--],m++,g=0,1==--s){y=!0;break}}while((g|m)<f);if(y)break;do{if(0!==(g=i-gallopRight(o[c],e,n,i,i-1,t))){for(i-=g,d=(h-=g)+1,p=(u-=g)+1,l=g-1;l>=0;l--)e[d+l]=e[p+l];if(0===i){y=!0;break}}if(e[h--]=o[c--],1==--s){y=!0;break}if(0!==(m=s-gallopLeft(e[u],o,0,s,s-1,t))){for(s-=m,d=(h-=m)+1,p=(c-=m)+1,l=0;l<m;l++)e[d+l]=o[p+l];if(s<=1){y=!0;break}}if(e[h--]=e[u--],0==--i){y=!0;break}f--}while(g>=DEFAULT_MIN_GALLOPING||m>=DEFAULT_MIN_GALLOPING);if(y)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===s){for(d=(h-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)e[d+l]=e[p+l];e[h]=o[c]}else{if(0===s)throw new Error;for(p=h-(s-1),l=0;l<s;l++)e[p+l]=o[l]}}(l,u,c,h))}return n=[],i=[],{mergeRuns:function(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]<i[e+1]&&e--;else if(i[e]>i[e+1])break;s(e)}},forceMergeRuns:function(){for(;a>1;){var e=a-2;e>0&&i[e-1]<i[e+1]&&e--,s(e)}},pushRun:function(e,t){n[a]=e,i[a]=t,a+=1}}}function sort(e,t,n,i){n||(n=0),i||(i=e.length);var r=i-n;if(!(r<2)){var a=0;if(r<DEFAULT_MIN_MERGE)binaryInsertionSort(e,n,i,n+(a=makeAscendingRun(e,n,i,t)),t);else{var o=TimSort(e,t),s=minRunLength(r);do{if((a=makeAscendingRun(e,n,i,t))<s){var l=r;l>s&&(l=s),binaryInsertionSort(e,n,n+l,n+a,t),a=l}o.pushRun(n,a),o.mergeRuns(),r-=a,n+=a}while(0!==r);o.forceMergeRuns()}}}var invalidZErrorLogged=!1;function logInvalidZError(){invalidZErrorLogged||(invalidZErrorLogged=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function shapeCompareFunc(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var requestAnimationFrame,Storage=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=shapeCompareFunc}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,i=0,r=t.length;i<r;i++)this._updateAndAddDisplayable(t[i],null,e);n.length=this._displayListLen,env.canvasSupported&&sort(n,shapeCompareFunc)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var i=e.getClipPath();if(e.ignoreClip)t=null;else if(i){t=t?t.slice():[];for(var r=i,a=e;r;)r.parent=a,r.updateTransform(),t.push(r),a=r,r=r.getClipPath()}if(e.childrenRef){for(var o=e.childrenRef(),s=0;s<o.length;s++){var l=o[s];e.__dirty&&(l.__dirty|=Element.REDARAW_BIT),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)&&(logInvalidZError(),u.z=0),isNaN(u.z2)&&(logInvalidZError(),u.z2=0),isNaN(u.zlevel)&&(logInvalidZError(),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 p=e.getTextContent();p&&this._updateAndAddDisplayable(p,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 i=indexOf(this._roots,e);i>=0&&this._roots.splice(i,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}(),requestAnimationFrame$1=requestAnimationFrame="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},Animation=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.onframe=t.onframe||function(){},n}return __extends(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._clipsHead?(this._clipsTail.next=e,e.prev=this._clipsTail,e.next=null,this._clipsTail=e):this._clipsHead=this._clipsTail=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._clipsHead=n,n?n.prev=t:this._clipsTail=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=(new Date).getTime()-this._pausedTime,n=t-this._time,i=this._clipsHead;i;){var r=i.next;i.step(t,n)?(i.ondestroy&&i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=t,e||(this.onframe(n),this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,requestAnimationFrame$1((function t(){e._running&&(requestAnimationFrame$1(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._clipsHead;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._clipsHead=this._clipsTail=null},t.prototype.isFinished=function(){return null==this._clipsHead},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Animator(e,t.loop);return this.addAnimator(n),n},t}(Eventful),TOUCH_CLICK_DELAY=300,globalEventSupported=env.domSupported,localNativeListenerNames=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:["touchstart","touchend","touchmove"],pointer:map(e,(function(e){var n=e.replace("mouse","pointer");return t.hasOwnProperty(n)?n:e}))}}(),globalNativeListenerNames={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wheelEventSupported=!1;function isPointerFromTouch(e){var t=e.pointerType;return"pen"===t||"touch"===t}function setTouchTimer(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}function markTouch(e){e&&(e.zrByTouch=!0)}function normalizeGlobalEvent(e,t){return normalizeEvent(e.dom,new FakeGlobalEvent(e,t),!0)}function isLocalEl(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var FakeGlobalEvent=function(e,t){this.stopPropagation=noop,this.stopImmediatePropagation=noop,this.preventDefault=noop,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},localDOMHandlers={mousedown:function(e){e=normalizeEvent(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=normalizeEvent(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=normalizeEvent(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){if(e.target===this.dom){e=normalizeEvent(this.dom,e),this.__pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=isLocalEl(this,t),this.trigger("mouseout",e)}},wheel:function(e){wheelEventSupported=!0,e=normalizeEvent(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){wheelEventSupported||(e=normalizeEvent(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),localDOMHandlers.mousemove.call(this,e),localDOMHandlers.mousedown.call(this,e)},touchmove:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.handler.processGesture(e,"change"),localDOMHandlers.mousemove.call(this,e)},touchend:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.handler.processGesture(e,"end"),localDOMHandlers.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<TOUCH_CLICK_DELAY&&localDOMHandlers.click.call(this,e)},pointerdown:function(e){localDOMHandlers.mousedown.call(this,e)},pointermove:function(e){isPointerFromTouch(e)||localDOMHandlers.mousemove.call(this,e)},pointerup:function(e){localDOMHandlers.mouseup.call(this,e)},pointerout:function(e){isPointerFromTouch(e)||localDOMHandlers.mouseout.call(this,e)}};each(["click","dblclick","contextmenu"],(function(e){localDOMHandlers[e]=function(t){t=normalizeEvent(this.dom,t),this.trigger(e,t)}}));var globalDOMHandlers={pointermove:function(e){isPointerFromTouch(e)||globalDOMHandlers.mousemove.call(this,e)},pointerup:function(e){globalDOMHandlers.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 mountLocalDOMEventListeners(e,t){var n=t.domHandlers;env.pointerEventsSupported?each(localNativeListenerNames.pointer,(function(i){mountSingleDOMEventListener(t,i,(function(t){n[i].call(e,t)}))})):(env.touchEventsSupported&&each(localNativeListenerNames.touch,(function(i){mountSingleDOMEventListener(t,i,(function(r){n[i].call(e,r),setTouchTimer(t)}))})),each(localNativeListenerNames.mouse,(function(i){mountSingleDOMEventListener(t,i,(function(r){r=getNativeEvent(r),t.touching||n[i].call(e,r)}))})))}function mountGlobalDOMEventListeners(e,t){function n(n){mountSingleDOMEventListener(t,n,(function(i){i=getNativeEvent(i),isLocalEl(e,i.target)||(i=normalizeGlobalEvent(e,i),t.domHandlers[n].call(e,i))}),{capture:!0})}env.pointerEventsSupported?each(globalNativeListenerNames.pointer,n):env.touchEventsSupported||each(globalNativeListenerNames.mouse,n)}function mountSingleDOMEventListener(e,t,n,i){e.mounted[t]=n,e.listenerOpts[t]=i,addEventListener(e.domTarget,t,n,i)}function unmountDOMEventListeners(e){var t=e.mounted;for(var n in t)t.hasOwnProperty(n)&&removeEventListener(e.domTarget,n,t[n],e.listenerOpts[n]);e.mounted={}}var DOMHandlerScope=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},HandlerDomProxy=function(e){function t(t,n){var i=e.call(this)||this;return i.__pointerCapturing=!1,i.dom=t,i.painterRoot=n,i._localHandlerScope=new DOMHandlerScope(t,localDOMHandlers),globalEventSupported&&(i._globalHandlerScope=new DOMHandlerScope(document,globalDOMHandlers)),mountLocalDOMEventListeners(i,i._localHandlerScope),i}return __extends(t,e),t.prototype.dispose=function(){unmountDOMEventListeners(this._localHandlerScope),globalEventSupported&&unmountDOMEventListeners(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,globalEventSupported&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?mountGlobalDOMEventListeners(this,t):unmountDOMEventListeners(t)}},t}(Eventful),STYLE_MAGIC_KEY="__zr_style_"+Math.round(10*Math.random()),DEFAULT_COMMON_STYLE={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},DEFAULT_COMMON_ANIMATION_PROPS={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY]=!0;var PRIMARY_STATES_KEYS$1=["z","z2","invisible"],Displayable=function(e){function t(t){return e.call(this,t)||this}var n;return __extends(t,e),t.prototype._init=function(t){for(var n=keys(t),i=0;i<n.length;i++){var r=n[i];"style"===r?this.useStyle(t[r]):e.prototype.attrKV.call(this,r,t[r])}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,i){var r=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&isDisplayableCulled(this,e,t)||r&&!r[0]&&!r[3])return!1;if(n&&this.__clipPaths)for(var a=0;a<this.__clipPaths.length;++a)if(this.__clipPaths[a].isZeroArea())return!1;if(i&&this.parent)for(var o=this.parent;o;){if(o.ignore)return!1;o=o.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(),i=this.style,r=i.shadowBlur||0,a=i.shadowOffsetX||0,o=i.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new BoundingRect(0,0,0,0)),t?BoundingRect.applyTransform(e,n,t):e.copy(n),(r||a||o)&&(e.width+=2*r+Math.abs(a),e.height+=2*r+Math.abs(o),e.x=Math.min(e.x,e.x+a-r),e.y=Math.min(e.y,e.y+o-r));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 BoundingRect(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:extend(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(){this.markRedraw(),this.__dirty|=t.STYLE_CHANGED_BIT,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&t.STYLE_CHANGED_BIT)},t.prototype.styleUpdated=function(){this.__dirty&=~t.STYLE_CHANGED_BIT},t.prototype.createStyle=function(e){return createObject(DEFAULT_COMMON_STYLE,e)},t.prototype.useStyle=function(e){e[STYLE_MAGIC_KEY]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[STYLE_MAGIC_KEY]},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,PRIMARY_STATES_KEYS$1)},t.prototype._applyStateObj=function(t,n,i,r,a,o){e.prototype._applyStateObj.call(this,t,n,i,r,a,o);var s,l=!(n&&r);if(n&&n.style?a?r?s=n.style:(s=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),r?this.style:i.style),this._mergeStyle(s,n.style)):l&&(s=i.style),s)if(a){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var c=keys(u),h=0;h<c.length;h++){(d=c[h])in s&&(s[d]=s[d],this.style[d]=u[d])}var p=keys(s);for(h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(t,{style:s},o,this.getAnimationStyleProps())}else this.useStyle(s);for(h=0;h<PRIMARY_STATES_KEYS$1.length;h++){d=PRIMARY_STATES_KEYS$1[h];n&&null!=n[d]?this[d]=n[d]:l&&null!=i[d]&&(this[d]=i[d])}},t.prototype._mergeStates=function(t){for(var n,i=e.prototype._mergeStates.call(this,t),r=0;r<t.length;r++){var a=t[r];a.style&&(n=n||{},this._mergeStyle(n,a.style))}return n&&(i.style=n),i},t.prototype._mergeStyle=function(e,t){return extend(e,t),e},t.prototype.getAnimationStyleProps=function(){return DEFAULT_COMMON_ANIMATION_PROPS},t.STYLE_CHANGED_BIT=2,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=Element.REDARAW_BIT|t.STYLE_CHANGED_BIT)),t}(Element),tmpRect=new BoundingRect(0,0,0,0),viewRect=new BoundingRect(0,0,0,0);function isDisplayableCulled(e,t,n){return tmpRect.copy(e.getBoundingRect()),e.transform&&tmpRect.applyTransform(e.transform),viewRect.width=t,viewRect.height=n,!tmpRect.intersect(viewRect)}var mathPow=Math.pow,mathSqrt=Math.sqrt,EPSILON$1=1e-8,EPSILON_NUMERIC=1e-4,THREE_SQRT=mathSqrt(3),ONE_THIRD=1/3,_v0=create(),_v1=create(),_v2=create();function isAroundZero(e){return e>-EPSILON$1&&e<EPSILON$1}function isNotAroundZero$1(e){return e>EPSILON$1||e<-EPSILON$1}function cubicAt(e,t,n,i,r){var a=1-r;return a*a*(a*e+3*r*t)+r*r*(r*i+3*a*n)}function cubicDerivativeAt(e,t,n,i,r){var a=1-r;return 3*(((t-e)*a+2*(n-t)*r)*a+(i-n)*r*r)}function cubicRootAt(e,t,n,i,r,a){var o=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-r,c=s*s-3*o*l,h=s*l-9*o*u,p=l*l-3*s*u,d=0;if(isAroundZero(c)&&isAroundZero(h)){if(isAroundZero(s))a[0]=0;else(M=-l/s)>=0&&M<=1&&(a[d++]=M)}else{var f=h*h-4*c*p;if(isAroundZero(f)){var g=h/c,m=-g/2;(M=-s/o+g)>=0&&M<=1&&(a[d++]=M),m>=0&&m<=1&&(a[d++]=m)}else if(f>0){var y=mathSqrt(f),v=c*s+1.5*o*(-h+y),_=c*s+1.5*o*(-h-y);(M=(-s-((v=v<0?-mathPow(-v,ONE_THIRD):mathPow(v,ONE_THIRD))+(_=_<0?-mathPow(-_,ONE_THIRD):mathPow(_,ONE_THIRD))))/(3*o))>=0&&M<=1&&(a[d++]=M)}else{var x=(2*c*s-3*o*h)/(2*mathSqrt(c*c*c)),S=Math.acos(x)/3,b=mathSqrt(c),T=Math.cos(S),M=(-s-2*b*T)/(3*o),A=(m=(-s+b*(T+THREE_SQRT*Math.sin(S)))/(3*o),(-s+b*(T-THREE_SQRT*Math.sin(S)))/(3*o));M>=0&&M<=1&&(a[d++]=M),m>=0&&m<=1&&(a[d++]=m),A>=0&&A<=1&&(a[d++]=A)}}return d}function cubicExtrema(e,t,n,i,r){var a=6*n-12*t+6*e,o=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(isAroundZero(o)){if(isNotAroundZero$1(a))(c=-s/a)>=0&&c<=1&&(r[l++]=c)}else{var u=a*a-4*o*s;if(isAroundZero(u))r[0]=-a/(2*o);else if(u>0){var c,h=mathSqrt(u),p=(-a-h)/(2*o);(c=(-a+h)/(2*o))>=0&&c<=1&&(r[l++]=c),p>=0&&p<=1&&(r[l++]=p)}}return l}function cubicSubdivide(e,t,n,i,r,a){var o=(t-e)*r+e,s=(n-t)*r+t,l=(i-n)*r+n,u=(s-o)*r+o,c=(l-s)*r+s,h=(c-u)*r+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=i}function cubicProjectPoint(e,t,n,i,r,a,o,s,l,u,c){var h,p,d,f,g,m=.005,y=1/0;_v0[0]=l,_v0[1]=u;for(var v=0;v<1;v+=.05)_v1[0]=cubicAt(e,n,r,o,v),_v1[1]=cubicAt(t,i,a,s,v),(f=distSquare(_v0,_v1))<y&&(h=v,y=f);y=1/0;for(var _=0;_<32&&!(m<EPSILON_NUMERIC);_++)p=h-m,d=h+m,_v1[0]=cubicAt(e,n,r,o,p),_v1[1]=cubicAt(t,i,a,s,p),f=distSquare(_v1,_v0),p>=0&&f<y?(h=p,y=f):(_v2[0]=cubicAt(e,n,r,o,d),_v2[1]=cubicAt(t,i,a,s,d),g=distSquare(_v2,_v0),d<=1&&g<y?(h=d,y=g):m*=.5);return c&&(c[0]=cubicAt(e,n,r,o,h),c[1]=cubicAt(t,i,a,s,h)),mathSqrt(y)}function cubicLength(e,t,n,i,r,a,o,s,l){for(var u=e,c=t,h=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=cubicAt(e,n,r,o,f),m=cubicAt(t,i,a,s,f),y=g-u,v=m-c;h+=Math.sqrt(y*y+v*v),u=g,c=m}return h}function quadraticAt(e,t,n,i){var r=1-i;return r*(r*e+2*i*t)+i*i*n}function quadraticDerivativeAt(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function quadraticRootAt(e,t,n,i,r){var a=e-2*t+n,o=2*(t-e),s=e-i,l=0;if(isAroundZero(a)){if(isNotAroundZero$1(o))(c=-s/o)>=0&&c<=1&&(r[l++]=c)}else{var u=o*o-4*a*s;if(isAroundZero(u))(c=-o/(2*a))>=0&&c<=1&&(r[l++]=c);else if(u>0){var c,h=mathSqrt(u),p=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(r[l++]=c),p>=0&&p<=1&&(r[l++]=p)}}return l}function quadraticExtremum(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function quadraticSubdivide(e,t,n,i,r){var a=(t-e)*i+e,o=(n-t)*i+t,s=(o-a)*i+a;r[0]=e,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=n}function quadraticProjectPoint(e,t,n,i,r,a,o,s,l){var u,c=.005,h=1/0;_v0[0]=o,_v0[1]=s;for(var p=0;p<1;p+=.05){_v1[0]=quadraticAt(e,n,r,p),_v1[1]=quadraticAt(t,i,a,p),(m=distSquare(_v0,_v1))<h&&(u=p,h=m)}h=1/0;for(var d=0;d<32&&!(c<EPSILON_NUMERIC);d++){var f=u-c,g=u+c;_v1[0]=quadraticAt(e,n,r,f),_v1[1]=quadraticAt(t,i,a,f);var m=distSquare(_v1,_v0);if(f>=0&&m<h)u=f,h=m;else{_v2[0]=quadraticAt(e,n,r,g),_v2[1]=quadraticAt(t,i,a,g);var y=distSquare(_v2,_v0);g<=1&&y<h?(u=g,h=y):c*=.5}}return l&&(l[0]=quadraticAt(e,n,r,u),l[1]=quadraticAt(t,i,a,u)),mathSqrt(h)}function quadraticLength(e,t,n,i,r,a,o){for(var s=e,l=t,u=0,c=1/o,h=1;h<=o;h++){var p=h*c,d=quadraticAt(e,n,r,p),f=quadraticAt(t,i,a,p),g=d-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=d,l=f}return u}var mathMin$1=Math.min,mathMax$1=Math.max,mathSin=Math.sin,mathCos=Math.cos,PI2=2*Math.PI,start=create(),end=create(),extremity=create();function fromPoints(e,t,n){if(0!==e.length){for(var i=e[0],r=i[0],a=i[0],o=i[1],s=i[1],l=1;l<e.length;l++)i=e[l],r=mathMin$1(r,i[0]),a=mathMax$1(a,i[0]),o=mathMin$1(o,i[1]),s=mathMax$1(s,i[1]);t[0]=r,t[1]=o,n[0]=a,n[1]=s}}function fromLine(e,t,n,i,r,a){r[0]=mathMin$1(e,n),r[1]=mathMin$1(t,i),a[0]=mathMax$1(e,n),a[1]=mathMax$1(t,i)}var xDim=[],yDim=[];function fromCubic(e,t,n,i,r,a,o,s,l,u){var c=cubicExtrema,h=cubicAt,p=c(e,n,r,o,xDim);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var d=0;d<p;d++){var f=h(e,n,r,o,xDim[d]);l[0]=mathMin$1(f,l[0]),u[0]=mathMax$1(f,u[0])}p=c(t,i,a,s,yDim);for(d=0;d<p;d++){var g=h(t,i,a,s,yDim[d]);l[1]=mathMin$1(g,l[1]),u[1]=mathMax$1(g,u[1])}l[0]=mathMin$1(e,l[0]),u[0]=mathMax$1(e,u[0]),l[0]=mathMin$1(o,l[0]),u[0]=mathMax$1(o,u[0]),l[1]=mathMin$1(t,l[1]),u[1]=mathMax$1(t,u[1]),l[1]=mathMin$1(s,l[1]),u[1]=mathMax$1(s,u[1])}function fromQuadratic(e,t,n,i,r,a,o,s){var l=quadraticExtremum,u=quadraticAt,c=mathMax$1(mathMin$1(l(e,n,r),1),0),h=mathMax$1(mathMin$1(l(t,i,a),1),0),p=u(e,n,r,c),d=u(t,i,a,h);o[0]=mathMin$1(e,r,p),o[1]=mathMin$1(t,a,d),s[0]=mathMax$1(e,r,p),s[1]=mathMax$1(t,a,d)}function fromArc(e,t,n,i,r,a,o,s,l){var u=min,c=max,h=Math.abs(r-a);if(h%PI2<1e-4&&h>1e-4)return s[0]=e-n,s[1]=t-i,l[0]=e+n,void(l[1]=t+i);if(start[0]=mathCos(r)*n+e,start[1]=mathSin(r)*i+t,end[0]=mathCos(a)*n+e,end[1]=mathSin(a)*i+t,u(s,start,end),c(l,start,end),(r%=PI2)<0&&(r+=PI2),(a%=PI2)<0&&(a+=PI2),r>a&&!o?a+=PI2:r<a&&o&&(r+=PI2),o){var p=a;a=r,r=p}for(var d=0;d<a;d+=Math.PI/2)d>r&&(extremity[0]=mathCos(d)*n+e,extremity[1]=mathSin(d)*i+t,u(s,extremity,s),c(l,extremity,l))}var CMD={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tmpOutX=[],tmpOutY=[],min$1=[],max$1=[],min2=[],max2=[],mathMin$2=Math.min,mathMax$2=Math.max,mathCos$1=Math.cos,mathSin$1=Math.sin,mathSqrt$1=Math.sqrt,mathAbs=Math.abs,PI=Math.PI,PI2$1=2*PI,hasTypedArray="undefined"!=typeof Float32Array,tmpAngles=[];function modPI2(e){return Math.round(e/PI*1e8)/1e8%2*PI}function normalizeArcAngles(e,t){var n=modPI2(e[0]);n<0&&(n+=PI2$1);var i=n-e[0],r=e[1];r+=i,!t&&r-n>=PI2$1?r=n+PI2$1:t&&n-r>=PI2$1?r=n-PI2$1:!t&&n>r?r=n+(PI2$1-modPI2(n-r)):t&&n<r&&(r=n-(PI2$1-modPI2(r-n))),e[0]=n,e[1]=r}var PathProxy=function(){function e(e){this.dpr=1,this._version=0,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=mathAbs(n/devicePixelRatio/e)||0,this._uy=mathAbs(n/devicePixelRatio/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._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this.addData(CMD.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=mathAbs(e-this._xi)>this._ux||mathAbs(t-this._yi)>this._uy||this._len<5;return this.addData(CMD.L,e,t),this._ctx&&n&&(this._needsDash?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),n&&(this._xi=e,this._yi=t),this},e.prototype.bezierCurveTo=function(e,t,n,i,r,a){return this.addData(CMD.C,e,t,n,i,r,a),this._ctx&&(this._needsDash?this._dashedBezierTo(e,t,n,i,r,a):this._ctx.bezierCurveTo(e,t,n,i,r,a)),this._xi=r,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,i){return this.addData(CMD.Q,e,t,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(e,t,n,i):this._ctx.quadraticCurveTo(e,t,n,i)),this._xi=n,this._yi=i,this},e.prototype.arc=function(e,t,n,i,r,a){tmpAngles[0]=i,tmpAngles[1]=r,normalizeArcAngles(tmpAngles,a),i=tmpAngles[0];var o=(r=tmpAngles[1])-i;return this.addData(CMD.A,e,t,n,n,i,o,0,a?0:1),this._ctx&&this._ctx.arc(e,t,n,i,r,a),this._xi=mathCos$1(r)*n+e,this._yi=mathSin$1(r)*n+t,this},e.prototype.arcTo=function(e,t,n,i,r){return this._ctx&&this._ctx.arcTo(e,t,n,i,r),this},e.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this.addData(CMD.R,e,t,n,i),this},e.prototype.closePath=function(){this.addData(CMD.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&(this._needsDash&&this._dashedLineTo(t,n),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.setLineDash=function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,n=0;n<e.length;n++)t+=e[n];this._dashSum=t,this._needsDash=!0}else this._lineDash=null,this._needsDash=!1;return this},e.prototype.setLineDashOffset=function(e){return this._dashOffset=e,this},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;this.data&&this.data.length===t||!hasTypedArray||(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,i=this._len,r=0;r<t;r++)n+=e[r].len();hasTypedArray&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+n));for(r=0;r<t;r++)for(var a=e[r].data,o=0;o<a.length;o++)this.data[i++]=a[o];this._len=i},e.prototype.addData=function(e,t,n,i,r,a,o,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._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._dashedLineTo=function(e,t){var n,i,r=this._dashSum,a=this._lineDash,o=this._ctx,s=this._dashOffset,l=this._xi,u=this._yi,c=e-l,h=t-u,p=mathSqrt$1(c*c+h*h),d=l,f=u,g=a.length;for(s<0&&(s=r+s),d-=(s%=r)*(c/=p),f-=s*(h/=p);c>0&&d<=e||c<0&&d>=e||0===c&&(h>0&&f<=t||h<0&&f>=t);)d+=c*(n=a[i=this._dashIdx]),f+=h*n,this._dashIdx=(i+1)%g,c>0&&d<l||c<0&&d>l||h>0&&f<u||h<0&&f>u||o[i%2?"moveTo":"lineTo"](c>=0?mathMin$2(d,e):mathMax$2(d,e),h>=0?mathMin$2(f,t):mathMax$2(f,t));c=d-e,h=f-t,this._dashOffset=-mathSqrt$1(c*c+h*h)},e.prototype._dashedBezierTo=function(e,t,n,i,r,a){var o,s,l,u,c,h=this._ctx,p=this._dashSum,d=this._dashOffset,f=this._lineDash,g=this._xi,m=this._yi,y=0,v=this._dashIdx,_=f.length,x=0;for(d<0&&(d=p+d),d%=p,o=0;o<1;o+=.1)s=cubicAt(g,e,n,r,o+.1)-cubicAt(g,e,n,r,o),l=cubicAt(m,t,i,a,o+.1)-cubicAt(m,t,i,a,o),y+=mathSqrt$1(s*s+l*l);for(;v<_&&!((x+=f[v])>d);v++);for(o=(x-d)/y;o<=1;)u=cubicAt(g,e,n,r,o),c=cubicAt(m,t,i,a,o),v%2?h.moveTo(u,c):h.lineTo(u,c),o+=f[v]/y,v=(v+1)%_;v%2!=0&&h.lineTo(r,a),s=r-u,l=a-c,this._dashOffset=-mathSqrt$1(s*s+l*l)},e.prototype._dashedQuadraticTo=function(e,t,n,i){var r=n,a=i;n=(n+2*e)/3,i=(i+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,n,i,r,a)},e.prototype.toStatic=function(){if(this._saveData){var e=this.data;e instanceof Array&&(e.length=this._len,hasTypedArray&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){min$1[0]=min$1[1]=min2[0]=min2[1]=Number.MAX_VALUE,max$1[0]=max$1[1]=max2[0]=max2[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,r=0,a=0;for(e=0;e<this._len;){var o=t[e++],s=1===e;switch(s&&(r=n=t[e],a=i=t[e+1]),o){case CMD.M:n=r=t[e++],i=a=t[e++],min2[0]=r,min2[1]=a,max2[0]=r,max2[1]=a;break;case CMD.L:fromLine(n,i,t[e],t[e+1],min2,max2),n=t[e++],i=t[e++];break;case CMD.C:fromCubic(n,i,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],min2,max2),n=t[e++],i=t[e++];break;case CMD.Q:fromQuadratic(n,i,t[e++],t[e++],t[e],t[e+1],min2,max2),n=t[e++],i=t[e++];break;case CMD.A:var l=t[e++],u=t[e++],c=t[e++],h=t[e++],p=t[e++],d=t[e++]+p;e+=1;var f=!t[e++];s&&(r=mathCos$1(p)*c+l,a=mathSin$1(p)*h+u),fromArc(l,u,c,h,p,d,f,min2,max2),n=mathCos$1(d)*c+l,i=mathSin$1(d)*h+u;break;case CMD.R:fromLine(r=n=t[e++],a=i=t[e++],r+t[e++],a+t[e++],min2,max2);break;case CMD.Z:n=r,i=a}min(min$1,min$1,min2),max(max$1,max$1,max2)}return 0===e&&(min$1[0]=min$1[1]=max$1[0]=max$1[1]=0),new BoundingRect(min$1[0],min$1[1],max$1[0]-min$1[0],max$1[1]-min$1[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,i=this._uy,r=0,a=0,o=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,c=0,h=0;h<t;){var p=e[h++],d=1===h;d&&(o=r=e[h],s=a=e[h+1]);var f=-1;switch(p){case CMD.M:r=o=e[h++],a=s=e[h++];break;case CMD.L:var g=e[h++],m=(_=e[h++])-a;(mathAbs(P=g-r)>n||mathAbs(m)>i||h===t-1)&&(f=Math.sqrt(P*P+m*m),r=g,a=_);break;case CMD.C:var y=e[h++],v=e[h++],_=(g=e[h++],e[h++]),x=e[h++],S=e[h++];f=cubicLength(r,a,y,v,g,_,x,S,10),r=x,a=S;break;case CMD.Q:f=quadraticLength(r,a,y=e[h++],v=e[h++],g=e[h++],_=e[h++],10),r=g,a=_;break;case CMD.A:var b=e[h++],T=e[h++],M=e[h++],A=e[h++],I=e[h++],C=e[h++],w=C+I;h+=1;e[h++];d&&(o=mathCos$1(I)*M+b,s=mathSin$1(I)*A+T),f=mathMax$2(M,A)*mathMin$2(PI2$1,Math.abs(C)),r=mathCos$1(w)*M+b,a=mathSin$1(w)*A+T;break;case CMD.R:o=r=e[h++],s=a=e[h++],f=2*e[h++]+2*e[h++];break;case CMD.Z:var P=o-r;m=s-a;f=Math.sqrt(P*P+m*m),r=o,a=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},e.prototype.rebuildPath=function(e,t){var n,i,r,a,o,s,l,u,c=this.data,h=this._ux,p=this._uy,d=this._len,f=t<1,g=0,m=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))e:for(var y=0;y<d;){var v=c[y++],_=1===y;switch(_&&(n=r=c[y],i=a=c[y+1]),v){case CMD.M:n=r=c[y++],i=a=c[y++],e.moveTo(r,a);break;case CMD.L:if(o=c[y++],s=c[y++],mathAbs(o-r)>h||mathAbs(s-a)>p||y===d-1){if(f){if(g+(G=l[m++])>u){var x=(u-g)/G;e.lineTo(r*(1-x)+o*x,a*(1-x)+s*x);break e}g+=G}e.lineTo(o,s),r=o,a=s}break;case CMD.C:var S=c[y++],b=c[y++],T=c[y++],M=c[y++],A=c[y++],I=c[y++];if(f){if(g+(G=l[m++])>u){cubicSubdivide(r,S,T,A,x=(u-g)/G,tmpOutX),cubicSubdivide(a,b,M,I,x,tmpOutY),e.bezierCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2],tmpOutX[3],tmpOutY[3]);break e}g+=G}e.bezierCurveTo(S,b,T,M,A,I),r=A,a=I;break;case CMD.Q:S=c[y++],b=c[y++],T=c[y++],M=c[y++];if(f){if(g+(G=l[m++])>u){quadraticSubdivide(r,S,T,x=(u-g)/G,tmpOutX),quadraticSubdivide(a,b,M,x,tmpOutY),e.quadraticCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2]);break e}g+=G}e.quadraticCurveTo(S,b,T,M),r=T,a=M;break;case CMD.A:var C=c[y++],w=c[y++],P=c[y++],L=c[y++],E=c[y++],D=c[y++],R=c[y++],O=!c[y++],k=P>L?P:L,N=mathAbs(P-L)>.001,B=E+D,V=!1;if(f)g+(G=l[m++])>u&&(B=E+D*(u-g)/G,V=!0),g+=G;if(N&&e.ellipse?e.ellipse(C,w,P,L,R,E,B,O):e.arc(C,w,k,E,B,O),V)break e;_&&(n=mathCos$1(E)*P+C,i=mathSin$1(E)*L+w),r=mathCos$1(B)*P+C,a=mathSin$1(B)*L+w;break;case CMD.R:n=r=c[y],i=a=c[y+1],o=c[y++],s=c[y++];var F=c[y++],$=c[y++];if(f){if(g+(G=l[m++])>u){var z=u-g;e.moveTo(o,s),e.lineTo(o+mathMin$2(z,F),s),(z-=F)>0&&e.lineTo(o+F,s+mathMin$2(z,$)),(z-=$)>0&&e.lineTo(o+mathMax$2(F-z,0),s+$),(z-=F)>0&&e.lineTo(o,s+mathMax$2($-z,0));break e}g+=G}e.rect(o,s,F,$);break;case CMD.Z:if(f){var G;if(g+(G=l[m++])>u){x=(u-g)/G;e.lineTo(r*(1-x)+n*x,a*(1-x)+i*x);break e}g+=G}e.closePath(),r=n,a=i}}},e.CMD=CMD,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._needsDash=!1,t._dashOffset=0,t._dashIdx=0,t._dashSum=0,t._ux=0,t._uy=0}(),e}();function containStroke(e,t,n,i,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>i+s||o<t-s&&o<i-s||a>e+s&&a>n+s||a<e-s&&a<n-s)return!1;if(e===n)return Math.abs(a-e)<=s/2;var u=(l=(t-i)/(e-n))*a-o+(e*i-n*t)/(e-n);return u*u/(l*l+1)<=s/2*s/2}function containStroke$1(e,t,n,i,r,a,o,s,l,u,c){if(0===l)return!1;var h=l;return!(c>t+h&&c>i+h&&c>a+h&&c>s+h||c<t-h&&c<i-h&&c<a-h&&c<s-h||u>e+h&&u>n+h&&u>r+h&&u>o+h||u<e-h&&u<n-h&&u<r-h&&u<o-h)&&cubicProjectPoint(e,t,n,i,r,a,o,s,u,c,null)<=h/2}function containStroke$2(e,t,n,i,r,a,o,s,l){if(0===o)return!1;var u=o;return!(l>t+u&&l>i+u&&l>a+u||l<t-u&&l<i-u&&l<a-u||s>e+u&&s>n+u&&s>r+u||s<e-u&&s<n-u&&s<r-u)&&quadraticProjectPoint(e,t,n,i,r,a,s,l,null)<=u/2}var PI2$2=2*Math.PI;function normalizeRadian(e){return(e%=PI2$2)<0&&(e+=PI2$2),e}var PI2$3=2*Math.PI;function containStroke$3(e,t,n,i,r,a,o,s,l){if(0===o)return!1;var u=o;s-=e,l-=t;var c=Math.sqrt(s*s+l*l);if(c-u>n||c+u<n)return!1;if(Math.abs(i-r)%PI2$3<1e-4)return!0;if(a){var h=i;i=normalizeRadian(r),r=normalizeRadian(h)}else i=normalizeRadian(i),r=normalizeRadian(r);i>r&&(r+=PI2$3);var p=Math.atan2(l,s);return p<0&&(p+=PI2$3),p>=i&&p<=r||p+PI2$3>=i&&p+PI2$3<=r}function windingLine(e,t,n,i,r,a){if(a>t&&a>i||a<t&&a<i)return 0;if(i===t)return 0;var o=(a-t)/(i-t),s=i<t?1:-1;1!==o&&0!==o||(s=i<t?.5:-.5);var l=o*(n-e)+e;return l===r?1/0:l>r?s:0}var CMD$1=PathProxy.CMD,PI2$4=2*Math.PI,EPSILON$2=1e-4;function isAroundEqual(e,t){return Math.abs(e-t)<EPSILON$2}var roots=[-1,-1,-1],extrema=[-1,-1];function swapExtrema(){var e=extrema[0];extrema[0]=extrema[1],extrema[1]=e}function windingCubic(e,t,n,i,r,a,o,s,l,u){if(u>t&&u>i&&u>a&&u>s||u<t&&u<i&&u<a&&u<s)return 0;var c=cubicRootAt(t,i,a,s,u,roots);if(0===c)return 0;for(var h=0,p=-1,d=void 0,f=void 0,g=0;g<c;g++){var m=roots[g],y=0===m||1===m?.5:1;cubicAt(e,n,r,o,m)<l||(p<0&&(p=cubicExtrema(t,i,a,s,extrema),extrema[1]<extrema[0]&&p>1&&swapExtrema(),d=cubicAt(t,i,a,s,extrema[0]),p>1&&(f=cubicAt(t,i,a,s,extrema[1]))),2===p?m<extrema[0]?h+=d<t?y:-y:m<extrema[1]?h+=f<d?y:-y:h+=s<f?y:-y:m<extrema[0]?h+=d<t?y:-y:h+=s<d?y:-y)}return h}function windingQuadratic(e,t,n,i,r,a,o,s){if(s>t&&s>i&&s>a||s<t&&s<i&&s<a)return 0;var l=quadraticRootAt(t,i,a,s,roots);if(0===l)return 0;var u=quadraticExtremum(t,i,a);if(u>=0&&u<=1){for(var c=0,h=quadraticAt(t,i,a,u),p=0;p<l;p++){var d=0===roots[p]||1===roots[p]?.5:1;quadraticAt(e,n,r,roots[p])<o||(roots[p]<u?c+=h<t?d:-d:c+=a<h?d:-d)}return c}d=0===roots[0]||1===roots[0]?.5:1;return quadraticAt(e,n,r,roots[0])<o?0:a<t?d:-d}function windingArc(e,t,n,i,r,a,o,s){if((s-=t)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);roots[0]=-l,roots[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=PI2$4-1e-4){i=0,r=PI2$4;var c=a?1:-1;return o>=roots[0]+e&&o<=roots[1]+e?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=PI2$4,r+=PI2$4);for(var p=0,d=0;d<2;d++){var f=roots[d];if(f+e>o){var g=Math.atan2(s,f);c=a?1:-1;g<0&&(g=PI2$4+g),(g>=i&&g<=r||g+PI2$4>=i&&g+PI2$4<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),p+=c)}}return p}function containPath(e,t,n,i,r){for(var a,o,s=e.data,l=e.len(),u=0,c=0,h=0,p=0,d=0,f=0;f<l;){var g=s[f++],m=1===f;switch(g===CMD$1.M&&f>1&&(n||(u+=windingLine(c,h,p,d,i,r))),m&&(p=c=s[f],d=h=s[f+1]),g){case CMD$1.M:c=p=s[f++],h=d=s[f++];break;case CMD$1.L:if(n){if(containStroke(c,h,s[f],s[f+1],t,i,r))return!0}else u+=windingLine(c,h,s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.C:if(n){if(containStroke$1(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],t,i,r))return!0}else u+=windingCubic(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.Q:if(n){if(containStroke$2(c,h,s[f++],s[f++],s[f],s[f+1],t,i,r))return!0}else u+=windingQuadratic(c,h,s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],S=s[f++],b=s[f++];f+=1;var T=!!(1-s[f++]);a=Math.cos(S)*_+y,o=Math.sin(S)*x+v,m?(p=a,d=o):u+=windingLine(c,h,a,o,i,r);var M=(i-y)*x/_+y;if(n){if(containStroke$3(y,v,x,S,S+b,T,t,M,r))return!0}else u+=windingArc(y,v,x,S,S+b,T,M,r);c=Math.cos(S+b)*_+y,h=Math.sin(S+b)*x+v;break;case CMD$1.R:if(p=c=s[f++],d=h=s[f++],a=p+s[f++],o=d+s[f++],n){if(containStroke(p,d,a,d,t,i,r)||containStroke(a,d,a,o,t,i,r)||containStroke(a,o,p,o,t,i,r)||containStroke(p,o,p,d,t,i,r))return!0}else u+=windingLine(a,d,a,o,i,r),u+=windingLine(p,o,p,d,i,r);break;case CMD$1.Z:if(n){if(containStroke(c,h,p,d,t,i,r))return!0}else u+=windingLine(c,h,p,d,i,r);c=p,h=d}}return n||isAroundEqual(h,d)||(u+=windingLine(c,h,p,d,i,r)||0),0!==u}function contain(e,t,n){return containPath(e,0,!1,t,n)}function containStroke$4(e,t,n,i){return containPath(e,t,!0,n,i)}var DEFAULT_PATH_STYLE=defaults({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},DEFAULT_COMMON_STYLE),DEFAULT_PATH_ANIMATION_PROPS={style:defaults({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)},pathCopyParams=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],Path=function(e){function t(t){return e.call(this,t)||this}var n;return __extends(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new t;r.buildPath===t.prototype.buildPath&&(r.buildPath=function(e){n.buildPath(e,n.shape)}),r.silent=!0;var a=r.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<pathCopyParams.length;++s)r[pathCopyParams[s]]=this[pathCopyParams[s]];r.__dirty|=Element.REDARAW_BIT}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=keys(t);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var r=0;r<n.length;r++){var a=n[r],o=t[a];"style"===a?this.style?extend(this.style,o):this.useStyle(o):"shape"===a?extend(this.shape,o):e.prototype.attrKV.call(this,a,o)}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(isString(e)){var t=lum(e,0);return t>.5?DARK_LABEL_COLOR:t>.2?LIGHTER_LABEL_COLOR:LIGHT_LABEL_COLOR}if(e)return LIGHT_LABEL_COLOR}return DARK_LABEL_COLOR},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(isString(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===lum(e,0)<DARK_MODE_THRESHOLD)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=~t.SHAPE_CHANGED_BIT},t.prototype.createPathProxy=function(){this.path=new PathProxy(!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,n=this.style,i=!e;if(i){var r=!1;this.path||(r=!0,this.createPathProxy());var a=this.path;(r||this.__dirty&t.SHAPE_CHANGED_BIT)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),e=a.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){o.copy(e);var s=n.strokeNoScale?this.getLineScale():1,l=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;l=Math.max(l,null==u?4:u)}s>1e-10&&(o.width+=l/s,o.height+=l/s,o.x-=l/s/2,o.y-=l/s/2)}return o}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),r=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),containStroke$4(a,o/s,e,t)))return!0}if(this.hasFill())return contain(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=t.SHAPE_CHANGED_BIT,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:extend(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&t.SHAPE_CHANGED_BIT)},t.prototype.createStyle=function(e){return createObject(DEFAULT_PATH_STYLE,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=extend({},this.shape))},t.prototype._applyStateObj=function(t,n,i,r,a,o){e.prototype._applyStateObj.call(this,t,n,i,r,a,o);var s,l=!(n&&r);if(n&&n.shape?a?r?s=n.shape:(s=extend({},i.shape),extend(s,n.shape)):(s=extend({},r?this.shape:i.shape),extend(s,n.shape)):l&&(s=i.shape),s)if(a){this.shape=extend({},this.shape);for(var u={},c=keys(s),h=0;h<c.length;h++){var p=c[h];"object"==typeof s[p]?this.shape[p]=s[p]:u[p]=s[p]}this._transitionState(t,{shape:u},o)}else this.shape=s,this.dirtyShape()},t.prototype._mergeStates=function(t){for(var n,i=e.prototype._mergeStates.call(this,t),r=0;r<t.length;r++){var a=t[r];a.shape&&(n=n||{},this._mergeStyle(n,a.shape))}return n&&(i.shape=n),i},t.prototype.getAnimationStyleProps=function(){return DEFAULT_PATH_ANIMATION_PROPS},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){function n(n){var i=t.call(this,n)||this;return e.init&&e.init.call(i,n),i}return __extends(n,t),n.prototype.getDefaultStyle=function(){return clone(e.style)},n.prototype.getDefaultShape=function(){return clone(e.shape)},n}(t);for(var i in e)"function"==typeof e[i]&&(n.prototype[i]=e[i]);return n},t.SHAPE_CHANGED_BIT=4,t.initDefaultProps=((n=t.prototype).type="path",n.strokeContainThreshold=5,n.segmentIgnoreThreshold=0,n.subPixelOptimize=!1,n.autoBatch=!1,void(n.__dirty=Element.REDARAW_BIT|Displayable.STYLE_CHANGED_BIT|t.SHAPE_CHANGED_BIT)),t}(Displayable),CMD$2=PathProxy.CMD,points=[[],[],[]],mathSqrt$2=Math.sqrt,mathAtan2=Math.atan2;function transformPath(e,t){var n,i,r,a,o,s,l=e.data,u=e.len(),c=CMD$2.M,h=CMD$2.C,p=CMD$2.L,d=CMD$2.R,f=CMD$2.A,g=CMD$2.Q;for(r=0,a=0;r<u;){switch(n=l[r++],a=r,i=0,n){case c:case p:i=1;break;case h:i=3;break;case g:i=2;break;case f:var m=t[4],y=t[5],v=mathSqrt$2(t[0]*t[0]+t[1]*t[1]),_=mathSqrt$2(t[2]*t[2]+t[3]*t[3]),x=mathAtan2(-t[1]/_,t[0]/v);l[r]*=v,l[r++]+=m,l[r]*=_,l[r++]+=y,l[r++]*=v,l[r++]*=_,l[r++]+=x,l[r++]+=x,a=r+=2;break;case d:s[0]=l[r++],s[1]=l[r++],applyTransform(s,s,t),l[a++]=s[0],l[a++]=s[1],s[0]+=l[r++],s[1]+=l[r++],applyTransform(s,s,t),l[a++]=s[0],l[a++]=s[1]}for(o=0;o<i;o++){var S=points[o];S[0]=l[r++],S[1]=l[r++],applyTransform(S,S,t),l[a++]=S[0],l[a++]=S[1]}}e.increaseVersion()}var mathSqrt$3=Math.sqrt,mathSin$2=Math.sin,mathCos$2=Math.cos,PI$1=Math.PI;function vMag(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function vRatio(e,t){return(e[0]*t[0]+e[1]*t[1])/(vMag(e)*vMag(t))}function vAngle(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(vRatio(e,t))}function processArc(e,t,n,i,r,a,o,s,l,u,c){var h=l*(PI$1/180),p=mathCos$2(h)*(e-n)/2+mathSin$2(h)*(t-i)/2,d=-1*mathSin$2(h)*(e-n)/2+mathCos$2(h)*(t-i)/2,f=p*p/(o*o)+d*d/(s*s);f>1&&(o*=mathSqrt$3(f),s*=mathSqrt$3(f));var g=(r===a?-1:1)*mathSqrt$3((o*o*(s*s)-o*o*(d*d)-s*s*(p*p))/(o*o*(d*d)+s*s*(p*p)))||0,m=g*o*d/s,y=g*-s*p/o,v=(e+n)/2+mathCos$2(h)*m-mathSin$2(h)*y,_=(t+i)/2+mathSin$2(h)*m+mathCos$2(h)*y,x=vAngle([1,0],[(p-m)/o,(d-y)/s]),S=[(p-m)/o,(d-y)/s],b=[(-1*p-m)/o,(-1*d-y)/s],T=vAngle(S,b);if(vRatio(S,b)<=-1&&(T=PI$1),vRatio(S,b)>=1&&(T=0),T<0){var M=Math.round(T/PI$1*1e6)/1e6;T=2*PI$1+M%2*PI$1}c.addData(u,v,_,o,s,x,T,h,a)}var commandReg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,numberReg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function createPathProxyFromString(e){if(!e)return new PathProxy;for(var t,n=0,i=0,r=n,a=i,o=new PathProxy,s=PathProxy.CMD,l=e.match(commandReg),u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),p=void 0,d=c.match(numberReg)||[],f=d.length,g=0;g<f;g++)d[g]=parseFloat(d[g]);for(var m=0;m<f;){var y=void 0,v=void 0,_=void 0,x=void 0,S=void 0,b=void 0,T=void 0,M=n,A=i,I=void 0,C=void 0;switch(h){case"l":n+=d[m++],i+=d[m++],p=s.L,o.addData(p,n,i);break;case"L":n=d[m++],i=d[m++],p=s.L,o.addData(p,n,i);break;case"m":n+=d[m++],i+=d[m++],p=s.M,o.addData(p,n,i),r=n,a=i,h="l";break;case"M":n=d[m++],i=d[m++],p=s.M,o.addData(p,n,i),r=n,a=i,h="L";break;case"h":n+=d[m++],p=s.L,o.addData(p,n,i);break;case"H":n=d[m++],p=s.L,o.addData(p,n,i);break;case"v":i+=d[m++],p=s.L,o.addData(p,n,i);break;case"V":i=d[m++],p=s.L,o.addData(p,n,i);break;case"C":p=s.C,o.addData(p,d[m++],d[m++],d[m++],d[m++],d[m++],d[m++]),n=d[m-2],i=d[m-1];break;case"c":p=s.C,o.addData(p,d[m++]+n,d[m++]+i,d[m++]+n,d[m++]+i,d[m++]+n,d[m++]+i),n+=d[m-2],i+=d[m-1];break;case"S":y=n,v=i,I=o.len(),C=o.data,t===s.C&&(y+=n-C[I-4],v+=i-C[I-3]),p=s.C,M=d[m++],A=d[m++],n=d[m++],i=d[m++],o.addData(p,y,v,M,A,n,i);break;case"s":y=n,v=i,I=o.len(),C=o.data,t===s.C&&(y+=n-C[I-4],v+=i-C[I-3]),p=s.C,M=n+d[m++],A=i+d[m++],n+=d[m++],i+=d[m++],o.addData(p,y,v,M,A,n,i);break;case"Q":M=d[m++],A=d[m++],n=d[m++],i=d[m++],p=s.Q,o.addData(p,M,A,n,i);break;case"q":M=d[m++]+n,A=d[m++]+i,n+=d[m++],i+=d[m++],p=s.Q,o.addData(p,M,A,n,i);break;case"T":y=n,v=i,I=o.len(),C=o.data,t===s.Q&&(y+=n-C[I-4],v+=i-C[I-3]),n=d[m++],i=d[m++],p=s.Q,o.addData(p,y,v,n,i);break;case"t":y=n,v=i,I=o.len(),C=o.data,t===s.Q&&(y+=n-C[I-4],v+=i-C[I-3]),n+=d[m++],i+=d[m++],p=s.Q,o.addData(p,y,v,n,i);break;case"A":_=d[m++],x=d[m++],S=d[m++],b=d[m++],T=d[m++],processArc(M=n,A=i,n=d[m++],i=d[m++],b,T,_,x,S,p=s.A,o);break;case"a":_=d[m++],x=d[m++],S=d[m++],b=d[m++],T=d[m++],processArc(M=n,A=i,n+=d[m++],i+=d[m++],b,T,_,x,S,p=s.A,o)}}"z"!==h&&"Z"!==h||(p=s.Z,o.addData(p),n=r,i=a),t=p}return o.toStatic(),o}var SVGPath=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.applyTransform=function(e){},t}(Path);function isPathProxy(e){return null!=e.setData}function createPathOptions(e,t){var n=createPathProxyFromString(e),i=extend({},t);return i.buildPath=function(e){if(isPathProxy(e)){e.setData(n.data),(t=e.getContext())&&e.rebuildPath(t,1)}else{var t=e;n.rebuildPath(t,1)}},i.applyTransform=function(e){transformPath(n,e),this.dirtyShape()},i}function createFromString(e,t){return new SVGPath(createPathOptions(e,t))}function extendFromString(e,t){var n=createPathOptions(e,t);return function(e){function t(t){var i=e.call(this,t)||this;return i.applyTransform=n.applyTransform,i.buildPath=n.buildPath,i}return __extends(t,e),t}(SVGPath)}function mergePath(e,t){for(var n=[],i=e.length,r=0;r<i;r++){var a=e[r];a.path||a.createPathProxy(),a.shapeChanged()&&a.buildPath(a.path,a.shape,!0),n.push(a.path)}var o=new Path(t);return o.createPathProxy(),o.buildPath=function(e){if(isPathProxy(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},o}var Group=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return __extends(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)),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,i=n.indexOf(t);i>=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),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,i=indexOf(n,e);return i<0||(n.splice(i,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 i=e[n];t&&i.removeSelfFromZr(t),i.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,i=0;i<n.length;i++){var r=n[i];e.call(t,r,i)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var i=this._children[n],r=e.call(t,i);i.isGroup&&!r&&i.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 BoundingRect(0,0,0,0),n=e||this._children,i=[],r=null,a=0;a<n.length;a++){var o=n[a];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(i);l?(BoundingRect.applyTransform(t,s,l),(r=r||t.clone()).union(t)):(r=r||s.clone()).union(s)}}return r||t},t}(Element);Group.prototype.type="group";var DEFAULT_IMAGE_STYLE=defaults({x:0,y:0},DEFAULT_COMMON_STYLE),DEFAULT_IMAGE_ANIMATION_PROPS={style:defaults({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)};function isImageLike(e){return!!(e&&"string"!=typeof e&&e.width&&e.height)}var ZRImage=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.createStyle=function(e){return createObject(DEFAULT_IMAGE_STYLE,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(null!=n)return n;var i=isImageLike(t.image)?t.image:this.__image;if(!i)return 0;var r="width"===e?"height":"width",a=t[r];return null==a?i[e]:i[e]/i[r]*a},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return DEFAULT_IMAGE_ANIMATION_PROPS},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new BoundingRect(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(Displayable);ZRImage.prototype.type="image";var CircleShape=function(){this.cx=0,this.cy=0,this.r=0},Circle=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new CircleShape},t.prototype.buildPath=function(e,t,n){n&&e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)},t}(Path);function buildPath(e,t){var n,i,r,a,o,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=i=r=a=h:h instanceof Array?1===h.length?n=i=r=a=h[0]:2===h.length?(n=r=h[0],i=a=h[1]):3===h.length?(n=h[0],i=a=h[1],r=h[2]):(n=h[0],i=h[1],r=h[2],a=h[3]):n=i=r=a=0,n+i>u&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),i+r>c&&(i*=c/(o=i+r),r*=c/o),n+a>c&&(n*=c/(o=n+a),a*=c/o),e.moveTo(s+n,l),e.lineTo(s+u-i,l),0!==i&&e.arc(s+u-i,l+i,i,-Math.PI/2,0),e.lineTo(s+u,l+c-r),0!==r&&e.arc(s+u-r,l+c-r,r,0,Math.PI/2),e.lineTo(s+a,l+c),0!==a&&e.arc(s+a,l+c-a,a,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)}Circle.prototype.type="circle";var round=Math.round;function subPixelOptimizeLine(e,t,n){if(t){var i=t.x1,r=t.x2,a=t.y1,o=t.y2;e.x1=i,e.x2=r,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(round(2*i)===round(2*r)&&(e.x1=e.x2=subPixelOptimize(i,s,!0)),round(2*a)===round(2*o)&&(e.y1=e.y2=subPixelOptimize(a,s,!0)),e):e}}function subPixelOptimizeRect(e,t,n){if(t){var i=t.x,r=t.y,a=t.width,o=t.height;e.x=i,e.y=r,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=subPixelOptimize(i,s,!0),e.y=subPixelOptimize(r,s,!0),e.width=Math.max(subPixelOptimize(i+a,s,!1)-e.x,0===a?0:1),e.height=Math.max(subPixelOptimize(r+o,s,!1)-e.y,0===o?0:1),e):e}}function subPixelOptimize(e,t,n){if(!t)return e;var i=round(2*e);return(i+round(t))%2==0?i/2:(i+(n?1:-1))/2}var RectShape=function(){this.x=0,this.y=0,this.width=0,this.height=0},subPixelOptimizeOutputShape={},Rect=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new RectShape},t.prototype.buildPath=function(e,t){var n,i,r,a;if(this.subPixelOptimize){var o=subPixelOptimizeRect(subPixelOptimizeOutputShape,t,this.style);n=o.x,i=o.y,r=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,i=t.y,r=t.width,a=t.height;t.r?buildPath(e,t):e.rect(n,i,r,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Path);Rect.prototype.type="rect";var EllipseShape=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Ellipse=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new EllipseShape},t.prototype.buildPath=function(e,t){var n=.5522848,i=t.cx,r=t.cy,a=t.rx,o=t.ry,s=a*n,l=o*n;e.moveTo(i-a,r),e.bezierCurveTo(i-a,r-l,i-s,r-o,i,r-o),e.bezierCurveTo(i+s,r-o,i+a,r-l,i+a,r),e.bezierCurveTo(i+a,r+l,i+s,r+o,i,r+o),e.bezierCurveTo(i-s,r+o,i-a,r+l,i-a,r),e.closePath()},t}(Path);Ellipse.prototype.type="ellipse";var subPixelOptimizeOutputShape$1={},LineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},Line=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LineShape},t.prototype.buildPath=function(e,t){var n,i,r,a;if(this.subPixelOptimize){var o=subPixelOptimizeLine(subPixelOptimizeOutputShape$1,t,this.style);n=o.x1,i=o.y1,r=o.x2,a=o.y2}else n=t.x1,i=t.y1,r=t.x2,a=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,i),s<1&&(r=n*(1-s)+r*s,a=i*(1-s)+a*s),e.lineTo(r,a))},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}(Path);function interpolate(e,t,n,i,r,a,o){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*o+(-3*(t-n)-2*s-l)*a+s*r+t}function smoothSpline(e,t){for(var n=e.length,i=[],r=0,a=1;a<n;a++)r+=distance(e[a-1],e[a]);var o=r/2;o=o<n?n:o;for(a=0;a<o;a++){var s=a/(o-1)*(t?n:n-1),l=Math.floor(s),u=s-l,c=void 0,h=e[l%n],p=void 0,d=void 0;t?(c=e[(l-1+n)%n],p=e[(l+1)%n],d=e[(l+2)%n]):(c=e[0===l?l:l-1],p=e[l>n-2?n-1:l+1],d=e[l>n-3?n-1:l+2]);var f=u*u,g=u*f;i.push([interpolate(c[0],h[0],p[0],d[0],u,f,g),interpolate(c[1],h[1],p[1],d[1],u,f,g)])}return i}function smoothBezier(e,t,n,i){var r,a,o,s,l=[],u=[],c=[],h=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,d=e.length;p<d;p++)min(o,o,e[p]),max(s,s,e[p]);min(o,o,i[0]),max(s,s,i[1])}for(p=0,d=e.length;p<d;p++){var f=e[p];if(n)r=e[p?p-1:d-1],a=e[(p+1)%d];else{if(0===p||p===d-1){l.push(clone$1(e[p]));continue}r=e[p-1],a=e[p+1]}sub(u,a,r),scale(u,u,t);var g=distance(f,r),m=distance(f,a),y=g+m;0!==y&&(g/=y,m/=y),scale(c,u,-g),scale(h,u,m);var v=add([],f,c),_=add([],f,h);i&&(max(v,v,o),min(v,v,s),max(_,_,o),min(_,_,s)),l.push(v),l.push(_)}return n&&l.push(l.shift()),l}function buildPath$1(e,t,n){var i=t.smooth,r=t.points;if(r&&r.length>=2){if(i&&"spline"!==i){var a=smoothBezier(r,i,n,t.smoothConstraint);e.moveTo(r[0][0],r[0][1]);for(var o=r.length,s=0;s<(n?o:o-1);s++){var l=a[2*s],u=a[2*s+1],c=r[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{"spline"===i&&(r=smoothSpline(r,n)),e.moveTo(r[0][0],r[0][1]);s=1;for(var h=r.length;s<h;s++)e.lineTo(r[s][0],r[s][1])}n&&e.closePath()}}Line.prototype.type="line";var PolygonShape=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},Polygon=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new PolygonShape},t.prototype.buildPath=function(e,t){buildPath$1(e,t,!0)},t}(Path);Polygon.prototype.type="polygon";var PolylineShape=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},Polyline=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new PolylineShape},t.prototype.buildPath=function(e,t){buildPath$1(e,t,!1)},t}(Path);Polyline.prototype.type="polyline";var Gradient=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),LinearGradient=function(e){function t(t,n,i,r,a,o){var s=e.call(this,a)||this;return s.x=null==t?0:t,s.y=null==n?0:n,s.x2=null==i?1:i,s.y2=null==r?0:r,s.type="linear",s.global=o||!1,s}return __extends(t,e),t}(Gradient),DEFAULT_TSPAN_STYLE=defaults({strokeFirst:!0,font:DEFAULT_FONT,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},DEFAULT_PATH_STYLE),TSpan=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(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 createObject(DEFAULT_TSPAN_STYLE,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=getBoundingRect(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(Displayable);TSpan.prototype.type="tspan";var nodeParsers,DILIMITER_REG=/[\s,]+/;function parseXML(e){isString(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 SVGParser=function(){function e(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}return e.prototype.parse=function(e,t){t=t||{};var n=parseXML(e);if(!n)throw new Error("Illegal svg");var i=new Group;this._root=i;var r=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||t.width),o=parseFloat(n.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(o)&&(o=null),parseAttributes(n,i,null,!0);for(var s,l,u=n.firstChild;u;)this._parseNode(u,i),u=u.nextSibling;if(r){var c=trim(r).split(DILIMITER_REG);c.length>=4&&(s={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(s&&null!=a&&null!=o&&(l=makeViewBoxTransform(s,a,o),!t.ignoreViewBox)){var h=i;(i=new Group).add(h),h.scaleX=h.scaleY=l.scale,h.x=l.x,h.y=l.y}return t.ignoreRootClip||null==a||null==o||i.setClipPath(new Rect({shape:{x:0,y:0,width:a,height:o}})),{root:i,width:a,height:o,viewBoxRect:s,viewBoxTransform:l}},e.prototype._parseNode=function(e,t){var n,i,r=e.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(i=defineParsers[r]){var a=i.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=a)}}else(i=nodeParsers[r])&&(n=i.call(this,e,t),t.add(n));if(n)for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,n),3===s.nodeType&&this._isText&&this._parseText(s,n),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},e.prototype._parseText=function(e,t){if(1===e.nodeType){var n=e.getAttribute("dx")||0,i=e.getAttribute("dy")||0;this._textX+=parseFloat(n),this._textY+=parseFloat(i)}var r=new TSpan({style:{text:e.textContent},x:this._textX||0,y:this._textY||0});inheritStyle(t,r),parseAttributes(e,r,this._defs);var a=r.style,o=a.fontSize;o&&o<9&&(a.fontSize=9,r.scaleX*=o/9,r.scaleY*=o/9);var s=(a.fontSize||a.fontFamily)&&[a.fontStyle,a.fontWeight,(a.fontSize||12)+"px",a.fontFamily||"sans-serif"].join(" ");a.font=s;var l=r.getBoundingRect();return this._textX+=l.width,t.add(r),r},e.internalField=void(nodeParsers={g:function(e,t){var n=new Group;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n},rect:function(e,t){var n=new Rect;return inheritStyle(t,n),parseAttributes(e,n,this._defs),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},circle:function(e,t){var n=new Circle;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n},line:function(e,t){var n=new Line;return inheritStyle(t,n),parseAttributes(e,n,this._defs),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},ellipse:function(e,t){var n=new Ellipse;return inheritStyle(t,n),parseAttributes(e,n,this._defs),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},polygon:function(e,t){var n,i=e.getAttribute("points");i&&(n=parsePoints(i));var r=new Polygon({shape:{points:n||[]}});return inheritStyle(t,r),parseAttributes(e,r,this._defs),r},polyline:function(e,t){var n=new Path;inheritStyle(t,n),parseAttributes(e,n,this._defs);var i,r=e.getAttribute("points");return r&&(i=parsePoints(r)),new Polyline({shape:{points:i||[]}})},image:function(e,t){var n=new ZRImage;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setStyle({image:e.getAttribute("xlink:href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",r=e.getAttribute("dx")||"0",a=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(a);var o=new Group;return inheritStyle(t,o),parseAttributes(e,o,this._defs),o},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0,o=new Group;return inheritStyle(t,o),parseAttributes(e,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(e,t){var n=createFromString(e.getAttribute("d")||"");return inheritStyle(t,n),parseAttributes(e,n,this._defs),n}}),e}(),defineParsers={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),i=parseInt(e.getAttribute("x2")||"10",10),r=parseInt(e.getAttribute("y2")||"0",10),a=new LinearGradient(t,n,i,r);return _parseGradientColorStops(e,a),a}};function _parseGradientColorStops(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType){var i=n.getAttribute("offset"),r=void 0;r=i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var a=n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:r,color:a})}n=n.nextSibling}}function inheritStyle(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),defaults(t.__inheritedStyle,e.__inheritedStyle))}function parsePoints(e){for(var t=trim(e).split(DILIMITER_REG),n=[],i=0;i<t.length;i+=2){var r=parseFloat(t[i]),a=parseFloat(t[i+1]);n.push([r,a])}return n}var attributesMap={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-align":"textAlign","alignment-baseline":"textBaseline"};function parseAttributes(e,t,n,i){var r=t,a=r.__inheritedStyle||{};if(1===e.nodeType&&(parseTransformAttribute(e,t),extend(a,parseStyleAttribute(e)),!i))for(var o in attributesMap)if(attributesMap.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(a[attributesMap[o]]=s)}r.style=r.style||{},null!=a.fill&&(r.style.fill=getPaint(a.fill,n)),null!=a.stroke&&(r.style.stroke=getPaint(a.stroke,n)),each(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){null!=a[e]&&(r.style[e]=parseFloat(a[e]))})),a.textBaseline&&"auto"!==a.textBaseline||(a.textBaseline="alphabetic"),"alphabetic"===a.textBaseline&&(a.textBaseline="bottom"),"start"===a.textAlign&&(a.textAlign="left"),"end"===a.textAlign&&(a.textAlign="right"),each(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=a[e]&&(r.style[e]=a[e])})),a.lineDash&&(r.style.lineDash=map(trim(a.lineDash).split(DILIMITER_REG),(function(e){return parseFloat(e)}))),r.__inheritedStyle=a}var urlRegex=/url\(\s*#(.*?)\)/;function getPaint(e,t){var n=t&&e&&e.match(urlRegex);return n?t[trim(n[1])]:e}var transformRegex=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;function parseTransformAttribute(e,t){var n=e.getAttribute("transform");if(n){n=n.replace(/,/g," ");var i=[],r=null;n.replace(transformRegex,(function(e,t,n){return i.push(t,n),""}));for(var a=i.length-1;a>0;a-=2){var o=i[a],s=i[a-1],l=void 0;switch(r=r||create$1(),s){case"translate":l=trim(o).split(DILIMITER_REG),translate(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":l=trim(o).split(DILIMITER_REG),scale$1(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":l=trim(o).split(DILIMITER_REG),rotate(r,r,parseFloat(l[0]));break;case"skew":l=trim(o).split(DILIMITER_REG),console.warn("Skew transform is not supported yet");break;case"matrix":l=trim(o).split(DILIMITER_REG),r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}t.setLocalTransform(r)}}var styleRegex=/([^\s:;]+)\s*:\s*([^:;]+)/g;function parseStyleAttribute(e){var t=e.getAttribute("style"),n={};if(!t)return n;var i,r={};for(styleRegex.lastIndex=0;null!=(i=styleRegex.exec(t));)r[i[1]]=i[2];for(var a in attributesMap)attributesMap.hasOwnProperty(a)&&null!=r[a]&&(n[attributesMap[a]]=r[a]);return n}function makeViewBoxTransform(e,t,n){var i=t/e.width,r=n/e.height,a=Math.min(i,r);return{scale:a,x:-(e.x+e.width/2)*a+t/2,y:-(e.y+e.height/2)*a+n/2}}function parseSVG(e,t){return(new SVGParser).parse(e,t)}var PI$2=Math.PI,PI2$5=2*PI$2,mathSin$3=Math.sin,mathCos$3=Math.cos,mathACos=Math.acos,mathATan2=Math.atan2,mathAbs$1=Math.abs,mathSqrt$4=Math.sqrt,mathMax$3=Math.max,mathMin$3=Math.min,e=1e-4;function intersect(t,n,i,r,a,o,s,l){var u=i-t,c=r-n,h=s-a,p=l-o,d=p*u-h*c;if(!(d*d<e))return[t+(d=(h*(n-o)-p*(t-a))/d)*u,n+d*c]}function computeCornerTangents(e,t,n,i,r,a,o){var s=e-n,l=t-i,u=(o?a:-a)/mathSqrt$4(s*s+l*l),c=u*l,h=-u*s,p=e+c,d=t+h,f=n+c,g=i+h,m=(p+f)/2,y=(d+g)/2,v=f-p,_=g-d,x=v*v+_*_,S=r-a,b=p*g-f*d,T=(_<0?-1:1)*mathSqrt$4(mathMax$3(0,S*S*x-b*b)),M=(b*_-v*T)/x,A=(-b*v-_*T)/x,I=(b*_+v*T)/x,C=(-b*v+_*T)/x,w=M-m,P=A-y,L=I-m,E=C-y;return w*w+P*P>L*L+E*E&&(M=I,A=C),{cx:M,cy:A,x01:-c,y01:-h,x11:M*(r/S-1),y11:A*(r/S-1)}}function buildPath$2(t,n){var i=mathMax$3(n.r,0),r=mathMax$3(n.r0||0,0),a=i>0;if(a||r>0){if(a||(i=r,r=0),r>i){var o=i;i=r,r=o}var s=!!n.clockwise,l=n.startAngle,u=n.endAngle,c=[l,u];normalizeArcAngles(c,!s);var h=mathAbs$1(c[0]-c[1]),p=n.cx,d=n.cy,f=n.cornerRadius||0,g=n.innerCornerRadius||0;if(i>e)if(h>PI2$5-e)t.moveTo(p+i*mathCos$3(l),d+i*mathSin$3(l)),t.arc(p,d,i,l,u,!s),r>e&&(t.moveTo(p+r*mathCos$3(u),d+r*mathSin$3(u)),t.arc(p,d,r,u,l,s));else{var m=mathAbs$1(i-r)/2,y=mathMin$3(m,f),v=mathMin$3(m,g),_=v,x=y,S=i*mathCos$3(l),b=i*mathSin$3(l),T=r*mathCos$3(u),M=r*mathSin$3(u),A=void 0,I=void 0,C=void 0,w=void 0;if((y>e||v>e)&&(A=i*mathCos$3(u),I=i*mathSin$3(u),C=r*mathCos$3(l),w=r*mathSin$3(l),h<PI$2)){var P=intersect(S,b,C,w,A,I,T,M);if(P){var L=S-P[0],E=b-P[1],D=A-P[0],R=I-P[1],O=1/mathSin$3(mathACos((L*D+E*R)/(mathSqrt$4(L*L+E*E)*mathSqrt$4(D*D+R*R)))/2),k=mathSqrt$4(P[0]*P[0]+P[1]*P[1]);_=mathMin$3(v,(r-k)/(O-1)),x=mathMin$3(y,(i-k)/(O+1))}}if(h>e)if(x>e){var N=computeCornerTangents(C,w,S,b,i,x,s),B=computeCornerTangents(A,I,T,M,i,x,s);t.moveTo(p+N.cx+N.x01,d+N.cy+N.y01),x<y?t.arc(p+N.cx,d+N.cy,x,mathATan2(N.y01,N.x01),mathATan2(B.y01,B.x01),!s):(t.arc(p+N.cx,d+N.cy,x,mathATan2(N.y01,N.x01),mathATan2(N.y11,N.x11),!s),t.arc(p,d,i,mathATan2(N.cy+N.y11,N.cx+N.x11),mathATan2(B.cy+B.y11,B.cx+B.x11),!s),t.arc(p+B.cx,d+B.cy,x,mathATan2(B.y11,B.x11),mathATan2(B.y01,B.x01),!s))}else t.moveTo(p+S,d+b),t.arc(p,d,i,l,u,!s);else t.moveTo(p+S,d+b);if(r>e&&h>e)if(_>e){N=computeCornerTangents(T,M,A,I,r,-_,s),B=computeCornerTangents(S,b,C,w,r,-_,s);t.lineTo(p+N.cx+N.x01,d+N.cy+N.y01),_<v?t.arc(p+N.cx,d+N.cy,_,mathATan2(N.y01,N.x01),mathATan2(B.y01,B.x01),!s):(t.arc(p+N.cx,d+N.cy,_,mathATan2(N.y01,N.x01),mathATan2(N.y11,N.x11),!s),t.arc(p,d,r,mathATan2(N.cy+N.y11,N.cx+N.x11),mathATan2(B.cy+B.y11,B.cx+B.x11),s),t.arc(p+B.cx,d+B.cy,_,mathATan2(B.y11,B.x11),mathATan2(B.y01,B.x01),!s))}else t.lineTo(p+T,d+M),t.arc(p,d,r,u,l,s);else t.lineTo(p+T,d+M)}else t.moveTo(p,d);t.closePath()}}var SectorShape=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,this.innerCornerRadius=0},Sector=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SectorShape},t.prototype.buildPath=function(e,t){buildPath$2(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Path);Sector.prototype.type="sector";var CMD$3=PathProxy.CMD,PI2$6=2*Math.PI,PROP_XY=["x","y"],PROP_WH=["width","height"],tmpArr=[];function aroundEqual(e,t){return Math.abs(e-t)<1e-5}function pathToBezierCurves(e){var t,n,i,r,a,o=e.data,s=e.len(),l=[],u=0,c=0,h=0,p=0;function d(e,n){t&&t.length>2&&l.push(t),t=[e,n]}function f(e,n,i,r){aroundEqual(e,i)&&aroundEqual(n,r)||t.push(e,n,i,r,i,r)}function g(e,n,i,r,a,o){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),p=Math.cos(n),d=Math.sin(n),f=c*a+i,g=h*o+r,m=p*a+i,y=d*o+r,v=a*l*u,_=o*l*u;t.push(f-v*h,g+_*c,m+v*d,y-_*p,m,y)}for(var m=0;m<s;){var y=o[m++],v=1===m;switch(v&&(h=u=o[m],p=c=o[m+1],y!==CMD$3.L&&y!==CMD$3.C&&y!==CMD$3.Q||(t=[h,p])),y){case CMD$3.M:u=h=o[m++],c=p=o[m++],d(h,p);break;case CMD$3.L:f(u,c,n=o[m++],i=o[m++]),u=n,c=i;break;case CMD$3.C:t.push(o[m++],o[m++],o[m++],o[m++],u=o[m++],c=o[m++]);break;case CMD$3.Q:n=o[m++],i=o[m++],r=o[m++],a=o[m++],t.push(u+2/3*(n-u),c+2/3*(i-c),r+2/3*(n-r),a+2/3*(i-a),r,a),u=r,c=a;break;case CMD$3.A:var _=o[m++],x=o[m++],S=o[m++],b=o[m++],T=o[m++],M=o[m++]+T;m+=1;var A=!o[m++];n=Math.cos(T)*S+_,i=Math.sin(T)*b+x,v?d(h=n,p=i):f(u,c,n,i),u=Math.cos(M)*S+_,c=Math.sin(M)*b+x;for(var I=(A?-1:1)*Math.PI/2,C=T;A?C>M:C<M;C+=I){g(C,A?Math.max(C+I,M):Math.min(C+I,M),_,x,S,b)}break;case CMD$3.R:h=u=o[m++],p=c=o[m++],n=h+o[m++],i=p+o[m++],d(n,p),f(n,p,n,i),f(n,i,h,i),f(h,i,h,p),f(h,p,n,p);break;case CMD$3.Z:t&&f(u,c,h,p),u=h,c=p}}return t&&t.length>2&&l.push(t),l}function alignSubpath(e,t){var n=e.length,i=t.length;if(n===i)return[e,t];for(var r=n<i?e:t,a=Math.min(n,i),o=Math.abs(i-n)/6,s=(a-2)/6,l=Math.ceil(o/s)+1,u=[r[0],r[1]],c=o,h=[],p=[],d=2;d<a;){var f=r[d-2],g=r[d-1],m=r[d++],y=r[d++],v=r[d++],_=r[d++],x=r[d++],S=r[d++];if(c<=0)u.push(m,y,v,_,x,S);else{for(var b=Math.min(c,l-1)+1,T=1;T<=b;T++){var M=T/b;cubicSubdivide(f,m,v,x,M,h),cubicSubdivide(g,y,_,S,M,p),f=h[3],g=p[3],u.push(h[1],p[1],h[2],p[2],f,g),m=h[5],y=p[5],v=h[6],_=p[6]}c-=b-1}}return r===e?[u,t]:[e,u]}function createSubpath(e,t){for(var n=e.length,i=e[n-2],r=e[n-1],a=[],o=0;o<t.length;)a[o++]=i,a[o++]=r;return a}function alignBezierCurves(e,t){for(var n,i,r,a=[],o=[],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?(i=c=(n=alignSubpath(l,u))[0],r=h=n[1]):(h=createSubpath(r||l,l),c=l):(c=createSubpath(i||u,u),h=u),a.push(c),o.push(h)}return[a,o]}function centroid(e){for(var t=0,n=0,i=0,r=e.length,a=0,o=r-2;a<r;o=a,a+=2){var s=e[o],l=e[o+1],u=e[a],c=e[a+1],h=s*c-u*l;t+=h,n+=(s+u)*h,i+=(l+c)*h}return 0===t?[e[0]||0,e[1]||0]:[n/t/3,i/t/3,t]}function findBestRingOffset(e,t,n,i){for(var r=(e.length-2)/6,a=1/0,o=0,s=e.length,l=s-2,u=0;u<r;u++){for(var c=6*u,h=0,p=0;p<s;p+=2){var d=0===p?c:(c+p-2)%l+2,f=e[d]-n[0],g=e[d+1]-n[1],m=t[p]-i[0]-f,y=t[p+1]-i[1]-g;h+=m*m+y*y}h<a&&(a=h,o=u)}return o}function reverse(e){for(var t=[],n=e.length,i=0;i<n;i+=2)t[i]=e[n-i-2],t[i+1]=e[n-i-1];return t}function findBestMorphingRotation(e,t,n,i){for(var r,a=[],o=0;o<e.length;o++){var s=e[o],l=t[o],u=centroid(s),c=centroid(l);null==r&&(r=u[2]<0!=c[2]<0);var h=[],p=[],d=0,f=1/0,g=[],m=s.length;r&&(s=reverse(s));for(var y=6*findBestRingOffset(s,l,u,c),v=m-2,_=0;_<v;_+=2){var x=(y+_)%v+2;h[_+2]=s[x]-u[0],h[_+3]=s[x+1]-u[1]}if(h[0]=s[y]-u[0],h[1]=s[y+1]-u[1],n>0)for(var S=i/n,b=-i/2;b<=i/2;b+=S){var T=Math.sin(b),M=Math.cos(b),A=0;for(_=0;_<s.length;_+=2){var I=h[_],C=h[_+1],w=l[_]-c[0],P=l[_+1]-c[1],L=w*M-P*T,E=w*T+P*M;g[_]=L,g[_+1]=E;var D=L-I,R=E-C;A+=D*D+R*R}if(A<f){f=A,d=b;for(var O=0;O<g.length;O++)p[O]=g[O]}}else for(var k=0;k<m;k+=2)p[k]=l[k]-c[0],p[k+1]=l[k+1]-c[1];a.push({from:h,to:p,fromCp:u,toCp:c,rotation:-d})}return a}function morphPath(e,t,n){var i,r;if(!e||!t)return t;!e.path&&e.createPathProxy(),(i=e.path).beginPath(),e.buildPath(i,e.shape),!t.path&&t.createPathProxy(),(r=t.path)===i&&(r=new PathProxy(!1)),r.beginPath(),isIndividualMorphingPath(t)?t.__oldBuildPath(r,t.shape):t.buildPath(r,t.shape);var a=alignBezierCurves(pathToBezierCurves(i),pathToBezierCurves(r)),o=findBestMorphingRotation(a[0],a[1],10,Math.PI);becomeIndividualMorphingPath(t,o,0);var s=n&&n.done,l=n&&n.aborted,u=n&&n.during;return t.animateTo({__morphT:1},defaults({during:function(e){t.dirtyShape(),u&&u(e)},done:function(){restoreIndividualMorphingPath(t),t.createPathProxy(),t.dirtyShape(),s&&s()},aborted:function(){l&&l()}},n)),t}function morphingPathBuildPath(e){for(var t=this.__morphingData,n=this.__morphT,i=1-n,r=[],a=0;a<t.length;a++){var o=t[a],s=o.from,l=o.to,u=o.rotation*n,c=o.fromCp,h=o.toCp,p=Math.sin(u),d=Math.cos(u);lerp(r,c,h,n);for(var f=0;f<s.length;f+=2){var g=s[f],m=s[f+1],y=g*i+l[f]*n,v=m*i+l[f+1]*n;tmpArr[f]=y*d-v*p+r[0],tmpArr[f+1]=y*p+v*d+r[1]}for(f=0;f<s.length;)0===f&&e.moveTo(tmpArr[f++],tmpArr[f++]),e.bezierCurveTo(tmpArr[f++],tmpArr[f++],tmpArr[f++],tmpArr[f++],tmpArr[f++],tmpArr[f++])}}function becomeIndividualMorphingPath(e,t,n){if(isIndividualMorphingPath(e))updateIndividualMorphingPath(e,t,n);else{var i=e;i.__oldBuildPath=i.buildPath,i.buildPath=morphingPathBuildPath,updateIndividualMorphingPath(i,t,n)}}function updateIndividualMorphingPath(e,t,n){e.__morphingData=t,e.__morphT=n}function restoreIndividualMorphingPath(e){isIndividualMorphingPath(e)&&(e.buildPath=e.__oldBuildPath,e.__oldBuildPath=e.__morphingData=null)}function isIndividualMorphingPath(e){return null!=e.__oldBuildPath}function isCombiningPath(e){return!!e.__combiningSubList}function isInAnyMorphing(e){return isIndividualMorphingPath(e)||isCombiningPath(e)}function combine(e,t,n,i){for(var r=[],a=0,o=0;o<e.length;o++){var s=e[o];if(isCombiningPath(s)){for(var l=s.__combiningSubList,u=0;u<l.length;u++)r.push(l[u]);a+=l.length}else r.push(s),a++}if(a){var c=n?n.dividingMethod:null,h=divideShape(t,a,c);assert(h.length===a);var p=n&&n.done,d=n&&n.aborted,f=n&&n.during,g=0,m=!1,y=defaults({during:function(e){f&&f(e)},done:function(){++g===h.length&&(restoreCombiningPath(t),p&&p())},aborted:function(){m||(m=!0,d&&d())}},n);for(o=0;o<a;o++){var v=r[o],_=h[o];i&&i(t,_,!0),morphPath(v,_,y)}return becomeCombiningPath(t,h),{fromIndividuals:r,toIndividuals:h,count:a}}}function becomeCombiningPath(e,t){if(isCombiningPath(e))updateCombiningPathSubList(e,t);else{var n=e;updateCombiningPathSubList(n,t),n.__oldAddSelfToZr=e.addSelfToZr,n.__oldRemoveSelfFromZr=e.removeSelfFromZr,n.addSelfToZr=combiningAddSelfToZr,n.removeSelfFromZr=combiningRemoveSelfFromZr,n.__oldBuildPath=n.buildPath,n.buildPath=noop,n.childrenRef=combiningChildrenRef}}function restoreCombiningPath(e){if(isCombiningPath(e)){var t=e;updateCombiningPathSubList(t,null),t.addSelfToZr=t.__oldAddSelfToZr,t.removeSelfFromZr=t.__oldRemoveSelfFromZr,t.buildPath=t.__oldBuildPath,t.childrenRef=t.__combiningSubList=t.__oldAddSelfToZr=t.__oldRemoveSelfFromZr=t.__oldBuildPath=null}}function updateCombiningPathSubList(e,t){if(e.__combiningSubList!==t){if(combiningPathSubListAddRemoveWithZr(e,"removeSelfFromZr"),e.__combiningSubList=t,t)for(var n=0;n<t.length;n++)t[n].parent=e;combiningPathSubListAddRemoveWithZr(e,"addSelfToZr")}}function combiningAddSelfToZr(e){this.__oldAddSelfToZr(e),combiningPathSubListAddRemoveWithZr(this,"addSelfToZr")}function combiningPathSubListAddRemoveWithZr(e,t){var n=e.__combiningSubList,i=e.__zr;if(n&&i)for(var r=0;r<n.length;r++){n[r][t](i)}}function combiningRemoveSelfFromZr(e){this.__oldRemoveSelfFromZr(e);for(var t=this.__combiningSubList,n=0;n<t.length;n++){t[n].removeSelfFromZr(e)}}function combiningChildrenRef(){return this.__combiningSubList}function separate(e,t,n,i){var r,a=t.length,o=n?n.dividingMethod:null,s=!1;if(isCombiningPath(e)){var l=e.__combiningSubList;l.length===a?r=l:(r=divideShape(e,a,o),s=!0)}else r=divideShape(e,a,o),s=!0;assert(r.length===a);for(var u=0;u<a;u++)s&&i&&i(e,r[u],!1),morphPath(r[u],t[u],n);return{fromIndividuals:r,toIndividuals:t,count:a}}function divideShape(e,t,n){return"duplicate"===n?duplicateShape(e,t):splitShape(e,t)}function splitShape(e,t){var n=[];if(t<=0)return n;if(1===t)return duplicateShape(e,t);if(e instanceof Rect)for(var i=(h=e.shape).height>h.width?1:0,r=PROP_WH[i],a=PROP_XY[i],o=h[r]/t,s=h[a],l=0;l<t;l++,s+=o){var u={x:h.x,y:h.y,width:h.width,height:h.height};u[a]=s,u[r]=l<t-1?o:h[a]+h[r]-s;var c=new Rect({shape:u});n.push(c)}else{if(!(e instanceof Sector))return duplicateShape(e,t);var h,p=(h=e.shape).clockwise,d=h.startAngle,f=h.endAngle,g=(normalizeRadian$1(d,h.endAngle,p)-d)/t,m=d;for(l=0;l<t;l++,m+=g){c=new Sector({shape:{cx:h.cx,cy:h.cy,r:h.r,r0:h.r0,clockwise:p,startAngle:m,endAngle:l===t-1?f:m+g}});n.push(c)}}return n}function duplicateShape(e,t){var n=[];if(t<=0)return n;for(var i=e.constructor,r=0;r<t;r++){var a=new i({shape:clone(e.shape)});n.push(a)}return n}function normalizeRadian$1(e,t,n){return t+PI2$6*Math[n?"ceil":"floor"]((e-t)/PI2$6)}var CompoundPath=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return __extends(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||[],i=0;i<n.length;i++)n[i].buildPath(e,n[i].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),Path.prototype.getBoundingRect.call(this)},t}(Path),m=[],IncrementalDisplayble=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 __extends(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 BoundingRect(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],i=n.getBoundingRect().clone();n.needLocalTransform()&&i.applyTransform(n.getLocalTransform(m)),e.union(i)}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 i=0;i<this._displayables.length;i++){if(this._displayables[i].contain(e,t))return!0}return!1},t}(Displayable),globalImageCache=new LRU(50);function findExistImage(e){if("string"==typeof e){var t=globalImageCache.get(e);return t&&t.image}return e}function createOrUpdateImage(e,t,n,i,r){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var a=globalImageCache.get(e),o={hostEl:n,cb:i,cbPayload:r};return a?!isImageReady(t=a.image)&&a.pending.push(o):((t=new Image).onload=t.onerror=imageOnLoad,globalImageCache.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return e}return t}function imageOnLoad(){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],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function isImageReady(e){return e&&e.width&&e.height}var STYLE_REG=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function truncateText(e,t,n,i,r){if(!t)return"";var a=(e+"").split("\n");r=prepareTruncateOptions(t,n,i,r);for(var o=0,s=a.length;o<s;o++)a[o]=truncateSingleLine(a[o],r);return a.join("\n")}function prepareTruncateOptions(e,t,n,i){var r=extend({},i=i||{});r.font=t,n=retrieve2(n,"..."),r.maxIterations=retrieve2(i.maxIterations,2);var a=r.minChar=retrieve2(i.minChar,0);r.cnCharWidth=getWidth("国",t);var o=r.ascCharWidth=getWidth("a",t);r.placeholder=retrieve2(i.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<a&&s>=o;l++)s-=o;var u=getWidth(n,t);return u>s&&(n="",u=0),s=e-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=e,r}function truncateSingleLine(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var a=getWidth(e,i);if(a<=n)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?estimateLength(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=getWidth(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}function estimateLength(e,t,n,i){for(var r=0,a=0,o=e.length;a<o&&r<t;a++){var s=e.charCodeAt(a);r+=0<=s&&s<=127?n:i}return a}function parsePlainText(e,t){null!=e&&(e+="");var n,i=t.overflow,r=t.padding,a=t.font,o="truncate"===i,s=getLineHeight(a),l=retrieve2(t.lineHeight,s),u="truncate"===t.lineOverflow,c=t.width,h=(n=null!=c&&"break"===i||"breakAll"===i?e?wrapText(e,t.font,c,"breakAll"===i,0).lines:[]:e?e.split("\n"):[]).length*l,p=retrieve2(t.height,h);if(h>p&&u){var d=Math.floor(p/l);n=n.slice(0,d)}var f=p,g=c;if(r&&(f+=r[0]+r[2],null!=g&&(g+=r[1]+r[3])),e&&o&&null!=g)for(var m=prepareTruncateOptions(c,a,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),y=0;y<n.length;y++)n[y]=truncateSingleLine(n[y],m);if(null==c){var v=0;for(y=0;y<n.length;y++)v=Math.max(getWidth(n[y],a),v);c=v}return{lines:n,height:p,outerHeight:f,lineHeight:l,calculatedLineHeight:s,contentHeight:h,width:c}}var RichTextToken=function(){},RichTextLine=function(e){this.tokens=[],e&&(this.tokens=e)},RichTextContentBlock=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function parseRichText(e,t){var n=new RichTextContentBlock;if(null!=e&&(e+=""),!e)return n;for(var i,r=t.width,a=t.height,o=t.overflow,s="break"!==o&&"breakAll"!==o||null==r?null:{width:r,accumWidth:0,breakAll:"breakAll"===o},l=STYLE_REG.lastIndex=0;null!=(i=STYLE_REG.exec(e));){var u=i.index;u>l&&pushTokens(n,e.substring(l,u),t,s),pushTokens(n,i[2],t,s,i[1]),l=STYLE_REG.lastIndex}l<e.length&&pushTokens(n,e.substring(l,e.length),t,s);var c=[],h=0,p=0,d=t.padding,f="truncate"===o,g="truncate"===t.lineOverflow;function m(e,t,n){e.width=t,e.lineHeight=n,h+=n,p=Math.max(p,t)}e:for(var y=0;y<n.lines.length;y++){for(var v=n.lines[y],_=0,x=0,S=0;S<v.tokens.length;S++){var b=(D=v.tokens[S]).styleName&&t.rich[D.styleName]||{},T=D.textPadding=b.padding,M=T?T[1]+T[3]:0,A=D.font=b.font||t.font;D.contentHeight=getLineHeight(A);var I=retrieve2(b.height,D.contentHeight);if(D.innerHeight=I,T&&(I+=T[0]+T[2]),D.height=I,D.lineHeight=retrieve3(b.lineHeight,t.lineHeight,I),D.align=b&&b.align||t.align,D.verticalAlign=b&&b.verticalAlign||"middle",g&&null!=a&&h+D.lineHeight>a){S>0?(v.tokens=v.tokens.slice(0,S),m(v,x,_),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break e}var C=b.width,w=null==C||"auto"===C;if("string"==typeof C&&"%"===C.charAt(C.length-1))D.percentWidth=C,c.push(D),D.contentWidth=getWidth(D.text,A);else{if(w){var P=b.backgroundColor,L=P&&P.image;L&&isImageReady(L=findExistImage(L))&&(D.width=Math.max(D.width,L.width*I/L.height))}var E=f&&null!=r?r-x:null;null!=E&&E<D.width?!w||E<M?(D.text="",D.width=D.contentWidth=0):(D.text=truncateText(D.text,E-M,A,t.ellipsis,{minChar:t.truncateMinChar}),D.width=D.contentWidth=getWidth(D.text,A)):D.contentWidth=getWidth(D.text,A)}D.width+=M,x+=D.width,b&&(_=Math.max(_,D.lineHeight))}m(v,x,_)}n.outerWidth=n.width=retrieve2(r,p),n.outerHeight=n.height=retrieve2(a,h),n.contentHeight=h,n.contentWidth=p,d&&(n.outerWidth+=d[1]+d[3],n.outerHeight+=d[0]+d[2]);for(y=0;y<c.length;y++){var D,R=(D=c[y]).percentWidth;D.width=parseInt(R,10)/100*n.width}return n}function pushTokens(e,t,n,i,r){var a,o,s=""===t,l=r&&n.rich[r]||{},u=e.lines,c=l.font||n.font,h=!1;if(i){var p=l.padding,d=p?p[1]+p[3]:0;if(null!=l.width&&"auto"!==l.width){var f=parsePercent$1(l.width,i.width)+d;u.length>0&&f+i.accumWidth>i.width&&(a=t.split("\n"),h=!0),i.accumWidth=f}else{var g=wrapText(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,o=g.linesWidths,a=g.lines}}else a=t.split("\n");for(var m=0;m<a.length;m++){var y=a[m],v=new RichTextToken;if(v.styleName=r,v.text=y,v.isLineHolder=!y&&!s,"number"==typeof l.width?v.width=l.width:v.width=o?o[m]:getWidth(y,c),m||h)u.push(new RichTextLine([v]));else{var _=(u[u.length-1]||(u[0]=new RichTextLine)).tokens,x=_.length;1===x&&_[0].isLineHolder?_[0]=v:(y||!x||s)&&_.push(v)}}}function isLatin(e){var t=e.charCodeAt(0);return t>=33&&t<=255}var breakCharMap=reduce(",&?/;] ".split(""),(function(e,t){return e[t]=!0,e}),{});function isWordBreakChar(e){return!isLatin(e)||!!breakCharMap[e]}function wrapText(e,t,n,i,r){for(var a=[],o=[],s="",l="",u=0,c=0,h=0;h<e.length;h++){var p=e.charAt(h);if("\n"!==p){var d=getWidth(p,t),f=!i&&!isWordBreakChar(p);(a.length?c+d>n:r+c+d>n)?c?(s||l)&&(f?(s||(s=l,l="",c=u=0),a.push(s),o.push(c-u),l+=p,s="",c=u+=d):(l&&(s+=l,c+=u,l="",u=0),a.push(s),o.push(c),s=p,c=d)):f?(a.push(l),o.push(u),l=p,u=d):(a.push(p),o.push(d)):(c+=d,f?(l+=p,u+=d):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,c+=u),a.push(s),o.push(c),s="",l="",u=0,c=0}return a.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),1===a.length&&(c+=r),{accumWidth:c,lines:a,linesWidths:o}}function parsePercent$1(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}var DEFAULT_RICH_TEXT_COLOR={fill:"#000"},DEFAULT_STROKE_LINE_WIDTH=2,DEFAULT_TEXT_ANIMATION_PROPS={style:defaults({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},DEFAULT_COMMON_ANIMATION_PROPS.style)},ZRText=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=DEFAULT_RICH_TEXT_COLOR,n.attr(t),n}return __extends(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){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}var i=this.attachedTransform;if(i){i.updateTransform();var r=i.transform;r?(this.transform=this.transform||[],copy$1(this.transform,r)):this.transform=null}else e.prototype.update.call(this)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),this.attachedTransform?this.attachedTransform.getComputedTransform():e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){this._childCursor=0,normalizeTextStyle(this.style),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 BoundingRect(0,0,0,0),t=this._children,n=[],i=null,r=0;r<t.length;r++){var a=t[r],o=a.getBoundingRect(),s=a.getLocalTransform(n);s?(e.copy(o),e.applyTransform(s),(i=i||e.clone()).union(e)):(i=i||o.clone()).union(o)}this._rect=i||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||DEFAULT_RICH_TEXT_COLOR},t.prototype.setTextContent=function(e){throw new Error("Can't attach text on another text")},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,i=e.rich||n&&{};return extend(e,t),n&&i?(this._mergeRich(i,n),e.rich=i):i&&(e.rich=i),e},t.prototype._mergeRich=function(e,t){for(var n=keys(t),i=0;i<n.length;i++){var r=n[i];e[r]=e[r]||{},extend(e[r],t[r])}},t.prototype.getAnimationStyleProps=function(){return DEFAULT_TEXT_ANIMATION_PROPS},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||DEFAULT_FONT,n=e.padding,i=parsePlainText(getStyleText(e),e),r=needDrawBackground(e),a=!!e.backgroundColor,o=i.outerHeight,s=i.lines,l=i.lineHeight,u=this._defaultStyle,c=e.x||0,h=e.y||0,p=e.align||u.align||"left",d=e.verticalAlign||u.verticalAlign||"top",f=c,g=adjustTextY(h,i.contentHeight,d);if(r||n){var m=i.width;n&&(m+=n[1]+n[3]);var y=adjustTextX(c,m,p),v=adjustTextY(h,o,d);r&&this._renderBackground(e,e,y,v,m,o)}g+=l/2,n&&(f=getTextXForPadding(c,p,n),"top"===d?g+=n[0]:"bottom"===d&&(g-=n[2]));for(var _=0,x=!1,S=(getFill("fill"in e?e.fill:(x=!0,u.fill))),b=(getStroke("stroke"in e?e.stroke:a||u.autoStroke&&!x?null:(_=DEFAULT_STROKE_LINE_WIDTH,u.stroke))),T=e.textShadowBlur>0,M=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),A=i.calculatedLineHeight,I=0;I<s.length;I++){var C=this._getOrCreateChild(TSpan),w=C.createStyle();C.useStyle(w),w.text=s[I],w.x=f,w.y=g,p&&(w.textAlign=p),w.textBaseline="middle",w.opacity=e.opacity,w.strokeFirst=!0,T&&(w.shadowBlur=e.textShadowBlur||0,w.shadowColor=e.textShadowColor||"transparent",w.shadowOffsetX=e.textShadowOffsetX||0,w.shadowOffsetY=e.textShadowOffsetY||0),b&&(w.stroke=b,w.lineWidth=e.lineWidth||_,w.lineDash=e.lineDash,w.lineDashOffset=e.lineDashOffset||0),S&&(w.fill=S),w.font=t,g+=l,M&&C.setBoundingRect(new BoundingRect(adjustTextX(w.x,e.width,w.textAlign),adjustTextY(w.y,A,w.textBaseline),e.width,A))}},t.prototype._updateRichTexts=function(){var e=this.style,t=parseRichText(getStyleText(e),e),n=t.width,i=t.outerWidth,r=t.outerHeight,a=e.padding,o=e.x||0,s=e.y||0,l=this._defaultStyle,u=e.align||l.align,c=e.verticalAlign||l.verticalAlign,h=adjustTextX(o,i,u),p=adjustTextY(s,r,c),d=h,f=p;a&&(d+=a[3],f+=a[0]);var g=d+n;needDrawBackground(e)&&this._renderBackground(e,e,h,p,i,r);for(var m=!!e.backgroundColor,y=0;y<t.lines.length;y++){for(var v=t.lines[y],_=v.tokens,x=_.length,S=v.lineHeight,b=v.width,T=0,M=d,A=g,I=x-1,C=void 0;T<x&&(!(C=_[T]).align||"left"===C.align);)this._placeToken(C,e,S,f,M,"left",m),b-=C.width,M+=C.width,T++;for(;I>=0&&"right"===(C=_[I]).align;)this._placeToken(C,e,S,f,A,"right",m),b-=C.width,A-=C.width,I--;for(M+=(n-(M-d)-(g-A)-b)/2;T<=I;)C=_[T],this._placeToken(C,e,S,f,M+C.width/2,"center",m),M+=C.width,T++;f+=S}},t.prototype._placeToken=function(e,t,n,i,r,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=i+n/2;"top"===l?u=i+e.height/2:"bottom"===l&&(u=i+n-e.height/2),!e.isLineHolder&&needDrawBackground(s)&&this._renderBackground(s,t,"right"===a?r-e.width:"center"===a?r-e.width/2:r,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(r=getTextXForPadding(r,a,h),u-=e.height/2-h[0]-e.innerHeight/2);var p=this._getOrCreateChild(TSpan),d=p.createStyle();p.useStyle(d);var f=this._defaultStyle,g=!1,m=0,y=getStroke("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,f.fill)),v=getStroke("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||o||f.autoStroke&&!g?null:(m=DEFAULT_STROKE_LINE_WIDTH,f.stroke)),_=s.textShadowBlur>0||t.textShadowBlur>0;d.text=e.text,d.x=r,d.y=u,_&&(d.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,d.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",d.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,d.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),d.textAlign=a,d.textBaseline="middle",d.font=e.font||DEFAULT_FONT,d.opacity=retrieve3(s.opacity,t.opacity,1),v&&(d.lineWidth=retrieve3(s.lineWidth,t.lineWidth,m),d.lineDash=retrieve2(s.lineDash,t.lineDash),d.lineDashOffset=t.lineDashOffset||0,d.stroke=v),y&&(d.fill=y);var x=e.contentWidth,S=e.contentHeight;p.setBoundingRect(new BoundingRect(adjustTextX(d.x,x,d.textAlign),adjustTextY(d.y,S,d.textBaseline),x,S))},t.prototype._renderBackground=function(e,t,n,i,r,a){var o,s,l,u=e.backgroundColor,c=e.borderWidth,h=e.borderColor,p=isString(u),d=e.borderRadius,f=this;if(p||c&&h){(o=this._getOrCreateChild(Rect)).useStyle(o.createStyle()),o.style.fill=null;var g=o.shape;g.x=n,g.y=i,g.width=r,g.height=a,g.r=d,o.dirtyShape()}if(p)(l=o.style).fill=u||null,l.fillOpacity=retrieve2(e.fillOpacity,1);else if(u&&u.image){(s=this._getOrCreateChild(ZRImage)).onload=function(){f.dirtyStyle()};var m=s.style;m.image=u.image,m.x=n,m.y=i,m.width=r,m.height=a}c&&h&&((l=o.style).lineWidth=c,l.stroke=h,l.strokeOpacity=retrieve2(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(o||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=retrieve3(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";if(e.fontSize||e.fontFamily||e.fontWeight){var n="";n="string"!=typeof e.fontSize||-1===e.fontSize.indexOf("px")&&-1===e.fontSize.indexOf("rem")&&-1===e.fontSize.indexOf("em")?isNaN(+e.fontSize)?"12px":e.fontSize+"px":e.fontSize,t=[e.fontStyle,e.fontWeight,n,e.fontFamily||"sans-serif"].join(" ")}return t&&trim(t)||e.textFont||e.font},t}(Displayable),VALID_TEXT_ALIGN={left:!0,right:1,center:1},VALID_TEXT_VERTICAL_ALIGN={top:1,bottom:1,middle:1};function normalizeTextStyle(e){return normalizeStyle(e),each(e.rich,normalizeStyle),e}function normalizeStyle(e){if(e){e.font=ZRText.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||VALID_TEXT_ALIGN[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||VALID_TEXT_VERTICAL_ALIGN[n]?n:"top",e.padding&&(e.padding=normalizeCssArray(e.padding))}}function getStroke(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function getFill(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function getTextXForPadding(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function getStyleText(e){var t=e.text;return null!=t&&(t+=""),t}function needDrawBackground(e){return!!(e.backgroundColor||e.borderWidth&&e.borderColor)}var ArcShape=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Arc=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ArcShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(a),u=Math.sin(a);e.moveTo(l*r+n,u*r+i),e.arc(n,i,r,a,o,!s)},t}(Path);Arc.prototype.type="arc";var out=[],BezierCurveShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function someVectorAt(e,t,n){var i=e.cpx2,r=e.cpy2;return null===i||null===r?[(n?cubicDerivativeAt:cubicAt)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?cubicDerivativeAt:cubicAt)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?quadraticDerivativeAt:quadraticAt)(e.x1,e.cpx1,e.x2,t),(n?quadraticDerivativeAt:quadraticAt)(e.y1,e.cpy1,e.y2,t)]}var BezierCurve=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new BezierCurveShape},t.prototype.buildPath=function(e,t){var n=t.x1,i=t.y1,r=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,i),null==l||null==u?(c<1&&(quadraticSubdivide(n,o,r,c,out),o=out[1],r=out[2],quadraticSubdivide(i,s,a,c,out),s=out[1],a=out[2]),e.quadraticCurveTo(o,s,r,a)):(c<1&&(cubicSubdivide(n,o,l,r,c,out),o=out[1],l=out[2],r=out[3],cubicSubdivide(i,s,u,a,c,out),s=out[1],u=out[2],a=out[3]),e.bezierCurveTo(o,s,l,u,r,a)))},t.prototype.pointAt=function(e){return someVectorAt(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=someVectorAt(this.shape,e,!0);return normalize(t,t)},t}(Path);BezierCurve.prototype.type="bezier-curve";var DropletShape=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},Droplet=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new DropletShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.width,a=t.height;e.moveTo(n,i+r),e.bezierCurveTo(n+r,i+r,n+3*r/2,i-r/3,n,i-a),e.bezierCurveTo(n-3*r/2,i-r/3,n-r,i+r,n,i+r),e.closePath()},t}(Path);Droplet.prototype.type="droplet";var HeartShape=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},Heart=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new HeartShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.width,a=t.height;e.moveTo(n,i),e.bezierCurveTo(n+r/2,i-2*a/3,n+2*r,i+a/3,n,i+a),e.bezierCurveTo(n-2*r,i+a/3,n-r/2,i-2*a/3,n,i)},t}(Path);Heart.prototype.type="heart";var PI$3=Math.PI,sin=Math.sin,cos=Math.cos,IsogonShape=function(){this.x=0,this.y=0,this.r=0,this.n=0},Isogon=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new IsogonShape},t.prototype.buildPath=function(e,t){var n=t.n;if(n&&!(n<2)){var i=t.x,r=t.y,a=t.r,o=2*PI$3/n,s=-PI$3/2;e.moveTo(i+a*cos(s),r+a*sin(s));for(var l=0,u=n-1;l<u;l++)s+=o,e.lineTo(i+a*cos(s),r+a*sin(s));e.closePath()}},t}(Path);Isogon.prototype.type="isogon";var RingShape=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Ring=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new RingShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=2*Math.PI;e.moveTo(n+t.r,i),e.arc(n,i,t.r,0,r,!1),e.moveTo(n+t.r0,i),e.arc(n,i,t.r0,0,r,!0)},t}(Path);Ring.prototype.type="ring";var sin$1=Math.sin,cos$1=Math.cos,radian=Math.PI/180,RoseShape=function(){this.cx=0,this.cy=0,this.r=[],this.k=0,this.n=1},Rose=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new RoseShape},t.prototype.buildPath=function(e,t){var n,i,r,a=t.r,o=t.k,s=t.n,l=t.cx,u=t.cy;e.moveTo(l,u);for(var c=0,h=a.length;c<h;c++){r=a[c];for(var p=0;p<=360*s;p++)n=r*sin$1(o/s*p%360*radian)*cos$1(p*radian)+l,i=r*sin$1(o/s*p%360*radian)*sin$1(p*radian)+u,e.lineTo(n,i)}},t}(Path);Rose.prototype.type="rose";var PI$4=Math.PI,cos$2=Math.cos,sin$2=Math.sin,StarShape=function(){this.cx=0,this.cy=0,this.n=3,this.r=0},Star=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new StarShape},t.prototype.buildPath=function(e,t){var n=t.n;if(n&&!(n<2)){var i=t.cx,r=t.cy,a=t.r,o=t.r0;null==o&&(o=n>4?a*cos$2(2*PI$4/n)/cos$2(PI$4/n):a/3);var s=PI$4/n,l=-PI$4/2,u=i+a*cos$2(l),c=r+a*sin$2(l);l+=s,e.moveTo(u,c);for(var h=0,p=2*n-1,d=void 0;h<p;h++)d=h%2==0?o:a,e.lineTo(i+d*cos$2(l),r+d*sin$2(l)),l+=s;e.closePath()}},t}(Path);Star.prototype.type="star";var cos$3=Math.cos,sin$3=Math.sin,TrochoidShape=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0,this.d=0,this.location="out"},Trochoid=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new TrochoidShape},t.prototype.buildPath=function(e,t){var n,i,r,a,o=t.r,s=t.r0,l=t.d,u=t.cx,c=t.cy,h="out"===t.location?1:-1;if(!(t.location&&o<=s)){var p,d=0,f=1;n=(o+h*s)*cos$3(0)-h*l*cos$3(0)+u,i=(o+h*s)*sin$3(0)-l*sin$3(0)+c,e.moveTo(n,i);do{d++}while(s*d%(o+h*s)!=0);do{p=Math.PI/180*f,r=(o+h*s)*cos$3(p)-h*l*cos$3((o/s+h)*p)+u,a=(o+h*s)*sin$3(p)-l*sin$3((o/s+h)*p)+c,e.lineTo(r,a),f++}while(f<=s*d/(o+h*s)*360)}},t}(Path);Trochoid.prototype.type="trochoid";var RadialGradient=function(e){function t(t,n,i,r,a){var o=e.call(this,r)||this;return o.x=null==t?.5:t,o.y=null==n?.5:n,o.r=null==i?.5:i,o.type="radial",o.global=a||!1,o}return __extends(t,e),t}(Gradient),extent=[0,0],extent2=[0,0],minTv$1=new Point,maxTv$1=new Point,OrientedBoundingRect=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Point;for(n=0;n<2;n++)this._axes[n]=new Point;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,i=this._axes,r=e.x,a=e.y,o=r+e.width,s=a+e.height;if(n[0].set(r,a),n[1].set(o,a),n[2].set(o,s),n[3].set(r,s),t)for(var l=0;l<4;l++)n[l].transform(t);Point.sub(i[0],n[1],n[0]),Point.sub(i[1],n[3],n[0]),i[0].normalize(),i[1].normalize();for(l=0;l<2;l++)this._origin[l]=i[l].dot(n[0])},e.prototype.intersect=function(e,t){var n=!0,i=!t;return minTv$1.set(1/0,1/0),maxTv$1.set(0,0),!this._intersectCheckOneSide(this,e,minTv$1,maxTv$1,i,1)&&(n=!1,i)||!this._intersectCheckOneSide(e,this,minTv$1,maxTv$1,i,-1)&&(n=!1,i)||i||Point.copy(t,n?minTv$1:maxTv$1),n},e.prototype._intersectCheckOneSide=function(e,t,n,i,r,a){for(var o=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,e._corners,extent),this._getProjMinMaxOnAxis(s,t._corners,extent2),extent[1]<extent2[0]||extent[0]>extent2[1]){if(o=!1,r)return o;var u=Math.abs(extent2[0]-extent[1]),c=Math.abs(extent[0]-extent2[1]);Math.min(u,c)>i.len()&&(u<c?Point.scale(i,l,-u*a):Point.scale(i,l,c*a))}else if(n){u=Math.abs(extent2[0]-extent[1]),c=Math.abs(extent[0]-extent2[1]);Math.min(u,c)<n.len()&&(u<c?Point.scale(n,l,u*a):Point.scale(n,l,-c*a))}}return o},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var i=this._axes[e],r=this._origin,a=t[0].dot(i)+r[e],o=a,s=a,l=1;l<t.length;l++){var u=t[l].dot(i)+r[e];o=Math.min(u,o),s=Math.max(u,s)}n[0]=o,n[1]=s},e}(),useVML=!env.canvasSupported,painterCtors={},instances={};function delInstance(e){delete instances[e]}function isDarkMode(e){if(!e)return!1;if("string"==typeof e)return lum(e,1)<DARK_MODE_THRESHOLD;if(e.colorStops){for(var t=e.colorStops,n=0,i=t.length,r=0;r<i;r++)n+=lum(t[r].color,1);return(n/=i)<DARK_MODE_THRESHOLD}return!1}var ZRender=function(){function e(e,t,n){var i=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 r=new Storage,a=n.renderer;if(useVML){if(!painterCtors.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");a="vml"}else a||(a="canvas");if(!painterCtors[a])throw new Error("Renderer '"+a+"' is not imported. Please import it first.");n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var o=new painterCtors[a](t,r,n,e);this.storage=r,this.painter=o;var s=env.node||env.worker?null:new HandlerDomProxy(o.getViewportRoot(),o.root);this.handler=new Handler(r,o,s,o.root),this.animation=new Animation({stage:{update:function(){return i._flush(!0)}}}),this.animation.start()}return e.prototype.add=function(e){e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh()},e.prototype.setBackgroundColor=function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=isDarkMode(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){e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},e.prototype.refresh=function(){this._needsRefresh=!0,this.animation.start()},e.prototype.flush=function(){this._flush(!1)},e.prototype._flush=function(e){var t,n=(new Date).getTime();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var i=(new Date).getTime();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-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.animation.start(),this._stillFrameAccum=0},e.prototype.addHover=function(e){},e.prototype.removeHover=function(e){},e.prototype.clearHover=function(){},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},e.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},e.prototype.clearAnimation=function(){this.animation.clear()},e.prototype.getWidth=function(){return this.painter.getWidth()},e.prototype.getHeight=function(){return this.painter.getHeight()},e.prototype.pathToImage=function(e,t){if(this.painter.pathToImage)return this.painter.pathToImage(e,t)},e.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this.handler.off(e,t)},e.prototype.trigger=function(e,t){this.handler.trigger(e,t)},e.prototype.clear=function(){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Group&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()},e.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,delInstance(this.id)},e}();function init(e,t){var n=new ZRender(guid(),e,t);return instances[n.id]=n,n}function dispose(e){e.dispose()}function disposeAll(){for(var e in instances)instances.hasOwnProperty(e)&&instances[e].dispose();instances={}}function getInstance(e){return instances[e]}function registerPainter(e,t){painterCtors[e]=t}var version="5.0.1",zrender=Object.freeze({__proto__:null,init:init,dispose:dispose,disposeAll:disposeAll,getInstance:getInstance,registerPainter:registerPainter,version:version}),RADIAN_EPSILON=1e-4;function _trim(e){return e.replace(/^\s+|\s+$/g,"")}function linearMap(e,t,n,i){var r=t[1]-t[0],a=n[1]-n[0];if(0===r)return 0===a?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(e<=t[0])return n[0];if(e>=t[1])return n[1]}else{if(e>=t[0])return n[0];if(e<=t[1])return n[1]}else{if(e===t[0])return n[0];if(e===t[1])return n[1]}return(e-t[0])/r*a+n[0]}function parsePercent$2(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"string"==typeof e?_trim(e).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function round$1(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function asc(e){return e.sort((function(e,t){return e-t})),e}function getPrecision(e){if(e=+e,isNaN(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}function getPrecisionSafe(e){var t=e.toString(),n=t.indexOf("e");if(n>0){var i=+t.slice(n+1);return i<0?-i:0}var r=t.indexOf(".");return r<0?0:t.length-1-r}function getPixelPrecision(e,t){var n=Math.log,i=Math.LN10,r=Math.floor(n(e[1]-e[0])/i),a=Math.round(n(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20}function getPercentWithPrecision(e,t,n){if(!e[t])return 0;var i=reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===i)return 0;for(var r=Math.pow(10,n),a=map(e,(function(e){return(isNaN(e)?0:e)/i*r*100})),o=100*r,s=map(a,(function(e){return Math.floor(e)})),l=reduce(s,(function(e,t){return e+t}),0),u=map(a,(function(e,t){return e-s[t]}));l<o;){for(var c=Number.NEGATIVE_INFINITY,h=null,p=0,d=u.length;p<d;++p)u[p]>c&&(c=u[p],h=p);++s[h],u[h]=0,++l}return s[t]/r}var MAX_SAFE_INTEGER=9007199254740991;function remRadian(e){var t=2*Math.PI;return(e%t+t)%t}function isRadianAroundZero(e){return e>-RADIAN_EPSILON&&e<RADIAN_EPSILON}var TIME_REG=/^(?:(\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 parseDate(e){if(e instanceof Date)return e;if("string"==typeof e){var t=TIME_REG.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]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))}function quantity(e){return Math.pow(10,quantityExponent(e))}function quantityExponent(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 nice(e,t){var n=quantityExponent(e),i=Math.pow(10,n),r=e/i;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function quantile(e,t){var n=(e.length-1)*t+1,i=Math.floor(n),r=+e[i-1],a=n-i;return a?r+a*(e[i]-r):r}function reformIntervals(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,i=0;i<e.length;){for(var r=e[i].interval,a=e[i].close,o=0;o<2;o++)r[o]<=t&&(r[o]=t,a[o]=o?1:1-n),t=r[o],n=a[o];r[0]===r[1]&&a[0]*a[1]!=1?e.splice(i,1):i++}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 numericToNumber(e){var t=parseFloat(e);return t==e&&(0!==t||"string"!=typeof e||e.indexOf("x")<=0)?t:NaN}function isNumeric(e){return!isNaN(numericToNumber(e))}function getRandomIdBase(){return Math.round(9*Math.random())}function getGreatestCommonDividor(e,t){return 0===t?e:getGreatestCommonDividor(t,e%t)}function getLeastCommonMultiple(e,t){return null==e?t:null==t?e:e*t/getGreatestCommonDividor(e,t)}var numberUtil=Object.freeze({__proto__:null,linearMap:linearMap,parsePercent:parsePercent$2,round:round$1,asc:asc,getPrecision:getPrecision,getPrecisionSafe:getPrecisionSafe,getPixelPrecision:getPixelPrecision,getPercentWithPrecision:getPercentWithPrecision,MAX_SAFE_INTEGER:MAX_SAFE_INTEGER,remRadian:remRadian,isRadianAroundZero:isRadianAroundZero,parseDate:parseDate,quantity:quantity,quantityExponent:quantityExponent,nice:nice,quantile:quantile,reformIntervals:reformIntervals,numericToNumber:numericToNumber,isNumeric:isNumeric,getRandomIdBase:getRandomIdBase,getGreatestCommonDividor:getGreatestCommonDividor,getLeastCommonMultiple:getLeastCommonMultiple}),ECHARTS_PREFIX="[ECharts] ",storedLogs={},hasConsole="undefined"!=typeof console&&console.warn&&console.log;function warn(e){hasConsole&&console.warn(ECHARTS_PREFIX+e)}function error(e){hasConsole&&console.error(ECHARTS_PREFIX+e)}function deprecateLog(e){0}function deprecateReplaceLog(e,t,n){0}function consoleLog(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function makePrintable(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";return n}function throwError(e){throw new Error(e)}var DUMMY_COMPONENT_NAME_PREFIX="series\0",INTERNAL_COMPONENT_ID_PREFIX="\0_ec_\0";function normalizeToArray(e){return e instanceof Array?e:null==e?[]:[e]}function defaultEmphasis(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var i=0,r=n.length;i<r;i++){var a=n[i];!e.emphasis[t].hasOwnProperty(a)&&e[t].hasOwnProperty(a)&&(e.emphasis[t][a]=e[t][a])}}}var TEXT_STYLE_OPTIONS=["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 getDataItemValue(e){return!isObject(e)||isArray(e)||e instanceof Date?e:e.value}function isDataItemOption(e){return isObject(e)&&!(e instanceof Array)}function mappingToExists(e,t,n){var i="normalMerge"===n,r="replaceMerge"===n,a="replaceAll"===n;e=e||[],t=(t||[]).slice();var o=createHashMap();each(t,(function(e,n){isObject(e)||(t[n]=null)}));var s=prepareResult(e,o,n);return(i||r)&&mappingById(s,e,o,t),i&&mappingByName(s,t),i||r?mappingByIndex(s,t,r):a&&mappingInReplaceAllMode(s,t),makeIdAndName(s),s}function prepareResult(e,t,n){var i=[];if("replaceAll"===n)return i;for(var r=0;r<e.length;r++){var a=e[r];a&&null!=a.id&&t.set(a.id,r),i.push({existing:"replaceMerge"===n||isComponentIdInternal(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return i}function mappingById(e,t,n,i){each(i,(function(r,a){if(r&&null!=r.id){var o=makeComparableKey(r.id),s=n.get(o);if(null!=s){var l=e[s];assert(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=r,l.existing=t[s],i[a]=null}}}))}function mappingByName(e,t){each(t,(function(n,i){if(n&&null!=n.name)for(var r=0;r<e.length;r++){var a=e[r].existing;if(!e[r].newOption&&a&&(null==a.id||null==n.id)&&!isComponentIdInternal(n)&&!isComponentIdInternal(a)&&keyExistAndEqual("name",a,n))return e[r].newOption=n,void(t[i]=null)}}))}function mappingByIndex(e,t,n){each(t,(function(t){if(t){for(var i,r=0;(i=e[r])&&(i.newOption||isComponentIdInternal(i.existing)||i.existing&&null!=t.id&&!keyExistAndEqual("id",t,i.existing));)r++;i?(i.newOption=t,i.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),r++}}))}function mappingInReplaceAllMode(e,t){each(t,(function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})}))}function makeIdAndName(e){var t=createHashMap();each(e,(function(e){var n=e.existing;n&&t.set(n.id,e)})),each(e,(function(e){var n=e.newOption;assert(!n||null==n.id||!t.get(n.id)||t.get(n.id)===e,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})})),each(e,(function(e,n){var i=e.existing,r=e.newOption,a=e.keyInfo;if(isObject(r)){if(a.name=null!=r.name?makeComparableKey(r.name):i?i.name:DUMMY_COMPONENT_NAME_PREFIX+n,i)a.id=makeComparableKey(i.id);else if(null!=r.id)a.id=makeComparableKey(r.id);else{var o=0;do{a.id="\0"+a.name+"\0"+o++}while(t.get(a.id))}t.set(a.id,e)}}))}function keyExistAndEqual(e,t,n){var i=convertOptionIdName(t[e],null),r=convertOptionIdName(n[e],null);return null!=i&&null!=r&&i===r}function makeComparableKey(e){return convertOptionIdName(e,"")}function convertOptionIdName(e,t){if(null==e)return t;var n=typeof e;return"string"===n?e:"number"===n||isStringSafe(e)?e+"":t}function warnInvalidateIdOrName(e){0}function isValidIdOrName(e){return isStringSafe(e)||isNumeric(e)}function isNameSpecified(e){var t=e.name;return!(!t||!t.indexOf(DUMMY_COMPONENT_NAME_PREFIX))}function isComponentIdInternal(e){return e&&null!=e.id&&0===makeComparableKey(e.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX)}function makeInternalComponentId(e){return INTERNAL_COMPONENT_ID_PREFIX+e}function setComponentTypeToKeyInfo(e,t,n){each(e,(function(e){var i=e.newOption;isObject(i)&&(e.keyInfo.mainType=t,e.keyInfo.subType=determineSubType(t,i,e.existing,n))}))}function determineSubType(e,t,n,i){return t.type?t.type:n?n.subType:i.determineSubType(e,t)}function compressBatches(e,t){var n={},i={};return r(e||[],n),r(t||[],i,n),[a(n),a(i)];function r(e,t,n){for(var i=0,r=e.length;i<r;i++){var a=convertOptionIdName(e[i].seriesId,null);if(null==a)return;for(var o=normalizeToArray(e[i].dataIndex),s=n&&n[a],l=0,u=o.length;l<u;l++){var c=o[l];s&&s[c]?s[c]=null:(t[a]||(t[a]={}))[c]=1}}}function a(e,t){var n=[];for(var i in e)if(e.hasOwnProperty(i)&&null!=e[i])if(t)n.push(+i);else{var r=a(e[i],!0);r.length&&n.push({seriesId:i,dataIndex:r})}return n}}function queryDataIndex(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?isArray(t.dataIndex)?map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?isArray(t.name)?map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}function makeInner(){var e="__ec_inner_"+innerUniqueIndex++;return function(t){return t[e]||(t[e]={})}}var innerUniqueIndex=getRandomIdBase();function parseFinder(e,t,n){var i;if(isString(t)){var r={};r[t+"Index"]=0,i=r}else i=t;var a=createHashMap(),o={},s=!1;each(i,(function(e,t){if("dataIndex"!==t&&"dataIndexInside"!==t){var i=t.match(/^(\w+)(Index|Id|Name)$/)||[],r=i[1],l=(i[2]||"").toLowerCase();if(r&&l&&!(n&&n.includeMainTypes&&indexOf(n.includeMainTypes,r)<0))s=s||!!r,(a.get(r)||a.set(r,{}))[l]=e}else o[t]=e}));var l=n?n.defaultMainType:null;return!s&&l&&a.set(l,{}),a.each((function(t,i){var r=queryReferringComponents(e,i,t,{useDefault:l===i,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});o[i+"Models"]=r.models,o[i+"Model"]=r.models[0]})),o}var SINGLE_REFERRING={useDefault:!0,enableAll:!1,enableNone:!1},MULTIPLE_REFERRING={useDefault:!1,enableAll:!0,enableNone:!0};function queryReferringComponents(e,t,n,i){i=i||SINGLE_REFERRING;var r=n.index,a=n.id,o=n.name,s={models:null,specified:null!=r||null!=a||null!=o};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=e.getComponent(t))?[l]:[],s}return"none"===r||!1===r?(assert(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):("all"===r&&(assert(i.enableAll,'`"all"` is not a valid value on index option.'),r=a=o=null),s.models=e.queryComponents({mainType:t,index:r,id:a,name:o}),s)}function setAttribute(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function getAttribute(e,t){return e.getAttribute?e.getAttribute(t):e[t]}function getTooltipRenderMode(e){return"auto"===e?env.domSupported?"html":"richText":e||"html"}function groupData(e,t){var n=createHashMap(),i=[];return each(e,(function(e){var r=t(e);(n.get(r)||(i.push(r),n.set(r,[]))).push(e)})),{keys:i,buckets:n}}function interpolateRawValues(e,t,n,i,r){var a=null==t||"auto"===t;if(null==i)return i;if("number"==typeof i)return round$1(d=interpolateNumber(n||0,i,r),a?Math.max(getPrecisionSafe(n||0),getPrecisionSafe(i)):t);if("string"==typeof i)return r<1?n:i;for(var o=[],s=n||[],l=i,u=Math.max(s.length,l.length),c=0;c<u;++c){if("ordinal"===e.getDimensionInfo(c).type)o[c]=(r<1?s:l)[c];else{var h=s&&s[c]?s[c]:0,p=l[c],d=null==s?i[c]:interpolateNumber(h,p,r);o[c]=round$1(d,a?Math.max(getPrecisionSafe(h),getPrecisionSafe(p)):t)}}return o}var TYPE_DELIMITER=".",IS_CONTAINER="___EC__COMPONENT__CONTAINER___",IS_EXTENDED_CLASS="___EC__EXTENDED_CLASS___";function parseClassType(e){var t={main:"",sub:""};if(e){var n=e.split(TYPE_DELIMITER);t.main=n[0]||"",t.sub=n[1]||""}return t}function checkClassType(e){assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function isExtendedClass(e){return!(!e||!e[IS_EXTENDED_CLASS])}function enableClassExtend(e,t){e.$constructor=e,e.extend=function(e){var t=this;function n(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(e.$constructor)e.$constructor.apply(this,arguments);else{if(isESClass(t)){var a=createObject(n.prototype,new(t.bind.apply(t,__spreadArrays([void 0],i))));return a}t.apply(this,arguments)}}return n[IS_EXTENDED_CLASS]=!0,extend(n.prototype,e),n.extend=this.extend,n.superCall=superCall,n.superApply=superApply,inherits(n,this),n.superClass=t,n}}function isESClass(e){return"function"==typeof e&&/^class\s/.test(Function.prototype.toString.call(e))}function mountExtend(e,t){e.extend=t.extend}var classBase=Math.round(10*Math.random());function enableClassCheck(e){var t=["__\0is_clz",classBase++].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}}function superCall(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return this.superClass.prototype[t].apply(e,n)}function superApply(e,t,n){return this.superClass.prototype[t].apply(e,n)}function enableClassManagement(e,t){t=t||{};var n={};if(e.registerClass=function(e){var t=e.type||e.prototype.type;if(t){checkClassType(t),e.prototype.type=t;var i=parseClassType(t);if(i.sub){if(i.sub!==IS_CONTAINER){(function(e){var t=n[e.main];t&&t[IS_CONTAINER]||((t=n[e.main]={})[IS_CONTAINER]=!0);return t}(i))[i.sub]=e}}else n[i.main]=e}return e},e.getClass=function(e,t,i){var r=n[e];if(r&&r[IS_CONTAINER]&&(r=t?r[t]:null),i&&!r)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return r},e.getClassesByMainType=function(e){var t=parseClassType(e),i=[],r=n[t.main];return r&&r[IS_CONTAINER]?each(r,(function(e,t){t!==IS_CONTAINER&&i.push(e)})):i.push(r),i},e.hasClass=function(e){var t=parseClassType(e);return!!n[t.main]},e.getAllClassMainTypes=function(){var e=[];return each(n,(function(t,n){e.push(n)})),e},e.hasSubTypes=function(e){var t=parseClassType(e),i=n[t.main];return i&&i[IS_CONTAINER]},t.registerWhenExtend){var i=e.extend;i&&(e.extend=function(t){var n=i.call(this,t);return e.registerClass(n)})}}function makeStyleMapper(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,i,r){for(var a={},o=0;o<e.length;o++){var s=e[o][1];if(!(i&&indexOf(i,s)>=0||r&&indexOf(r,s)<0)){var l=n.getShallow(s,t);null!=l&&(a[e[o][0]]=l)}}return a}}var AREA_STYLE_KEY_MAP=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],getAreaStyle=makeStyleMapper(AREA_STYLE_KEY_MAP),AreaStyleMixin=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return getAreaStyle(this,e,t)},e}(),getECData=makeInner(),_highlightNextDigit=1,_highlightKeyMap={},getSavedStates=makeInner(),HOVER_STATE_NORMAL=0,HOVER_STATE_BLUR=1,HOVER_STATE_EMPHASIS=2,SPECIAL_STATES=["emphasis","blur","select"],DISPLAY_STATES=["normal","emphasis","blur","select"],Z2_EMPHASIS_LIFT=10,Z2_SELECT_LIFT=9,HIGHLIGHT_ACTION_TYPE="highlight",DOWNPLAY_ACTION_TYPE="downplay",SELECT_ACTION_TYPE="select",UNSELECT_ACTION_TYPE="unselect",TOGGLE_SELECT_ACTION_TYPE="toggleSelect";function hasFillOrStroke(e){return null!=e&&"none"!==e}var liftedColorCache=new LRU(100);function liftColor(e){if("string"!=typeof e)return e;var t=liftedColorCache.get(e);return t||(t=lift(e,-.1),liftedColorCache.put(e,t)),t}function doChangeHoverState(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function singleEnterEmphasis(e){doChangeHoverState(e,"emphasis",HOVER_STATE_EMPHASIS)}function singleLeaveEmphasis(e){e.hoverState===HOVER_STATE_EMPHASIS&&doChangeHoverState(e,"normal",HOVER_STATE_NORMAL)}function singleEnterBlur(e){doChangeHoverState(e,"blur",HOVER_STATE_BLUR)}function singleLeaveBlur(e){e.hoverState===HOVER_STATE_BLUR&&doChangeHoverState(e,"normal",HOVER_STATE_NORMAL)}function singleEnterSelect(e){e.selected=!0}function singleLeaveSelect(e){e.selected=!1}function updateElementState(e,t,n){t(e,n)}function traverseUpdateState(e,t,n){updateElementState(e,t,n),e.isGroup&&e.traverse((function(e){updateElementState(e,t,n)}))}function setStatesFlag(e,t){switch(t){case"emphasis":e.hoverState=HOVER_STATE_EMPHASIS;break;case"normal":e.hoverState=HOVER_STATE_NORMAL;break;case"blur":e.hoverState=HOVER_STATE_BLUR;break;case"select":e.selected=!0}}function getFromStateStyle(e,t,n,i){for(var r=e.style,a={},o=0;o<t.length;o++){var s=t[o],l=r[s];a[s]=null==l?i&&i[s]:l}for(o=0;o<e.animators.length;o++){var u=e.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveFinalToTarget(a,t)}return a}function createEmphasisDefaultState(e,t,n,i){var r=n&&indexOf(n,"select")>=0,a=!1;if(e instanceof Path){var o=getSavedStates(e),s=r&&o.selectFill||o.normalFill,l=r&&o.selectStroke||o.normalStroke;if(hasFillOrStroke(s)||hasFillOrStroke(l)){var u=(i=i||{}).style||{};!hasFillOrStroke(u.fill)&&hasFillOrStroke(s)?(a=!0,i=extend({},i),(u=extend({},u)).fill=liftColor(s)):!hasFillOrStroke(u.stroke)&&hasFillOrStroke(l)&&(a||(i=extend({},i),u=extend({},u)),u.stroke=liftColor(l)),i.style=u}}if(i&&null==i.z2){a||(i=extend({},i));var c=e.z2EmphasisLift;i.z2=e.z2+(null!=c?c:Z2_EMPHASIS_LIFT)}return i}function createSelectDefaultState(e,t,n){if(n&&null==n.z2){n=extend({},n);var i=e.z2SelectLift;n.z2=e.z2+(null!=i?i:Z2_SELECT_LIFT)}return n}function createBlurDefaultState(e,t,n){var i=indexOf(e.currentStates,t)>=0,r=e.style.opacity,a=i?null:getFromStateStyle(e,["opacity"],t,{opacity:1}),o=(n=n||{}).style||{};return null==o.opacity&&(n=extend({},n),o=extend({opacity:i?r:.1*a.opacity},o),n.style=o),n}function elementStateProxy(e,t){var n=this.states[e];if(this.style){if("emphasis"===e)return createEmphasisDefaultState(this,e,t,n);if("blur"===e)return createBlurDefaultState(this,e,n);if("select"===e)return createSelectDefaultState(this,e,n)}return n}function setDefaultStateProxy(e){e.stateProxy=elementStateProxy;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=elementStateProxy),n&&(n.stateProxy=elementStateProxy)}function enterEmphasisWhenMouseOver(e,t){!shouldSilent(e,t)&&!e.__highByOuter&&traverseUpdateState(e,singleEnterEmphasis)}function leaveEmphasisWhenMouseOut(e,t){!shouldSilent(e,t)&&!e.__highByOuter&&traverseUpdateState(e,singleLeaveEmphasis)}function enterEmphasis(e,t){e.__highByOuter|=1<<(t||0),traverseUpdateState(e,singleEnterEmphasis)}function leaveEmphasis(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&traverseUpdateState(e,singleLeaveEmphasis)}function enterBlur(e){traverseUpdateState(e,singleEnterBlur)}function leaveBlur(e){traverseUpdateState(e,singleLeaveBlur)}function enterSelect(e){traverseUpdateState(e,singleEnterSelect)}function leaveSelect(e){traverseUpdateState(e,singleLeaveSelect)}function shouldSilent(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function allLeaveBlur(e){e.getModel().eachComponent((function(t,n){("series"===t?e.getViewOfSeriesModel(n):e.getViewOfComponentModel(n)).group.traverse((function(e){singleLeaveBlur(e)}))}))}function toggleSeriesBlurState(e,t,n,i,r){var a=i.getModel();function o(e,t){for(var n=0;n<t.length;n++){var i=e.getItemGraphicEl(t[n]);i&&leaveBlur(i)}}if(n=n||"coordinateSystem",r){if(null!=e&&t&&"none"!==t){var s=a.getSeriesByIndex(e),l=s.coordinateSystem;l&&l.master&&(l=l.master);var u=[];a.eachSeries((function(e){var r=s===e,a=e.coordinateSystem;if(a&&a.master&&(a=a.master),!("series"===n&&!r||"coordinateSystem"===n&&!(a&&l?a===l:r)||"series"===t&&r)){if(i.getViewOfSeriesModel(e).group.traverse((function(e){singleEnterBlur(e)})),isArrayLike(t))o(e.getData(),t);else if(isObject(t))for(var c=keys(t),h=0;h<c.length;h++)o(e.getData(c[h]),t[c[h]]);u.push(e)}})),a.eachComponent((function(e,t){if("series"!==e){var n=i.getViewOfComponentModel(t);n&&n.blurSeries&&n.blurSeries(u,a)}}))}}else allLeaveBlur(i)}function toggleSeriesBlurStateFromPayload(e,t,n){if(isHighDownPayload(t)){var i=t.type===HIGHLIGHT_ACTION_TYPE,r=e.seriesIndex,a=e.getData(t.dataType),o=queryDataIndex(a,t);o=(isArray(o)?o[0]:o)||0;var s=a.getItemGraphicEl(o);if(!s)for(var l=a.count(),u=0;!s&&u<l;)s=a.getItemGraphicEl(u++);if(s){var c=getECData(s);toggleSeriesBlurState(r,c.focus,c.blurScope,n,i)}else{var h=e.get(["emphasis","focus"]),p=e.get(["emphasis","blurScope"]);null!=h&&toggleSeriesBlurState(r,h,p,n,i)}}}function toggleSelectionFromPayload(e,t,n){if(isSelectChangePayload(t)){var i=t.dataType,r=queryDataIndex(e.getData(i),t);isArray(r)||(r=[r]),e[t.type===TOGGLE_SELECT_ACTION_TYPE?"toggleSelect":t.type===SELECT_ACTION_TYPE?"select":"unselect"](r,i)}}function updateSeriesElementSelection(e){each(e.getAllData(),(function(t){var n=t.data,i=t.type;n.eachItemGraphicEl((function(t,n){e.isSelected(n,i)?enterSelect(t):leaveSelect(t)}))}))}function getAllSelectedIndices(e){var t=[];return e.eachSeries((function(e){each(e.getAllData(),(function(n){n.data;var i=n.type,r=e.getSelectedDataIndices();if(r.length>0){var a={dataIndex:r,seriesIndex:e.seriesIndex};null!=i&&(a.dataType=i),t.push(a)}}))})),t}function enableHoverEmphasis(e,t,n){setAsHighDownDispatcher(e,!0),traverseUpdateState(e,setDefaultStateProxy),enableHoverFocus(e,t,n)}function enableHoverFocus(e,t,n){var i=getECData(e);null!=t?(i.focus=t,i.blurScope=n):i.focus&&(i.focus=null)}var OTHER_STATES=["emphasis","blur","select"],defaultStyleGetterMap={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function setStatesStylesFromModel(e,t,n,i){n=n||"itemStyle";for(var r=0;r<OTHER_STATES.length;r++){var a=OTHER_STATES[r],o=t.getModel([a,n]);e.ensureState(a).style=i?i(o):o[defaultStyleGetterMap[n]]()}}function setAsHighDownDispatcher(e,t){var n=!1===t,i=e;e.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=e.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function isHighDownDispatcher(e){return!(!e||!e.__highDownDispatcher)}function getHighlightDigit(e){var t=_highlightKeyMap[e];return null==t&&_highlightNextDigit<=32&&(t=_highlightKeyMap[e]=_highlightNextDigit++),t}function isSelectChangePayload(e){var t=e.type;return t===SELECT_ACTION_TYPE||t===UNSELECT_ACTION_TYPE||t===TOGGLE_SELECT_ACTION_TYPE}function isHighDownPayload(e){var t=e.type;return t===HIGHLIGHT_ACTION_TYPE||t===DOWNPLAY_ACTION_TYPE}function savePathStates(e){var t=getSavedStates(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}var mathMax$4=Math.max,mathMin$4=Math.min,_customShapeMap={};function extendShape(e){return Path.extend(e)}var extendPathFromString=extendFromString;function extendPath(e,t){return extendPathFromString(e,t)}function registerShape(e,t){_customShapeMap[e]=t}function getShapeClass(e){if(_customShapeMap.hasOwnProperty(e))return _customShapeMap[e]}function makePath(e,t,n,i){var r=createFromString(e,t);return n&&("center"===i&&(n=centerGraphic(n,r.getBoundingRect())),resizePath(r,n)),r}function makeImage(e,t,n){var i=new ZRImage({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===n){var r={width:e.width,height:e.height};i.setStyle(centerGraphic(t,r))}}});return i}function centerGraphic(e,t){var n,i=t.width/t.height,r=e.height*i;return n=r<=e.width?e.height:(r=e.width)/i,{x:e.x+e.width/2-r/2,y:e.y+e.height/2-n/2,width:r,height:n}}var mergePath$1=mergePath;function resizePath(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function subPixelOptimizeLine$1(e){return subPixelOptimizeLine(e.shape,e.shape,e.style),e}function subPixelOptimizeRect$1(e){return subPixelOptimizeRect(e.shape,e.shape,e.style),e}var subPixelOptimize$1=subPixelOptimize;function animateOrSetProps(e,t,n,i,r,a,o){var s,l=!1;"function"==typeof r?(o=a,a=r,r=null):isObject(r)&&(a=r.cb,o=r.during,l=r.isFrom,s=r.removeOpt,r=r.dataIndex);var u,c="update"===e,h="remove"===e;if(i&&i.ecModel){var p=i.ecModel.getUpdatePayload();u=p&&p.animation}var d=i&&i.isAnimationEnabled();if(h||t.stopAnimation("remove"),d){var f=void 0,g=void 0,m=void 0;u?(f=u.duration||0,g=u.easing||"cubicOut",m=u.delay||0):h?(f=retrieve2((s=s||{}).duration,200),g=retrieve2(s.easing,"cubicOut"),m=0):(f=i.getShallow(c?"animationDurationUpdate":"animationDuration"),g=i.getShallow(c?"animationEasingUpdate":"animationEasing"),m=i.getShallow(c?"animationDelayUpdate":"animationDelay")),"function"==typeof m&&(m=m(r,i.getAnimationDelayParams?i.getAnimationDelayParams(t,r):null)),"function"==typeof f&&(f=f(r)),f>0?l?t.animateFrom(n,{duration:f,delay:m||0,easing:g,done:a,force:!!a||!!o,scope:e,during:o}):t.animateTo(n,{duration:f,delay:m||0,easing:g,done:a,force:!!a||!!o,setToFinal:!0,scope:e,during:o}):(t.stopAnimation(),!l&&t.attr(n),a&&a())}else t.stopAnimation(),!l&&t.attr(n),o&&o(1),a&&a()}function updateProps(e,t,n,i,r,a){animateOrSetProps("update",e,t,n,i,r,a)}function initProps(e,t,n,i,r,a){animateOrSetProps("init",e,t,n,i,r,a)}function removeElement(e,t,n,i,r,a){isElementRemoved(e)||animateOrSetProps("remove",e,t,n,i,r,a)}function fadeOutDisplayable(e,t,n,i){e.removeTextContent(),e.removeTextGuideLine(),removeElement(e,{style:{opacity:0}},t,n,i)}function removeElementWithFadeOut(e,t,n){function i(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse((function(e){e.isGroup||fadeOutDisplayable(e,t,n,i)})):fadeOutDisplayable(e,t,n,i)}function isElementRemoved(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++){if("remove"===e.animators[t].scope)return!0}return!1}function getTransform(e,t){for(var n=identity([]);e&&e!==t;)mul$1(n,e.getLocalTransform(),n),e=e.parent;return n}function applyTransform$1(e,t,n){return t&&!isArrayLike(t)&&(t=Transformable.getLocalTransform(t)),n&&(t=invert([],t)),applyTransform([],e,t)}function transformDirection(e,t,n){var i=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),r=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),a=["left"===e?-i:"right"===e?i:0,"top"===e?-r:"bottom"===e?r:0];return a=applyTransform$1(a,t,n),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function isNotGroup(e){return!e.isGroup}function isPath(e){return null!=e.shape}function groupTransition(e,t,n){if(e&&t){var i,r=(i={},e.traverse((function(e){isNotGroup(e)&&e.anid&&(i[e.anid]=e)})),i);t.traverse((function(e){if(isNotGroup(e)&&e.anid){var t=r[e.anid];if(t){var i=a(e);e.attr(a(t)),updateProps(e,i,n,getECData(e).dataIndex)}}}))}function a(e){var t={x:e.x,y:e.y,rotation:e.rotation};return isPath(e)&&(t.shape=extend({},e.shape)),t}}function clipPointsByRect(e,t){return map(e,(function(e){var n=e[0];n=mathMax$4(n,t.x),n=mathMin$4(n,t.x+t.width);var i=e[1];return i=mathMax$4(i,t.y),[n,i=mathMin$4(i,t.y+t.height)]}))}function clipRectByRect(e,t){var n=mathMax$4(e.x,t.x),i=mathMin$4(e.x+e.width,t.x+t.width),r=mathMax$4(e.y,t.y),a=mathMin$4(e.y+e.height,t.y+t.height);if(i>=n&&a>=r)return{x:n,y:r,width:i-n,height:a-r}}function createIcon(e,t,n){var i=extend({rectHover:!0},t),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(r.image=e.slice(8),defaults(r,n),new ZRImage(i)):makePath(e.replace("path://",""),i,n,"center")}function linePolygonIntersect(e,t,n,i,r){for(var a=0,o=r[r.length-1];a<r.length;a++){var s=r[a];if(lineLineIntersect(e,t,n,i,s[0],s[1],o[0],o[1]))return!0;o=s}}function lineLineIntersect(e,t,n,i,r,a,o,s){var l=n-e,u=i-t,c=o-r,h=s-a,p=crossProduct2d(c,h,l,u);if(nearZero(p))return!1;var d=e-r,f=t-a,g=crossProduct2d(d,f,l,u)/p;if(g<0||g>1)return!1;var m=crossProduct2d(d,f,c,h)/p;return!(m<0||m>1)}function crossProduct2d(e,t,n,i){return e*i-n*t}function nearZero(e){return e<=1e-6&&e>=-1e-6}registerShape("circle",Circle),registerShape("ellipse",Ellipse),registerShape("sector",Sector),registerShape("ring",Ring),registerShape("polygon",Polygon),registerShape("polyline",Polyline),registerShape("rect",Rect),registerShape("line",Line),registerShape("bezierCurve",BezierCurve),registerShape("arc",Arc);var graphic=Object.freeze({__proto__:null,extendShape:extendShape,extendPath:extendPath,registerShape:registerShape,getShapeClass:getShapeClass,makePath:makePath,makeImage:makeImage,mergePath:mergePath$1,resizePath:resizePath,subPixelOptimizeLine:subPixelOptimizeLine$1,subPixelOptimizeRect:subPixelOptimizeRect$1,subPixelOptimize:subPixelOptimize$1,updateProps:updateProps,initProps:initProps,removeElement:removeElement,removeElementWithFadeOut:removeElementWithFadeOut,isElementRemoved:isElementRemoved,getTransform:getTransform,applyTransform:applyTransform$1,transformDirection:transformDirection,groupTransition:groupTransition,clipPointsByRect:clipPointsByRect,clipRectByRect:clipRectByRect,createIcon:createIcon,linePolygonIntersect:linePolygonIntersect,lineLineIntersect:lineLineIntersect,Group:Group,Image:ZRImage,Text:ZRText,Circle:Circle,Ellipse:Ellipse,Sector:Sector,Ring:Ring,Polygon:Polygon,Polyline:Polyline,Rect:Rect,Line:Line,BezierCurve:BezierCurve,Arc:Arc,IncrementalDisplayable:IncrementalDisplayble,CompoundPath:CompoundPath,LinearGradient:LinearGradient,RadialGradient:RadialGradient,BoundingRect:BoundingRect,OrientedBoundingRect:OrientedBoundingRect,Point:Point,Path:Path}),EMPTY_OBJ={};function setLabelText(e,t){for(var n=0;n<SPECIAL_STATES.length;n++){var i=SPECIAL_STATES[n],r=t[i],a=e.ensureState(i);a.style=a.style||{},a.style.text=r}var o=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(o,!0)}function getLabelText(e,t,n){var i,r=e.labelFetcher,a=e.labelDataIndex,o=e.labelDimIndex,s=t.normal;r&&(i=r.getFormattedLabel(a,"normal",null,o,s&&s.get("formatter"),null!=n?{value:n}:null)),null==i&&(i=isFunction(e.defaultText)?e.defaultText(a,e,n):e.defaultText);for(var l={normal:i},u=0;u<SPECIAL_STATES.length;u++){var c=SPECIAL_STATES[u],h=t[c];l[c]=retrieve2(r?r.getFormattedLabel(a,c,null,o,h&&h.get("formatter")):null,i)}return l}function setLabelStyle(e,t,n,i){n=n||EMPTY_OBJ;for(var r=e instanceof ZRText,a=!1,o=0;o<DISPLAY_STATES.length;o++){if((p=t[DISPLAY_STATES[o]])&&p.getShallow("show")){a=!0;break}}var s=r?e:e.getTextContent();if(a){r||(s||(s=new ZRText,e.setTextContent(s)),e.stateProxy&&(s.stateProxy=e.stateProxy));var l=getLabelText(n,t),u=t.normal,c=!!u.getShallow("show"),h=createTextStyle(u,i&&i.normal,n,!1,!r);h.text=l.normal,r||e.setTextConfig(createTextConfig(u,n,!1));for(o=0;o<SPECIAL_STATES.length;o++){var p,d=SPECIAL_STATES[o];if(p=t[d]){var f=s.ensureState(d),g=!!retrieve2(p.getShallow("show"),c);if(g!==c&&(f.ignore=!g),f.style=createTextStyle(p,i&&i[d],n,!0,!r),f.style.text=l[d],!r)e.ensureState(d).textConfig=createTextConfig(p,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&&(labelInner(s).setLabelText=function(e){var i=getLabelText(n,t,e);setLabelText(s,i)})}else s&&(s.ignore=!0);e.dirty()}function getLabelStatesModels(e,t){t=t||"label";for(var n={normal:e.getModel(t)},i=0;i<SPECIAL_STATES.length;i++){var r=SPECIAL_STATES[i];n[r]=e.getModel([r,t])}return n}function createTextStyle(e,t,n,i,r){var a={};return setTextStyleCommon(a,e,n,i,r),t&&extend(a,t),a}function createTextConfig(e,t,n){t=t||{};var i,r={},a=e.getShallow("rotate"),o=retrieve2(e.getShallow("distance"),n?null:5),s=e.getShallow("offset");return"outside"===(i=e.getShallow("position")||(n?null:"inside"))&&(i=t.defaultOutsidePosition||"top"),null!=i&&(r.position=i),null!=s&&(r.offset=s),null!=a&&(a*=Math.PI/180,r.rotation=a),null!=o&&(r.distance=o),r.outsideFill="inherit"===e.get("color")?t.inheritColor||null:"auto",r}function setTextStyleCommon(e,t,n,i,r){n=n||EMPTY_OBJ;var a,o=t.ecModel,s=o&&o.option.textStyle,l=getRichItemNames(t);if(l)for(var u in a={},l)if(l.hasOwnProperty(u)){var c=t.getModel(["rich",u]);setTokenTextStyle(a[u]={},c,s,n,i,r,!1,!0)}a&&(e.rich=a);var h=t.get("overflow");h&&(e.overflow=h);var p=t.get("minMargin");null!=p&&(e.margin=p),setTokenTextStyle(e,t,s,n,i,r,!0,!1)}function getRichItemNames(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||EMPTY_OBJ).rich;if(n){t=t||{};for(var i=keys(n),r=0;r<i.length;r++){t[i[r]]=1}}e=e.parentModel}return t}var TEXT_PROPS_WITH_GLOBAL=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],TEXT_PROPS_SELF=["align","lineHeight","width","height","tag","verticalAlign"],TEXT_PROPS_BOX=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function setTokenTextStyle(e,t,n,i,r,a,o,s){n=!r&&n||EMPTY_OBJ;var l=i&&i.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=retrieve2(t.getShallow("opacity"),n.opacity);"inherit"!==u&&"auto"!==u||(u=l||null),"inherit"!==c&&"auto"!==c||(c=l||null),a||(u=u||n.color,c=c||n.textBorderColor),null!=u&&(e.fill=u),null!=c&&(e.stroke=c);var p=retrieve2(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=p&&(e.lineWidth=p);var d=retrieve2(t.getShallow("textBorderType"),n.textBorderType);null!=d&&(e.lineDash=d);var f=retrieve2(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(e.lineDashOffset=f),r||null!=h||s||(h=i&&i.defaultOpacity),null!=h&&(e.opacity=h),r||a||null==e.fill&&i.inheritColor&&(e.fill=i.inheritColor);for(var g=0;g<TEXT_PROPS_WITH_GLOBAL.length;g++){var m=TEXT_PROPS_WITH_GLOBAL[g];null!=(v=retrieve2(t.getShallow(m),n[m]))&&(e[m]=v)}for(g=0;g<TEXT_PROPS_SELF.length;g++){m=TEXT_PROPS_SELF[g];null!=(v=t.getShallow(m))&&(e[m]=v)}if(null==e.verticalAlign){var y=t.getShallow("baseline");null!=y&&(e.verticalAlign=y)}if(!o||!i.disableBox){for(g=0;g<TEXT_PROPS_BOX.length;g++){var v;m=TEXT_PROPS_BOX[g];null!=(v=t.getShallow(m))&&(e[m]=v)}var _=t.getShallow("borderType");null!=_&&(e.borderDash=_),"auto"!==e.backgroundColor&&"inherit"!==e.backgroundColor||!l||(e.backgroundColor=l),"auto"!==e.borderColor&&"inherit"!==e.borderColor||!l||(e.borderColor=l)}}function getFont(e,t){var n=t&&t.getModel("textStyle");return trim([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 labelInner=makeInner();function setLabelValueAnimation(e,t,n,i){if(e){var r=labelInner(e);r.prevValue=r.value,r.value=n;var a=t.normal;r.valueAnimation=a.get("valueAnimation"),r.valueAnimation&&(r.precision=a.get("precision"),r.defaultInterpolatedText=i,r.statesModels=t)}}function animateLabelValue(e,t,n,i){var r=labelInner(e);if(r.valueAnimation){var a=r.defaultInterpolatedText,o=r.prevValue,s=r.value;(null==o?initProps:updateProps)(e,{},i,t,null,(function(i){var l=interpolateRawValues(n,r.precision,o,s,i),u=getLabelText({labelDataIndex:t,defaultText:a?a(l):l+""},r.statesModels,l);setLabelText(e,u)}))}}var PATH_COLOR=["textStyle","color"],tmpRichText=new ZRText,TextStyleMixin=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(PATH_COLOR):null)},e.prototype.getFont=function(){return getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(e){return tmpRichText.useStyle({text:e,fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily"),verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline"),padding:this.getShallow("padding"),lineHeight:this.getShallow("lineHeight"),rich:this.getShallow("rich")}),tmpRichText.update(),tmpRichText.getBoundingRect()},e}(),LINE_STYLE_KEY_MAP=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],getLineStyle=makeStyleMapper(LINE_STYLE_KEY_MAP),LineStyleMixin=function(){function e(){}return e.prototype.getLineStyle=function(e){return getLineStyle(this,e)},e}(),ITEM_STYLE_KEY_MAP=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],getItemStyle=makeStyleMapper(ITEM_STYLE_KEY_MAP),ItemStyleMixin=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return getItemStyle(this,e,t)},e}(),Model=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){for(var i=[],r=3;r<arguments.length;r++)i[r-3]=arguments[r]},e.prototype.mergeOption=function(e,t){merge(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,i=null==n?n:n[e];if(null==i&&!t){var r=this.parentModel;r&&(i=r.getShallow(e))}return i},e.prototype.getModel=function(t,n){var i=null!=t,r=i?this.parsePath(t):null;return new e(i?this._doGet(r):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(r)),this.ecModel)},e.prototype.isEmpty=function(){return null==this.option},e.prototype.restoreData=function(){},e.prototype.clone=function(){return new(0,this.constructor)(clone(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(!env.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 i=0;i<e.length&&(!e[i]||null!=(n=n&&"object"==typeof n?n[e[i]]:null));i++);return null==n&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();enableClassExtend(Model),enableClassCheck(Model),mixin(Model,LineStyleMixin),mixin(Model,ItemStyleMixin),mixin(Model,AreaStyleMixin),mixin(Model,TextStyleMixin);var base=Math.round(10*Math.random());function getUID(e){return[e||"",base++].join("_")}function enableSubTypeDefaulter(e){var t={};e.registerSubTypeDefaulter=function(e,n){var i=parseClassType(e);t[i.main]=n},e.determineSubType=function(n,i){var r=i.type;if(!r){var a=parseClassType(n).main;e.hasSubTypes(n)&&t[a]&&(r=t[a](i))}return r}}function enableTopologicalTravel(e,t){function n(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,i,r,a){if(e.length){var o=function(e){var i={},r=[];return each(e,(function(a){var o=n(i,a),s=function(e,t){var n=[];return each(e,(function(e){indexOf(t,e)>=0&&n.push(e)})),n}(o.originalDeps=t(a),e);o.entryCount=s.length,0===o.entryCount&&r.push(a),each(s,(function(e){indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=n(i,e);indexOf(t.successor,e)<0&&t.successor.push(a)}))})),{graph:i,noEntryList:r}}(i),s=o.graph,l=o.noEntryList,u={};for(each(e,(function(e){u[e]=!0}));l.length;){var c=l.pop(),h=s[c],p=!!u[c];p&&(r.call(a,c,h.originalDeps.slice()),delete u[c]),each(h.successor,p?f:d)}each(u,(function(){var e="";throw new Error(e)}))}function d(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,d(e)}}}function inheritDefaultOption(e,t){return merge(merge({},e,!0),t,!0)}var langEN={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:"Guage",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},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:". "}}}},langZH={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:"旭日图"}},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:""}}}},LOCALE_ZH="ZH",LOCALE_EN="EN",DEFAULT_LOCALE=LOCALE_EN,localeStorage={},localeModels={},SYSTEM_LANG=env.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase().indexOf(LOCALE_ZH)>-1?LOCALE_ZH:DEFAULT_LOCALE;function registerLocale(e,t){e=e.toUpperCase(),localeModels[e]=new Model(t),localeStorage[e]=t}function createLocaleObject(e){if(isString(e)){var t=localeStorage[e.toUpperCase()]||{};return e===LOCALE_ZH||e===LOCALE_EN?clone(t):merge(clone(t),clone(localeStorage[DEFAULT_LOCALE]),!1)}return merge(clone(e),clone(localeStorage[DEFAULT_LOCALE]),!1)}function getLocaleModel(e){return localeModels[e]}function getDefaultLocaleModel(){return localeModels[DEFAULT_LOCALE]}registerLocale(LOCALE_EN,langEN),registerLocale(LOCALE_ZH,langZH);var ONE_SECOND=1e3,ONE_MINUTE=60*ONE_SECOND,ONE_HOUR=60*ONE_MINUTE,ONE_DAY=24*ONE_HOUR,ONE_YEAR=365*ONE_DAY,defaultLeveledFormatter={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}"},fullDayFormatter="{yyyy}-{MM}-{dd}",fullLeveledFormatter={year:"{yyyy}",month:"{yyyy}-{MM}",day:fullDayFormatter,hour:fullDayFormatter+" "+defaultLeveledFormatter.hour,minute:fullDayFormatter+" "+defaultLeveledFormatter.minute,second:fullDayFormatter+" "+defaultLeveledFormatter.second,millisecond:defaultLeveledFormatter.none},primaryTimeUnits=["year","month","day","hour","minute","second","millisecond"],timeUnits=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function pad(e,t){return"0000".substr(0,t-(e+="").length)+e}function getPrimaryTimeUnit(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 isPrimaryTimeUnit(e){return e===getPrimaryTimeUnit(e)}function getDefaultFormatPrecisionOfInterval(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function format(e,t,n,i){var r=parseDate(e),a=r[fullYearGetterName(n)](),o=r[monthGetterName(n)]()+1,s=Math.floor((o-1)/4)+1,l=r[dateGetterName(n)](),u=r["get"+(n?"UTC":"")+"Day"](),c=r[hoursGetterName(n)](),h=(c-1)%12+1,p=r[minutesGetterName(n)](),d=r[secondsGetterName(n)](),f=r[millisecondsGetterName(n)](),g=(i instanceof Model?i:getLocaleModel(i||SYSTEM_LANG)||getDefaultLocaleModel()).getModel("time"),m=g.get("month"),y=g.get("monthAbbr"),v=g.get("dayOfWeek"),_=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,a%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,pad(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,pad(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,v[u]).replace(/{ee}/g,_[u]).replace(/{e}/g,u+"").replace(/{HH}/g,pad(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,pad(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,pad(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,pad(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,pad(f,3)).replace(/{S}/g,f+"")}function leveledFormat(e,t,n,i,r){var a=null;if("string"==typeof n)a=n;else if("function"==typeof n)a=n(e.value,t,{level:e.level});else{var o=extend({},defaultLeveledFormatter);if(e.level>0)for(var s=0;s<primaryTimeUnits.length;++s)o[primaryTimeUnits[s]]="{primary|"+o[primaryTimeUnits[s]]+"}";var l=n?!1===n.inherit?n:defaults(n,o):o,u=getUnitFromValue(e.value,r);if(l[u])a=l[u];else if(l.inherit){for(s=timeUnits.indexOf(u)-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(isArray(a)){var c=null==e.level?0:e.level>=0?e.level:a.length+e.level;a=a[c=Math.min(c,a.length-1)]}}return format(new Date(e.value),a,r,i)}function getUnitFromValue(e,t){var n=parseDate(e),i=n[monthGetterName(t)]()+1,r=n[dateGetterName(t)](),a=n[hoursGetterName(t)](),o=n[minutesGetterName(t)](),s=n[secondsGetterName(t)](),l=0===n[millisecondsGetterName(t)](),u=l&&0===s,c=u&&0===o,h=c&&0===a,p=h&&1===r;return p&&1===i?"year":p?"month":h?"day":c?"hour":u?"minute":l?"second":"millisecond"}function getUnitValue(e,t,n){var i="number"==typeof e?parseDate(e):e;switch(t=t||getUnitFromValue(e,n)){case"year":return i[fullYearGetterName(n)]();case"half-year":return i[monthGetterName(n)]()>=6?1:0;case"quarter":return Math.floor((i[monthGetterName(n)]()+1)/4);case"month":return i[monthGetterName(n)]();case"day":return i[dateGetterName(n)]();case"half-day":return i[hoursGetterName(n)]()/24;case"hour":return i[hoursGetterName(n)]();case"minute":return i[minutesGetterName(n)]();case"second":return i[secondsGetterName(n)]();case"millisecond":return i[millisecondsGetterName(n)]()}}function fullYearGetterName(e){return e?"getUTCFullYear":"getFullYear"}function monthGetterName(e){return e?"getUTCMonth":"getMonth"}function dateGetterName(e){return e?"getUTCDate":"getDate"}function hoursGetterName(e){return e?"getUTCHours":"getHours"}function minutesGetterName(e){return e?"getUTCMinutes":"getMinutes"}function secondsGetterName(e){return e?"getUTCSeconds":"getSeconds"}function millisecondsGetterName(e){return e?"getUTCSeconds":"getSeconds"}function fullYearSetterName(e){return e?"setUTCFullYear":"setFullYear"}function monthSetterName(e){return e?"setUTCMonth":"setMonth"}function dateSetterName(e){return e?"setUTCDate":"setDate"}function hoursSetterName(e){return e?"setUTCHours":"setHours"}function minutesSetterName(e){return e?"setUTCMinutes":"setMinutes"}function secondsSetterName(e){return e?"setUTCSeconds":"setSeconds"}function millisecondsSetterName(e){return e?"setUTCSeconds":"setSeconds"}function getTextRect(e,t,n,i,r,a,o,s){return deprecateLog("getTextRect is deprecated."),new ZRText({style:{text:e,font:t,align:n,verticalAlign:i,padding:r,rich:a,overflow:o?"truncate":null,lineHeight:s}}).getBoundingRect()}function addCommas(e){if(!isNumeric(e))return isString(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function toCamelCase(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 normalizeCssArray$1=normalizeCssArray,replaceReg=/([&<>"'])/g,replaceMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function encodeHTML(e){return null==e?"":(e+"").replace(replaceReg,(function(e,t){return replaceMap[t]}))}function makeValueReadable(e,t,n){function i(e){return e&&trim(e)?e:"-"}function r(e){return!(null==e||isNaN(e)||!isFinite(e))}var a="time"===t,o=e instanceof Date;if(a||o){var s=a?parseDate(e):e;if(!isNaN(+s))return format(s,"yyyy-MM-dd hh:mm:ss",n);if(o)return"-"}if("ordinal"===t)return isStringSafe(e)?i(e):isNumber(e)&&r(e)?e+"":"-";var l=numericToNumber(e);return r(l)?addCommas(l):isStringSafe(e)?i(e):"-"}var TPL_VAR_ALIAS=["a","b","c","d","e","f","g"],wrapVar=function(e,t){return"{"+e+(null==t?"":t)+"}"};function formatTpl(e,t,n){isArray(t)||(t=[t]);var i=t.length;if(!i)return"";for(var r=t[0].$vars||[],a=0;a<r.length;a++){var o=TPL_VAR_ALIAS[a];e=e.replace(wrapVar(o),wrapVar(o,0))}for(var s=0;s<i;s++)for(var l=0;l<r.length;l++){var u=t[s][r[l]];e=e.replace(wrapVar(TPL_VAR_ALIAS[l],s),n?encodeHTML(u):u)}return e}function formatTplSimple(e,t,n){return each(t,(function(t,i){e=e.replace("{"+i+"}",n?encodeHTML(t):t)})),e}function getTooltipMarker(e,t){var n=isString(e)?{color:e,extraCssText:t}:e||{},i=n.color,r=n.type;t=n.extraCssText;var a=n.renderMode||"html";return i?"html"===a?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+encodeHTML(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+encodeHTML(i)+";"+(t||"")+'"></span>':{renderMode:a,content:"{"+(n.markerId||"markerX")+"|}  ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function formatTime(e,t,n){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var i=parseDate(t),r=n?"UTC":"",a=i["get"+r+"FullYear"](),o=i["get"+r+"Month"]()+1,s=i["get"+r+"Date"](),l=i["get"+r+"Hours"](),u=i["get"+r+"Minutes"](),c=i["get"+r+"Seconds"](),h=i["get"+r+"Milliseconds"]();return e=e.replace("MM",pad(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100+"").replace("dd",pad(s,2)).replace("d",s).replace("hh",pad(l,2)).replace("h",l).replace("mm",pad(u,2)).replace("m",u).replace("ss",pad(c,2)).replace("s",c).replace("SSS",pad(h,3))}function capitalFirst(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e}function convertToColorString(e,t){return t=t||"transparent",isString(e)?e:isObject(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function windowOpen(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var formatUtil=Object.freeze({__proto__:null,addCommas:addCommas,toCamelCase:toCamelCase,normalizeCssArray:normalizeCssArray$1,encodeHTML:encodeHTML,makeValueReadable:makeValueReadable,formatTpl:formatTpl,formatTplSimple:formatTplSimple,getTooltipMarker:getTooltipMarker,formatTime:formatTime,capitalFirst:capitalFirst,convertToColorString:convertToColorString,windowOpen:windowOpen,truncateText:truncateText,getTextRect:getTextRect}),each$1=each,LOCATION_PARAMS=["left","right","top","bottom","width","height"],HV_NAMES=[["width","left","right"],["height","top","bottom"]];function boxLayout(e,t,n,i,r){var a=0,o=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var c,h,p=l.getBoundingRect(),d=t.childAt(u+1),f=d&&d.getBoundingRect();if("horizontal"===e){var g=p.width+(f?-f.x+p.x:0);(c=a+g)>i||l.newline?(a=0,c=g,o+=s+n,s=p.height):s=Math.max(s,p.height)}else{var m=p.height+(f?-f.y+p.y:0);(h=o+m)>r||l.newline?(a+=s+n,o=0,h=m,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),"horizontal"===e?a=c+n:o=h+n)}))}var box=boxLayout,vbox=curry(boxLayout,"vertical"),hbox=curry(boxLayout,"horizontal");function getAvailableSize(e,t,n){var i=t.width,r=t.height,a=parsePercent$2(e.left,i),o=parsePercent$2(e.top,r),s=parsePercent$2(e.right,i),l=parsePercent$2(e.bottom,r);return(isNaN(a)||isNaN(parseFloat(e.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(e.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.bottom)))&&(l=r),n=normalizeCssArray$1(n||0),{width:Math.max(s-a-n[1]-n[3],0),height:Math.max(l-o-n[0]-n[2],0)}}function getLayoutRect(e,t,n){n=normalizeCssArray$1(n||0);var i=t.width,r=t.height,a=parsePercent$2(e.left,i),o=parsePercent$2(e.top,r),s=parsePercent$2(e.right,i),l=parsePercent$2(e.bottom,r),u=parsePercent$2(e.width,i),c=parsePercent$2(e.height,r),h=n[2]+n[0],p=n[1]+n[3],d=e.aspect;switch(isNaN(u)&&(u=i-s-p-a),isNaN(c)&&(c=r-l-h-o),null!=d&&(isNaN(u)&&isNaN(c)&&(d>i/r?u=.8*i:c=.8*r),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=i-s-u-p),isNaN(o)&&(o=r-l-c-h),e.left||e.right){case"center":a=i/2-u/2-n[3];break;case"right":a=i-u-p}switch(e.top||e.bottom){case"middle":case"center":o=r/2-c/2-n[0];break;case"bottom":o=r-c-h}a=a||0,o=o||0,isNaN(u)&&(u=i-p-a-(s||0)),isNaN(c)&&(c=r-h-o-(l||0));var f=new BoundingRect(a+n[3],o+n[0],u,c);return f.margin=n,f}function positionElement(e,t,n,i,r){var a=!r||!r.hv||r.hv[0],o=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(a||o){var l;if("raw"===s)l="group"===e.type?new BoundingRect(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}var c=getLayoutRect(defaults({width:l.width,height:l.height},t),n,i),h=a?c.x-l.x:0,p=o?c.y-l.y:0;"raw"===s?(e.x=h,e.y=p):(e.x+=h,e.y+=p),e.markRedraw()}}function sizeCalculable(e,t){return null!=e[HV_NAMES[t][0]]||null!=e[HV_NAMES[t][1]]&&null!=e[HV_NAMES[t][2]]}function fetchLayoutMode(e){var t=e.layoutMode||e.constructor.layoutMode;return isObject(t)?t:t?{type:t}:null}function mergeLayoutParam(e,t,n){var i=n&&n.ignoreSize;!isArray(i)&&(i=[i,i]);var r=o(HV_NAMES[0],0),a=o(HV_NAMES[1],1);function o(n,r){var a={},o=0,u={},c=0;if(each$1(n,(function(t){u[t]=e[t]})),each$1(n,(function(e){s(t,e)&&(a[e]=u[e]=t[e]),l(a,e)&&o++,l(u,e)&&c++})),i[r])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2!==c&&o){if(o>=2)return a;for(var h=0;h<n.length;h++){var p=n[h];if(!s(a,p)&&s(e,p)){a[p]=e[p];break}}return a}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){each$1(e,(function(e){t[e]=n[e]}))}u(HV_NAMES[0],e,r),u(HV_NAMES[1],e,a)}function getLayoutParams(e){return copyLayoutParams({},e)}function copyLayoutParams(e,t){return t&&e&&each$1(LOCATION_PARAMS,(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}var inner=makeInner(),ComponentModel=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.uid=getUID("ec_cpt_model"),r}return __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=fetchLayoutMode(this),i=n?getLayoutParams(e):{};merge(e,t.getTheme().get(this.mainType)),merge(e,this.getDefaultOption()),n&&mergeLayoutParam(e,i,n)},t.prototype.mergeOption=function(e,t){merge(this.option,e,!0);var n=fetchLayoutMode(this);n&&mergeLayoutParam(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!isExtendedClass(e))return e.defaultOption;var t=inner(this);if(!t.defaultOption){for(var n=[],i=e;i;){var r=i.prototype.defaultOption;r&&n.push(r),i=i.superClass}for(var a={},o=n.length-1;o>=0;o--)a=merge(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",i=e+"Id";return queryReferringComponents(this.ecModel,e,{index:this.get(n,!0),id:this.get(i,!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.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Model);function getDependencies(e){var t=[];return each(ComponentModel.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=map(t,(function(e){return parseClassType(e).main})),"dataset"!==e&&indexOf(t,"dataset")<=0&&t.unshift("dataset"),t}mountExtend(ComponentModel,Model),enableClassManagement(ComponentModel,{registerWhenExtend:!0}),enableSubTypeDefaulter(ComponentModel),enableTopologicalTravel(ComponentModel,getDependencies);var platform="";"undefined"!=typeof navigator&&(platform=navigator.platform||"");var decalColor="rgba(0, 0, 0, 0.2)",globalDefault={darkMode:"auto",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:decalColor,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:decalColor,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:decalColor,dashArrayX:[1,0],dashArrayY:[4,3],dashLineOffset:0,rotation:-Math.PI/4},{color:decalColor,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:decalColor,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:decalColor,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:platform.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},VISUAL_DIMENSIONS=createHashMap(["tooltip","label","itemName","itemId","seriesName"]),SOURCE_FORMAT_ORIGINAL="original",SOURCE_FORMAT_ARRAY_ROWS="arrayRows",SOURCE_FORMAT_OBJECT_ROWS="objectRows",SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",SOURCE_FORMAT_TYPED_ARRAY="typedArray",SOURCE_FORMAT_UNKNOWN="unknown",SERIES_LAYOUT_BY_COLUMN="column",SERIES_LAYOUT_BY_ROW="row",BE_ORDINAL={Must:1,Might:2,Not:3},innerGlobalModel=makeInner();function resetSourceDefaulter(e){innerGlobalModel(e).datasetMap=createHashMap()}function inheritSourceMetaRawOption(e,t){var n=e?e.metaRawOption:null;return{seriesLayoutBy:retrieve2(t.seriesLayoutBy,n?n.seriesLayoutBy:null),sourceHeader:retrieve2(t.sourceHeader,e?e.startIndex:null),dimensions:retrieve2(t.dimensions,e?e.dimensionsDefine:null)}}function makeSeriesEncodeForAxisCoordSys(e,t,n){var i={},r=querySeriesUpstreamDatasetModel(t);if(!r||!e)return i;var a,o,s=[],l=[],u=t.ecModel,c=innerGlobalModel(u).datasetMap,h=r.uid+"_"+n.seriesLayoutBy;each(e=e.slice(),(function(t,n){var r=isObject(t)?t:e[n]={name:t};"ordinal"===r.type&&null==a&&(a=n,o=f(r)),i[r.name]=[]}));var p=c.get(h)||c.set(h,{categoryWayDim:o,valueWayDim:0});function d(e,t,n){for(var i=0;i<n;i++)e.push(t+i)}function f(e){var t=e.dimsDef;return t?t.length:1}return each(e,(function(e,t){var n=e.name,r=f(e);if(null==a){var o=p.valueWayDim;d(i[n],o,r),d(l,o,r),p.valueWayDim+=r}else if(a===t)d(i[n],0,r),d(s,0,r);else{o=p.categoryWayDim;d(i[n],o,r),d(l,o,r),p.categoryWayDim+=r}})),s.length&&(i.itemName=s),l.length&&(i.seriesName=l),i}function makeSeriesEncodeForNameBased(e,t,n){var i={};if(!querySeriesUpstreamDatasetModel(e))return i;var r,a=t.sourceFormat,o=t.dimensionsDefine;a!==SOURCE_FORMAT_OBJECT_ROWS&&a!==SOURCE_FORMAT_KEYED_COLUMNS||each(o,(function(e,t){"name"===(isObject(e)?e.name:e)&&(r=t)}));var s=function(){for(var e={},i={},s=[],l=0,u=Math.min(5,n);l<u;l++){var c=doGuessOrdinal(t.data,a,t.seriesLayoutBy,o,t.startIndex,l);s.push(c);var h=c===BE_ORDINAL.Not;if(h&&null==e.v&&l!==r&&(e.v=l),(null==e.n||e.n===e.v||!h&&s[e.n]===BE_ORDINAL.Not)&&(e.n=l),p(e)&&s[e.n]!==BE_ORDINAL.Not)return e;h||(c===BE_ORDINAL.Might&&null==i.v&&l!==r&&(i.v=l),null!=i.n&&i.n!==i.v||(i.n=l))}function p(e){return null!=e.v&&null!=e.n}return p(e)?e:p(i)?i:null}();if(s){i.value=[s.v];var l=null!=r?r:s.n;i.itemName=[l],i.seriesName=[l]}return i}function querySeriesUpstreamDatasetModel(e){if(!e.get("data",!0))return queryReferringComponents(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},SINGLE_REFERRING).models[0]}function queryDatasetUpstreamDatasetModels(e){return e.get("transform",!0)||e.get("fromTransformResult",!0)?queryReferringComponents(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},SINGLE_REFERRING).models:[]}function guessOrdinal(e,t){return doGuessOrdinal(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function doGuessOrdinal(e,t,n,i,r,a){var o,s,l;if(isTypedArray(e))return BE_ORDINAL.Not;if(i){var u=i[a];isObject(u)?(s=u.name,l=u.type):isString(u)&&(s=u)}if(null!=l)return"ordinal"===l?BE_ORDINAL.Must:BE_ORDINAL.Not;if(t===SOURCE_FORMAT_ARRAY_ROWS){var c=e;if(n===SERIES_LAYOUT_BY_ROW){for(var h=c[a],p=0;p<(h||[]).length&&p<5;p++)if(null!=(o=_(h[r+p])))return o}else for(p=0;p<c.length&&p<5;p++){var d=c[r+p];if(d&&null!=(o=_(d[a])))return o}}else if(t===SOURCE_FORMAT_OBJECT_ROWS){var f=e;if(!s)return BE_ORDINAL.Not;for(p=0;p<f.length&&p<5;p++){if((y=f[p])&&null!=(o=_(y[s])))return o}}else if(t===SOURCE_FORMAT_KEYED_COLUMNS){var g=e;if(!s)return BE_ORDINAL.Not;if(!(h=g[s])||isTypedArray(h))return BE_ORDINAL.Not;for(p=0;p<h.length&&p<5;p++)if(null!=(o=_(h[p])))return o}else if(t===SOURCE_FORMAT_ORIGINAL){var m=e;for(p=0;p<m.length&&p<5;p++){var y,v=getDataItemValue(y=m[p]);if(!isArray(v))return BE_ORDINAL.Not;if(null!=(o=_(v[a])))return o}}function _(e){var t=isString(e);return null!=e&&isFinite(e)&&""!==e?t?BE_ORDINAL.Might:BE_ORDINAL.Not:t&&"-"!==e?BE_ORDINAL.Must:void 0}return BE_ORDINAL.Not}var internalOptionCreatorMap=createHashMap();function registerInternalOptionCreator(e,t){assert(null==internalOptionCreatorMap.get(e)&&t),internalOptionCreatorMap.set(e,t)}function concatInternalOptions(e,t,n){var i=internalOptionCreatorMap.get(t);if(!i)return n;var r=i(e);return r?n.concat(r):n}var reCreateSeriesIndices,assertSeriesInitialized,initBase,innerColor=makeInner(),innerDecal=makeInner(),PaletteMixin=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var i=normalizeToArray(this.get("color",!0)),r=this.get("colorLayer",!0);return getFromPalette(this,innerColor,i,r,e,t,n)},e.prototype.clearColorPalette=function(){clearPalette(this,innerColor)},e}();function getDecalFromPalette(e,t,n,i){var r=normalizeToArray(e.get(["aria","decal","decals"]));return getFromPalette(e,innerDecal,r,null,t,n,i)}function getNearestPalette(e,t){for(var n=e.length,i=0;i<n;i++)if(e[i].length>t)return e[i];return e[n-1]}function getFromPalette(e,t,n,i,r,a,o){var s=t(a=a||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var c=null!=o&&i?getNearestPalette(i,o):n;if((c=c||n)&&c.length){var h=c[l];return r&&(u[r]=h),s.paletteIdx=(l+1)%c.length,h}}function clearPalette(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var OPTION_INNER_KEY="\0_ec_inner",GlobalModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(e,t,n,i,r,a){i=i||{},this.option=null,this._theme=new Model(i),this._locale=new Model(r),this._optionManager=a},t.prototype.setOption=function(e,t,n){assert(!(OPTION_INNER_KEY in e),"please use chart.getOption()");var i=normalizeSetOptionInput(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,normalizeSetOptionInput(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var r=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(r,t)):initBase(this,r),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var a=i.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,t))}if(!e||"recreate"===e||"media"===e){var o=i.getMediaOption(this);o.length&&each(o,(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,i=this._componentsMap,r=this._componentsCount,a=[],o=createHashMap(),s=t&&t.replaceMergeMainTypeMap;resetSourceDefaulter(this),each(e,(function(e,t){null!=e&&(ComponentModel.hasClass(t)?t&&(a.push(t),o.set(t,!0)):n[t]=null==n[t]?clone(e):merge(n[t],e,!0))})),s&&s.each((function(e,t){ComponentModel.hasClass(t)&&!o.get(t)&&(a.push(t),o.set(t,!0))})),ComponentModel.topologicalTravel(a,ComponentModel.getAllClassMainTypes(),(function(t){var a=concatInternalOptions(this,t,normalizeToArray(e[t])),o=i.get(t),l=o?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",u=mappingToExists(o,a,l);setComponentTypeToKeyInfo(u,t,ComponentModel),n[t]=null,i.set(t,null),r.set(t,0);var c=[],h=[],p=0;each(u,(function(e,n){var i=e.existing,r=e.newOption;if(r){var a=ComponentModel.getClass(t,e.keyInfo.subType,!0);if(i&&i.constructor===a)i.name=e.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var o=extend({componentIndex:n},e.keyInfo);extend(i=new a(r,this,this,o),o),e.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),h.push(i),p++):(c.push(void 0),h.push(void 0))}),this),n[t]=c,i.set(t,h),r.set(t,p),"series"===t&&reCreateSeriesIndices(this)}),this),this._seriesIndices||reCreateSeriesIndices(this)},t.prototype.getOption=function(){var e=clone(this.option);return each(e,(function(t,n){if(ComponentModel.hasClass(n)){for(var i=normalizeToArray(t),r=i.length,a=!1,o=r-1;o>=0;o--)i[o]&&!isComponentIdInternal(i[o])?a=!0:(i[o]=null,!a&&r--);i.length=r,e[n]=i}})),delete e[OPTION_INNER_KEY],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.getLocale=function(e){return this.getLocaleModel().get(e)},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 i=n[t||0];if(i)return i;if(null==t)for(var r=0;r<n.length;r++)if(n[r])return n[r]}},t.prototype.queryComponents=function(e){var t=e.mainType;if(!t)return[];var n,i=e.index,r=e.id,a=e.name,o=this._componentsMap.get(t);return o&&o.length?(null!=i?(n=[],each(normalizeToArray(i),(function(e){o[e]&&n.push(o[e])}))):n=null!=r?queryByIdOrName("id",r,o):null!=a?queryByIdOrName("name",a,o):filter(o,(function(e){return!!e})),filterBySubType(n,e)):[]},t.prototype.findComponents=function(e){var t,n,i,r,a,o=e.query,s=e.mainType,l=(n=s+"Index",i=s+"Id",r=s+"Name",!(t=o)||null==t[n]&&null==t[i]&&null==t[r]?null:{mainType:s,index:t[n],id:t[i],name:t[r]}),u=l?this.queryComponents(l):filter(this._componentsMap.get(s),(function(e){return!!e}));return a=filterBySubType(u,e),e.filter?filter(a,e.filter):a},t.prototype.eachComponent=function(e,t,n){var i=this._componentsMap;if(isFunction(e)){var r=t,a=e;i.each((function(e,t){for(var n=0;e&&n<e.length;n++){var i=e[n];i&&a.call(r,t,i,i.componentIndex)}}))}else for(var o=isString(e)?i.get(e):isObject(e)?this.findComponents(e):null,s=0;o&&s<o.length;s++){var l=o[s];l&&t.call(n,l,l.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=convertOptionIdName(e,null);return filter(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 filter(this._componentsMap.get("series"),(function(t){return!!t&&t.subType===e}))},t.prototype.getSeries=function(){return filter(this._componentsMap.get("series").slice(),(function(e){return!!e}))},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,t){assertSeriesInitialized(this),each(this._seriesIndices,(function(n){var i=this._componentsMap.get("series")[n];e.call(t,i,n)}),this)},t.prototype.eachRawSeries=function(e,t){each(this._componentsMap.get("series"),(function(n){n&&e.call(t,n,n.componentIndex)}))},t.prototype.eachSeriesByType=function(e,t,n){assertSeriesInitialized(this),each(this._seriesIndices,(function(i){var r=this._componentsMap.get("series")[i];r.subType===e&&t.call(n,r,i)}),this)},t.prototype.eachRawSeriesByType=function(e,t,n){return each(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return assertSeriesInitialized(this),null==this._seriesIndicesMap.get(e.componentIndex)},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){assertSeriesInitialized(this);var n=[];each(this._seriesIndices,(function(i){var r=this._componentsMap.get("series")[i];e.call(t,r,i)&&n.push(i)}),this),this._seriesIndices=n,this._seriesIndicesMap=createHashMap(n)},t.prototype.restoreData=function(e){reCreateSeriesIndices(this);var t=this._componentsMap,n=[];t.each((function(e,t){ComponentModel.hasClass(t)&&n.push(t)})),ComponentModel.topologicalTravel(n,ComponentModel.getAllClassMainTypes(),(function(n){each(t.get(n),(function(t){!t||"series"===n&&isNotTargetSeries(t,e)||t.restoreData()}))}))},t.internalField=(reCreateSeriesIndices=function(e){var t=e._seriesIndices=[];each(e._componentsMap.get("series"),(function(e){e&&t.push(e.componentIndex)})),e._seriesIndicesMap=createHashMap(t)},assertSeriesInitialized=function(e){},void(initBase=function(e,t){e.option={},e.option[OPTION_INNER_KEY]=1,e._componentsMap=createHashMap({series:[]}),e._componentsCount=createHashMap();var n=t.aria;isObject(n)&&null==n.enabled&&(n.enabled=!0),mergeTheme(t,e._theme.option),merge(t,globalDefault,!1),e._mergeOption(t,null)})),t}(Model);function isNotTargetSeries(e,t){if(t){var n=t.seriesIndex,i=t.seriesId,r=t.seriesName;return null!=n&&e.componentIndex!==n||null!=i&&e.id!==i||null!=r&&e.name!==r}}function mergeTheme(e,t){var n=e.color&&!e.colorLayer;each(t,(function(t,i){"colorLayer"===i&&n||ComponentModel.hasClass(i)||("object"==typeof t?e[i]=e[i]?merge(e[i],t,!1):clone(t):null==e[i]&&(e[i]=t))}))}function queryByIdOrName(e,t,n){if(isArray(t)){var i=createHashMap();return each(t,(function(e){null!=e&&(null!=convertOptionIdName(e,null)&&i.set(e,!0))})),filter(n,(function(t){return t&&i.get(t[e])}))}var r=convertOptionIdName(t,null);return filter(n,(function(t){return t&&null!=r&&t[e]===r}))}function filterBySubType(e,t){return t.hasOwnProperty("subType")?filter(e,(function(e){return e&&e.subType===t.subType})):e}function normalizeSetOptionInput(e){var t=createHashMap();return e&&each(normalizeToArray(e.replaceMerge),(function(e){t.set(e,!0)})),{replaceMergeMainTypeMap:t}}mixin(GlobalModel,PaletteMixin);var availableMethods=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],ExtensionAPI=function(e){each(availableMethods,(function(t){this[t]=bind(e[t],e)}),this)},coordinateSystemCreators={},CoordinateSystemManager=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];each(coordinateSystemCreators,(function(i,r){var a=i.create(e,t);n=n.concat(a||[])})),this._coordinateSystems=n},e.prototype.update=function(e,t){each(this._coordinateSystems,(function(n){n.update&&n.update(e,t)}))},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){coordinateSystemCreators[e]=t},e.get=function(e){return coordinateSystemCreators[e]},e}(),QUERY_REG=/^(min|max)?(.+)$/,OptionManager=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(each(normalizeToArray(e.series),(function(e){e&&e.data&&isTypedArray(e.data)&&setAsPrimitive(e.data)})),each(normalizeToArray(e.dataset),(function(e){e&&e.source&&isTypedArray(e.source)&&setAsPrimitive(e.source)}))),e=clone(e);var i=this._optionBackup,r=parseRawOption(e,t,!i);this._newBaseOption=r.baseOption,i?(r.timelineOptions.length&&(i.timelineOptions=r.timelineOptions),r.mediaList.length&&(i.mediaList=r.mediaList),r.mediaDefault&&(i.mediaDefault=r.mediaDefault)):this._optionBackup=r},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],clone(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var i=e.getComponent("timeline");i&&(t=clone(n[i.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t=this._api.getWidth(),n=this._api.getHeight(),i=this._mediaList,r=this._mediaDefault,a=[],o=[];if(!i.length&&!r)return o;for(var s=0,l=i.length;s<l;s++)applyMediaQuery(i[s].query,t,n)&&a.push(s);return!a.length&&r&&(a=[-1]),a.length&&!indicesEquals(a,this._currentMediaIndices)&&(o=map(a,(function(e){return clone(-1===e?r.option:i[e].option)}))),this._currentMediaIndices=a,o},e}();function parseRawOption(e,t,n){var i,r,a=[],o=e.baseOption,s=e.timeline,l=e.options,u=e.media,c=!!e.media,h=!!(l||s||o&&o.timeline);function p(e){each(t,(function(t){t(e,n)}))}return o?(r=o).timeline||(r.timeline=s):((h||c)&&(e.options=e.media=null),r=e),c&&isArray(u)&&each(u,(function(e){e&&e.option&&(e.query?a.push(e):i||(i=e))})),p(r),each(l,(function(e){return p(e)})),each(a,(function(e){return p(e.option)})),{baseOption:r,timelineOptions:l||[],mediaDefault:i,mediaList:a}}function applyMediaQuery(e,t,n){var i={width:t,height:n,aspectratio:t/n},r=!0;return each(e,(function(e,t){var n=t.match(QUERY_REG);if(n&&n[1]&&n[2]){var a=n[1],o=n[2].toLowerCase();compare(i[o],e,a)||(r=!1)}})),r}function compare(e,t,n){return"min"===n?e>=t:"max"===n?e<=t:e===t}function indicesEquals(e,t){return e.join(",")===t.join(",")}var each$2=each,isObject$1=isObject,POSSIBLE_STYLES=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function compatEC2ItemStyle(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=POSSIBLE_STYLES.length;n<i;n++){var r=POSSIBLE_STYLES[n],a=t.normal,o=t.emphasis;a&&a[r]&&(e[r]=e[r]||{},e[r].normal?merge(e[r].normal,a[r]):e[r].normal=a[r],a[r]=null),o&&o[r]&&(e[r]=e[r]||{},e[r].emphasis?merge(e[r].emphasis,o[r]):e[r].emphasis=o[r],o[r]=null)}}function convertNormalEmphasis(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var i=e[t].normal,r=e[t].emphasis;i&&(n?(e[t].normal=e[t].emphasis=null,defaults(e[t],i)):e[t]=i),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r,r.focus&&(e.emphasis.focus=r.focus),r.blurScope&&(e.emphasis.blurScope=r.blurScope))}}function removeEC3NormalStatus(e){convertNormalEmphasis(e,"itemStyle"),convertNormalEmphasis(e,"lineStyle"),convertNormalEmphasis(e,"areaStyle"),convertNormalEmphasis(e,"label"),convertNormalEmphasis(e,"labelLine"),convertNormalEmphasis(e,"upperLabel"),convertNormalEmphasis(e,"edgeLabel")}function compatTextStyle(e,t){var n=isObject$1(e)&&e[t],i=isObject$1(n)&&n.textStyle;if(i){0;for(var r=0,a=TEXT_STYLE_OPTIONS.length;r<a;r++){var o=TEXT_STYLE_OPTIONS[r];i.hasOwnProperty(o)&&(n[o]=i[o])}}}function compatEC3CommonStyles(e){e&&(removeEC3NormalStatus(e),compatTextStyle(e,"label"),e.emphasis&&compatTextStyle(e.emphasis,"label"))}function processSeries(e){if(isObject$1(e)){compatEC2ItemStyle(e),removeEC3NormalStatus(e),compatTextStyle(e,"label"),compatTextStyle(e,"upperLabel"),compatTextStyle(e,"edgeLabel"),e.emphasis&&(compatTextStyle(e.emphasis,"label"),compatTextStyle(e.emphasis,"upperLabel"),compatTextStyle(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(compatEC2ItemStyle(t),compatEC3CommonStyles(t));var n=e.markLine;n&&(compatEC2ItemStyle(n),compatEC3CommonStyles(n));var i=e.markArea;i&&compatEC3CommonStyles(i);var r=e.data;if("graph"===e.type){r=r||e.nodes;var a=e.links||e.edges;if(a&&!isTypedArray(a))for(var o=0;o<a.length;o++)compatEC3CommonStyles(a[o]);each(e.categories,(function(e){removeEC3NormalStatus(e)}))}if(r&&!isTypedArray(r))for(o=0;o<r.length;o++)compatEC3CommonStyles(r[o]);if((t=e.markPoint)&&t.data){var s=t.data;for(o=0;o<s.length;o++)compatEC3CommonStyles(s[o])}if((n=e.markLine)&&n.data){var l=n.data;for(o=0;o<l.length;o++)isArray(l[o])?(compatEC3CommonStyles(l[o][0]),compatEC3CommonStyles(l[o][1])):compatEC3CommonStyles(l[o])}"gauge"===e.type?(compatTextStyle(e,"axisLabel"),compatTextStyle(e,"title"),compatTextStyle(e,"detail")):"treemap"===e.type?(convertNormalEmphasis(e.breadcrumb,"itemStyle"),each(e.levels,(function(e){removeEC3NormalStatus(e)}))):"tree"===e.type&&removeEC3NormalStatus(e.leaves)}}function toArr(e){return isArray(e)?e:e?[e]:[]}function toObj(e){return(isArray(e)?e[0]:e)||{}}function globalCompatStyle(e,t){each$2(toArr(e.series),(function(e){isObject$1(e)&&processSeries(e)}));var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),each$2(n,(function(t){each$2(toArr(e[t]),(function(e){e&&(compatTextStyle(e,"axisLabel"),compatTextStyle(e.axisPointer,"label"))}))})),each$2(toArr(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;compatTextStyle(t,"axisLabel"),compatTextStyle(t&&t.axisPointer,"label")})),each$2(toArr(e.calendar),(function(e){convertNormalEmphasis(e,"itemStyle"),compatTextStyle(e,"dayLabel"),compatTextStyle(e,"monthLabel"),compatTextStyle(e,"yearLabel")})),each$2(toArr(e.radar),(function(e){compatTextStyle(e,"name"),e.name&&null==e.axisName&&(e.axisName=e.name,delete e.name),null!=e.nameGap&&null==e.axisNameGap&&(e.axisNameGap=e.nameGap,delete e.nameGap)})),each$2(toArr(e.geo),(function(e){isObject$1(e)&&(compatEC3CommonStyles(e),each$2(toArr(e.regions),(function(e){compatEC3CommonStyles(e)})))})),each$2(toArr(e.timeline),(function(e){compatEC3CommonStyles(e),convertNormalEmphasis(e,"label"),convertNormalEmphasis(e,"itemStyle"),convertNormalEmphasis(e,"controlStyle",!0);var t=e.data;isArray(t)&&each(t,(function(e){isObject(e)&&(convertNormalEmphasis(e,"label"),convertNormalEmphasis(e,"itemStyle"))}))})),each$2(toArr(e.toolbox),(function(e){convertNormalEmphasis(e,"iconStyle"),each$2(e.feature,(function(e){convertNormalEmphasis(e,"iconStyle")}))})),compatTextStyle(toObj(e.axisPointer),"label"),compatTextStyle(toObj(e.tooltip).axisPointer,"label")}function get(e,t){for(var n=t.split(","),i=e,r=0;r<n.length&&null!=(i=i&&i[n[r]]);r++);return i}function set$1(e,t,n,i){for(var r,a=t.split(","),o=e,s=0;s<a.length-1;s++)null==o[r=a[s]]&&(o[r]={}),o=o[r];(i||null==o[a[s]])&&(o[a[s]]=n)}function compatLayoutProperties(e){e&&each(LAYOUT_PROPERTIES,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var LAYOUT_PROPERTIES=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],COMPATITABLE_COMPONENTS=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],BAR_ITEM_STYLE_MAP=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function compatBarItemStyle(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<BAR_ITEM_STYLE_MAP.length;n++){var i=BAR_ITEM_STYLE_MAP[n][1],r=BAR_ITEM_STYLE_MAP[n][0];null!=t[i]&&(t[r]=t[i])}}function compatPieLabel(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&(e.edgeDistance=e.margin)}function compatSunburstState(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay)}function compatGraphFocus(e){e&&null!=e.focusNodeAdjacency&&(e.emphasis=e.emphasis||{},null==e.emphasis.focus&&(e.emphasis.focus="adjacency"))}function traverseTree(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&traverseTree(e[n].children,t)}function globalBackwardCompat(e,t){globalCompatStyle(e,t),e.series=normalizeToArray(e.series),each(e.series,(function(e){if(isObject(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t){if(null!=e.clockWise&&(e.clockwise=e.clockWise),compatPieLabel(e.label),(r=e.data)&&!isTypedArray(r))for(var n=0;n<r.length;n++)compatPieLabel(r[n]);null!=e.hoverOffset&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&(e.emphasis.scaleSize=e.hoverOffset))}else if("gauge"===t){var i=get(e,"pointer.color");null!=i&&set$1(e,"itemStyle.color",i)}else if("bar"===t){var r;if(compatBarItemStyle(e),compatBarItemStyle(e.backgroundStyle),compatBarItemStyle(e.emphasis),(r=e.data)&&!isTypedArray(r))for(n=0;n<r.length;n++)"object"==typeof r[n]&&(compatBarItemStyle(r[n]),compatBarItemStyle(r[n]&&r[n].emphasis))}else if("sunburst"===t){var a=e.highlightPolicy;a&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=a)),compatSunburstState(e),traverseTree(e.data,compatSunburstState)}else"graph"===t||"sankey"===t?compatGraphFocus(e):"map"===t&&(e.mapType&&!e.map&&(e.map=e.mapType),e.mapLocation&&defaults(e,e.mapLocation));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&(e.emphasis.scale=e.hoverAnimation)),compatLayoutProperties(e)}})),e.dataRange&&(e.visualMap=e.dataRange),each(COMPATITABLE_COMPONENTS,(function(t){var n=e[t];n&&(isArray(n)||(n=[n]),each(n,(function(e){compatLayoutProperties(e)})))}))}function dataStack(e){var t=createHashMap();e.eachSeries((function(e){var n=e.get("stack");if(n){var i=t.get(n)||t.set(n,[]),r=e.getData(),a={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:e};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(a)}})),t.each(calculateStack)}function calculateStack(e){each(e,(function(t,n){var i=[],r=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=o.map(a,(function(a,l,u){var c,h,p=o.get(t.stackedDimension,u);if(isNaN(p))return r;s?h=o.getRawIndex(u):c=o.get(t.stackedByDimension,u);for(var d=NaN,f=n-1;f>=0;f--){var g=e[f];if(s||(h=g.data.rawIndexOf(g.stackedByDimension,c)),h>=0){var m=g.data.getByRawIndex(g.stackResultDimension,h);if(p>=0&&m>0||p<=0&&m<0){p+=m,d=m;break}}}return i[0]=p,i[1]=d,i}));o.hostModel.setData(l),t.data=l}))}var _a,_b,_c,providerMethods,mountMethods,SourceImpl=function(e){this.data=e.data||(e.sourceFormat===SOURCE_FORMAT_KEYED_COLUMNS?{}:[]),this.sourceFormat=e.sourceFormat||SOURCE_FORMAT_UNKNOWN,this.seriesLayoutBy=e.seriesLayoutBy||SERIES_LAYOUT_BY_COLUMN,this.startIndex=e.startIndex||0,this.dimensionsDefine=e.dimensionsDefine,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.encodeDefine=e.encodeDefine,this.metaRawOption=e.metaRawOption};function isSourceInstance(e){return e instanceof SourceImpl}function createSource(e,t,n,i){n=n||detectSourceFormat(e);var r=t.seriesLayoutBy,a=determineSourceDimensions(e,n,r,t.sourceHeader,t.dimensions);return new SourceImpl({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,encodeDefine:makeEncodeDefine(i),metaRawOption:clone(t)})}function createSourceFromSeriesDataOption(e){return new SourceImpl({data:e,sourceFormat:isTypedArray(e)?SOURCE_FORMAT_TYPED_ARRAY:SOURCE_FORMAT_ORIGINAL})}function cloneSourceShallow(e){return new SourceImpl({data:e.data,sourceFormat:e.sourceFormat,seriesLayoutBy:e.seriesLayoutBy,dimensionsDefine:clone(e.dimensionsDefine),startIndex:e.startIndex,dimensionsDetectedCount:e.dimensionsDetectedCount,encodeDefine:makeEncodeDefine(e.encodeDefine)})}function makeEncodeDefine(e){return e?createHashMap(e):null}function detectSourceFormat(e){var t=SOURCE_FORMAT_UNKNOWN;if(isTypedArray(e))t=SOURCE_FORMAT_TYPED_ARRAY;else if(isArray(e)){0===e.length&&(t=SOURCE_FORMAT_ARRAY_ROWS);for(var n=0,i=e.length;n<i;n++){var r=e[n];if(null!=r){if(isArray(r)){t=SOURCE_FORMAT_ARRAY_ROWS;break}if(isObject(r)){t=SOURCE_FORMAT_OBJECT_ROWS;break}}}}else if(isObject(e)){for(var a in e)if(hasOwn(e,a)&&isArrayLike(e[a])){t=SOURCE_FORMAT_KEYED_COLUMNS;break}}else if(null!=e)throw new Error("Invalid data");return t}function determineSourceDimensions(e,t,n,i,r){var a,o;if(!e)return{dimensionsDefine:normalizeDimensionsOption(r),startIndex:o,dimensionsDetectedCount:a};if(t===SOURCE_FORMAT_ARRAY_ROWS){var s=e;"auto"===i||null==i?arrayRowsTravelFirst((function(e){null!=e&&"-"!==e&&(isString(e)?null==o&&(o=1):o=0)}),n,s,10):o=isNumber(i)?i:i?1:0,r||1!==o||(r=[],arrayRowsTravelFirst((function(e,t){r[t]=null!=e?e+"":""}),n,s,1/0)),a=r?r.length:n===SERIES_LAYOUT_BY_ROW?s.length:s[0]?s[0].length:null}else if(t===SOURCE_FORMAT_OBJECT_ROWS)r||(r=objectRowsCollectDimensions(e));else if(t===SOURCE_FORMAT_KEYED_COLUMNS)r||(r=[],each(e,(function(e,t){r.push(t)})));else if(t===SOURCE_FORMAT_ORIGINAL){var l=getDataItemValue(e[0]);a=isArray(l)&&l.length||1}return{startIndex:o,dimensionsDefine:normalizeDimensionsOption(r),dimensionsDetectedCount:a}}function objectRowsCollectDimensions(e){for(var t,n=0;n<e.length&&!(t=e[n++]););if(t){var i=[];return each(t,(function(e,t){i.push(t)})),i}}function normalizeDimensionsOption(e){if(e){var t=createHashMap();return map(e,(function(e,n){var i={name:(e=isObject(e)?e:{name:e}).name,displayName:e.displayName,type:e.type};if(null==name)return i;i.name+="",null==i.displayName&&(i.displayName=i.name);var r=t.get(i.name);return r?i.name+="-"+r.count++:t.set(i.name,{count:1}),i}))}}function arrayRowsTravelFirst(e,t,n,i){if(t===SERIES_LAYOUT_BY_ROW)for(var r=0;r<n.length&&r<i;r++)e(n[r]?n[r][0]:null,r);else{var a=n[0]||[];for(r=0;r<a.length&&r<i;r++)e(a[r],r)}}var DefaultDataProvider=function(){function e(e,t){var n=isSourceInstance(e)?e:createSourceFromSeriesDataOption(e);this._source=n;var i=this._data=n.data;n.sourceFormat===SOURCE_FORMAT_TYPED_ARRAY&&(this._offset=0,this._dimSize=t,this._data=i),mountMethods(this,i,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;mountMethods=function(e,r,a){var o=a.sourceFormat,s=a.seriesLayoutBy,l=a.startIndex,u=a.dimensionsDefine,c=providerMethods[getMethodMapKey(o,s)];if(extend(e,c),o===SOURCE_FORMAT_TYPED_ARRAY)e.getItem=t,e.count=i,e.fillStorage=n;else{var h=getRawSourceItemGetter(o,s);e.getItem=bind(h,null,r,l,u);var p=getRawSourceDataCounter(o,s);e.count=bind(p,null,r,l,u)}};var t=function(e,t){e-=this._offset,t=t||[];for(var n=this._data,i=this._dimSize,r=i*e,a=0;a<i;a++)t[a]=n[r+a];return t},n=function(e,t,n,i){for(var r=this._data,a=this._dimSize,o=0;o<a;o++){for(var s=i[o],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],c=t-e,h=n[o],p=0;p<c;p++){var d=r[(e+p)*a+o];h[e+p]=d,d<l&&(l=d),d>u&&(u=d)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}(e={})[SOURCE_FORMAT_ARRAY_ROWS+"_"+SERIES_LAYOUT_BY_COLUMN]={pure:!0,appendData:r},e[SOURCE_FORMAT_ARRAY_ROWS+"_"+SERIES_LAYOUT_BY_ROW]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[SOURCE_FORMAT_OBJECT_ROWS]={pure:!0,appendData:r},e[SOURCE_FORMAT_KEYED_COLUMNS]={pure:!0,appendData:function(e){var t=this._data;each(e,(function(e,n){for(var i=t[n]||(t[n]=[]),r=0;r<(e||[]).length;r++)i.push(e[r])}))}},e[SOURCE_FORMAT_ORIGINAL]={appendData:r},e[SOURCE_FORMAT_TYPED_ARRAY]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},providerMethods=e}(),e}(),getItemSimply=function(e,t,n,i){return e[i]},rawSourceItemGetterMap=((_a={})[SOURCE_FORMAT_ARRAY_ROWS+"_"+SERIES_LAYOUT_BY_COLUMN]=function(e,t,n,i){return e[i+t]},_a[SOURCE_FORMAT_ARRAY_ROWS+"_"+SERIES_LAYOUT_BY_ROW]=function(e,t,n,i){i+=t;for(var r=[],a=e,o=0;o<a.length;o++){var s=a[o];r.push(s?s[i]:null)}return r},_a[SOURCE_FORMAT_OBJECT_ROWS]=getItemSimply,_a[SOURCE_FORMAT_KEYED_COLUMNS]=function(e,t,n,i){for(var r=[],a=0;a<n.length;a++){var o=n[a].name;0;var s=e[o];r.push(s?s[i]:null)}return r},_a[SOURCE_FORMAT_ORIGINAL]=getItemSimply,_a);function getRawSourceItemGetter(e,t){var n=rawSourceItemGetterMap[getMethodMapKey(e,t)];return n}var countSimply=function(e,t,n){return e.length},rawSourceDataCounterMap=((_b={})[SOURCE_FORMAT_ARRAY_ROWS+"_"+SERIES_LAYOUT_BY_COLUMN]=function(e,t,n){return Math.max(0,e.length-t)},_b[SOURCE_FORMAT_ARRAY_ROWS+"_"+SERIES_LAYOUT_BY_ROW]=function(e,t,n){var i=e[0];return i?Math.max(0,i.length-t):0},_b[SOURCE_FORMAT_OBJECT_ROWS]=countSimply,_b[SOURCE_FORMAT_KEYED_COLUMNS]=function(e,t,n){var i=n[0].name;var r=e[i];return r?r.length:0},_b[SOURCE_FORMAT_ORIGINAL]=countSimply,_b);function getRawSourceDataCounter(e,t){var n=rawSourceDataCounterMap[getMethodMapKey(e,t)];return n}var getRawValueSimply=function(e,t,n){return null!=t?e[t]:e},rawSourceValueGetterMap=((_c={})[SOURCE_FORMAT_ARRAY_ROWS]=getRawValueSimply,_c[SOURCE_FORMAT_OBJECT_ROWS]=function(e,t,n){return null!=t?e[n]:e},_c[SOURCE_FORMAT_KEYED_COLUMNS]=getRawValueSimply,_c[SOURCE_FORMAT_ORIGINAL]=function(e,t,n){var i=getDataItemValue(e);return null!=t&&i instanceof Array?i[t]:i},_c[SOURCE_FORMAT_TYPED_ARRAY]=getRawValueSimply,_c);function getRawSourceValueGetter(e){var t=rawSourceValueGetterMap[e];return t}function getMethodMapKey(e,t){return e===SOURCE_FORMAT_ARRAY_ROWS?e+"_"+t:e}function retrieveRawValue(e,t,n){if(e){var i=e.getRawDataItem(t);if(null!=i){var r,a,o=e.getProvider().getSource().sourceFormat,s=e.getDimensionInfo(n);return s&&(r=s.name,a=s.index),getRawSourceValueGetter(o)(i,a,r)}}}var DIMENSION_LABEL_REG=/\{@(.+?)\}/g,DataFormatMixin=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),i=this.getRawValue(e,t),r=n.getRawIndex(e),a=n.getName(e),o=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,p=n.userOutput;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:a,dataIndex:r,data:o,dataType:t,value:i,color:l,borderColor:u,dimensionNames:p?p.dimensionNames:null,encode:p?p.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(e,t,n,i,r,a){t=t||"normal";var o=this.getData(n),s=this.getDataParams(e,n);(a&&extend(s,a),null!=i&&s.value instanceof Array&&(s.value=s.value[i]),r)||(r=o.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"]));return"function"==typeof r?(s.status=t,s.dimensionIndex=i,r(s)):"string"==typeof r?formatTpl(r,s).replace(DIMENSION_LABEL_REG,(function(t,n){var i=n.length;return"["===n.charAt(0)&&"]"===n.charAt(i-1)&&(n=+n.slice(1,i-1)),retrieveRawValue(o,e,n)})):void 0},e.prototype.getRawValue=function(e,t){return retrieveRawValue(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function normalizeTooltipFormatResult(e){var t,n;return isObject(e)?e.type&&(n=e):t=e,{markupText:t,markupFragment:n}}function createTask(e){return new Task(e)}var Task=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,i=e&&e.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(t=this._plan(this.context));var a,o=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}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,a=this._doReset(i)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!i&&(a||p<d)){var f=this._progress;if(isArray(f))for(var g=0;g<f.length;g++)this._doProgress(f[g],p,d,l,u);else this._doProgress(f,p,d,l,u)}this._dueIndex=d;var m=null!=this._settedOutputEnd?this._settedOutputEnd:d;0,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,i,r){iterator.reset(t,n,i,r),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:iterator.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),isArray(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var i=this._downstream;return i&&i.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){(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}(),iterator=function(){var e,t,n,i,r,a={reset:function(l,u,c,h){t=l,e=u,n=c,i=h,r=Math.ceil(i/n),a.next=n>1&&i>0?s:o}};return a;function o(){return t<e?t++:null}function s(){var a=t%r*n+Math.ceil(t/r),o=t>=e?null:a<i?a:t;return t++,o}}();function parseDataValue(e,t){var n=t&&t.type;if("ordinal"===n){var i=t&&t.ordinalMeta;return i?i.parseAndCollect(e):e}return"time"===n&&"number"!=typeof e&&null!=e&&"-"!==e&&(e=+parseDate(e)),null==e||""===e?NaN:+e}var valueParserMap=createHashMap({number:function(e){return parseFloat(e)},time:function(e){return+parseDate(e)},trim:function(e){return"string"==typeof e?trim(e):e}});function getRawValueParser(e){return valueParserMap.get(e)}var ORDER_COMPARISON_OP_MAP={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}},FilterOrderComparator=function(){function e(e,t){if("number"!=typeof t){var n="";0,throwError(n)}this._opFn=ORDER_COMPARISON_OP_MAP[e],this._rvalFloat=numericToNumber(t)}return e.prototype.evaluate=function(e){return"number"==typeof e?this._opFn(e,this._rvalFloat):this._opFn(numericToNumber(e),this._rvalFloat)},e}(),SortOrderComparator=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=typeof e,i=typeof t,r="number"===n?e:numericToNumber(e),a="number"===i?t:numericToNumber(t),o=isNaN(r),s=isNaN(a);if(o&&(r=this._incomparable),s&&(a=this._incomparable),o&&s){var l="string"===n,u="string"===i;l&&(r=u?e:0),u&&(a=l?t:0)}return r<a?this._resultLT:r>a?-this._resultLT:0},e}(),FilterEqualityComparator=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=numericToNumber(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=numericToNumber(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function createFilterComparator(e,t){return"eq"===e||"ne"===e?new FilterEqualityComparator("eq"===e,t):hasOwn(ORDER_COMPARISON_OP_MAP,e)?new FilterOrderComparator(e,t):null}var ExternalSource=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 parseDataValue(e,t)},e}();function createExternalSource(e,t){var n=new ExternalSource,i=e.data,r=n.sourceFormat=e.sourceFormat,a=e.startIndex,o=[],s={},l=e.dimensionsDefine;if(l)each(l,(function(e,t){var n=e.name,i={index:t,name:n,displayName:e.displayName};if(o.push(i),null!=n){var r="";hasOwn(s,n)&&throwError(r),s[n]=i}}));else for(var u=0;u<e.dimensionsDetectedCount;u++)o.push({index:u});var c=getRawSourceItemGetter(r,SERIES_LAYOUT_BY_COLUMN);t.__isBuiltIn&&(n.getRawDataItem=function(e){return c(i,a,o,e)},n.getRawData=bind(getRawData,null,e)),n.cloneRawData=bind(cloneRawData,null,e);var h=getRawSourceDataCounter(r,SERIES_LAYOUT_BY_COLUMN);n.count=bind(h,null,i,a,o);var p=getRawSourceValueGetter(r);n.retrieveValue=function(e,t){var n=c(i,a,o,e);return d(n,t)};var d=n.retrieveValueFromItem=function(e,t){if(null!=e){var n=o[t];return n?p(e,t,n.name):void 0}};return n.getDimensionInfo=bind(getDimensionInfo,null,o,s),n.cloneAllDimensionInfo=bind(cloneAllDimensionInfo,null,o),n}function getRawData(e){var t=e.sourceFormat,n=e.data;if(t===SOURCE_FORMAT_ARRAY_ROWS||t===SOURCE_FORMAT_OBJECT_ROWS||!n||isArray(n)&&!n.length)return e.data;var i="";throwError(i)}function cloneRawData(e){var t=e.sourceFormat,n=e.data;if(!n)return n;if(isArray(n)&&!n.length)return[];if(t===SOURCE_FORMAT_ARRAY_ROWS){for(var i=[],r=0,a=n.length;r<a;r++)i.push(n[r].slice());return i}if(t===SOURCE_FORMAT_OBJECT_ROWS){for(i=[],r=0,a=n.length;r<a;r++)i.push(extend({},n[r]));return i}}function getDimensionInfo(e,t,n){if(null!=n)return"number"==typeof n||!isNaN(n)&&!hasOwn(t,n)?e[n]:hasOwn(t,n)?t[n]:void 0}function cloneAllDimensionInfo(e){return clone(e)}var externalTransformMap=createHashMap();function registerExternalTransform(e){var t=(e=clone(e)).type,n="";t||throwError(n);var i=t.split(":");2!==i.length&&throwError(n);var r=!1;"echarts"===i[0]&&(t=i[1],r=!0),e.__isBuiltIn=r,externalTransformMap.set(t,e)}function applyDataTransform(e,t,n){var i=normalizeToArray(e),r=i.length,a="";r||throwError(a);for(var o=0,s=r;o<s;o++){t=applySingleDataTransform(i[o],t,n,1===r?null:o),o!==s-1&&(t.length=Math.max(t.length,1))}return t}function applySingleDataTransform(e,t,n,i){var r="";t.length||throwError(r),isObject(e)||throwError(r);var a=e.type,o=externalTransformMap.get(a);o||throwError(r);var s=map(t,(function(e){return createExternalSource(e,o)})),l=normalizeToArray(o.transform({upstream:s[0],upstreamList:s,config:clone(e.config)}));return map(l,(function(e){var n="";isObject(e)||throwError(n);var i=e.data;return null!=i?isObject(i)||isArrayLike(i)||throwError(n):i=t[0].data,createSource(i,inheritSourceMetaRawOption(t[0],{seriesLayoutBy:SERIES_LAYOUT_BY_COLUMN,sourceHeader:0,dimensions:e.dimensions}),null,null)}))}var SourceManager=function(){function e(e){this._sourceList=[],this._upstreamSignList=[],this._versionSignBase=0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[])},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()},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(isSeries(n)){var a=n,o=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),o=(l=u.getSource()).data,s=l.sourceFormat,t=[u._getVersionSign()]}else s=isTypedArray(o=a.get("data",!0))?SOURCE_FORMAT_TYPED_ARRAY:SOURCE_FORMAT_ORIGINAL,t=[];e=[createSource(o,inheritSourceMetaRawOption(l,this._getSourceMetaRawOption()),s,a.get("encode",!0))]}else{var c=n;if(r){var h=this._applyTransform(i);e=h.sourceList,t=h.upstreamSignList}else{e=[createSource(c.get("source",!0),this._getSourceMetaRawOption(),null,null)],t=[]}}this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var a="";1!==e.length&&doThrow(a)}var o=[],s=[];return each(e,(function(e){e.prepareSource();var t=e.getSource(r||0),n="";null==r||t||doThrow(n),o.push(t),s.push(e._getVersionSign())})),i?t=applyDataTransform(i,o,{datasetIndex:n.componentIndex}):null!=r&&(t=[cloneSourceShallow(o[0])]),{sourceList:t,upstreamSignList:s}},e.prototype._isDirty=function(){if(!this._sourceList.length)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){return this._sourceList[e||0]},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(isSeries(e)){var t=querySeriesUpstreamDatasetModel(e);return t?[t.getSourceManager()]:[]}return map(queryDatasetUpstreamDatasetModels(e),(function(e){return e.getSourceManager()}))},e.prototype._getSourceMetaRawOption=function(){var e,t,n,i=this._sourceHost;if(isSeries(i))e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var r=i;e=r.get("seriesLayoutBy",!0),t=r.get("sourceHeader",!0),n=r.get("dimensions",!0)}return{seriesLayoutBy:e,sourceHeader:t,dimensions:n}},e}();function disableTransformOptionMerge(e){e.option.transform&&setAsPrimitive(e.option.transform)}function isSeries(e){return"series"===e.mainType}function doThrow(e){throw new Error(e)}var TOOLTIP_NAME_TEXT_STYLE_CSS="font-size:12px;color:#6e7079",TOOLTIP_TEXT_STYLE_RICH={fontSize:12,fill:"#6e7079"},TOOLTIP_VALUE_TEXT_STYLE_CSS="font-size:14px;color:#464646;font-weight:900",TOOLTIP_VALUE_TEXT_STYLE_RICH={fontSize:14,fill:"#464646",fontWeight:900},TOOLTIP_LINE_HEIGHT_CSS="line-height:1",HTML_GAPS=[0,10,20,30],RICH_TEXT_GAPS=["","\n","\n\n","\n\n\n"];function createTooltipMarkup(e,t){return t.type=e,t}function getBuilder(e){return hasOwn(builderMap,e.type)&&builderMap[e.type]}var builderMap={section:{planLayout:function(e){var t=e.blocks.length,n=t>1||t>0&&!e.noHeader,i=0;each(e.blocks,(function(e){getBuilder(e).planLayout(e);var t=e.__gapLevelBetweenSubBlocks;t>=i&&(i=t+(!n||t&&("section"!==e.type||e.noHeader)?0:1))})),e.__gapLevelBetweenSubBlocks=i},build:function(e,t,n){var i=t.noHeader,r=getGap(t),a=buildSubBlocks(e,t,i?n:r.html);if(i)return a;var o=makeValueReadable(t.header,"ordinal",e.useUTC);return"richText"===e.renderMode?wrapInlineNameRichText(e,o)+r.richText+a:wrapBlockHTML('<div style="'+TOOLTIP_NAME_TEXT_STYLE_CSS+";"+TOOLTIP_LINE_HEIGHT_CSS+';">'+encodeHTML(o)+"</div>"+a,n)}},nameValue:{planLayout:function(e){e.__gapLevelBetweenSubBlocks=0},build:function(e,t,n){var i=e.renderMode,r=t.noName,a=t.noValue,o=!t.markerType,s=t.name,l=t.value,u=e.useUTC;if(!r||!a){var c=o?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",i),h=r?"":makeValueReadable(s,"ordinal",u),p=t.valueType,d=a?[]:isArray(l)?map(l,(function(e,t){return makeValueReadable(e,isArray(p)?p[t]:p,u)})):[makeValueReadable(l,isArray(p)?p[0]:p,u)],f=!o||!r,g=!o&&r;return"richText"===i?(o?"":c)+(r?"":wrapInlineNameRichText(e,h))+(a?"":wrapInlineValueRichText(e,d,f,g)):wrapBlockHTML((o?"":c)+(r?"":wrapInlineNameHTML(h,!o))+(a?"":wrapInlineValueHTML(d,f,g)),n)}}}};function buildSubBlocks(e,t,n){var i=[],r=t.blocks||[];assert(!r||isArray(r)),r=r||[];var a=e.orderMode;if(t.sortBlocks&&a){r=r.slice();var o={valueAsc:"asc",valueDesc:"desc"};if(hasOwn(o,a)){var s=new SortOrderComparator(o[a],null);r.sort((function(e,t){return s.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===a&&r.reverse()}var l=getGap(t);if(each(r,(function(t,n){var r=getBuilder(t).build(e,t,n>0?l.html:0);null!=r&&i.push(r)})),i.length)return"richText"===e.renderMode?i.join(l.richText):wrapBlockHTML(i.join(""),n)}function buildTooltipMarkup(e,t,n,i,r){if(e){var a=getBuilder(e);a.planLayout(e);var o={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:t};return a.build(o,e,0)}}function getGap(e){var t=e.__gapLevelBetweenSubBlocks;return{html:HTML_GAPS[t],richText:RICH_TEXT_GAPS[t]}}function wrapBlockHTML(e,t){return'<div style="'+("margin: "+t+"px 0 0")+";"+TOOLTIP_LINE_HEIGHT_CSS+';">'+e+'<div style="clear:both"></div></div>'}function wrapInlineNameHTML(e,t){return'<span style="'+TOOLTIP_NAME_TEXT_STYLE_CSS+";"+(t?"margin-left:2px":"")+'">'+encodeHTML(e)+"</span>"}function wrapInlineValueHTML(e,t,n){return'<span style="'+(t?"float:right;margin-left:"+(n?"10px":"20px"):"")+";"+TOOLTIP_VALUE_TEXT_STYLE_CSS+'">'+map(e,(function(e){return encodeHTML(e)})).join("&nbsp;&nbsp;")+"</span>"}function wrapInlineNameRichText(e,t){return e.markupStyleCreator.wrapRichTextStyle(t,TOOLTIP_TEXT_STYLE_RICH)}function wrapInlineValueRichText(e,t,n,i){var r=[TOOLTIP_VALUE_TEXT_STYLE_RICH],a=i?10:20;return n&&r.push({padding:[0,0,0,a],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(t.join("  "),r)}function retrieveVisualColorForTooltipMarker(e,t){return convertToColorString(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function getPaddingFromTooltipModel(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var TooltipMarkupStyleCreator=function(){function e(){this.richTextStyles={},this._nextStyleNameId=getRandomIdBase()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i="richText"===n?this._generateStyleName():null,r=getTooltipMarker({color:t,type:e,renderMode:n,markerId:i});return isString(r)?r:(this.richTextStyles[i]=r.style,r.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};isArray(t)?each(t,(function(e){return extend(n,e)})):extend(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}();function defaultSeriesFormatTooltip(e){var t,n,i,r,a=e.series,o=e.dataIndex,s=e.multipleSeries,l=a.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=a.getRawValue(o),p=isArray(h),d=retrieveVisualColorForTooltipMarker(a,o);if(c>1||p&&!c){var f=formatTooltipArrayValue(h,a,o,u,d);t=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);r=t=retrieveRawValue(l,o,u[0]),n=g.type}else r=t=p?h[0]:h;var m=isNameSpecified(a),y=m&&a.name||"",v=l.getName(o),_=s?y:v;return createTooltipMarkup("section",{header:y,noHeader:s||!m,sortParam:r,blocks:[createTooltipMarkup("nameValue",{markerType:"item",markerColor:d,name:_,noName:!trim(_),value:t,valueType:n})].concat(i||[])})}function formatTooltipArrayValue(e,t,n,i,r){var a=t.getData(),o=reduce(e,(function(e,t,n){var i=a.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function c(e,t){var n=a.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(o?u.push(createTooltipMarkup("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?each(i,(function(e){c(retrieveRawValue(a,n,e),e)})):each(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}var inner$1=makeInner();function getSelectionKey(e,t){return e.getName(t)||e.getId(t)}var SeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return __extends(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=createTask({count:dataTaskCount,reset:dataTaskReset}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(inner$1(this).sourceManager=new SourceManager(this)).prepareSource();var i=this.getInitialData(e,n);wrapData(i,this),this.dataTask.context.data=i,inner$1(this).dataBeforeProcessed=i,autoSeriesName(this),this._initSelectedMapFromData(i)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=fetchLayoutMode(this),i=n?getLayoutParams(e):{},r=this.subType;ComponentModel.hasClass(r)&&(r+="Series"),merge(e,t.getTheme().get(this.subType)),merge(e,this.getDefaultOption()),defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&mergeLayoutParam(e,i,n)},t.prototype.mergeOption=function(e,t){e=merge(this.option,e,!0),this.fillDataTextStyle(e.data);var n=fetchLayoutMode(this);n&&mergeLayoutParam(this.option,e,n);var i=inner$1(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(e,t);wrapData(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,inner$1(this).dataBeforeProcessed=r,autoSeriesName(this),this._initSelectedMapFromData(r)},t.prototype.fillDataTextStyle=function(e){if(e&&!isTypedArray(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&defaultEmphasis(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=getCurrentTask(this);if(t){var n=t.context.data;return null==e?n:n.getLinkedData(e)}return inner$1(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=getCurrentTask(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}inner$1(this).data=e},t.prototype.getSource=function(){return inner$1(this).sourceManager.getSource()},t.prototype.getRawData=function(){return inner$1(this).dataBeforeProcessed},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.formatTooltip=function(e,t,n){return defaultSeriesFormatTooltip({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){if(env.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,r=PaletteMixin.prototype.getColorFromPalette.call(this,e,t,n);return r||(r=i.getColorFromPalette(e,t,n)),r},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)for(var i=this.getData(t),r=0;r<e.length;r++){var a=getSelectionKey(i,e[r]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}},t.prototype.toggleSelect=function(e,t){for(var n=[],i=0;i<e.length;i++)n[0]=e[i],this.isSelected(e[i],t)?this.unselect(n,t):this.select(n,t)},t.prototype.getSelectedDataIndices=function(){for(var e=this._selectedDataIndicesMap,t=keys(e),n=[],i=0;i<t.length;i++){var r=e[t[i]];r>=0&&n.push(r)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;return n&&n[getSelectionKey(this.getData(t),e)]||!1},t.prototype._innerSelect=function(e,t){var n,i,r=this.option.selectedMode,a=t.length;if(r&&a)if("multiple"===r)for(var o=this.option.selectedMap||(this.option.selectedMap={}),s=0;s<a;s++){var l=t[s];o[c=getSelectionKey(e,l)]=!0,this._selectedDataIndicesMap[c]=e.getRawIndex(l)}else if("single"===r||!0===r){var u=t[a-1],c=getSelectionKey(e,u);this.option.selectedMap=((n={})[c]=!0,n),this._selectedDataIndicesMap=((i={})[c]=e.getRawIndex(u),i)}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each((function(n){var i=e.getRawDataItem(n);"object"==typeof i&&i.selected&&t.push(n)})),t.length>0&&this._innerSelect(e,t)}},t.registerClass=function(e){return ComponentModel.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.useColorPaletteOnData=!1,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(ComponentModel);function autoSeriesName(e){var t=e.name;isNameSpecified(e)||(e.name=getSeriesAutoName(e)||t)}function getSeriesAutoName(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),i=[];return each(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)})),i.join(" ")}function dataTaskCount(e){return e.model.getRawData().count()}function dataTaskReset(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),dataTaskProgress}function dataTaskProgress(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function wrapData(e,t){each(__spreadArrays(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,curry(onDataChange,t))}))}function onDataChange(e,t){var n=getCurrentTask(e);return n&&n.setOutputEnd((t||this).count()),t}function getCurrentTask(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(e.uid))}return i}}mixin(SeriesModel,DataFormatMixin),mixin(SeriesModel,PaletteMixin),mountExtend(SeriesModel,ComponentModel);var ComponentView=function(){function e(){this.group=new Group,this.uid=getUID("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.blurSeries=function(e,t){},e}();function createRenderPlanner(){var e=makeInner();return function(t){var n=e(t),i=t.pipelineContext,r=!!n.large,a=!!n.progressiveRender,o=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===o&&a===s)&&"reset"}}enableClassExtend(ComponentView),enableClassManagement(ComponentView,{registerWhenExtend:!0});var inner$2=makeInner(),renderPlanner=createRenderPlanner(),ChartView=function(){function e(){this.group=new Group,this.uid=getUID("viewChart"),this.renderTask=createTask({plan:renderTaskPlan,reset:renderTaskReset}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.highlight=function(e,t,n,i){toggleHighlight(e.getData(),i,"emphasis")},e.prototype.downplay=function(e,t,n,i){toggleHighlight(e.getData(),i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.markUpdateMethod=function(e,t){inner$2(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function elSetState(e,t,n){e&&("emphasis"===t?enterEmphasis:leaveEmphasis)(e,n)}function toggleHighlight(e,t,n){var i=queryDataIndex(e,t),r=t&&null!=t.highlightKey?getHighlightDigit(t.highlightKey):null;null!=i?each(normalizeToArray(i),(function(t){elSetState(e.getItemGraphicEl(t),n,r)})):e.eachItemGraphicEl((function(e){elSetState(e,n,r)}))}function renderTaskPlan(e){return renderPlanner(e.model)}function renderTaskReset(e){var t=e.model,n=e.ecModel,i=e.api,r=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=r&&inner$2(r).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,n,i,r),progressMethodMap[l]}enableClassExtend(ChartView,["dispose"]),enableClassManagement(ChartView,{registerWhenExtend:!0});var progressMethodMap={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)}}},ORIGIN_METHOD="\0__throttleOriginMethod",RATE="\0__throttleRate",THROTTLE_TYPE="\0__throttleType";function throttle(e,t,n){var i,r,a,o,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,e.apply(a,o||[])}t=t||0;var p=function(){for(var e=[],p=0;p<arguments.length;p++)e[p]=arguments[p];i=(new Date).getTime(),a=this,o=e;var d=s||t,f=s||n;s=null,r=i-(f?l:u)-d,clearTimeout(c),f?c=setTimeout(h,d):r>=0?h():c=setTimeout(h,-r),l=i};return p.clear=function(){c&&(clearTimeout(c),c=null)},p.debounceNextCall=function(e){s=e},p}function createOrUpdate(e,t,n,i){var r=e[t];if(r){var a=r[ORIGIN_METHOD]||r,o=r[THROTTLE_TYPE];if(r[RATE]!==n||o!==i){if(null==n||!i)return e[t]=a;(r=e[t]=throttle(a,n,"debounce"===i))[ORIGIN_METHOD]=a,r[THROTTLE_TYPE]=i,r[RATE]=n}return r}}function clear(e,t){var n=e[t];n&&n[ORIGIN_METHOD]&&(e[t]=n[ORIGIN_METHOD])}var inner$3=makeInner(),defaultStyleMappers={itemStyle:makeStyleMapper(ITEM_STYLE_KEY_MAP,!0),lineStyle:makeStyleMapper(LINE_STYLE_KEY_MAP,!0)},defaultColorKey={lineStyle:"stroke",itemStyle:"fill"};function getStyleMapper(e,t){var n=e.visualStyleMapper||defaultStyleMappers[t];return n||(console.warn("Unkown style type '"+t+"'."),defaultStyleMappers.itemStyle)}function getDefaultColorKey(e,t){var n=e.visualDrawType||defaultColorKey[t];return n||(console.warn("Unkown style type '"+t+"'."),"fill")}var seriesStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=e.getModel(i),a=getStyleMapper(e,i)(r),o=r.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var s=getDefaultColorKey(e,i),l=a[s],u=isFunction(l)?l:null;if(a[s]&&!u||(a[s]=e.getColorFromPalette(e.name,null,t.getSeriesCount()),n.setVisual("colorFromPalette",!0)),n.setVisual("style",a),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),r=extend({},a);r[s]=u(i),t.setItemVisual(n,"style",r)}}}},sharedModel=new Model,dataStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=getStyleMapper(e,i),a=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){sharedModel.option=n[i];var o=r(sharedModel);extend(e.ensureUniqueItemVisual(t,"style"),o),sharedModel.option.decal&&(e.setItemVisual(t,"decal",sharedModel.option.decal),sharedModel.option.decal.dirty=!0),a in o&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},dataColorPaletteTask={performRawSeries:!0,overallReset:function(e){var t=createHashMap();e.eachSeries((function(e){if(e.useColorPaletteOnData){var n=t.get(e.type);n||(n={},t.set(e.type,n)),inner$3(e).scope=n}})),e.eachSeries((function(t){if(t.useColorPaletteOnData&&!e.isSeriesFiltered(t)){var n=t.getRawData(),i={},r=t.getData(),a=inner$3(t).scope,o=t.visualStyleAccessPath||"itemStyle",s=getDefaultColorKey(t,o);r.each((function(e){var t=r.getRawIndex(e);i[t]=e})),n.each((function(e){var o=i[e];if(r.getItemVisual(o,"colorFromPalette")){var l=r.ensureUniqueItemVisual(o,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,a,c)}}))}}))}},PI$5=Math.PI;function defaultLoading(e,t){defaults(t=t||{},{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Group,i=new Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(i);var r,a=t.fontSize+" sans-serif",o=new Rect({style:{fill:"none"},textContent:new ZRText({style:{text:t.text,fill:t.textColor,font:a}}),textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(o),t.showSpinner&&((r=new Arc({shape:{startAngle:-PI$5/2,endAngle:-PI$5/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*PI$5/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*PI$5/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=getWidth(t.text,a),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner?0:n/2),u=e.getHeight()/2;t.showSpinner&&r.setShape({cx:l,cy:u}),o.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var Scheduler=function(){function e(e,t,n,i){this._stageTaskMap=createHashMap(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}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),i=n.context,r=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=i&&i.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),r=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,a=e.get("large")&&i>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:r,modDataCount:o,large:a}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=createHashMap();e.eachSeries((function(e){var i=e.getProgressive(),r=e.uid;n.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;each(this._allHandlers,(function(i){var r=e.get(i.uid)||e.set(i.uid,{}),a="";assert(!(i.reset&&i.overallReset),a),i.reset&&this._createSeriesStageTask(i,r,t,n),i.overallReset&&this._createOverallStageTask(i,r,t,n)}),this)},e.prototype.prepareView=function(e,t,n,i){var r=e.renderTask,a=r.context;a.model=t,a.ecModel=n,a.api=i,r.__block=!e.incrementalPrepareRender,this._pipe(t,r)},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,i){i=i||{};var r=!1,a=this;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}each(e,(function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=a._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,p=c.agentStubMap;p.each((function(e){o(i,e)&&(e.dirty(),h=!0)})),h&&c.dirty(),a.updatePayload(c,n);var d=a.getPerformArgs(c,i.block);p.each((function(e){e.perform(d)})),c.perform(d)&&(r=!0)}else u&&u.each((function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||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,i){var r=this,a=t.seriesTaskMap,o=t.seriesTaskMap=createHashMap(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=o.set(s,a&&a.get(s)||createTask({plan:seriesTaskPlan,reset:seriesTaskReset,count:seriesTaskCount}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:r},r._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},e.prototype._createOverallStageTask=function(e,t,n,i){var r=this,a=t.overallTask=t.overallTask||createTask({reset:overallTaskReset});a.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:r};var o=a.agentStubMap,s=a.agentStubMap=createHashMap(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1,p="";function d(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(h=!0,createTask({reset:stubReset,onDirty:stubOnDirty})));n.context={model:e,overallProgress:c},n.agent=a,n.__block=c,r._pipe(e,n)}assert(!e.createOnAllSeries,p),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(c=!1,each(n.getSeries(),d)),h&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return isFunction(e)&&(e={overallReset:e,seriesType:detectSeriseType(e)}),e.uid=getUID("stageHandler"),t&&(e.visualType=t),e},e}();function overallTaskReset(e){e.overallReset(e.ecModel,e.api,e.payload)}function stubReset(e){return e.overallProgress&&stubProgress}function stubProgress(){this.agent.dirty(),this.getDownstream().dirty()}function stubOnDirty(){this.agent&&this.agent.dirty()}function seriesTaskPlan(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function seriesTaskReset(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=normalizeToArray(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?map(t,(function(e,t){return makeSeriesTaskProgress(t)})):singleSeriesTaskProgress}var singleSeriesTaskProgress=makeSeriesTaskProgress(0);function makeSeriesTaskProgress(e){return function(t,n){var i=n.data,r=n.resetDefines[e];if(r&&r.dataEach)for(var a=t.start;a<t.end;a++)r.dataEach(i,a);else r&&r.progress&&r.progress(t,i)}}function seriesTaskCount(e){return e.data.count()}function detectSeriseType(e){seriesType=null;try{e(ecModelMock,apiMock)}catch(e){}return seriesType}var seriesType,ecModelMock={},apiMock={};function mockMethods(e,t){for(var n in t.prototype)e[n]=noop}mockMethods(ecModelMock,GlobalModel),mockMethods(apiMock,ExtensionAPI),ecModelMock.eachSeriesByType=ecModelMock.eachRawSeriesByType=function(e){seriesType=e},ecModelMock.eachComponent=function(e){"series"===e.mainType&&e.subType&&(seriesType=e.subType)};var colorAll=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],lightTheme={color:colorAll,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],colorAll]},contrastColor="#B9B8CE",backgroundColor="#100C2A",axisCommon=function(){return{axisLine:{lineStyle:{color:contrastColor}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},colorPalette=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],theme={darkMode:!0,color:colorPalette,backgroundColor:backgroundColor,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:contrastColor}},textStyle:{color:contrastColor},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:contrastColor}},dataZoom:{borderColor:"#71708A",textStyle:{color:contrastColor},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:contrastColor}},timeline:{lineStyle:{color:contrastColor},label:{color:contrastColor},controlStyle:{color:contrastColor,borderColor:contrastColor}},calendar:{itemStyle:{color:backgroundColor},dayLabel:{color:contrastColor},monthLabel:{color:contrastColor},yearLabel:{color:contrastColor}},timeAxis:axisCommon(),logAxis:axisCommon(),valueAxis:axisCommon(),categoryAxis:axisCommon(),line:{symbol:"circle"},graph:{color:colorPalette},gauge:{title:{color:contrastColor},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:contrastColor},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}};theme.categoryAxis.splitLine.show=!1;var DatasetModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return __extends(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),this._sourceManager=new SourceManager(this),disableTransformOptionMerge(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),disableTransformOptionMerge(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:SERIES_LAYOUT_BY_COLUMN},t}(ComponentModel);ComponentModel.registerClass(DatasetModel);var DatasetView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return __extends(t,e),t.type="dataset",t}(ComponentView);ComponentView.registerClass(DatasetView);var storage=createHashMap(),mapDataStorage={registerMap:function(e,t,n){var i;if(isArray(t))i=t;else if(t.svg)i=[{type:"svg",source:t.svg,specialAreas:t.specialAreas}];else{var r=t.geoJson||t.geoJSON;r&&!t.features&&(n=t.specialAreas,t=r),i=[{type:"geoJSON",source:t,specialAreas:n}]}return each(i,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON");var n=parsers[t];n(e)})),storage.set(e,i)},retrieveMap:function(e){return storage.get(e)}},parsers={geoJSON:function(e){var t=e.source;e.geoJSON=isString(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=parseXML(e.source)}},ECEventProcessor=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},i={};if(isString(e)){var r=parseClassType(e);t.mainType=r.main||null,t.subType=r.sub||null}else{var a=["Index","Name","Id"],o={name:1,dataIndex:1,dataType:1};each(e,(function(e,r){for(var s=!1,l=0;l<a.length;l++){var u=a[l],c=r.lastIndexOf(u);if(c>0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(r)&&(n[r]=e,s=!0),s||(i[r]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,a,"mainType")&&u(s,a,"subType")&&u(s,a,"index","componentIndex")&&u(s,a,"name")&&u(s,a,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,r));function u(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),seriesSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendSymbol&&n.setVisual("legendSymbol",e.legendSymbol),e.hasSymbolVisual){var i=e.get("symbol"),r=e.get("symbolSize"),a=e.get("symbolKeepAspect"),o=e.get("symbolRotate"),s=isFunction(i),l=isFunction(r),u=isFunction(o),c=s||l||u,h=!s&&i?i:e.defaultSymbol,p=l?null:r,d=u?null:o;if(n.setVisual({legendSymbol:e.legendSymbol||h,symbol:h,symbolSize:p,symbolKeepAspect:a,symbolRotate:d}),!t.isSeriesFiltered(e))return{dataEach:c?function(t,n){var a=e.getRawValue(n),c=e.getDataParams(n);s&&t.setItemVisual(n,"symbol",i(a,c)),l&&t.setItemVisual(n,"symbolSize",r(a,c)),u&&t.setItemVisual(n,"symbolRotate",o(a,c))}:null}}}},dataSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){var n=e.getItemModel(t),i=n.getShallow("symbol",!0),r=n.getShallow("symbolSize",!0),a=n.getShallow("symbolRotate",!0),o=n.getShallow("symbolKeepAspect",!0);null!=i&&e.setItemVisual(t,"symbol",i),null!=r&&e.setItemVisual(t,"symbolSize",r),null!=a&&e.setItemVisual(t,"symbolRotate",a),null!=o&&e.setItemVisual(t,"symbolKeepAspect",o)}:null}}};function getItemVisualFromData(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:0}}function getVisualFromData(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:0}}function setItemVisualFromData(e,t,n,i){switch(n){case"color":e.ensureUniqueItemVisual(t,"style")[e.getVisual("drawType")]=i,e.setItemVisual(t,"colorFromPalette",!1);break;case"opacity":e.ensureUniqueItemVisual(t,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":e.setItemVisual(t,n,i);break;default:0}}var PI2$7=2*Math.PI,CMD$4=PathProxy.CMD,DEFAULT_SEARCH_SPACE=["top","right","bottom","left"];function getCandidateAnchor(e,t,n,i,r){var a=n.width,o=n.height;switch(e){case"top":i.set(n.x+a/2,n.y-t),r.set(0,-1);break;case"bottom":i.set(n.x+a/2,n.y+o+t),r.set(0,1);break;case"left":i.set(n.x-t,n.y+o/2),r.set(-1,0);break;case"right":i.set(n.x+a+t,n.y+o/2),r.set(1,0)}}function projectPointToArc(e,t,n,i,r,a,o,s,l){o-=e,s-=t;var u=Math.sqrt(o*o+s*s),c=(o/=u)*n+e,h=(s/=u)*n+t;if(Math.abs(i-r)%PI2$7<1e-4)return l[0]=c,l[1]=h,u-n;if(a){var p=i;i=normalizeRadian(r),r=normalizeRadian(p)}else i=normalizeRadian(i),r=normalizeRadian(r);i>r&&(r+=PI2$7);var d=Math.atan2(s,o);if(d<0&&(d+=PI2$7),d>=i&&d<=r||d+PI2$7>=i&&d+PI2$7<=r)return l[0]=c,l[1]=h,u-n;var f=n*Math.cos(i)+e,g=n*Math.sin(i)+t,m=n*Math.cos(r)+e,y=n*Math.sin(r)+t,v=(f-o)*(f-o)+(g-s)*(g-s),_=(m-o)*(m-o)+(y-s)*(y-s);return v<_?(l[0]=f,l[1]=g,Math.sqrt(v)):(l[0]=m,l[1]=y,Math.sqrt(_))}function projectPointToLine(e,t,n,i,r,a,o,s){var l=r-e,u=a-t,c=n-e,h=i-t,p=Math.sqrt(c*c+h*h),d=(l*(c/=p)+u*(h/=p))/p;s&&(d=Math.min(Math.max(d,0),1)),d*=p;var f=o[0]=e+d*c,g=o[1]=t+d*h;return Math.sqrt((f-r)*(f-r)+(g-a)*(g-a))}function projectPointToRect(e,t,n,i,r,a,o){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i);var s=e+n,l=t+i,u=o[0]=Math.min(Math.max(r,e),s),c=o[1]=Math.min(Math.max(a,t),l);return Math.sqrt((u-r)*(u-r)+(c-a)*(c-a))}var tmpPt=[];function nearestPointOnRect(e,t,n){var i=projectPointToRect(t.x,t.y,t.width,t.height,e.x,e.y,tmpPt);return n.set(tmpPt[0],tmpPt[1]),i}function nearestPointOnPath(e,t,n){for(var i,r,a=0,o=0,s=0,l=0,u=1/0,c=t.data,h=e.x,p=e.y,d=0;d<c.length;){var f=c[d++];1===d&&(s=a=c[d],l=o=c[d+1]);var g=u;switch(f){case CMD$4.M:a=s=c[d++],o=l=c[d++];break;case CMD$4.L:g=projectPointToLine(a,o,c[d],c[d+1],h,p,tmpPt,!0),a=c[d++],o=c[d++];break;case CMD$4.C:g=cubicProjectPoint(a,o,c[d++],c[d++],c[d++],c[d++],c[d],c[d+1],h,p,tmpPt),a=c[d++],o=c[d++];break;case CMD$4.Q:g=quadraticProjectPoint(a,o,c[d++],c[d++],c[d],c[d+1],h,p,tmpPt),a=c[d++],o=c[d++];break;case CMD$4.A:var m=c[d++],y=c[d++],v=c[d++],_=c[d++],x=c[d++],S=c[d++];d+=1;var b=!!(1-c[d++]);i=Math.cos(x)*v+m,r=Math.sin(x)*_+y,d<=1&&(s=i,l=r),g=projectPointToArc(m,y,_,x,x+S,b,(h-m)*_/v+m,p,tmpPt),a=Math.cos(x+S)*v+m,o=Math.sin(x+S)*_+y;break;case CMD$4.R:g=projectPointToRect(s=a=c[d++],l=o=c[d++],c[d++],c[d++],h,p,tmpPt);break;case CMD$4.Z:g=projectPointToLine(a,o,s,l,h,p,tmpPt,!0),a=s,o=l}g<u&&(u=g,n.set(tmpPt[0],tmpPt[1]))}return u}var pt0=new Point,pt1=new Point,pt2=new Point,dir=new Point,dir2=new Point;function updateLabelLinePoints(e,t){if(e){var n=e.getTextGuideLine(),i=e.getTextContent();if(i&&n){var r=e.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=r.candidates||DEFAULT_SEARCH_SPACE,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=1/0,u=r.anchor,c=e.getComputedTransform(),h=c&&invert([],c),p=t.get("length2")||0;u&&pt2.copy(u);for(var d=0;d<o.length;d++){getCandidateAnchor(o[d],0,s,pt0,dir),Point.scaleAndAdd(pt1,pt0,dir,p),pt1.transform(h);var f=e.getBoundingRect(),g=u?u.distance(pt1):e instanceof Path?nearestPointOnPath(pt1,e.path,pt2):nearestPointOnRect(pt1,f,pt2);g<l&&(l=g,pt1.transform(c),pt2.transform(c),pt2.toArray(a[0]),pt1.toArray(a[1]),pt0.toArray(a[2]))}limitTurnAngle(a,t.get("minTurnAngle")),n.setShape({points:a})}}}var tmpArr$1=[],tmpProjPoint=new Point;function limitTurnAngle(e,t){if(t<=180&&t>0){t=t/180*Math.PI,pt0.fromArray(e[0]),pt1.fromArray(e[1]),pt2.fromArray(e[2]),Point.sub(dir,pt0,pt1),Point.sub(dir2,pt2,pt1);var n=dir.len(),i=dir2.len();if(!(n<.001||i<.001)){dir.scale(1/n),dir2.scale(1/i);var r=dir.dot(dir2);if(Math.cos(t)<r){var a=projectPointToLine(pt1.x,pt1.y,pt2.x,pt2.y,pt0.x,pt0.y,tmpArr$1,!1);tmpProjPoint.fromArray(tmpArr$1),tmpProjPoint.scaleAndAdd(dir2,a/Math.tan(Math.PI-t));var o=pt2.x!==pt1.x?(tmpProjPoint.x-pt1.x)/(pt2.x-pt1.x):(tmpProjPoint.y-pt1.y)/(pt2.y-pt1.y);if(isNaN(o))return;o<0?Point.copy(tmpProjPoint,pt1):o>1&&Point.copy(tmpProjPoint,pt2),tmpProjPoint.toArray(e[1])}}}}function limitSurfaceAngle(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,pt0.fromArray(e[0]),pt1.fromArray(e[1]),pt2.fromArray(e[2]),Point.sub(dir,pt1,pt0),Point.sub(dir2,pt2,pt1);var i=dir.len(),r=dir2.len();if(!(i<.001||r<.001))if(dir.scale(1/i),dir2.scale(1/r),dir.dot(t)<Math.cos(n)){var a=projectPointToLine(pt1.x,pt1.y,pt2.x,pt2.y,pt0.x,pt0.y,tmpArr$1,!1);tmpProjPoint.fromArray(tmpArr$1);var o=Math.PI/2,s=o+Math.acos(dir2.dot(t))-n;if(s>=o)Point.copy(tmpProjPoint,pt2);else{tmpProjPoint.scaleAndAdd(dir2,a/Math.tan(Math.PI/2-s));var l=pt2.x!==pt1.x?(tmpProjPoint.x-pt1.x)/(pt2.x-pt1.x):(tmpProjPoint.y-pt1.y)/(pt2.y-pt1.y);if(isNaN(l))return;l<0?Point.copy(tmpProjPoint,pt1):l>1&&Point.copy(tmpProjPoint,pt2)}tmpProjPoint.toArray(e[1])}}}function setLabelLineState(e,t,n,i){var r="normal"===n,a=r?e:e.ensureState(n);a.ignore=t;var o=i.get("smooth");o&&!0===o&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();r?e.useStyle(s):a.style=s}function buildLabelLinePath(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=dist(i[0],i[1]),a=dist(i[1],i[2]);if(!r||!a)return e.lineTo(i[1][0],i[1][1]),void e.lineTo(i[2][0],i[2][1]);var o=Math.min(r,a)*n,s=lerp([],i[1],i[0],o/r),l=lerp([],i[1],i[2],o/a),u=lerp([],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],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)e.lineTo(i[c][0],i[c][1])}function setLabelLineStyle(e,t,n){var i=e.getTextGuideLine(),r=e.getTextContent();if(r){for(var a=t.normal,o=a.get("show"),s=r.ignore,l=0;l<DISPLAY_STATES.length;l++){var u=DISPLAY_STATES[l],c=t[u],h="normal"===u;if(c){var p=c.get("show");if((h?s:retrieve2(r.states[u]&&r.states[u].ignore,s))||!retrieve2(p,o)){var d=h?i:i&&i.states.normal;d&&(d.ignore=!0);continue}i||(i=new Polyline,e.setTextGuideLine(i),h||!s&&o||setLabelLineState(i,!0,"normal",t.normal),e.stateProxy&&(i.stateProxy=e.stateProxy)),setLabelLineState(i,!1,u,c)}}if(i){defaults(i.style,n),i.style.fill=null;var f=a.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,i.buildPath=buildLabelLinePath}}else i&&e.removeTextGuideLine()}function getLabelLineStatesModels(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},i=0;i<SPECIAL_STATES.length;i++){var r=SPECIAL_STATES[i];n[r]=e.getModel([r,t])}return n}function prepareLayoutList(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if(!i.defaultAttr.ignore){var r=i.label,a=r.getComputedTransform(),o=r.getBoundingRect(),s=!a||a[1]<1e-5&&a[2]<1e-5,l=r.style.margin||0,u=o.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new OrientedBoundingRect(o,a):null;t.push({label:r,labelLine:i.labelLine,rect:u,localRect:o,obb:c,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:a})}}return t}function shiftLayout(e,t,n,i,r,a){var o=e.length;if(!(o<2)){e.sort((function(e,n){return e.rect[t]-n.rect[t]}));for(var s,l=0,u=!1,c=0,h=0;h<o;h++){var p=e[h],d=p.rect;(s=d[t]-l)<0&&(d[t]-=s,p.label[t]-=s,u=!0),c+=Math.max(-s,0),l=d[t]+d[n]}c>0&&a&&x(-c/o,0,o);var f,g,m=e[0],y=e[o-1];return v(),f<0&&S(-f,.8),g<0&&S(g,.8),v(),_(f,g,1),_(g,f,-1),v(),f<0&&b(-f),g<0&&b(g),u}function v(){f=m.rect[t]-i,g=r-y.rect[t]-y.rect[n]}function _(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){x(i*n,0,o);var r=i+e;r<0&&S(-r*n,1)}else S(-e*n,1)}}function x(n,i,r){0!==n&&(u=!0);for(var a=i;a<r;a++){var o=e[a];o.rect[t]+=n,o.label[t]+=n}}function S(i,r){for(var a=[],s=0,l=1;l<o;l++){var u=e[l-1].rect,c=Math.max(e[l].rect[t]-u[t]-u[n],0);a.push(c),s+=c}if(s){var h=Math.min(Math.abs(i)/s,r);if(i>0)for(l=0;l<o-1;l++){x(a[l]*h,0,l+1)}else for(l=o-1;l>0;l--){x(-(a[l-1]*h),l,o)}}}function b(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),i=0;i<o-1;i++)if(t>0?x(n,0,i+1):x(-n,o-i-1,o),(e-=n)<=0)return}}function shiftLayoutOnX(e,t,n,i){return shiftLayout(e,"x","width",t,n,i)}function shiftLayoutOnY(e,t,n,i){return shiftLayout(e,"y","height",t,n,i)}function hideOverlap(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new BoundingRect(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var r=0;r<e.length;r++){var a=e[r],o=a.axisAligned,s=a.localRect,l=a.transform,u=a.label,c=a.labelLine;n.copy(a.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=a.obb,p=!1,d=0;d<t.length;d++){var f=t[d];if(n.intersect(f.rect)){if(o&&f.axisAligned){p=!0;break}if(f.obb||(f.obb=new OrientedBoundingRect(f.localRect,f.transform)),h||(h=new OrientedBoundingRect(s,l)),h.intersect(f.obb)){p=!0;break}}}p?(i(u),c&&i(c)):(u.attr("ignore",a.defaultAttr.ignore),c&&c.attr("ignore",a.defaultAttr.labelGuideIgnore),t.push(a))}}function cloneArr(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function prepareLayoutCallbackParams(e,t){var n=e.label,i=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:cloneArr(i&&i.shape.points)}}var LABEL_OPTION_TO_STYLE_KEYS=["align","verticalAlign","width","height","fontSize"],dummyTransformable=new Transformable,labelLayoutInnerStore=makeInner(),labelLineAnimationStore=makeInner();function extendWithKeys(e,t,n){for(var i=0;i<n.length;i++){var r=n[i];null!=t[r]&&(e[r]=t[r])}}var LABEL_LAYOUT_PROPS=["x","y","rotation"],LabelManager=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,i,r){var a=i.style,o=i.__hostTarget.textConfig||{},s=i.getComputedTransform(),l=i.getBoundingRect().plain();BoundingRect.applyTransform(l,l,s),s?dummyTransformable.setLocalTransform(s):(dummyTransformable.x=dummyTransformable.y=dummyTransformable.rotation=dummyTransformable.originX=dummyTransformable.originY=0,dummyTransformable.scaleX=dummyTransformable.scaleY=1);var u,c=i.__hostTarget;if(c){u=c.getBoundingRect().plain();var h=c.getComputedTransform();BoundingRect.applyTransform(u,u,h)}var p=u&&c.getTextGuideLine();this._labelList.push({label:i,labelLine:p,seriesModel:n,dataIndex:e,dataType:t,layoutOption:r,computedLayoutOption:null,rect:l,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:p&&p.ignore,x:dummyTransformable.x,y:dummyTransformable.y,rotation:dummyTransformable.rotation,style:{x:a.x,y:a.y,align:a.align,verticalAlign:a.verticalAlign,width:a.width,height:a.height,fontSize:a.fontSize},cursor:i.cursor,attachedPos:o.position,attachedRot:o.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,i=n.get("labelLayout");(isFunction(i)||keys(i).length)&&e.group.traverse((function(e){if(e.ignore)return!0;var r=e.getTextContent(),a=getECData(e);r&&!r.disableLabelLayout&&t._addLabel(a.dataIndex,a.dataType,n,r,i)}))},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function i(e,t){return function(){updateLabelLinePoints(e,t)}}for(var r=0;r<this._labelList.length;r++){var a=this._labelList[r],o=a.label,s=o.__hostTarget,l=a.defaultAttr,u=void 0;u=(u="function"==typeof a.layoutOption?a.layoutOption(prepareLayoutCallbackParams(a,s)):a.layoutOption)||{},a.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?(o.x=parsePercent$2(u.x,t),o.setStyle("x",0),h=!0):(o.x=l.x,o.setStyle("x",l.style.x)),null!=u.y?(o.y=parsePercent$2(u.y,n),o.setStyle("y",0),h=!0):(o.y=l.y,o.setStyle("y",l.style.y)),u.labelLinePoints){var p=s.getTextGuideLine();p&&(p.setShape({points:u.labelLinePoints}),h=!1)}labelLayoutInnerStore(o).needsUpdateLabelLine=h,o.rotation=null!=u.rotate?u.rotate*c:l.rotation;for(var d=0;d<LABEL_OPTION_TO_STYLE_KEYS.length;d++){var f=LABEL_OPTION_TO_STYLE_KEYS[d];o.setStyle(f,null!=u[f]?u[f]:l.style[f])}if(u.draggable){if(o.draggable=!0,o.cursor="move",s){var g=a.seriesModel;if(null!=a.dataIndex)g=a.seriesModel.getData(a.dataType).getItemModel(a.dataIndex);o.on("drag",i(s,g.getModel("labelLine")))}}else o.off("drag"),o.cursor=l.cursor}},e.prototype.layout=function(e){var t=e.getWidth(),n=e.getHeight(),i=prepareLayoutList(this._labelList),r=filter(i,(function(e){return"shiftX"===e.layoutOption.moveOverlap})),a=filter(i,(function(e){return"shiftY"===e.layoutOption.moveOverlap}));shiftLayoutOnX(r,0,t),shiftLayoutOnY(a,0,n),hideOverlap(filter(i,(function(e){return e.layoutOption.hideOverlap})))},e.prototype.processLabelsOverall=function(){var e=this;each(this._chartViewList,(function(t){var n=t.__model,i=t.ignoreLabelLineUpdate,r=n.isAnimationEnabled();t.group.traverse((function(t){if(t.ignore)return!0;var a=!i,o=t.getTextContent();!a&&o&&(a=labelLayoutInnerStore(o).needsUpdateLabelLine),a&&e._updateLabelLine(t,n),r&&e._animateLabels(t,n)}))}))},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),i=getECData(e),r=i.dataIndex;if(n&&null!=r){var a=t.getData(i.dataType),o=a.getItemModel(r),s={},l=a.getItemVisual(r,"style"),u=a.getVisual("drawType");s.stroke=l[u];var c=o.getModel("labelLine");setLabelLineStyle(e,getLabelLineStatesModels(o),s),updateLabelLinePoints(e,c)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),i=e.getTextGuideLine();if(n&&!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!isElementRemoved(e)){var r=(d=labelLayoutInnerStore(n)).oldLayout,a=getECData(e),o=a.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(a.dataType);if(r){n.attr(r);var u=e.prevStates;u&&(indexOf(u,"select")>=0&&n.attr(d.oldLayoutSelect),indexOf(u,"emphasis")>=0&&n.attr(d.oldLayoutEmphasis)),updateProps(n,s,t,o)}else if(n.attr(s),!labelInner(n).valueAnimation){var c=retrieve2(n.style.opacity,1);n.style.opacity=0,initProps(n,{style:{opacity:c}},t,o)}if(d.oldLayout=s,n.states.select){var h=d.oldLayoutSelect={};extendWithKeys(h,s,LABEL_LAYOUT_PROPS),extendWithKeys(h,n.states.select,LABEL_LAYOUT_PROPS)}if(n.states.emphasis){var p=d.oldLayoutEmphasis={};extendWithKeys(p,s,LABEL_LAYOUT_PROPS),extendWithKeys(p,n.states.emphasis,LABEL_LAYOUT_PROPS)}animateLabelValue(n,o,l,t)}if(i&&!i.ignore&&!i.invisible){r=(d=labelLineAnimationStore(i)).oldLayout;var d,f={points:i.shape.points};r?(i.attr({shape:r}),updateProps(i,{shape:f},t)):(i.setShape(f),i.style.strokePercent=0,initProps(i,{style:{strokePercent:1}},t)),d.oldLayout=f}},e}();function createLegacyDataSelectAction(e,t){function n(t,n){var i=[];return t.eachComponent({mainType:"series",subType:e,query:n},(function(e){i.push(e.seriesIndex)})),i}each([[e+"ToggleSelect","toggleSelect"],[e+"Select","select"],[e+"UnSelect","unselect"]],(function(e){t(e[0],(function(t,i,r){t=extend({},t),r.dispatchAction(extend(t,{type:e[1],seriesIndex:n(i,t)}))}))}))}function handleSeriesLegacySelectEvents(e,t,n,i,r){var a=e+t;n.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var t=e.seriesIndex,i=r.selected,o=0;o<i.length;o++)if(i[o].seriesIndex===t){var s=e.getData(),l=queryDataIndex(s,r.fromActionPayload);n.trigger(a,{type:a,seriesId:e.id,name:isArray(l)?s.getName(l[0]):s.getName(l),selected:extend({},e.option.selectedMap)})}}))}function handleLegacySelectEvents(e,t,n){e.on("selectchanged",(function(e){e.isFromClick?(handleSeriesLegacySelectEvents("map","selectchanged",t,n,e),handleSeriesLegacySelectEvents("pie","selectchanged",t,n,e)):"select"===e.fromAction?(handleSeriesLegacySelectEvents("map","selected",t,n,e),handleSeriesLegacySelectEvents("pie","selected",t,n,e)):"unselect"===e.fromAction&&(handleSeriesLegacySelectEvents("map","unselected",t,n,e),handleSeriesLegacySelectEvents("pie","unselected",t,n,e))}))}function createLinearGradient(e,t,n){var i=null==t.x?0:t.x,r=null==t.x2?1:t.x2,a=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(i=i*n.width+n.x,r=r*n.width+n.x,a=a*n.height+n.y,o=o*n.height+n.y),i=isNaN(i)?0:i,r=isNaN(r)?1:r,a=isNaN(a)?0:a,o=isNaN(o)?0:o,e.createLinearGradient(i,a,r,o)}function createRadialGradient(e,t,n){var i=n.width,r=n.height,a=Math.min(i,r),o=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(o=o*i+n.x,s=s*r+n.y,l*=a),e.createRadialGradient(o,s,0,o,s,l)}function getCanvasGradient(e,t,n){for(var i="radial"===t.type?createRadialGradient(e,t,n):createLinearGradient(e,t,n),r=t.colorStops,a=0;a<r.length;a++)i.addColorStop(r[a].offset,r[a].color);return i}function isClipPathChanged(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}function normalizeLineDash(e,t){return e&&"solid"!==e&&t>0?(t=t||1,"dashed"===e?[4*t,2*t]:"dotted"===e?[t]:isNumber(e)?[e]:isArray(e)?e:null):null}var pathProxyForDraw=new PathProxy(!0);function styleHasStroke(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function styleHasFill(e){var t=e.fill;return null!=t&&"none"!==t}function doFillPath(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 doStrokePath(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 createCanvasPattern(e,t,n){var i=createOrUpdateImage(t.image,t.__image,n);if(isImageReady(i)){var r=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix){var a=new DOMMatrix;a.rotateSelf(0,0,(t.rotation||0)/Math.PI*180),a.scaleSelf(t.scaleX||1,t.scaleY||1),a.translateSelf(t.x||0,t.y||0),r.setTransform(a)}return r}}function brushPath(e,t,n,i){var r=styleHasStroke(n),a=styleHasFill(n),o=n.strokePercent,s=o<1,l=!t.path;t.silent&&!s||!l||t.createPathProxy();var u=t.path||pathProxyForDraw;if(!i){var c=n.fill,h=n.stroke,p=a&&!!c.colorStops,d=r&&!!h.colorStops,f=a&&!!c.image,g=r&&!!h.image,m=void 0,y=void 0,v=void 0,_=void 0,x=void 0;(p||d)&&(x=t.getBoundingRect()),p&&(m=t.__dirty?getCanvasGradient(e,c,x):t.__canvasFillGradient,t.__canvasFillGradient=m),d&&(y=t.__dirty?getCanvasGradient(e,h,x):t.__canvasStrokeGradient,t.__canvasStrokeGradient=y),f&&(v=t.__dirty||!t.__canvasFillPattern?createCanvasPattern(e,c,t):t.__canvasFillPattern,t.__canvasFillPattern=v),g&&(_=t.__dirty||!t.__canvasStrokePattern?createCanvasPattern(e,h,t):t.__canvasStrokePattern,t.__canvasStrokePattern=v),p?e.fillStyle=m:f&&(v?e.fillStyle=v:a=!1),d?e.strokeStyle=y:g&&(_?e.strokeStyle=_:r=!1)}var S=n.lineDash&&n.lineWidth>0&&normalizeLineDash(n.lineDash,n.lineWidth),b=n.lineDashOffset,T=!!e.setLineDash,M=t.getGlobalScale();if(u.setScale(M[0],M[1],t.segmentIgnoreThreshold),S){var A=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;A&&1!==A&&(S=map(S,(function(e){return e/A})),b/=A)}var I=!0;(l||t.__dirty&Path.SHAPE_CHANGED_BIT||S&&!T&&r)&&(u.setDPR(e.dpr),s?u.setContext(null):(u.setContext(e),I=!1),u.reset(),S&&!T&&(u.setLineDash(S),u.setLineDashOffset(b)),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),I&&u.rebuildPath(e,s?o:1),S&&T&&(e.setLineDash(S),e.lineDashOffset=b),i||(n.strokeFirst?(r&&doStrokePath(e,n),a&&doFillPath(e,n)):(a&&doFillPath(e,n),r&&doStrokePath(e,n))),S&&T&&e.setLineDash([])}function brushImage(e,t,n){var i=t.__image=createOrUpdateImage(n.image,t.__image,t,t.onload);if(i&&isImageReady(i)){var r=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(null==o&&null!=s?o=s*l:null==s&&null!=o?s=o/l:null==o&&null==s&&(o=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(i,u,c,n.sWidth,n.sHeight,r,a,o,s)}else if(n.sx&&n.sy){var h=o-(u=n.sx),p=s-(c=n.sy);e.drawImage(i,u,c,h,p,r,a,o,s)}else e.drawImage(i,r,a,o,s)}}function brushText(e,t,n){var i=n.text;if(null!=i&&(i+=""),i){e.font=n.font||DEFAULT_FONT,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var r=void 0;if(e.setLineDash){var a=n.lineDash&&n.lineWidth>0&&normalizeLineDash(n.lineDash,n.lineWidth),o=n.lineDashOffset;if(a){var s=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;s&&1!==s&&(a=map(a,(function(e){return e/s})),o/=s),e.setLineDash(a),e.lineDashOffset=o,r=!0}}n.strokeFirst?(styleHasStroke(n)&&e.strokeText(i,n.x,n.y),styleHasFill(n)&&e.fillText(i,n.x,n.y)):(styleHasFill(n)&&e.fillText(i,n.x,n.y),styleHasStroke(n)&&e.strokeText(i,n.x,n.y)),r&&e.setLineDash([])}}var SHADOW_NUMBER_PROPS=["shadowBlur","shadowOffsetX","shadowOffsetY"],STROKE_PROPS=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function bindCommonProps(e,t,n,i,r){var a=!1;if(!i&&t===(n=n||{}))return!1;(i||t.opacity!==n.opacity)&&(a||(flushPathDrawn(e,r),a=!0),e.globalAlpha=null==t.opacity?DEFAULT_COMMON_STYLE.opacity:t.opacity),(i||t.blend!==n.blend)&&(a||(flushPathDrawn(e,r),a=!0),e.globalCompositeOperation=t.blend||DEFAULT_COMMON_STYLE.blend);for(var o=0;o<SHADOW_NUMBER_PROPS.length;o++){var s=SHADOW_NUMBER_PROPS[o];(i||t[s]!==n[s])&&(a||(flushPathDrawn(e,r),a=!0),e[s]=e.dpr*(t[s]||0))}return(i||t.shadowColor!==n.shadowColor)&&(a||(flushPathDrawn(e,r),a=!0),e.shadowColor=t.shadowColor||DEFAULT_COMMON_STYLE.shadowColor),a}function bindPathAndTextCommonStyle(e,t,n,i,r){var a=getStyle(t,r.inHover),o=i?null:n&&getStyle(n,r.inHover)||{};if(a===o)return!1;var s=bindCommonProps(e,a,o,i,r);if((i||a.fill!==o.fill)&&(s||(flushPathDrawn(e,r),s=!0),e.fillStyle=a.fill),(i||a.stroke!==o.stroke)&&(s||(flushPathDrawn(e,r),s=!0),e.strokeStyle=a.stroke),(i||a.opacity!==o.opacity)&&(s||(flushPathDrawn(e,r),s=!0),e.globalAlpha=null==a.opacity?1:a.opacity),t.hasStroke()){var l=a.lineWidth/(a.strokeNoScale&&t&&t.getLineScale?t.getLineScale():1);e.lineWidth!==l&&(s||(flushPathDrawn(e,r),s=!0),e.lineWidth=l)}for(var u=0;u<STROKE_PROPS.length;u++){var c=STROKE_PROPS[u],h=c[0];(i||a[h]!==o[h])&&(s||(flushPathDrawn(e,r),s=!0),e[h]=a[h]||c[1])}return s}function bindImageStyle(e,t,n,i,r){return bindCommonProps(e,getStyle(t,r.inHover),n&&getStyle(n,r.inHover),i,r)}function setContextTransform(e,t){var n=t.transform,i=e.dpr||1;n?e.setTransform(i*n[0],i*n[1],i*n[2],i*n[3],i*n[4],i*n[5]):e.setTransform(i,0,0,i,0,0)}function updateClipStatus(e,t,n){for(var i=!1,r=0;r<e.length;r++){var a=e[r];i=i||a.isZeroArea(),setContextTransform(t,a),t.beginPath(),a.buildPath(t,a.shape),t.clip()}n.allClipped=i}function isTransformChanged(e,t){return e&&t?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&&!t)}var DRAW_TYPE_PATH=1,DRAW_TYPE_IMAGE=2,DRAW_TYPE_TEXT=3,DRAW_TYPE_INCREMENTAL=4;function canPathBatch(e){var t=styleHasFill(e),n=styleHasStroke(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)}function flushPathDrawn(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function getStyle(e,t){return t&&e.__hoverStyle||e.style}function brushSingle(e,t){brush(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function brush(e,t,n,i){var r=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))return t.__dirty&=~Element.REDARAW_BIT,void(t.__isRendered=!1);var a=t.__clipPaths,o=n.prevElClipPaths,s=!1,l=!1;if(o&&!isClipPathChanged(a,o)||(o&&o.length&&(flushPathDrawn(e,n),e.restore(),l=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),a&&a.length&&(flushPathDrawn(e,n),e.save(),updateClipStatus(a,e,n),s=!0),n.prevElClipPaths=a),n.allClipped)t.__isRendered=!1;else{t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var u=n.prevEl;u||(l=s=!0);var c=t instanceof Path&&t.autoBatch&&canPathBatch(t.style);s||isTransformChanged(r,u.transform)?(flushPathDrawn(e,n),setContextTransform(e,t)):c||flushPathDrawn(e,n);var h=getStyle(t,n.inHover);t instanceof Path?(n.lastDrawType!==DRAW_TYPE_PATH&&(l=!0,n.lastDrawType=DRAW_TYPE_PATH),bindPathAndTextCommonStyle(e,t,u,l,n),c&&(n.batchFill||n.batchStroke)||e.beginPath(),brushPath(e,t,h,c),c&&(n.batchFill=h.fill||"",n.batchStroke=h.stroke||"")):t instanceof TSpan?(n.lastDrawType!==DRAW_TYPE_TEXT&&(l=!0,n.lastDrawType=DRAW_TYPE_TEXT),bindPathAndTextCommonStyle(e,t,u,l,n),brushText(e,t,h)):t instanceof ZRImage?(n.lastDrawType!==DRAW_TYPE_IMAGE&&(l=!0,n.lastDrawType=DRAW_TYPE_IMAGE),bindImageStyle(e,t,u,l,n),brushImage(e,t,h)):t instanceof IncrementalDisplayble&&(n.lastDrawType!==DRAW_TYPE_INCREMENTAL&&(l=!0,n.lastDrawType=DRAW_TYPE_INCREMENTAL),brushIncremental(e,t,n)),c&&i&&flushPathDrawn(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}}function brushIncremental(e,t,n){var i=t.getDisplayables(),r=t.getTemporalDisplayables();e.save();var a,o,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(a=t.getCursor(),o=i.length;a<o;a++){(c=i[a]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),brush(e,c,s,a===o-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}for(var l=0,u=r.length;l<u;l++){var c;(c=r[l]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),brush(e,c,s,l===u-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}function returnFalse(){return!1}function createDom(e,t,n){var i=createCanvas(),r=t.getWidth(),a=t.getHeight(),o=i.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=r+"px",o.height=a+"px",i.setAttribute("data-zr-dom-id",e)),i.width=r*n,i.height=a*n,i}var Layer=function(e){function t(t,n,i){var r,a=e.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null,i=i||devicePixelRatio,"string"==typeof t?r=createDom(t,n,i):isObject(t)&&(t=(r=t).id),a.id=t,a.dom=r;var o=r.style;return o&&(r.onselectstart=returnFalse,o.webkitUserSelect="none",o.userSelect="none",o.webkitTapHighlightColor="rgba(0,0,0,0)",o["-webkit-touch-callout"]="none",o.padding="0",o.margin="0",o.borderWidth="0"),a.domBack=null,a.ctxBack=null,a.painter=n,a.config=null,a.dpr=i,a}return __extends(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=createDom("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,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,a=[],o=this.maxRepaintRectCount,s=!1,l=new BoundingRect(0,0,0,0);function u(e){if(e.isFinite()&&!e.isZero())if(0===a.length){(t=new BoundingRect(0,0,0,0)).copy(e),a.push(t)}else{for(var t,n=!1,i=1/0,r=0,u=0;u<a.length;++u){var c=a[u];if(c.intersect(e)){var h=new BoundingRect(0,0,0,0);h.copy(c),h.union(e),a[u]=h,n=!0;break}if(s){l.copy(e),l.union(c);var p=e.width*e.height,d=c.width*c.height;l.width*l.height-p-d<i&&(i=i,r=u)}}if(s&&(a[r].union(e),n=!0),!n)(t=new BoundingRect(0,0,0,0)).copy(e),a.push(t);s||(s=a.length>=o)}}for(var c=this.__startIndex;c<this.__endIndex;++c){if(d=e[c]){var h=d.shouldBePainted(n,i,!0,!0);(f=d.__isRendered&&(d.__dirty&Element.REDARAW_BIT||!h)?d.getPrevPaintRect():null)&&u(f);var p=h&&(d.__dirty&Element.REDARAW_BIT||!d.__isRendered)?d.getPaintRect():null;p&&u(p)}}for(c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var d,f;h=(d=t[c]).shouldBePainted(n,i,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered)(f=d.getPrevPaintRect())&&u(f)}do{r=!1;for(c=0;c<a.length;)if(a[c].isZero())a.splice(c,1);else{for(var g=c+1;g<a.length;)a[c].intersect(a[g])?(r=!0,a[c].union(a[g]),a.splice(g,1)):g++;c++}}while(r);return this._paintRects=a,a},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,i=this.dom,r=i.style,a=this.domBack;r&&(r.width=e+"px",r.height=t+"px"),i.width=e*n,i.height=t*n,a&&(a.width=e*n,a.height=t*n,1!==n&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var i=this.dom,r=this.ctx,a=i.width,o=i.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(i,0,0,a/u,o/u));var h=this.domBack;function p(e,n,i,a){if(r.clearRect(e,n,i,a),t&&"transparent"!==t){var o=void 0;isGradientObject(t)?(o=t.__canvasGradient||getCanvasGradient(r,t,{x:0,y:0,width:i,height:a}),t.__canvasGradient=o):isPatternObject(t)&&(o=createCanvasPattern(r,t,{dirty:function(){c.setUnpainted(),c.__painter.refresh()}})),r.save(),r.fillStyle=o||t,r.fillRect(e,n,i,a),r.restore()}s&&(r.save(),r.globalAlpha=l,r.drawImage(h,e,n,i,a),r.restore())}!n||s?p(0,0,a,o):n.length&&each(n,(function(e){p(e.x*u,e.y*u,e.width*u,e.height*u)}))},t}(Eventful),HOVER_LAYER_ZLEVEL=1e5,CANVAS_ZLEVEL=314159,EL_AFTER_INCREMENTAL_INC=.01,INCREMENTAL_INC=.001;function parseInt10(e){return parseInt(e,10)}function isLayerValid(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}function createRoot(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}var CanvasPainter=function(){function e(e,t,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var r=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=extend({},n||{}),this.dpr=n.devicePixelRatio||devicePixelRatio,this._singleCanvas=r,this.root=e;var a=e.style;a&&(a.webkitTapHighlightColor="transparent",a.webkitUserSelect="none",a.userSelect="none",a["-webkit-touch-callout"]="none",e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var s=this._layers;if(r){var l=e,u=l.width,c=l.height;null!=n.width&&(u=n.width),null!=n.height&&(c=n.height),this.dpr=n.devicePixelRatio||1,l.width=u*this.dpr,l.height=c*this.dpr,this._width=u,this._height=c;var h=new Layer(l,this,this.dpr);h.__builtin__=!0,h.initContext(),s[CANVAS_ZLEVEL]=h,h.zlevel=CANVAS_ZLEVEL,o.push(CANVAS_ZLEVEL),this._domRoot=e}else{this._width=this._getSize(0),this._height=this._getSize(1);var p=this._domRoot=createRoot(this._width,this._height);e.appendChild(p)}}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,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var r=0;r<i.length;r++){var a=i[r],o=this._layers[a];if(!o.__builtin__&&o.refresh){var s=0===r?this._backgroundColor:null;o.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 i,r={inHover:!0,viewWidth:this._width,viewHeight:this._height},a=0;a<t;a++){var o=e[a];o.__inHover&&(n||(n=this._hoverlayer=this.getLayer(HOVER_LAYER_ZLEVEL)),i||(i=n.ctx).save(),brush(i,o,r,a===t-1))}i&&i.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(HOVER_LAYER_ZLEVEL)},e.prototype.paintOne=function(e,t){brushSingle(e,t)},e.prototype._paintList=function(e,t,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var r=this._doPaintList(e,t,n),a=r.finished,o=r.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),o&&this._paintHoverList(e),a)this.eachLayer((function(e){e.afterBrush&&e.afterBrush()}));else{var s=this;requestAnimationFrame$1((function(){s._paintList(e,t,n,i)}))}}},e.prototype._compositeManually=function(){var e=this.getLayer(CANVAS_ZLEVEL).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer((function(i){i.virtual&&e.drawImage(i.dom,0,0,t,n)}))},e.prototype._doPaintList=function(e,t,n){for(var i=this,r=[],a=this._opts.useDirtyRect,o=0;o<this._zlevelList.length;o++){var s=this._zlevelList[o],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&r.push(l)}for(var u=!0,c=!1,h=function(o){var s=r[o],l=s.ctx,h=a&&s.createRepaintRects(e,t,p._width,p._height);l.save();var d,f=n?s.__startIndex:s.__drawIndex,g=!n&&s.incremental&&Date.now,m=g&&Date.now(),y=s.zlevel===p._zlevelList[0]?p._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,y,h);else if(f===s.__startIndex){var v=e[f];v.incremental&&v.notClear&&!n||s.clear(!1,y,h)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=s.__startIndex);var _=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(d=f;d<s.__endIndex;d++){var r=e[d];if(r.__inHover&&(c=!0),i._doPaintEl(r,s,a,t,n,d===s.__endIndex-1),g)if(Date.now()-m>15)break}n.prevElClipPaths&&l.restore()};if(h)if(0===h.length)d=s.__endIndex;else for(var x=p.dpr,S=0;S<h.length;++S){var b=h[S];l.save(),l.beginPath(),l.rect(b.x*x,b.y*x,b.width*x,b.height*x),l.clip(),_(b),l.restore()}else l.save(),_(),l.restore();s.__drawIndex=d,s.__drawIndex<s.__endIndex&&(u=!1)},p=this,d=0;d<r.length;d++)h(d);return env.wxa&&each(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,i,r,a){var o=t.ctx;if(n){var s=e.getPaintRect();(!i||s&&s.intersect(i))&&(brush(o,e,r,a),e.setPrevPaintRect(s))}else brush(o,e,r,a)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=CANVAS_ZLEVEL);var n=this._layers[e];return n||((n=new Layer("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?merge(n,this._layerConfig[e],!0):this._layerConfig[e-EL_AFTER_INCREMENTAL_INC]&&merge(n,this._layerConfig[e-EL_AFTER_INCREMENTAL_INC],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,i=this._zlevelList,r=i.length,a=this._domRoot,o=null,s=-1;if(n[e])logError("ZLevel "+e+" has been used already");else if(isLayerValid(t)){if(r>0&&e>i[0]){for(s=0;s<r-1&&!(i[s]<e&&i[s+1]>e);s++);o=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var l=o.dom;l.nextSibling?a.insertBefore(t.dom,l.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.__painter=this}else logError("Layer of zlevel "+e+" is not valid")},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i];e.call(t,this._layers[r],r)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],a=this._layers[r];a.__builtin__&&e.call(t,a,r)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],a=this._layers[r];a.__builtin__||e.call(t,a,r)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){function t(e){a&&(a.__endIndex!==e&&(a.__dirty=!0),a.__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 i,r,a=null,o=0;for(r=0;r<e.length;r++){var s,l=(s=e[r]).zlevel,u=void 0;i!==l&&(i=l,o=0),s.incremental?((u=this.getLayer(l+INCREMENTAL_INC,this._needsManuallyCompositing)).incremental=!0,o=1):u=this.getLayer(l+(o>0?EL_AFTER_INCREMENTAL_INC:0),this._needsManuallyCompositing),u.__builtin__||logError("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,t(r),a=u),s.__dirty&Element.REDARAW_BIT&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}t(r),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,each(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?merge(n[e],t,!0):n[e]=t;for(var i=0;i<this._zlevelList.length;i++){var r=this._zlevelList[i];if(r===e||r===e+EL_AFTER_INCREMENTAL_INC)merge(this._layers[r],n[e],!0)}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,i=t[e];i&&(i.dom.parentNode.removeChild(i.dom),delete t[e],n.splice(indexOf(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts;if(null!=e&&(i.width=e),null!=t&&(i.height=t),e=this._getSize(0),t=this._getSize(1),n.style.display="",this._width!==e||t!==this._height){for(var r in n.style.width=e+"px",n.style.height=t+"px",this._layers)this._layers.hasOwnProperty(r)&&this._layers[r].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(CANVAS_ZLEVEL).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[CANVAS_ZLEVEL].dom;var t=new Layer("image",this,e.pixelRatio||this.dpr),n=t.ctx;if(t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor),e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,r=t.dom.height,a=t.ctx;this.eachLayer((function(e){e.__builtin__?a.drawImage(e.dom,0,0,i,r):e.renderToCanvas&&(t.ctx.save(),e.renderToCanvas(t.ctx),t.ctx.restore())}))}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){brush(n,s[l],o,l===u-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype._getSize=function(e){var t=this._opts,n=["width","height"][e],i=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[n]&&"auto"!==t[n])return parseFloat(t[n]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[i]||parseInt10(s[n])||parseInt10(o.style[n]))-(parseInt10(s[r])||0)-(parseInt10(s[a])||0)|0},e.prototype.pathToImage=function(e,t){t=t||this.dpr;var n=document.createElement("canvas"),i=n.getContext("2d"),r=e.getBoundingRect(),a=e.style,o=a.shadowBlur*t,s=a.shadowOffsetX*t,l=a.shadowOffsetY*t,u=e.hasStroke()?a.lineWidth:0,c=Math.max(u/2,-s+o),h=Math.max(u/2,s+o),p=Math.max(u/2,-l+o),d=Math.max(u/2,l+o),f=r.width+c+h,g=r.height+p+d;n.width=f*t,n.height=g*t,i.scale(t,t),i.clearRect(0,0,f,g),i.dpr=t;var m={x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY,rotation:e.rotation,originX:e.originX,originY:e.originY};e.x=c-r.x,e.y=p-r.y,e.rotation=0,e.scaleX=1,e.scaleY=1,e.updateTransform(),e&&brush(i,e,{inHover:!1,viewWidth:this._width,viewHeight:this._height},!0);var y=new ZRImage({style:{x:0,y:0,image:n}});return extend(e,m),y},e}();function findEventDispatcher(e,t,n){for(var i;e&&(!t(e)||(i=e,!n));)e=e.__hostTarget||e.parent;return i}registerPainter("canvas",CanvasPainter);var wmUniqueIndex=Math.round(9*Math.random()),WeakMap=function(){function e(){this._id="__ec_inner_"+wmUniqueIndex++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return"function"==typeof Object.defineProperty?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}(),Triangle=Path.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,i=t.cy,r=t.width/2,a=t.height/2;e.moveTo(n,i-a),e.lineTo(n+r,i+a),e.lineTo(n-r,i+a),e.closePath()}}),Diamond=Path.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,i=t.cy,r=t.width/2,a=t.height/2;e.moveTo(n,i-a),e.lineTo(n+r,i),e.lineTo(n,i+a),e.lineTo(n-r,i),e.closePath()}}),Pin=Path.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,i=t.y,r=t.width/5*3,a=Math.max(r,t.height),o=r/2,s=o*o/(a-o),l=i-a+o+s,u=Math.asin(s/o),c=Math.cos(u)*o,h=Math.sin(u),p=Math.cos(u),d=.6*o,f=.7*o;e.moveTo(n-c,l+s),e.arc(n,l,o,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(n+c-h*d,l+s+p*d,n,i-f,n,i),e.bezierCurveTo(n,i-f,n-c+h*d,l+s+p*d,n-c,l+s),e.closePath()}}),Arrow=Path.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,i=t.width,r=t.x,a=t.y,o=i/3*2;e.moveTo(r,a),e.lineTo(r+o,a+n),e.lineTo(r,a+n/4*3),e.lineTo(r-o,a+n),e.lineTo(r,a),e.closePath()}}),symbolCtors={line:Rect,rect:Rect,roundRect:Rect,square:Rect,circle:Circle,diamond:Diamond,pin:Pin,arrow:Arrow,triangle:Triangle},symbolShapeMakers={line:function(e,t,n,i,r){r.x=e,r.y=t+i/2-1,r.width=n,r.height=2},rect:function(e,t,n,i,r){r.x=e,r.y=t,r.width=n,r.height=i},roundRect:function(e,t,n,i,r){r.x=e,r.y=t,r.width=n,r.height=i,r.r=Math.min(n,i)/4},square:function(e,t,n,i,r){var a=Math.min(n,i);r.x=e,r.y=t,r.width=a,r.height=a},circle:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.r=Math.min(n,i)/2},diamond:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.width=n,r.height=i},pin:function(e,t,n,i,r){r.x=e+n/2,r.y=t+i/2,r.width=n,r.height=i},arrow:function(e,t,n,i,r){r.x=e+n/2,r.y=t+i/2,r.width=n,r.height=i},triangle:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.width=n,r.height=i}},symbolBuildProxies={};each(symbolCtors,(function(e,t){symbolBuildProxies[t]=new e}));var SymbolClz=Path.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var i=calculateTextPosition(e,t,n),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===t.position&&(i.y=n.y+.4*n.height),i},buildPath:function(e,t,n){var i=t.symbolType;if("none"!==i){var r=symbolBuildProxies[i];r||(r=symbolBuildProxies[i="rect"]),symbolShapeMakers[i](t.x,t.y,t.width,t.height,r.shape),r.buildPath(e,r.shape,n)}}});function symbolPathSetColor(e,t){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||"#fff",n.lineWidth=2):n.fill=e,this.markRedraw()}}function createSymbol(e,t,n,i,r,a,o){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?makeImage(e.slice(8),new BoundingRect(t,n,i,r),o?"center":"cover"):0===e.indexOf("path://")?makePath(e.slice(7),{},new BoundingRect(t,n,i,r),o?"center":"cover"):new SymbolClz({shape:{symbolType:e,x:t,y:n,width:i,height:r}})).__isEmptyBrush=l,s.setColor=symbolPathSetColor,a&&s.setColor(a),s}var decalMap=new WeakMap,decalCache=new LRU(100),decalKeys=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","dashLineOffset","maxTileWidth","maxTileHeight"];function createOrUpdatePatternFromDecal(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),i=t.getZr(),r="svg"===i.painter.type;e.dirty&&decalMap.delete(e);var a=decalMap.get(e);if(a)return a;var o=defaults(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,dashLineOffset:0,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===o.backgroundColor&&(o.backgroundColor=null);var s={repeat:"repeat"};return function(e){for(var t,a=[n],s=!0,l=0;l<decalKeys.length;++l){var u=o[decalKeys[l]],c=typeof u;if(null!=u&&!isArray(u)&&"string"!==c&&"number"!==c&&"boolean"!==c){s=!1;break}a.push(u)}if(s){t=a.join(",")+(r?"-svg":"");var h=decalCache.get(t);h&&(r?e.svgElement=h:e.image=h)}var p,d=normalizeDashArrayX(o.dashArrayX),f=normalizeDashArrayY(o.dashArrayY),g=normalizeSymbolArray(o.symbol),m=getLineBlockLengthX(d),y=getLineBlockLengthY(f),v=!r&&createCanvas(),_=r&&i.painter.createSVGElement("g"),x=function(){for(var e=1,t=0,n=m.length;t<n;++t)e=getLeastCommonMultiple(e,m[t]);var i=1;for(t=0,n=g.length;t<n;++t)i=getLeastCommonMultiple(i,g[t].length);e*=i;var r=y*m.length*g.length;return{width:Math.max(1,Math.min(e,o.maxTileWidth)),height:Math.max(1,Math.min(r,o.maxTileHeight))}}();v&&(v.width=x.width*n,v.height=x.height*n,p=v.getContext("2d"));(function(){p&&(p.clearRect(0,0,v.width,v.height),o.backgroundColor&&(p.fillStyle=o.backgroundColor,p.fillRect(0,0,v.width,v.height)));for(var e=0,t=0;t<f.length;++t)e+=f[t];if(e<=0)return;var a=-y,s=0,l=0,u=0;for(;a<x.height;){if(s%2==0){for(var c=l/2%g.length,h=0,m=0,S=0;h<2*x.width;){var b=0;for(t=0;t<d[u].length;++t)b+=d[u][t];if(b<=0)break;if(m%2==0){var T=.5*(1-o.symbolSize),M=h+d[u][m]*T,A=a+f[s]*T,I=d[u][m]*o.symbolSize,C=f[s]*o.symbolSize,w=S/2%g[c].length;P(M,A,I,C,g[c][w])}h+=d[u][m],++S,++m===d[u].length&&(m=0)}++u===d.length&&(u=0)}a+=f[s],++l,++s===f.length&&(s=0)}function P(e,t,a,s,l){var u=r?1:n,c=createSymbol(l,e*u,t*u,a*u,s*u,o.color,o.symbolKeepAspect);r?_.appendChild(i.painter.paintOne(c)):brushSingle(p,c)}})(),s&&decalCache.put(t,v||_);e.image=v,e.svgElement=_,e.svgWidth=x.width,e.svgHeight=x.height}(s),s.rotation=o.rotation,s.scaleX=s.scaleY=r?1:1/n,decalMap.set(e,s),e.dirty=!1,s}function normalizeSymbolArray(e){if(!e||0===e.length)return[["rect"]];if("string"==typeof e)return[[e]];for(var t=!0,n=0;n<e.length;++n)if("string"!=typeof e[n]){t=!1;break}if(t)return normalizeSymbolArray([e]);var i=[];for(n=0;n<e.length;++n)"string"==typeof e[n]?i.push([e[n]]):i.push(e[n]);return i}function normalizeDashArrayX(e){if(!e||0===e.length)return[[0,0]];if("number"==typeof e)return[[r=Math.ceil(e),r]];for(var t=!0,n=0;n<e.length;++n)if("number"!=typeof e[n]){t=!1;break}if(t)return normalizeDashArrayX([e]);var i=[];for(n=0;n<e.length;++n)if("number"==typeof e[n]){var r=Math.ceil(e[n]);i.push([r,r])}else{(r=map(e[n],(function(e){return Math.ceil(e)}))).length%2==1?i.push(r.concat(r)):i.push(r)}return i}function normalizeDashArrayY(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if("number"==typeof e){var t=Math.ceil(e);return[t,t]}var n=map(e,(function(e){return Math.ceil(e)}));return e.length%2?n.concat(n):n}function getLineBlockLengthX(e){return map(e,(function(e){return getLineBlockLengthY(e)}))}function getLineBlockLengthY(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}function decalVisual(e,t){e.eachRawSeries((function(n){if(!e.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(e){var n=i.getItemVisual(e,"decal");n&&(i.ensureUniqueItemVisual(e,"style").decal=createOrUpdatePatternFromDecal(n,t))}));var r=i.getVisual("decal");if(r)i.getVisual("style").decal=createOrUpdatePatternFromDecal(r,t)}}))}var assert$1=assert,each$3=each,isFunction$1=isFunction,isObject$2=isObject,version$1="5.0.0",dependencies={zrender:"5.0.1"},TEST_FRAME_REMAIN_TIME=1,PRIORITY_PROCESSOR_SERIES_FILTER=800,PRIORITY_PROCESSOR_DATASTACK=900,PRIORITY_PROCESSOR_FILTER=1e3,PRIORITY_PROCESSOR_DEFAULT=2e3,PRIORITY_PROCESSOR_STATISTIC=5e3,PRIORITY_VISUAL_LAYOUT=1e3,PRIORITY_VISUAL_PROGRESSIVE_LAYOUT=1100,PRIORITY_VISUAL_GLOBAL=2e3,PRIORITY_VISUAL_CHART=3e3,PRIORITY_VISUAL_COMPONENT=4e3,PRIORITY_VISUAL_CHART_DATA_CUSTOM=4500,PRIORITY_VISUAL_POST_CHART_LAYOUT=4600,PRIORITY_VISUAL_BRUSH=5e3,PRIORITY_VISUAL_ARIA=6e3,PRIORITY_VISUAL_DECAL=7e3,PRIORITY={PROCESSOR:{FILTER:PRIORITY_PROCESSOR_FILTER,SERIES_FILTER:PRIORITY_PROCESSOR_SERIES_FILTER,STATISTIC:PRIORITY_PROCESSOR_STATISTIC},VISUAL:{LAYOUT:PRIORITY_VISUAL_LAYOUT,PROGRESSIVE_LAYOUT:PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,GLOBAL:PRIORITY_VISUAL_GLOBAL,CHART:PRIORITY_VISUAL_CHART,POST_CHART_LAYOUT:PRIORITY_VISUAL_POST_CHART_LAYOUT,COMPONENT:PRIORITY_VISUAL_COMPONENT,BRUSH:PRIORITY_VISUAL_BRUSH,CHART_ITEM:PRIORITY_VISUAL_CHART_DATA_CUSTOM,ARIA:PRIORITY_VISUAL_ARIA,DECAL:PRIORITY_VISUAL_DECAL}},IN_MAIN_PROCESS_KEY="__flagInMainProcess",OPTION_UPDATED_KEY="__optionUpdated",STATUS_NEEDS_UPDATE_KEY="__needsUpdateStatus",ACTION_REG=/^[a-zA-Z0-9_]+$/,CONNECT_STATUS_KEY="__connectUpdateStatus",CONNECT_STATUS_PENDING=0,CONNECT_STATUS_UPDATING=1,CONNECT_STATUS_UPDATED=2;function createRegisterEventWithLowercaseECharts(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!this.isDisposed())return toLowercaseNameAndCallEventful(this,e,t);disposedWarning(this.id)}}function createRegisterEventWithLowercaseMessageCenter(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return toLowercaseNameAndCallEventful(this,e,t)}}function toLowercaseNameAndCallEventful(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),Eventful.prototype[t].apply(e,n)}var prepare,prepareView,updateDirectly,updateMethods,doConvertPixel,updateStreamModes,doDispatchAction,flushPendingActions,triggerUpdatedEvent,bindRenderedEvent,bindMouseEvent,clearColorPalette,render,renderComponents,renderSeries,performPostUpdateFuncs,createExtensionAPI,enableConnect,setTransitionOpt,markStatusToUpdate,applyChangedStates,MessageCenter=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Eventful),messageCenterProto=MessageCenter.prototype;messageCenterProto.on=createRegisterEventWithLowercaseMessageCenter("on"),messageCenterProto.off=createRegisterEventWithLowercaseMessageCenter("off");var ECharts=function(e){function t(t,n,i){var r=e.call(this,new ECEventProcessor)||this;r._chartsViews=[],r._chartsMap={},r._componentsViews=[],r._componentsMap={},r._pendingActions=[],i=i||{},"string"==typeof n&&(n=themeStorage[n]),r._dom=t;"undefined"==typeof window?global:window;var a="canvas",o=!1,s=r._zr=init(t,{renderer:i.renderer||a,devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,useDirtyRect:null==i.useDirtyRect?o:i.useDirtyRect});r._throttledZrFlush=throttle(bind(s.flush,s),17),(n=clone(n))&&globalBackwardCompat(n,!0),r._theme=n,r._locale=createLocaleObject(i.locale||SYSTEM_LANG),r._coordSysMgr=new CoordinateSystemManager;var l=r._api=createExtensionAPI(r);function u(e,t){return e.__prio-t.__prio}return sort(visualFuncs,u),sort(dataProcessorFuncs,u),r._scheduler=new Scheduler(r,l,dataProcessorFuncs,visualFuncs),r._messageCenter=new MessageCenter,r._labelManager=new LabelManager,r._initEvents(),r.resize=bind(r.resize,r),s.animation.on("frame",r._onframe,r),bindRenderedEvent(s,r),bindMouseEvent(s,r),setAsPrimitive(r),r}return __extends(t,e),t.prototype._onframe=function(){if(!this._disposed){applyChangedStates(this);var e=this._scheduler;if(this[OPTION_UPDATED_KEY]){var t=this[OPTION_UPDATED_KEY].silent;this[IN_MAIN_PROCESS_KEY]=!0,prepare(this),updateMethods.update.call(this),this._zr.flush(),this[IN_MAIN_PROCESS_KEY]=!1,this[OPTION_UPDATED_KEY]=!1,flushPendingActions.call(this,t),triggerUpdatedEvent.call(this,t)}else if(e.unfinished){var n=TEST_FRAME_REMAIN_TIME,i=this._model,r=this._api;e.unfinished=!1;do{var a=+new Date;e.performSeriesTasks(i),e.performDataProcessorTasks(i),updateStreamModes(this,i),e.performVisualTasks(i),renderSeries(this,this._model,r,"remain"),n-=+new Date-a}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.setOption=function(e,t,n){if(this._disposed)disposedWarning(this.id);else{var i,r,a;if(isObject$2(t)&&(n=t.lazyUpdate,i=t.silent,r=t.replaceMerge,a=t.transition,t=t.notMerge),this[IN_MAIN_PROCESS_KEY]=!0,!this._model||t){var o=new OptionManager(this._api),s=this._theme,l=this._model=new GlobalModel;l.scheduler=this._scheduler,l.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:r},optionPreprocessorFuncs),setTransitionOpt(this,a),n?(this[OPTION_UPDATED_KEY]={silent:i},this[IN_MAIN_PROCESS_KEY]=!1,this.getZr().wakeUp()):(prepare(this),updateMethods.update.call(this),this._zr.flush(),this[OPTION_UPDATED_KEY]=!1,this[IN_MAIN_PROCESS_KEY]=!1,flushPendingActions.call(this,i),triggerUpdatedEvent.call(this,i))}},t.prototype.setTheme=function(){console.error("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||window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){if(env.canvasSupported)return(e=extend({},e||{})).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},t.prototype.getSvgDataURL=function(){if(env.svgSupported){var e=this._zr;return each(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,i=[],r=this;each$3(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return each$3(i,(function(e){e.group.ignore=!1})),a}disposedWarning(this.id)},t.prototype.getConnectedDataURL=function(e){if(this._disposed)disposedWarning(this.id);else if(env.canvasSupported){var t="svg"===e.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(connectedGroups[n]){var o=a,s=a,l=-1/0,u=-1/0,c=[],h=e&&e.pixelRatio||1;each(instances$1,(function(a,h){if(a.group===n){var p=t?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(clone(e)),d=a.getDom().getBoundingClientRect();o=i(d.left,o),s=i(d.top,s),l=r(d.right,l),u=r(d.bottom,u),c.push({dom:p,left:d.left,top:d.top})}}));var p=(l*=h)-(o*=h),d=(u*=h)-(s*=h),f=createCanvas(),g=init(f,{renderer:t?"svg":"canvas"});if(g.resize({width:p,height:d}),t){var m="";return each$3(c,(function(e){var t=e.left-o,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 Rect({shape:{x:0,y:0,width:p,height:d},style:{fill:e.connectedBackgroundColor}})),each$3(c,(function(e){var t=new ZRImage({style:{x:e.left*h-o,y:e.top*h-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},t.prototype.convertToPixel=function(e,t){return doConvertPixel(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return doConvertPixel(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return each(parseFinder(this._model,e),(function(e,i){i.indexOf("Models")>=0&&each(e,(function(e){var r=e.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(t);else if("seriesModels"===i){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(n=n||a.containPoint(t,e))}else 0}),this)}),this),!!n;disposedWarning(this.id)},t.prototype.getVisual=function(e,t){var n=parseFinder(this._model,e,{defaultMainType:"series"}),i=n.seriesModel;var r=i.getData(),a=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?r.indexOfRawIndex(n.dataIndex):null;return null!=a?getItemVisualFromData(r,a,t):getVisualFromData(r,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=this;each$3(MOUSE_EVENT_NAMES,(function(t){var n=function(n){var i,r=e.getModel(),a=n.target,o="globalout"===t;if(o?i={}:a&&findEventDispatcher(a,(function(e){var t=getECData(e);if(t&&null!=t.dataIndex){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return i=n&&n.getDataParams(t.dataIndex,t.dataType)||{},!0}if(t.eventData)return i=extend({},t.eventData),!0}),!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),c=u&&e["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,i.event=n,i.type=t,e._$eventProcessor.eventInfo={targetEl:a,packedEvent:i,model:u,view:c},e.trigger(t,i)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)})),each$3(eventActionMap,(function(t,n){e._messageCenter.on(n,(function(e){this.trigger(n,e)}),e)})),each$3(["selectchanged"],(function(t){e._messageCenter.on(t,(function(e){this.trigger(t,e)}),e)})),handleLegacySelectEvents(this._messageCenter,this,this._model)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?disposedWarning(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)disposedWarning(this.id);else{this._disposed=!0,setAttribute(this.getDom(),DOM_ATTRIBUTE_KEY,"");var e=this._api,t=this._model;each$3(this._componentsViews,(function(n){n.dispose(t,e)})),each$3(this._chartsViews,(function(n){n.dispose(t,e)})),this._zr.dispose(),delete instances$1[this.id]}},t.prototype.resize=function(e){if(this._disposed)disposedWarning(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[IN_MAIN_PROCESS_KEY]=!0,n&&prepare(this),updateMethods.update.call(this,{type:"resize",animation:{duration:0}}),this[IN_MAIN_PROCESS_KEY]=!1,flushPendingActions.call(this,i),triggerUpdatedEvent.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)disposedWarning(this.id);else if(isObject$2(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),loadingEffects[e]){var n=loadingEffects[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?disposedWarning(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=extend({},e);return t.type=eventActionMap[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)disposedWarning(this.id);else if(isObject$2(t)||(t={silent:!!t}),actions[e.type]&&this._model)if(this[IN_MAIN_PROCESS_KEY])this._pendingActions.push(e);else{var n=t.silent;doDispatchAction.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&env.browser.weChat&&this._throttledZrFlush(),flushPendingActions.call(this,n),triggerUpdatedEvent.call(this,n)}},t.prototype.updateLabelLayout=function(){var e=this._labelManager;e.updateLayoutConfig(this._api),e.layout(this._api),e.processLabelsOverall()},t.prototype.appendData=function(e){if(this._disposed)disposedWarning(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);0,n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){for(var t=[],n=e.currentStates,i=0;i<n.length;i++){var r=n[i];"emphasis"!==r&&"blur"!==r&&"select"!==r&&t.push(r)}e.selected&&e.states.select&&t.push("select"),e.hoverState===HOVER_STATE_EMPHASIS&&e.states.emphasis?t.push("emphasis"):e.hoverState===HOVER_STATE_BLUR&&e.states.blur&&t.push("blur"),e.useStates(t)}function t(e,t){if(!e.preventAutoZ){var n=e.get("z"),i=e.get("zlevel");t.group.traverse((function(e){if(!e.isGroup){null!=n&&(e.z=n),null!=i&&(e.zlevel=i);var t=e.getTextContent(),r=e.getTextGuideLine();if(t&&(t.z=e.z,t.zlevel=e.zlevel,t.z2=e.z2+2),r){var a=e.textGuideLineConfig&&e.textGuideLineConfig.showAbove;r.z=e.z,r.zlevel=e.zlevel,r.z2=e.z2+(a?1:-1)}}}))}}function n(e,t){t.group.traverse((function(e){if(!isElementRemoved(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 i(t,n){var i=t.getModel("stateAnimation"),r=t.isAnimationEnabled(),a=i.get("duration"),o=a>0?{duration:a,delay:i.get("delay"),easing:i.get("easing")}:null;n.group.traverse((function(t){if(t.states&&t.states.emphasis){if(isElementRemoved(t))return;if(t instanceof Path&&savePathStates(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=o;var i=t.getTextContent(),a=t.getTextGuideLine();i&&(i.stateTransition=o),a&&(a.stateTransition=o)}t.__dirty&&e(t)}}))}prepare=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),prepareView(e,!0),prepareView(e,!1),t.plan()},prepareView=function(e,t){for(var n=e._model,i=e._scheduler,r=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,l=0;l<r.length;l++)r[l].__alive=!1;function u(e){var l=e.__requireNewView;e.__requireNewView=!1;var u="_ec_"+e.id+"_"+e.type,c=!l&&a[u];if(!c){var h=parseClassType(e.type),p=t?ComponentView.getClass(h.main,h.sub):ChartView.getClass(h.sub);0,(c=new p).init(n,s),a[u]=c,r.push(c),o.add(c.group)}e.__viewId=c.__id=u,c.__alive=!0,c.__model=e,c.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!t&&i.prepareView(c,e,n,s)}t?n.eachComponent((function(e,t){"series"!==e&&u(t)})):n.eachSeries(u);for(l=0;l<r.length;){var c=r[l];c.__alive?l++:(!t&&c.renderTask.dispose(),o.remove(c.group),c.dispose(n,s),r.splice(l,1),a[c.__id]===c&&delete a[c.__id],c.__id=c.group.__ecComponentInfo=null)}},updateDirectly=function(e,t,n,i,r){var a=e._model;if(a.setUpdatePayload(n),i){var o={};o[i+"Id"]=n[i+"Id"],o[i+"Index"]=n[i+"Index"],o[i+"Name"]=n[i+"Name"];var s={mainType:i,query:o};r&&(s.subType=r);var l,u=n.excludeSeriesId;null!=u&&(l=createHashMap(),each$3(normalizeToArray(u),(function(e){var t=convertOptionIdName(e,null);null!=t&&l.set(t,!0)}))),a&&a.eachComponent(s,(function(t){l&&null!=l.get(t.id)||(isHighDownPayload(n)&&!n.notBlur?t instanceof SeriesModel&&toggleSeriesBlurStateFromPayload(t,n,e._api):isSelectChangePayload(n)&&t instanceof SeriesModel&&(toggleSelectionFromPayload(t,n,e._api),updateSeriesElementSelection(t),markStatusToUpdate(e)),c(e["series"===i?"_chartsMap":"_componentsMap"][t.__viewId]))}),e)}else each$3([].concat(e._componentsViews).concat(e._chartsViews),c);function c(i){i&&i.__alive&&i[t]&&i[t](i.__model,a,e._api,n)}},updateMethods={prepareAndUpdate:function(e){prepare(this),updateMethods.update.call(this,e)},update:function(e){var t=this._model,n=this._api,i=this._zr,r=this._coordSysMgr,a=this._scheduler;if(t){t.setUpdatePayload(e),a.restoreData(t,e),a.performSeriesTasks(t),r.create(t,n),a.performDataProcessorTasks(t,e),updateStreamModes(this,t),r.update(t,n),clearColorPalette(t),a.performVisualTasks(t,e),render(this,t,n,e);var o=t.get("backgroundColor")||"transparent",s=t.get("darkMode");if(env.canvasSupported)i.setBackgroundColor(o),null!=s&&"auto"!==s&&i.setDarkMode(s);else{var l=parse(o);o=stringify(l,"rgb"),0===l[3]&&(o="transparent")}performPostUpdateFuncs(t,n)}},updateTransform:function(e){var t=this,n=this._model,i=this._api;if(n){n.setUpdatePayload(e);var r=[];n.eachComponent((function(a,o){if("series"!==a){var s=t.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,n,i,e);l&&l.update&&r.push(s)}else r.push(s)}}));var a=createHashMap();n.eachSeries((function(r){var o=t._chartsMap[r.__viewId];if(o.updateTransform){var s=o.updateTransform(r,n,i,e);s&&s.update&&a.set(r.uid,1)}else a.set(r.uid,1)})),clearColorPalette(n),this._scheduler.performVisualTasks(n,e,{setDirty:!0,dirtyMap:a}),renderSeries(this,n,i,e,a),performPostUpdateFuncs(n,this._api)}},updateView:function(e){var t=this._model;t&&(t.setUpdatePayload(e),ChartView.markUpdateMethod(e,"updateView"),clearColorPalette(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),render(this,this._model,this._api,e),performPostUpdateFuncs(t,this._api))},updateVisual:function(e){var t=this,n=this._model;n&&(n.setUpdatePayload(e),n.eachSeries((function(e){e.getData().clearAllVisual()})),ChartView.markUpdateMethod(e,"updateVisual"),clearColorPalette(n),this._scheduler.performVisualTasks(n,e,{visualType:"visual",setDirty:!0}),n.eachComponent((function(i,r){if("series"!==i){var a=t.getViewOfComponentModel(r);a&&a.__alive&&a.updateVisual(r,n,t._api,e)}})),n.eachSeries((function(i){t._chartsMap[i.__viewId].updateVisual(i,n,t._api,e)})),performPostUpdateFuncs(n,this._api))},updateLayout:function(e){updateMethods.update.call(this,e)}},doConvertPixel=function(e,t,n,i){if(e._disposed)disposedWarning(e.id);else{for(var r,a=e._model,o=e._coordSysMgr.getCoordinateSystems(),s=parseFinder(a,n),l=0;l<o.length;l++){var u=o[l];if(u[t]&&null!=(r=u[t](a,s,i)))return r}0}},updateStreamModes=function(e,t){var n=e._chartsMap,i=e._scheduler;t.eachSeries((function(e){i.updateStreamModes(e,n[e.__viewId])}))},doDispatchAction=function(e,t){var n=this,i=this.getModel(),r=e.type,a=e.escapeConnect,o=actions[r],s=o.actionInfo,l=(s.update||"update").split(":"),u=l.pop(),c=null!=l[0]&&parseClassType(l[0]);this[IN_MAIN_PROCESS_KEY]=!0;var h=[e],p=!1;e.batch&&(p=!0,h=map(e.batch,(function(t){return(t=defaults(extend({},t),e)).batch=null,t})));var d,f=[],g=isSelectChangePayload(e),m=isHighDownPayload(e)||g;if(each$3(h,(function(e){(d=(d=o.action(e,n._model,n._api))||extend({},e)).type=s.event||d.type,f.push(d),m?(updateDirectly(n,u,e,"series"),markStatusToUpdate(n)):c&&updateDirectly(n,u,e,c.main,c.sub)})),"none"===u||m||c||(this[OPTION_UPDATED_KEY]?(prepare(this),updateMethods.update.call(this,e),this[OPTION_UPDATED_KEY]=!1):updateMethods[u].call(this,e)),d=p?{type:s.event||r,escapeConnect:a,batch:f}:f[0],this[IN_MAIN_PROCESS_KEY]=!1,!t){var y=this._messageCenter;if(y.trigger(d.type,d),g){var v={type:"selectchanged",escapeConnect:a,selected:getAllSelectedIndices(i),isFromClick:e.isFromClick||!1,fromAction:e.type,fromActionPayload:e};y.trigger(v.type,v)}}},flushPendingActions=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();doDispatchAction.call(this,n,e)}},triggerUpdatedEvent=function(e){!e&&this.trigger("updated")},bindRenderedEvent=function(e,t){e.on("rendered",(function(n){t.trigger("rendered",n),!e.animation.isFinished()||t[OPTION_UPDATED_KEY]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))},bindMouseEvent=function(e,t){e.on("mouseover",(function(e){var n=findEventDispatcher(e.target,isHighDownDispatcher);if(n){var i=getECData(n);toggleSeriesBlurState(i.seriesIndex,i.focus,i.blurScope,t._api,!0),enterEmphasisWhenMouseOver(n,e),markStatusToUpdate(t)}})).on("mouseout",(function(e){var n=findEventDispatcher(e.target,isHighDownDispatcher);if(n){var i=getECData(n);toggleSeriesBlurState(i.seriesIndex,i.focus,i.blurScope,t._api,!1),leaveEmphasisWhenMouseOut(n,e),markStatusToUpdate(t)}})).on("click",(function(e){var n=findEventDispatcher(e.target,(function(e){return null!=getECData(e).dataIndex}),!0);if(n){var i=n.selected?"unselect":"select",r=getECData(n);t._api.dispatchAction({type:i,dataType:r.dataType,dataIndexInside:r.dataIndex,seriesIndex:r.seriesIndex,isFromClick:!0})}}))},clearColorPalette=function(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))},render=function(e,t,n,i){renderComponents(e,t,n,i),each$3(e._chartsViews,(function(e){e.__alive=!1})),renderSeries(e,t,n,i),each$3(e._chartsViews,(function(e){e.__alive||e.remove(t,n)}))},renderComponents=function(e,r,a,o,s){each$3(s||e._componentsViews,(function(e){var s=e.__model;n(s,e),e.render(s,r,a,o),t(s,e),i(s,e)}))},renderSeries=function(e,r,a,o,s){var l=e._scheduler,u=e._labelManager;u.clearLabels();var c=!1;r.eachSeries((function(t){var i=e._chartsMap[t.__viewId];i.__alive=!0;var r=i.renderTask;l.updatePayload(r,o),n(t,i),s&&s.get(t.uid)&&r.dirty(),r.perform(l.getPerformArgs(r))&&(c=!0),t.__transientTransitionOpt=null,i.group.silent=!!t.get("silent"),function(e,t){var n=e.get("blendMode")||null;0;t.group.traverse((function(e){e.isGroup||(e.style.blend=n),e.eachPendingDisplayable&&e.eachPendingDisplayable((function(e){e.style.blend=n}))}))}(t,i),updateSeriesElementSelection(t),u.addLabelsOfSeries(i)})),l.unfinished=c||l.unfinished,u.updateLayoutConfig(a),u.layout(a),u.processLabelsOverall(),r.eachSeries((function(n){var r=e._chartsMap[n.__viewId];t(n,r),i(n,r)})),function(e,t){var n=e._zr.storage,i=0;n.traverse((function(e){e.isGroup||i++})),i>t.get("hoverLayerThreshold")&&!env.node&&!env.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.group.traverse((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,r)},performPostUpdateFuncs=function(e,t){each$3(postUpdateFuncs,(function(n){n(e,t)}))},markStatusToUpdate=function(e){e[STATUS_NEEDS_UPDATE_KEY]=!0,e.getZr().wakeUp()},applyChangedStates=function(t){t[STATUS_NEEDS_UPDATE_KEY]&&(t.getZr().storage.traverse((function(t){isElementRemoved(t)||e(t)})),t[STATUS_NEEDS_UPDATE_KEY]=!1)},createExtensionAPI=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(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){enterEmphasis(t,n),markStatusToUpdate(e)},n.prototype.leaveEmphasis=function(t,n){leaveEmphasis(t,n),markStatusToUpdate(e)},n.prototype.enterBlur=function(t){enterBlur(t),markStatusToUpdate(e)},n.prototype.leaveBlur=function(t){leaveBlur(t),markStatusToUpdate(e)},n.prototype.enterSelect=function(t){enterSelect(t),markStatusToUpdate(e)},n.prototype.leaveSelect=function(t){leaveSelect(t),markStatusToUpdate(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}(ExtensionAPI))(e)},enableConnect=function(e){function t(e,t){for(var n=0;n<e.length;n++){e[n][CONNECT_STATUS_KEY]=t}}each$3(eventActionMap,(function(n,i){e._messageCenter.on(i,(function(n){if(connectedGroups[e.group]&&e[CONNECT_STATUS_KEY]!==CONNECT_STATUS_PENDING){if(n&&n.escapeConnect)return;var i=e.makeActionFromEvent(n),r=[];each$3(instances$1,(function(t){t!==e&&t.group===e.group&&r.push(t)})),t(r,CONNECT_STATUS_PENDING),each$3(r,(function(e){e[CONNECT_STATUS_KEY]!==CONNECT_STATUS_UPDATING&&e.dispatchAction(i)})),t(r,CONNECT_STATUS_UPDATED)}}))}))},setTransitionOpt=function(e,t){var n=e._model;each(normalizeToArray(t),(function(e){var t,i=e.from,r=e.to;null==r&&throwError(t);var a={includeMainTypes:["series"],enableAll:!1,enableNone:!1},o=i?parseFinder(n,i,a):null,s=parseFinder(n,r,a).seriesModel;null==s&&(t=""),o&&o.seriesModel!==s&&(t=""),null!=t&&throwError(t),s.__transientTransitionOpt={from:i?i.dimension:null,to:r.dimension,dividingMethod:e.dividingMethod}}))}}(),t}(Eventful),echartsProto=ECharts.prototype;echartsProto.on=createRegisterEventWithLowercaseECharts("on"),echartsProto.off=createRegisterEventWithLowercaseECharts("off"),echartsProto.one=function(e,t,n){var i=this;deprecateLog("ECharts#one is deprecated."),this.on.call(this,e,(function n(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];t&&t.apply&&t.apply(this,r),i.off(e,n)}),n)};var MOUSE_EVENT_NAMES=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function disposedWarning(e){0}var actions={},eventActionMap={},dataProcessorFuncs=[],optionPreprocessorFuncs=[],postInitFuncs=[],postUpdateFuncs=[],visualFuncs=[],themeStorage={},loadingEffects={},instances$1={},connectedGroups={},idBase=+new Date-0,groupIdBase=+new Date-0,DOM_ATTRIBUTE_KEY="_echarts_instance_";function init$1(e,t,n){var i=getInstanceByDom(e);if(i)return i;var r=new ECharts(e,t,n);return r.id="ec_"+idBase++,instances$1[r.id]=r,setAttribute(e,DOM_ATTRIBUTE_KEY,r.id),enableConnect(r),each$3(postInitFuncs,(function(e){e(r)})),r}function connect(e){if(isArray(e)){var t=e;e=null,each$3(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+groupIdBase++,each$3(t,(function(t){t.group=e}))}return connectedGroups[e]=!0,e}function disConnect(e){connectedGroups[e]=!1}var disconnect=disConnect;function dispose$1(e){"string"==typeof e?e=instances$1[e]:e instanceof ECharts||(e=getInstanceByDom(e)),e instanceof ECharts&&!e.isDisposed()&&e.dispose()}function getInstanceByDom(e){return instances$1[getAttribute(e,DOM_ATTRIBUTE_KEY)]}function getInstanceById(e){return instances$1[e]}function registerTheme(e,t){themeStorage[e]=t}function registerPreprocessor(e){optionPreprocessorFuncs.push(e)}function registerProcessor(e,t){normalizeRegister(dataProcessorFuncs,e,t,PRIORITY_PROCESSOR_DEFAULT)}function registerPostInit(e){e&&postInitFuncs.push(e)}function registerPostUpdate(e){e&&postUpdateFuncs.push(e)}function registerAction(e,t,n){"function"==typeof t&&(n=t,t="");var i=isObject$2(e)?e.type:[e,e={event:t}][0];e.event=(e.event||i).toLowerCase(),t=e.event,assert$1(ACTION_REG.test(i)&&ACTION_REG.test(t)),actions[i]||(actions[i]={action:n,actionInfo:e}),eventActionMap[t]=i}function registerCoordinateSystem(e,t){CoordinateSystemManager.register(e,t)}function getCoordinateSystemDimensions(e){var t=CoordinateSystemManager.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()}function registerLayout(e,t){normalizeRegister(visualFuncs,e,t,PRIORITY_VISUAL_LAYOUT,"layout")}function registerVisual(e,t){normalizeRegister(visualFuncs,e,t,PRIORITY_VISUAL_CHART,"visual")}function normalizeRegister(e,t,n,i,r){(isFunction$1(t)||isObject$2(t))&&(n=t,t=i);var a=Scheduler.wrapStageHandler(n,r);a.__prio=t,a.__raw=n,e.push(a)}function registerLoading(e,t){loadingEffects[e]=t}function extendComponentModel(e){return ComponentModel.extend(e)}function extendComponentView(e){return ComponentView.extend(e)}function extendSeriesModel(e){return SeriesModel.extend(e)}function extendChartView(e){return ChartView.extend(e)}function setCanvasCreator(e){$override("createCanvas",e)}function registerMap(e,t,n){mapDataStorage.registerMap(e,t,n)}function getMap(e){var t=mapDataStorage.retrieveMap(e);return t&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}}var registerTransform=registerExternalTransform;registerVisual(PRIORITY_VISUAL_GLOBAL,seriesStyleTask),registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM,dataStyleTask),registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM,dataColorPaletteTask),registerVisual(PRIORITY_VISUAL_GLOBAL,seriesSymbolTask),registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM,dataSymbolTask),registerVisual(PRIORITY_VISUAL_DECAL,decalVisual),registerPreprocessor(globalBackwardCompat),registerProcessor(PRIORITY_PROCESSOR_DATASTACK,dataStack),registerLoading("default",defaultLoading),registerAction({type:HIGHLIGHT_ACTION_TYPE,event:HIGHLIGHT_ACTION_TYPE,update:HIGHLIGHT_ACTION_TYPE},noop),registerAction({type:DOWNPLAY_ACTION_TYPE,event:DOWNPLAY_ACTION_TYPE,update:DOWNPLAY_ACTION_TYPE},noop),registerAction({type:SELECT_ACTION_TYPE,event:SELECT_ACTION_TYPE,update:SELECT_ACTION_TYPE},noop),registerAction({type:UNSELECT_ACTION_TYPE,event:UNSELECT_ACTION_TYPE,update:UNSELECT_ACTION_TYPE},noop),registerAction({type:TOGGLE_SELECT_ACTION_TYPE,event:TOGGLE_SELECT_ACTION_TYPE,update:TOGGLE_SELECT_ACTION_TYPE},noop),registerTheme("light",lightTheme),registerTheme("dark",theme);var dataTool={};function dataIndexMapValueLength(e){return null==e?0:e.length||1}function defaultKeyGetter(e){return e}var DataDiffer=function(){function e(e,t,n,i,r,a){this._old=e,this._new=t,this._oldKeyGetter=n||defaultKeyGetter,this._newKeyGetter=i||defaultKeyGetter,this.context=r,this._diffModeMultiple="multiple"===a}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.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={},i=new Array(e.length),r=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,r,"_newKeyGetter");for(var a=0;a<e.length;a++){var o=i[a],s=n[o],l=dataIndexMapValueLength(s);if(l>1){var u=s.shift();1===s.length&&(n[o]=s[0]),this._update&&this._update(u,a)}else 1===l?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(r,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},r=[],a=[];this._initIndexMap(e,n,r,"_oldKeyGetter"),this._initIndexMap(t,i,a,"_newKeyGetter");for(var o=0;o<r.length;o++){var s=r[o],l=n[s],u=i[s],c=dataIndexMapValueLength(l),h=dataIndexMapValueLength(u);if(c>1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),i[s]=null;else if(c>1)for(var p=0;p<c;p++)this._remove&&this._remove(l[p]);else this._remove&&this._remove(l)}this._performRestAdd(a,i)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=t[i],a=dataIndexMapValueLength(r);if(a>1)for(var o=0;o<a;o++)this._add&&this._add(r[o]);else 1===a&&this._add&&this._add(r);t[i]=null}},e.prototype._initIndexMap=function(e,t,n,i){for(var r=this._diffModeMultiple,a=0;a<e.length;a++){var o="_ec_"+this[i](e[a],a);if(r||(n[a]=o),t){var s=t[o],l=dataIndexMapValueLength(s);0===l?(t[o]=a,r&&n.push(o)):1===l?t[o]=[s,a]:s.push(a)}}},e}();function summarizeDimensions(e){var t={},n=t.encode={},i=createHashMap(),r=[],a=[],o=t.userOutput={dimensionNames:e.dimensions.slice(),encode:{}};each(e.dimensions,(function(t){var s=e.getDimensionInfo(t),l=s.coordDim;if(l){0;var u=s.coordDimIndex;getOrCreateEncodeArr(n,l)[u]=t,s.isExtraCoord||(i.set(l,1),mayLabelDimType(s.type)&&(r[0]=t),getOrCreateEncodeArr(o.encode,l)[u]=s.index),s.defaultTooltip&&a.push(t)}VISUAL_DIMENSIONS.each((function(e,t){var i=getOrCreateEncodeArr(n,t),r=s.otherDims[t];null!=r&&!1!==r&&(i[r]=s.name)}))}));var s=[],l={};i.each((function(e,t){var i=n[t];l[t]=i[0],s=s.concat(i)})),t.dataDimsOnCoord=s,t.encodeFirstDimNotExtra=l;var u=n.label;u&&u.length&&(r=u.slice());var c=n.tooltip;return c&&c.length?a=c.slice():a.length||(a=r.slice()),n.defaultedLabel=r,n.defaultedTooltip=a,t}function getOrCreateEncodeArr(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function getDimensionTypeByAxis(e){return"category"===e?"ordinal":"time"===e?"time":"float"}function mayLabelDimType(e){return!("ordinal"===e||"time"===e)}var defaultDimValueGetters,prepareInvertedIndex,getIndicesCtor,prepareStorage,getRawIndexWithoutIndices,getRawIndexWithIndices,getId,getIdNameFromStore,makeIdFromName,normalizeDimensions,validateDimensions,cloneListForMapAndSample,getInitialExtent,setItemDataAndSeriesIndex,transferProperties,DataDimensionInfo=function(e){this.otherDims={},null!=e&&extend(this,e)},mathFloor=Math.floor,isObject$3=isObject,map$1=map,UNDEFINED="undefined",INDEX_NOT_FOUND=-1,ID_PREFIX="e\0\0",dataCtors={float:typeof Float64Array===UNDEFINED?Array:Float64Array,int:typeof Int32Array===UNDEFINED?Array:Int32Array,ordinal:Array,number:Array,time:Array},CtorUint32Array=typeof Uint32Array===UNDEFINED?Array:Uint32Array,CtorInt32Array=typeof Int32Array===UNDEFINED?Array:Int32Array,CtorUint16Array=typeof Uint16Array===UNDEFINED?Array:Uint16Array,TRANSFERABLE_PROPERTIES=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx","_nameRepeatCount"],CLONE_PROPERTIES=["_extent","_approximateExtent","_rawExtent"],List=function(){function e(e,t){this.type="list",this._count=0,this._rawCount=0,this._storage={},this._storageArr=[],this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._rawExtent={},this._extent={},this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!0,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"],this.getRawIndex=getRawIndexWithoutIndices,e=e||["x","y"];for(var n={},i=[],r={},a=0;a<e.length;a++){var o=e[a],s=isString(o)?new DataDimensionInfo({name:o}):o instanceof DataDimensionInfo?o:new DataDimensionInfo(o),l=s.name;s.type=s.type||"float",s.coordDim||(s.coordDim=l,s.coordDimIndex=0);var u=s.otherDims=s.otherDims||{};i.push(l),n[l]=s,s.index=a,s.createInvertedIndices&&(r[l]=[]),0===u.itemName&&(this._nameDimIdx=a,this._nameOrdinalMeta=s.ordinalMeta),0===u.itemId&&(this._idDimIdx=a,this._idOrdinalMeta=s.ordinalMeta)}this.dimensions=i,this._dimensionInfos=n,this.hostModel=t,this._dimensionsSummary=summarizeDimensions(this),this._invertedIndicesMap=r,this.userOutput=this._dimensionsSummary.userOutput}return e.prototype.getDimension=function(e){return"number"!=typeof e&&(isNaN(e)||this._dimensionInfos.hasOwnProperty(e))||(e=this.dimensions[e]),e},e.prototype.getDimensionInfo=function(e){return this._dimensionInfos[this.getDimension(e)]},e.prototype.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimensionsSummary;if(null==t)return n.encodeFirstDimNotExtra[e];var i=n.encode[e];return i?i[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimensionsSummary.encode[e]||[]).slice()},e.prototype.initData=function(e,t,n){var i=isSourceInstance(e)||isArrayLike(e),r=i?new DefaultDataProvider(e,this.dimensions.length):e;this._rawData=r;var a=r.getSource().sourceFormat;this._storage={},this._indices=null,this._dontMakeIdFromName=null!=this._idDimIdx||a===SOURCE_FORMAT_TYPED_ARRAY||!!r.fillStorage,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},n||(this.hasItemOption=!1),this.defaultDimValueGetter=defaultDimValueGetters[a],this._dimValueGetter=n=n||this.defaultDimValueGetter,this._dimValueGetterArrayRows=defaultDimValueGetters.arrayRows,this._rawExtent={},this._initDataFromProvider(0,r.count()),r.pure&&(this.hasItemOption=!1)},e.prototype.getProvider=function(){return this._rawData},e.prototype.appendData=function(e){var t=this._rawData,n=this.count();t.appendData(e);var i=t.count();t.persistent||(i+=n),this._initDataFromProvider(n,i,!0)},e.prototype.appendValues=function(e,t){for(var n=this._storage,i=this.dimensions,r=i.length,a=this._rawExtent,o=this.count(),s=o+Math.max(e.length,t?t.length:0),l=0;l<r;l++){var u=i[l];a[u]||(a[u]=getInitialExtent()),prepareStorage(n,this._dimensionInfos[u],s,!0)}for(var c=map$1(i,(function(e){return a[e]})),h=this._storageArr=map$1(i,(function(e){return n[e]})),p=[],d=o;d<s;d++){for(var f=d-o,g=0;g<r;g++){u=i[g];var m=this._dimValueGetterArrayRows(e[f]||p,u,f,g);h[g][d]=m;var y=c[g];m<y[0]&&(y[0]=m),m>y[1]&&(y[1]=m)}t&&(this._nameList[d]=t[f],this._dontMakeIdFromName||makeIdFromName(this,d))}this._rawCount=this._count=s,this._extent={},prepareInvertedIndex(this)},e.prototype._initDataFromProvider=function(e,t,n){if(!(e>=t)){for(var i=this._rawData,r=this._storage,a=this.dimensions,o=a.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,c=this._rawExtent,h=i.getSource().sourceFormat===SOURCE_FORMAT_ORIGINAL,p=0;p<o;p++){var d=a[p];c[d]||(c[d]=getInitialExtent()),prepareStorage(r,s[d],t,n)}var f=this._storageArr=map$1(a,(function(e){return r[e]})),g=map$1(a,(function(e){return c[e]}));if(i.fillStorage)i.fillStorage(e,t,f,g);else for(var m=[],y=e;y<t;y++){m=i.getItem(y,m);for(var v=0;v<o;v++){d=a[v];var _=f[v],x=this._dimValueGetter(m,d,y,v);_[y]=x;var S=g[v];x<S[0]&&(S[0]=x),x>S[1]&&(S[1]=x)}if(h&&!i.pure&&m){var b=m.name;null==l[y]&&null!=b&&(l[y]=convertOptionIdName(b,null));var T=m.id;null==u[y]&&null!=T&&(u[y]=convertOptionIdName(T,null))}this._dontMakeIdFromName||makeIdFromName(this,y)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent={},prepareInvertedIndex(this)}},e.prototype.count=function(){return this._count},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var r=0;r<i;r++)e[r]=t[r]}else e=new n(t.buffer,0,i)}else{e=new(n=getIndicesCtor(this))(this.count());for(r=0;r<e.length;r++)e[r]=r}return e},e.prototype.getByDimIdx=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._storageArr[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._storage[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._storage[e];return n?n[t]:NaN},e.prototype.getValues=function(e,t){var n=[];isArray(e)||(t=e,e=this.dimensions);for(var i=0,r=e.length;i<r;i++)n.push(this.get(e[i],t));return n},e.prototype.hasValue=function(e){for(var t=this._dimensionsSummary.dataDimsOnCoord,n=0,i=t.length;n<i;n++)if(isNaN(this.get(t[n],e)))return!1;return!0},e.prototype.getDataExtent=function(e){e=this.getDimension(e);var t=this._storage[e],n=getInitialExtent();if(!t)return n;var i,r=this.count();if(!this._indices)return this._rawExtent[e].slice();if(i=this._extent[e])return i.slice();for(var a=(i=n)[0],o=i[1],s=0;s<r;s++){var l=t[this.getRawIndex(s)];l<a&&(a=l),l>o&&(o=l)}return i=[a,o],this._extent[e]=i,i},e.prototype.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(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){isObject$3(e)?extend(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getSum=function(e){var t=0;if(this._storage[e])for(var n=0,i=this.count();n<i;n++){var r=this.get(e,n);isNaN(r)||(t+=r)}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})),i=this.count();return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e];var i=n[t];return null==i||isNaN(i)?INDEX_NOT_FOUND:i},e.prototype.indexOfName=function(e){for(var t=0,n=this.count();t<n;t++)if(this.getName(t)===e)return t;return-1},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 i=0,r=this._count-1;i<=r;){var a=(i+r)/2|0;if(t[a]<e)i=a+1;else{if(!(t[a]>e))return a;r=a-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._storage[e],r=[];if(!i)return r;null==n&&(n=1/0);for(var a=1/0,o=-1,s=0,l=0,u=this.count();l<u;l++){var c=t-i[this.getRawIndex(l)],h=Math.abs(c);h<=n&&((h<a||h===a&&c>=0&&o<0)&&(a=h,o=c,s=0),c===o&&(r[s++]=l))}return r.length=s,r},e.prototype.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],n=0;n<this.dimensions.length;n++){var i=this.dimensions[n];t.push(this.get(i,e))}return t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return null==n&&null!=this._nameDimIdx&&(n=getIdNameFromStore(this,this._nameDimIdx,this._nameOrdinalMeta,t)),null==n&&(n=""),n},e.prototype.getId=function(e){return getId(this,this.getRawIndex(e))},e.prototype.each=function(e,t,n,i){var r=this;if(this._count){"function"==typeof e&&(i=n,n=t,t=e,e=[]);var a=n||i||this,o=map$1(normalizeDimensions(e),this.getDimension,this);0;for(var s=o.length,l=map$1(o,(function(e){return r._dimensionInfos[e].index})),u=this._storageArr,c=0,h=this.count();c<h;c++){var p=this.getRawIndex(c);switch(s){case 0:t.call(a,c);break;case 1:t.call(a,u[l[0]][p],c);break;case 2:t.call(a,u[l[0]][p],u[l[1]][p],c);break;default:for(var d=0,f=[];d<s;d++)f[d]=u[l[d]][p];f[d]=c,t.apply(a,f)}}}},e.prototype.filterSelf=function(e,t,n,i){var r=this;if(this._count){"function"==typeof e&&(i=n,n=t,t=e,e=[]);var a=n||i||this,o=map$1(normalizeDimensions(e),this.getDimension,this);0;for(var s=this.count(),l=new(getIndicesCtor(this))(s),u=[],c=o.length,h=0,p=map$1(o,(function(e){return r._dimensionInfos[e].index})),d=p[0],f=this._storageArr,g=0;g<s;g++){var m=void 0,y=this.getRawIndex(g);if(0===c)m=t.call(a,g);else if(1===c){var v=f[d][y];m=t.call(a,v,g)}else{for(var _=0;_<c;_++)u[_]=f[p[_]][y];u[_]=g,m=t.apply(a,u)}m&&(l[h++]=y)}return h<s&&(this._indices=l),this._count=h,this._extent={},this.getRawIndex=this._indices?getRawIndexWithIndices:getRawIndexWithoutIndices,this}},e.prototype.selectRange=function(e){var t=this,n=this._count;if(n){var i=[];for(var r in e)e.hasOwnProperty(r)&&i.push(r);0;var a=i.length;if(a){var o=this.count(),s=new(getIndicesCtor(this))(o),l=0,u=i[0],c=map$1(i,(function(e){return t._dimensionInfos[e].index})),h=e[u][0],p=e[u][1],d=this._storageArr,f=!1;if(!this._indices){var g=0;if(1===a){for(var m=d[c[0]],y=0;y<n;y++){((S=m[y])>=h&&S<=p||isNaN(S))&&(s[l++]=g),g++}f=!0}else if(2===a){m=d[c[0]];var v=d[c[1]],_=e[i[1]][0],x=e[i[1]][1];for(y=0;y<n;y++){var S=m[y],b=v[y];(S>=h&&S<=p||isNaN(S))&&(b>=_&&b<=x||isNaN(b))&&(s[l++]=g),g++}f=!0}}if(!f)if(1===a)for(y=0;y<o;y++){var T=this.getRawIndex(y);((S=d[c[0]][T])>=h&&S<=p||isNaN(S))&&(s[l++]=T)}else for(y=0;y<o;y++){for(var M=!0,A=(T=this.getRawIndex(y),0);A<a;A++){var I=i[A];((S=d[c[A]][T])<e[I][0]||S>e[I][1])&&(M=!1)}M&&(s[l++]=this.getRawIndex(y))}return l<o&&(this._indices=s),this._count=l,this._extent={},this.getRawIndex=this._indices?getRawIndexWithIndices:getRawIndexWithoutIndices,this}}},e.prototype.mapArray=function(e,t,n,i){"function"==typeof e&&(i=n,n=t,t=e,e=[]),n=n||i||this;var r=[];return this.each(e,(function(){r.push(t&&t.apply(this,arguments))}),n),r},e.prototype.map=function(e,t,n,i){var r=n||i||this,a=map$1(normalizeDimensions(e),this.getDimension,this);var o=cloneListForMapAndSample(this,a),s=o._storage;o._indices=this._indices,o.getRawIndex=o._indices?getRawIndexWithIndices:getRawIndexWithoutIndices;for(var l=[],u=a.length,c=this.count(),h=[],p=o._rawExtent,d=0;d<c;d++){for(var f=0;f<u;f++)h[f]=this.get(a[f],d);h[u]=d;var g=t&&t.apply(r,h);if(null!=g){"object"!=typeof g&&(l[0]=g,g=l);for(var m=this.getRawIndex(d),y=0;y<g.length;y++){var v=a[y],_=g[y],x=p[v],S=s[v];S&&(S[m]=_),_<x[0]&&(x[0]=_),_>x[1]&&(x[1]=_)}}}return o},e.prototype.downSample=function(e,t,n,i){for(var r=cloneListForMapAndSample(this,[e]),a=r._storage,o=[],s=mathFloor(1/t),l=a[e],u=this.count(),c=r._rawExtent[e],h=new(getIndicesCtor(this))(u),p=0,d=0;d<u;d+=s){s>u-d&&(s=u-d,o.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(d+f);o[f]=l[g]}var m=n(o),y=this.getRawIndex(Math.min(d+i(o,m)||0,u-1));l[y]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),h[p++]=y}return r._count=p,r._indices=h,r.getRawIndex=getRawIndexWithIndices,r},e.prototype.lttbDownSample=function(e,t){var n,i,r,a=cloneListForMapAndSample(this,[]),o=a._storage[e],s=this.count(),l=new(getIndicesCtor(this))(s),u=0,c=mathFloor(1/t),h=this.getRawIndex(0);l[u++]=h;for(var p=1;p<s-1;p+=c){for(var d=Math.min(p+c,s-1),f=Math.min(p+2*c,s),g=(f+d)/2,m=0,y=d;y<f;y++){var v=o[T=this.getRawIndex(y)];isNaN(v)||(m+=v)}m/=f-d;var _=p,x=Math.min(p+c,s),S=p-1,b=o[h];n=-1,r=_;for(y=_;y<x;y++){var T;v=o[T=this.getRawIndex(y)];isNaN(v)||(i=Math.abs((S-g)*(v-b)-(S-y)*(m-b)))>n&&(n=i,r=T)}l[u++]=r,h=r}return l[u++]=this.getRawIndex(s-1),a._count=u,a._indices=l,a.getRawIndex=getRawIndexWithIndices,a},e.prototype.getItemModel=function(e){var t=this.hostModel,n=this.getRawDataItem(e);return new Model(n,t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new DataDiffer(e?e.getIndices():[],this.getIndices(),(function(t){return getId(e,t)}),(function(e){return getId(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||{},isObject$3(e)?extend(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],i=n&&n[t];return null==i?this.getVisual(t):i},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var r=i[t];return null==r&&(isArray(r=this.getVisual(t))?r=r.slice():isObject$3(r)&&(r=extend({},r)),i[t]=r),r},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,isObject$3(t)?extend(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){if(isObject$3(e))for(var n in e)e.hasOwnProperty(n)&&this.setLayout(n,e[n]);else 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?extend(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel;if(t){var i=getECData(t);i.dataIndex=e,i.dataType=this.dataType,i.seriesIndex=n&&n.seriesIndex,"group"===t.type&&t.traverse(setItemDataAndSeriesIndex,t)}this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){each(this._graphicEls,(function(n,i){n&&e&&e.call(t,n,i)}))},e.prototype.cloneShallow=function(t){t||(t=new e(map$1(this.dimensions,this.getDimensionInfo,this),this.hostModel));if(t._storage=this._storage,t._storageArr=this._storageArr,transferProperties(t,this),this._indices){var n=this._indices.constructor;if(n===Array){var i=this._indices.length;t._indices=new n(i);for(var r=0;r<i;r++)t._indices[r]=this._indices[r]}else t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?getRawIndexWithIndices:getRawIndexWithoutIndices,t},e.prototype.wrapMethod=function(e,t){var n=this[e];"function"==typeof n&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(slice(arguments)))})},e.internalField=function(){function t(e,t,n,i){return parseDataValue(e[i],this._dimensionInfos[t])}defaultDimValueGetters={arrayRows:t,objectRows:function(e,t,n,i){return parseDataValue(e[t],this._dimensionInfos[t])},keyedColumns:t,original:function(e,t,n,i){var r=e&&(null==e.value?e:e.value);return!this._rawData.pure&&isDataItemOption(e)&&(this.hasItemOption=!0),parseDataValue(r instanceof Array?r[i]:r,this._dimensionInfos[t])},typedArray:function(e,t,n,i){return e[i]}},prepareInvertedIndex=function(e){var t=e._invertedIndicesMap;each(t,(function(n,i){var r=e._dimensionInfos[i].ordinalMeta;if(r){n=t[i]=new CtorInt32Array(r.categories.length);for(var a=0;a<n.length;a++)n[a]=INDEX_NOT_FOUND;for(a=0;a<e._count;a++)n[e.get(i,a)]=a}}))},getIdNameFromStore=function(e,t,n,i){var r,a=e._storageArr[t];return a&&(r=a[i],n&&n.categories.length&&(r=n.categories[r])),convertOptionIdName(r,null)},getIndicesCtor=function(e){return e._rawCount>65535?CtorUint32Array:CtorUint16Array},prepareStorage=function(e,t,n,i){var r=dataCtors[t.type],a=t.name;if(i){var o=e[a],s=o&&o.length;if(s!==n){for(var l=new r(n),u=0;u<s;u++)l[u]=o[u];e[a]=l}}else e[a]=new r(n)},getRawIndexWithoutIndices=function(e){return e},getRawIndexWithIndices=function(e){return e<this._count&&e>=0?this._indices[e]:-1},getId=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=getIdNameFromStore(e,e._idDimIdx,e._idOrdinalMeta,t)),null==n&&(n=ID_PREFIX+t),n},normalizeDimensions=function(e){return isArray(e)||(e=null!=e?[e]:[]),e},validateDimensions=function(e,t){for(var n=0;n<t.length;n++)e._dimensionInfos[t[n]]||console.error("Unkown dimension "+t[n])},cloneListForMapAndSample=function(t,n){var i=t.dimensions,r=new e(map$1(i,t.getDimensionInfo,t),t.hostModel);transferProperties(r,t);for(var a,o,s=r._storage={},l=t._storage,u=r._storageArr=[],c=0;c<i.length;c++){var h=i[c];l[h]&&(indexOf(n,h)>=0?(s[h]=(a=l[h],o=void 0,(o=a.constructor)===Array?a.slice():new o(a)),r._rawExtent[h]=getInitialExtent(),r._extent[h]=null):s[h]=l[h],u.push(s[h]))}return r},getInitialExtent=function(){return[1/0,-1/0]},setItemDataAndSeriesIndex=function(e){var t=getECData(e),n=getECData(this);t.seriesIndex=n.seriesIndex,t.dataIndex=n.dataIndex,t.dataType=n.dataType},transferProperties=function(e,t){each(TRANSFERABLE_PROPERTIES.concat(t.__wrappedMethods||[]),(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e.__wrappedMethods=t.__wrappedMethods,each(CLONE_PROPERTIES,(function(n){e[n]=clone(t[n])})),e._calculationInfo=extend({},t._calculationInfo)},makeIdFromName=function(e,t){var n=e._nameList,i=e._idList,r=e._nameDimIdx,a=e._idDimIdx,o=n[t],s=i[t];if(null==o&&null!=r&&(n[t]=o=getIdNameFromStore(e,r,e._nameOrdinalMeta,t)),null==s&&null!=a&&(i[t]=s=getIdNameFromStore(e,a,e._idOrdinalMeta,t)),null==s&&null!=o){var l=e._nameRepeatCount,u=l[o]=(l[o]||0)+1;s=o,u>1&&(s+="__ec__"+u),i[t]=s}}}(),e}();function completeDimensions(e,t,n){isSourceInstance(t)||(t=createSourceFromSeriesDataOption(t)),n=n||{},e=(e||[]).slice();for(var i=(n.dimsDef||[]).slice(),r=createHashMap(),a=createHashMap(),o=[],s=getDimCount(t,e,i,n.dimCount),l=0;l<s;l++){var u=i[l],c=i[l]=extend({},isObject(u)?u:{name:u}),h=c.name,p=o[l]=new DataDimensionInfo;null!=h&&null==r.get(h)&&(p.name=p.displayName=h,r.set(h,l)),null!=c.type&&(p.type=c.type),null!=c.displayName&&(p.displayName=c.displayName)}var d=n.encodeDef;!d&&n.encodeDefaulter&&(d=n.encodeDefaulter(t,s));var f=createHashMap(d);f.each((function(e,t){var n=normalizeToArray(e).slice();if(1===n.length&&!isString(n[0])&&n[0]<0)f.set(t,!1);else{var i=f.set(t,[]);each(n,(function(e,n){var a=isString(e)?r.get(e):e;null!=a&&a<s&&(i[n]=a,m(o[a],t,n))}))}}));var g=0;function m(e,t,n){null!=VISUAL_DIMENSIONS.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,a.set(t,!0))}each(e,(function(e){var t,n,i,r;if(isString(e))t=e,r={};else{t=(r=e).name;var a=r.ordinalMeta;r.ordinalMeta=null,(r=clone(r)).ordinalMeta=a,n=r.dimsDef,i=r.otherDims,r.name=r.coordDim=r.coordDimIndex=r.dimsDef=r.otherDims=null}var s=f.get(t);if(!1!==s){if(!(s=normalizeToArray(s)).length)for(var l=0;l<(n&&n.length||1);l++){for(;g<o.length&&null!=o[g].coordDim;)g++;g<o.length&&s.push(g++)}each(s,(function(e,a){var s=o[e];if(m(defaults(s,r),t,a),null==s.name&&n){var l=n[a];!isObject(l)&&(l={name:l}),s.name=s.displayName=l.name,s.defaultTooltip=l.defaultTooltip}i&&defaults(s.otherDims,i)}))}}));var y=n.generateCoord,v=n.generateCoordCount,_=null!=v;v=y?v||1:0;for(var x=y||"value",S=0;S<s;S++){null==(p=o[S]=o[S]||new DataDimensionInfo).coordDim&&(p.coordDim=genName(x,a,_),p.coordDimIndex=0,(!y||v<=0)&&(p.isExtraCoord=!0),v--),null==p.name&&(p.name=genName(p.coordDim,r,!1)),null!=p.type||guessOrdinal(t,S)!==BE_ORDINAL.Must&&(!p.isExtraCoord||null==p.otherDims.itemName&&null==p.otherDims.seriesName)||(p.type="ordinal")}return o}function getDimCount(e,t,n,i){var r=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,i||0);return each(t,(function(e){var t;isObject(e)&&(t=e.dimsDef)&&(r=Math.max(r,t.length))})),r}function genName(e,t,n){if(n||null!=t.get(e)){for(var i=0;null!=t.get(e+i);)i++;e+=i}return t.set(e,!0),e}function createDimensions(e,t){return completeDimensions((t=t||{}).coordDimensions||[],e,{dimsDef:t.dimensionsDefine||e.dimensionsDefine,encodeDef:t.encodeDefine||e.encodeDefine,dimCount:t.dimensionsCount,encodeDefaulter:t.encodeDefaulter,generateCoord:t.generateCoord,generateCoordCount:t.generateCoordCount})}var CoordSysInfo=function(e){this.coordSysDims=[],this.axisMap=createHashMap(),this.categoryAxisMap=createHashMap(),this.coordSysName=e};function getCoordSysInfoBySeries(e){var t=e.get("coordinateSystem"),n=new CoordSysInfo(t),i=fetchers[t];if(i)return i(e,n,n.axisMap,n.categoryAxisMap),n}var fetchers={cartesian2d:function(e,t,n,i){var r=e.getReferringComponents("xAxis",SINGLE_REFERRING).models[0],a=e.getReferringComponents("yAxis",SINGLE_REFERRING).models[0];t.coordSysDims=["x","y"],n.set("x",r),n.set("y",a),isCategory(r)&&(i.set("x",r),t.firstCategoryDimIndex=0),isCategory(a)&&(i.set("y",a),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,i){var r=e.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0];t.coordSysDims=["single"],n.set("single",r),isCategory(r)&&(i.set("single",r),t.firstCategoryDimIndex=0)},polar:function(e,t,n,i){var r=e.getReferringComponents("polar",SINGLE_REFERRING).models[0],a=r.findAxisModel("radiusAxis"),o=r.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],n.set("radius",a),n.set("angle",o),isCategory(a)&&(i.set("radius",a),t.firstCategoryDimIndex=0),isCategory(o)&&(i.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,i){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,i){var r=e.ecModel,a=r.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();each(a.parallelAxisIndex,(function(e,a){var s=r.getComponent("parallelAxis",e),l=o[a];n.set(l,s),isCategory(s)&&(i.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=a))}))}};function isCategory(e){return"category"===e.get("type")}function enableDataStack(e,t,n){var i,r,a,o,s=(n=n||{}).byIndex,l=n.stackedCoordDimension,u=!(!e||!e.get("stack"));if(each(t,(function(e,n){isString(e)&&(t[n]=e={name:e}),u&&!e.isExtraCoord&&(s||i||!e.ordinalMeta||(i=e),r||"ordinal"===e.type||"time"===e.type||l&&l!==e.coordDim||(r=e))})),!r||s||i||(s=!0),r){a="__\0ecstackresult",o="__\0ecstackedover",i&&(i.createInvertedIndices=!0);var c=r.coordDim,h=r.type,p=0;each(t,(function(e){e.coordDim===c&&p++})),t.push({name:a,coordDim:c,coordDimIndex:p,type:h,isExtraCoord:!0,isCalculationCoord:!0}),p++,t.push({name:o,coordDim:o,coordDimIndex:p,type:h,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:r&&r.name,stackedByDimension:i&&i.name,isStackedByIndex:s,stackedOverDimension:o,stackResultDimension:a}}function isDimensionStacked(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function getStackedDimension(e,t){return isDimensionStacked(e,t)?e.getCalculationInfo("stackResultDimension"):t}function createListFromArray(e,t,n){n=n||{},isSourceInstance(e)||(e=createSourceFromSeriesDataOption(e));var i,r=t.get("coordinateSystem"),a=CoordinateSystemManager.get(r),o=getCoordSysInfoBySeries(t);o&&o.coordSysDims&&(i=map(o.coordSysDims,(function(e){var t={name:e},n=o.axisMap.get(e);if(n){var i=n.get("type");t.type=getDimensionTypeByAxis(i)}return t}))),i||(i=a&&(a.getDimensionsInfo?a.getDimensionsInfo():a.dimensions.slice())||["x","y"]);var s,l,u=n.useEncodeDefaulter,c=createDimensions(e,{coordDimensions:i,generateCoord:n.generateCoord,encodeDefaulter:isFunction(u)?u:u?curry(makeSeriesEncodeForAxisCoordSys,i,t):null});o&&each(c,(function(e,t){var n=e.coordDim,i=o.categoryAxisMap.get(n);i&&(null==s&&(s=t),e.ordinalMeta=i.getOrdinalMeta()),null!=e.otherDims.itemName&&(l=!0)})),l||null==s||(c[s].otherDims.itemName=0);var h=enableDataStack(t,c),p=new List(c,t);p.setCalculationInfo(h);var d=null!=s&&isNeedCompleteOrdinalData(e)?function(e,t,n,i){return i===s?n:this.defaultDimValueGetter(e,t,n,i)}:null;return p.hasItemOption=!1,p.initData(e,null,d),p}function isNeedCompleteOrdinalData(e){if(e.sourceFormat===SOURCE_FORMAT_ORIGINAL){var t=firstDataNotNull(e.data||[]);return null!=t&&!isArray(getDataItemValue(t))}}function firstDataNotNull(e){for(var t=0;t<e.length&&null==e[t];)t++;return e[t]}var Scale=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}();enableClassManagement(Scale,{registerWhenExtend:!0});var OrdinalMeta=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication}return e.createByAxisModel=function(t){var n=t.option,i=n.data,r=i&&map(i,getName);return new e({categories:r,needCollect:!r,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("string"!=typeof e&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=createHashMap(this.categories))},e}();function getName(e){return isObject(e)&&null!=e.value?e.value:e+""}var roundNumber=round$1;function intervalScaleNiceTicks(e,t,n,i){var r={},a=e[1]-e[0],o=r.interval=nice(a/t,!0);null!=n&&o<n&&(o=r.interval=n),null!=i&&o>i&&(o=r.interval=i);var s=r.intervalPrecision=getIntervalPrecision(o);return fixExtent(r.niceTickExtent=[roundNumber(Math.ceil(e[0]/o)*o,s),roundNumber(Math.floor(e[1]/o)*o,s)],e),r}function getIntervalPrecision(e){return getPrecisionSafe(e)+2}function clamp(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function fixExtent(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),clamp(e,0,t),clamp(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function contain$1(e,t){return e>=t[0]&&e<=t[1]}function normalize$1(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function scale$2(e,t){return e*(t[1]-t[0])+t[0]}var OrdinalScale=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new OrdinalMeta({})),isArray(i)&&(i=new OrdinalMeta({categories:map(i,(function(e){return isObject(e)?e.value:e}))})),n._ordinalMeta=i,n._categorySortInfo=[],n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return __extends(t,e),t.prototype.parse=function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return contain$1(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return normalize$1(e=this.getCategoryIndex(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=this.getCategoryIndex(e),Math.round(scale$2(e,this._extent))},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:this.getCategoryIndex(n)}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setCategorySortInfo=function(e){this._categorySortInfo=e},t.prototype.getCategorySortInfo=function(){return this._categorySortInfo},t.prototype.getCategoryIndex=function(e){return this._categorySortInfo.length?this._categorySortInfo[e].beforeSortIndex:e},t.prototype.getRawIndex=function(e){return this._categorySortInfo.length?this._categorySortInfo[e].ordinalNumber:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawIndex(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.getCategoryIndex(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.niceTicks=function(){},t.prototype.niceExtent=function(){},t.type="ordinal",t}(Scale);Scale.registerClass(OrdinalScale);var roundNumber$1=round$1,IntervalScale=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 __extends(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return contain$1(e,this._extent)},t.prototype.normalize=function(e){return normalize$1(e,this._extent)},t.prototype.scale=function(e){return scale$2(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=getIntervalPrecision(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,a=[];if(!t)return a;n[0]<i[0]&&(e?a.push({value:roundNumber$1(i[0]-t,r)}):a.push({value:n[0]}));for(var o=i[0];o<=i[1]&&(a.push({value:o}),(o=roundNumber$1(o+t,r))!==a[a.length-1].value);)if(a.length>1e4)return[];var s=a.length?a[a.length-1].value:i[1];return n[1]>s&&(e?a.push({value:roundNumber$1(s+t,r)}):a.push({value:n[1]})),a},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),r=1;r<t.length;r++){for(var a=t[r],o=t[r-1],s=0,l=[],u=(a.value-o.value)/e;s<e-1;){var c=roundNumber$1(o.value+(s+1)*u);c>i[0]&&c<i[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=getPrecisionSafe(e.value)||0:"auto"===n&&(n=this._intervalPrecision),addCommas(roundNumber$1(e.value,n,!0))},t.prototype.niceTicks=function(e,t,n){e=e||5;var i=this._extent,r=i[1]-i[0];if(isFinite(r)){r<0&&(r=-r,i.reverse());var a=intervalScaleNiceTicks(i,e,t,n);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},t.prototype.niceExtent=function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var n=t[0];e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;var i=t[1]-t[0];isFinite(i)||(t[0]=0,t[1]=1),this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var r=this._interval;e.fixMin||(t[0]=roundNumber$1(Math.floor(t[0]/r)*r)),e.fixMax||(t[1]=roundNumber$1(Math.ceil(t[1]/r)*r))},t.type="interval",t}(Scale);Scale.registerClass(IntervalScale);var STACK_PREFIX="__ec_stack_",LARGE_BAR_MIN_WIDTH=.5,LargeArr="undefined"!=typeof Float32Array?Float32Array:Array;function getSeriesStackId(e){return e.get("stack")||STACK_PREFIX+e.seriesIndex}function getAxisKey(e){return e.dim+e.index}function getLayoutOnAxis(e){var t=[],n=e.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),a=0;a<e.count;a++)t.push(defaults({bandWidth:r,axisKey:i,stackId:STACK_PREFIX+a},e));var o=doCalBarWidthAndOffset(t),s=[];for(a=0;a<e.count;a++){var l=o.axis0[STACK_PREFIX+a];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}function prepareLayoutBarSeries(e,t){var n=[];return t.eachSeriesByType(e,(function(e){isOnCartesian(e)&&!isInLargeMode(e)&&n.push(e)})),n}function getValueAxesMinGaps(e){var t={};each(e,(function(e){var n=e.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=e.getData(),r=n.dim+"_"+n.index,a=i.mapDimension(n.dim),o=0,s=i.count();o<s;++o){var l=i.get(a,o);t[r]?t[r].push(l):t[r]=[l]}}));var n={};for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(r){r.sort((function(e,t){return e-t}));for(var a=null,o=1;o<r.length;++o){var s=r[o]-r[o-1];s>0&&(a=null===a?s:Math.min(a,s))}n[i]=a}}return n}function makeColumnLayout(e){var t=getValueAxesMinGaps(e),n=[];return each(e,(function(e){var i,r=e.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=t[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),c=Math.abs(u[1]-u[0]);i=s?l/c*s:l}else{var h=e.getData();i=Math.abs(a[1]-a[0])/h.count()}var p=parsePercent$2(e.get("barWidth"),i),d=parsePercent$2(e.get("barMaxWidth"),i),f=parsePercent$2(e.get("barMinWidth")||1,i),g=e.get("barGap"),m=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:d,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:getAxisKey(r),stackId:getSeriesStackId(e)})})),doCalBarWidthAndOffset(n)}function doCalBarWidthAndOffset(e){var t={};each(e,(function(e,n){var i=e.axisKey,r=e.bandWidth,a=t[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},o=a.stacks;t[i]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var c=e.barMinWidth;c&&(o[s].minWidth=c);var h=e.barGap;null!=h&&(a.gap=h);var p=e.barCategoryGap;null!=p&&(a.categoryGap=p)}));var n={};return each(t,(function(e,t){n[t]={};var i=e.stacks,r=e.bandWidth,a=e.categoryGap;if(null==a){var o=keys(i).length;a=Math.max(35-4*o,15)+"%"}var s=parsePercent$2(a,r),l=parsePercent$2(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),each(i,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,u-=i+l*i,c--}else{var i=h;t&&t<i&&(i=Math.min(t,u)),n&&n>i&&(i=n),i!==h&&(e.width=i,u-=i+l*i,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var p,d=0;each(i,(function(e,t){e.width||(e.width=h),p=e,d+=e.width*(1+l)})),p&&(d-=p.width*l);var f=-d/2;each(i,(function(e,i){n[t][i]=n[t][i]||{bandWidth:r,offset:f,width:e.width},f+=e.width*(1+l)}))})),n}function retrieveColumnLayout(e,t,n){if(e&&t){var i=e[getAxisKey(t)];return null!=i&&null!=n?i[getSeriesStackId(n)]:i}}function layout(e,t){var n=prepareLayoutBarSeries(e,t),i=makeColumnLayout(n),r={};each(n,(function(e){var t=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),o=getSeriesStackId(e),s=i[getAxisKey(a)][o],l=s.offset,u=s.width,c=n.getOtherAxis(a),h=e.get("barMinHeight")||0;r[o]=r[o]||[],t.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var p=t.mapDimension(c.dim),d=t.mapDimension(a.dim),f=isDimensionStacked(t,p),g=c.isHorizontal(),m=getValueAxisStart(a,c),y=0,v=t.count();y<v;y++){var _=t.get(p,y),x=t.get(d,y),S=_>=0?"p":"n",b=m;f&&(r[o][x]||(r[o][x]={p:m,n:m}),b=r[o][x][S]);var T,M=void 0,A=void 0,I=void 0,C=void 0;if(g)M=b,A=(T=n.dataToPoint([_,x]))[1]+l,I=T[0]-m,C=u,Math.abs(I)<h&&(I=(I<0?-1:1)*h),isNaN(I)||f&&(r[o][x][S]+=I);else M=(T=n.dataToPoint([x,_]))[0]+l,A=b,I=u,C=T[1]-m,Math.abs(C)<h&&(C=(C<=0?-1:1)*h),isNaN(C)||f&&(r[o][x][S]+=C);t.setItemLayout(y,{x:M,y:A,width:I,height:C})}}))}var largeLayout={seriesType:"bar",plan:createRenderPlanner(),reset:function(e){if(isOnCartesian(e)&&isInLargeMode(e)){var t=e.getData(),n=e.coordinateSystem,i=n.master.getRect(),r=n.getBaseAxis(),a=n.getOtherAxis(r),o=t.mapDimension(a.dim),s=t.mapDimension(r.dim),l=a.isHorizontal(),u=l?0:1,c=retrieveColumnLayout(makeColumnLayout([e]),r,e).width;return c>LARGE_BAR_MIN_WIDTH||(c=LARGE_BAR_MIN_WIDTH),{progress:function(e,t){for(var h,p=e.count,d=new LargeArr(2*p),f=new LargeArr(2*p),g=new LargeArr(p),m=[],y=[],v=0,_=0;null!=(h=e.next());)y[u]=t.get(o,h),y[1-u]=t.get(s,h),m=n.dataToPoint(y,null,m),f[v]=l?i.x+i.width:m[0],d[v++]=m[0],f[v]=l?m[1]:i.y+i.height,d[v++]=m[1],g[_++]=h;t.setLayout({largePoints:d,largeDataIndices:g,largeBackgroundPoints:f,barWidth:c,valueAxisStart:getValueAxisStart(r,a),backgroundStart:l?i.x:i.y,valueAxisHorizontal:l})}}}}};function isOnCartesian(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function isInLargeMode(e){return e.pipelineContext&&e.pipelineContext.large}function getValueAxisStart(e,t,n){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}var bisect=function(e,t,n,i){for(;n<i;){var r=n+i>>>1;e[r][1]<t?n=r+1:i=r}return n},TimeScale=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return __extends(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return format(e.value,fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))]||fullLeveledFormatter.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var i=this.getSetting("useUTC");return leveledFormat(e,t,n,this.getSetting("locale"),i)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,i=[];if(!t)return i;i.push({value:n[0],level:0});var r=this.getSetting("useUTC"),a=getIntervalTicks(this._minLevelUnit,this._approxInterval,r,n);return(i=i.concat(a)).push({value:n[1],level:0}),i},t.prototype.niceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=ONE_DAY,t[1]+=ONE_DAY),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]-ONE_DAY}this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.niceTicks=function(e,t,n){e=e||10;var i=this._extent,r=i[1]-i[0];this._approxInterval=r/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var a=scaleIntervals.length,o=Math.min(bisect(scaleIntervals,this._approxInterval,0,a),a-1);this._interval=scaleIntervals[o][1],this._minLevelUnit=scaleIntervals[Math.max(o-1,0)][0]},t.prototype.parse=function(e){return"number"==typeof e?e:+parseDate(e)},t.prototype.contain=function(e){return contain$1(this.parse(e),this._extent)},t.prototype.normalize=function(e){return normalize$1(this.parse(e),this._extent)},t.prototype.scale=function(e){return scale$2(e,this._extent)},t.type="time",t}(IntervalScale),scaleIntervals=[["second",ONE_SECOND],["minute",ONE_MINUTE],["hour",ONE_HOUR],["quarter-day",6*ONE_HOUR],["half-day",12*ONE_HOUR],["day",1.2*ONE_DAY],["half-week",3.5*ONE_DAY],["week",7*ONE_DAY],["month",31*ONE_DAY],["quarter",95*ONE_DAY],["half-year",ONE_YEAR/2],["year",ONE_YEAR]];function isUnitValueSame(e,t,n,i){var r=parseDate(t),a=parseDate(n),o=function(e){return getUnitValue(r,e,i)===getUnitValue(a,e,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},h=function(){return c()&&o("minute")},p=function(){return h()&&o("second")};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 p();case"millisecond":return p()&&o("millisecond")}}function getDateInterval(e,t){return(e/=ONE_DAY)>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function getMonthInterval(e){return(e/=30*ONE_DAY)>6?6:e>3?3:e>2?2:1}function getHourInterval(e){return(e/=ONE_HOUR)>12?12:e>6?6:e>3.5?4:e>2?2:1}function getMinutesAndSecondsInterval(e,t){return(e/=t?ONE_MINUTE:ONE_SECOND)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function getMillisecondsInterval(e){return nice(e,!0)}function getFirstTimestampOfUnit(e,t,n){var i=new Date(e);switch(getPrimaryTimeUnit(t)){case"year":case"month":i[monthSetterName(n)](0);case"day":i[dateSetterName(n)](1);case"hour":i[hoursSetterName(n)](0);case"minute":i[minutesSetterName(n)](0);case"second":i[secondsSetterName(n)](0),i[millisecondsSetterName(n)](0)}return i.getTime()}function getIntervalTicks(e,t,n,i){var r=timeUnits,a=0;function o(e,t,n,r,a,o,s){for(var l=new Date(t),u=t,c=l[r]();u<n&&u<=i[1];)s.push({value:u}),c+=e,l[a](c),u=l.getTime();s.push({value:u,notAdd:!0})}function s(e,r,a){var s=[],l=!r.length;if(!isUnitValueSame(getPrimaryTimeUnit(e),i[0],i[1],n)){l&&(r=[{value:getFirstTimestampOfUnit(new Date(i[0]),e,n)},{value:i[1]}]);for(var u=0;u<r.length-1;u++){var c=r[u].value,h=r[u+1].value;if(c!==h){var p=void 0,d=void 0,f=void 0;switch(e){case"year":p=Math.max(1,Math.round(t/ONE_DAY/365)),d=fullYearGetterName(n),f=fullYearSetterName(n);break;case"half-year":case"quarter":case"month":p=getMonthInterval(t),d=monthGetterName(n),f=monthSetterName(n);break;case"week":case"half-week":case"day":p=getDateInterval(t),d=dateGetterName(n),f=dateSetterName(n),!0;break;case"half-day":case"quarter-day":case"hour":p=getHourInterval(t),d=hoursGetterName(n),f=hoursSetterName(n);break;case"minute":p=getMinutesAndSecondsInterval(t,!0),d=minutesGetterName(n),f=minutesSetterName(n);break;case"second":p=getMinutesAndSecondsInterval(t,!1),d=secondsGetterName(n),f=secondsSetterName(n);break;case"millisecond":p=getMillisecondsInterval(t),d=millisecondsGetterName(n),f=millisecondsSetterName(n)}o(p,c,h,d,f,0,s),"year"===e&&a.length>1&&0===u&&a.unshift({value:a[0].value-p})}}for(u=0;u<s.length;u++)a.push(s[u]);return s}}for(var l=[],u=[],c=0,h=0,p=0;p<r.length&&a++<1e4;++p){var d=getPrimaryTimeUnit(r[p]);if(isPrimaryTimeUnit(r[p]))if(s(r[p],l[l.length-1]||[],u),d!==(r[p+1]?getPrimaryTimeUnit(r[p+1]):null)){if(u.length){h=c,u.sort((function(e,t){return e.value-t.value}));for(var f=[],g=0;g<u.length;++g){var m=u[g].value;0!==g&&u[g-1].value===m||(f.push(u[g]),m>=i[0]&&m<=i[1]&&c++)}var y=(i[1]-i[0])/t;if(c>1.5*y&&h>y/1.5)break;if(l.push(f),c>y||e===r[p])break}u=[]}}var v=filter(map(l,(function(e){return filter(e,(function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd}))})),(function(e){return e.length>0})),_=[],x=v.length-1;for(p=0;p<v.length;++p)for(var S=v[p],b=0;b<S.length;++b)_.push({value:S[b].value,level:x-p});_.sort((function(e,t){return e.value-t.value}));var T=[];for(p=0;p<_.length;++p)0!==p&&_[p].value===_[p-1].value||T.push(_[p]);return T}Scale.registerClass(TimeScale);var scaleProto=Scale.prototype,intervalScaleProto=IntervalScale.prototype,getPrecisionSafe$1=getPrecisionSafe,roundingErrorFix=round$1,mathFloor$1=Math.floor,mathCeil=Math.ceil,mathPow$1=Math.pow,mathLog=Math.log,LogScale=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new IntervalScale,t._interval=0,t}return __extends(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,i=t.getExtent();return map(intervalScaleProto.getTicks.call(this,e),(function(e){var t=e.value,r=round$1(mathPow$1(this.base,t));return r=t===n[0]&&this._fixMin?fixRoundingError(r,i[0]):r,{value:r=t===n[1]&&this._fixMax?fixRoundingError(r,i[1]):r}}),this)},t.prototype.setExtent=function(e,t){var n=this.base;e=mathLog(e)/mathLog(n),t=mathLog(t)/mathLog(n),intervalScaleProto.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=scaleProto.getExtent.call(this);t[0]=mathPow$1(e,t[0]),t[1]=mathPow$1(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=fixRoundingError(t[0],n[0])),this._fixMax&&(t[1]=fixRoundingError(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=mathLog(e[0])/mathLog(t),e[1]=mathLog(e[1])/mathLog(t),scaleProto.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.niceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(!(n===1/0||n<=0)){var i=quantity(n);for(e/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var r=[round$1(mathCeil(t[0]/i)*i),round$1(mathFloor$1(t[1]/i)*i)];this._interval=i,this._niceExtent=r}},t.prototype.niceExtent=function(e){intervalScaleProto.niceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return contain$1(e=mathLog(e)/mathLog(this.base),this._extent)},t.prototype.normalize=function(e){return normalize$1(e=mathLog(e)/mathLog(this.base),this._extent)},t.prototype.scale=function(e){return e=scale$2(e,this._extent),mathPow$1(this.base,e)},t.type="log",t}(Scale),proto=LogScale.prototype;function fixRoundingError(e,t){return roundingErrorFix(e,getPrecisionSafe$1(t))}proto.getMinorTicks=intervalScaleProto.getMinorTicks,proto.getLabel=intervalScaleProto.getLabel,Scale.registerClass(LogScale);var ScaleRawExtentInfo=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 i=this._isOrdinal="ordinal"===e.type;this._needCrossZero=t.getNeedCrossZero&&t.getNeedCrossZero();var r=this._modelMinRaw=t.get("min",!0);isFunction(r)?this._modelMinNum=parseAxisModelMinMax(e,r({min:n[0],max:n[1]})):"dataMin"!==r&&(this._modelMinNum=parseAxisModelMinMax(e,r));var a=this._modelMaxRaw=t.get("max",!0);if(isFunction(a)?this._modelMaxNum=parseAxisModelMinMax(e,a({min:n[0],max:n[1]})):"dataMax"!==a&&(this._modelMaxNum=parseAxisModelMinMax(e,a)),i)this._axisDataLen=t.getCategories().length;else{var o=t.get("boundaryGap"),s=isArray(o)?o:[o||0,o||0];"boolean"==typeof s[0]||"boolean"==typeof s[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[parsePercent(s[0],1),parsePercent(s[1],1)]}},e.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,n=this._dataMax,i=this._axisDataLen,r=this._boundaryGapInner,a=e?null:n-t||Math.abs(t),o="dataMin"===this._modelMinRaw?t:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=o,u=null!=s;null==o&&(o=e?i?0:NaN:t-r[0]*a),null==s&&(s=e?i?i-1:NaN:n+r[1]*a),(null==o||!isFinite(o))&&(o=NaN),(null==s||!isFinite(s))&&(s=NaN),o>s&&(o=NaN,s=NaN);var c=eqNaN(o)||eqNaN(s)||e&&!i;this._needCrossZero&&(o>0&&s>0&&!l&&(o=0),o<0&&s<0&&!u&&(s=0));var h=this._determinedMin,p=this._determinedMax;return null!=h&&(o=h,l=!0),null!=p&&(s=p,u=!0),{min:o,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[DATA_MIN_MAX_ATTR[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=DETERMINED_MIN_MAX_ATTR[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),DETERMINED_MIN_MAX_ATTR={min:"_determinedMin",max:"_determinedMax"},DATA_MIN_MAX_ATTR={min:"_dataMin",max:"_dataMax"};function ensureScaleRawExtentInfo(e,t,n){var i=e.rawExtentInfo;return i||(i=new ScaleRawExtentInfo(e,t,n),e.rawExtentInfo=i,i)}function parseAxisModelMinMax(e,t){return null==t?null:eqNaN(t)?NaN:e.parse(t)}function getScaleExtent(e,t){var n=e.type,i=ensureScaleRawExtentInfo(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var r=i.min,a=i.max,o=t.ecModel;if(o&&"time"===n){var s=prepareLayoutBarSeries("bar",o),l=!1;if(each(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=makeColumnLayout(s),c=adjustScaleForOverflow(r,a,t,u);r=c.min,a=c.max}}return{extent:[r,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function adjustScaleForOverflow(e,t,n,i){var r=n.axis.getExtent(),a=r[1]-r[0],o=retrieveColumnLayout(i,n.axis);if(void 0===o)return{min:e,max:t};var s=1/0;each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;each(o,(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)/a)-c;return{min:e-=h*(s/u),max:t+=h*(l/u)}}function niceScaleExtent(e,t){var n=getScaleExtent(e,t),i=n.extent,r=t.get("splitNumber");e instanceof LogScale&&(e.base=t.get("logBase"));var a=e.type;e.setExtent(i[0],i[1]),e.niceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:"interval"===a||"time"===a?t.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)}function createScaleByModel(e,t){if(t=t||e.get("type"))switch(t){case"category":return new OrdinalScale({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new TimeScale({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(Scale.getClass(t)||IntervalScale)}}function ifAxisCrossZero(e){var t=e.scale.getExtent(),n=t[0],i=t[1];return!(n>0&&i>0||n<0&&i<0)}function makeLabelFormatter(e){var t,n,i=e.getLabelModel().get("formatter"),r="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=i,function(t,i){return e.scale.getFormattedLabel(t,i,n)}):"string"==typeof i?function(t){return function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(i):"function"==typeof i?(t=i,function(n,i){return null!=r&&(i=n.value-r),t(getAxisRawValue(e,n),i,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function getAxisRawValue(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function estimateLabelUnionRect(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var i,r,a=n.getExtent();r=n instanceof OrdinalScale?n.count():(i=n.getTicks()).length;var o,s=e.getLabelModel(),l=makeLabelFormatter(e),u=1;r>40&&(u=Math.ceil(r/40));for(var c=0;c<r;c+=u){var h=l(i?i[c]:{value:a[0]+c},c),p=rotateTextRect(s.getTextRect(h),s.get("rotate")||0);o?o.union(p):o=p}return o}}function rotateTextRect(e,t){var n=t*Math.PI/180,i=e.width,r=e.height,a=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),o=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new BoundingRect(e.x,e.y,a,o)}function getOptionCategoryInterval(e){var t=e.get("interval");return null==t?"auto":t}function shouldShowAllLabels(e){return"category"===e.type&&0===getOptionCategoryInterval(e.getLabelModel())}function getDataDimensionsOnAxis(e,t){var n={};return each(e.mapDimensionsAll(t),(function(t){n[getStackedDimension(e,t)]=!0})),keys(n)}function unionAxisExtentFromData(e,t,n){t&&each(getDataDimensionsOnAxis(t,n),(function(n){var i=t.getApproximateExtent(n);i[0]<e[0]&&(e[0]=i[0]),i[1]>e[1]&&(e[1]=i[1])}))}var AxisModelCommonMixin=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();function createList(e){return createListFromArray(e.getSource(),e)}var dataStack$1={isDimensionStacked:isDimensionStacked,enableDataStack:enableDataStack,getStackedDimension:getStackedDimension};function createScale(e,t){var n=t;t instanceof Model||(n=new Model(t));var i=createScaleByModel(n);return i.setExtent(e[0],e[1]),niceScaleExtent(i,n),i}function mixinAxisModelCommonMethods(e){mixin(e,AxisModelCommonMixin)}var helper=Object.freeze({__proto__:null,createList:createList,getLayoutRect:getLayoutRect,dataStack:dataStack$1,createScale:createScale,mixinAxisModelCommonMethods:mixinAxisModelCommonMethods,getECData:getECData,createDimensions:createDimensions,createSymbol:createSymbol}),EPSILON$3=1e-8;function isAroundEqual$1(e,t){return Math.abs(e-t)<EPSILON$3}function contain$2(e,t,n){var i=0,r=e[0];if(!r)return!1;for(var a=1;a<e.length;a++){var o=e[a];i+=windingLine(r[0],r[1],o[0],o[1],t,n),r=o}var s=e[0];return isAroundEqual$1(r[0],s[0])&&isAroundEqual$1(r[1],s[1])||(i+=windingLine(r[0],r[1],s[0],s[1],t,n)),0!==i}var Region=function(){function e(e,t,n){if(this.name=e,this.geometries=t,n)n=[n[0],n[1]];else{var i=this.getBoundingRect();n=[i.x+i.width/2,i.y+i.height/2]}this.center=n}return e.prototype.getBoundingRect=function(){var e=this._rect;if(e)return e;for(var t=Number.MAX_VALUE,n=[t,t],i=[-t,-t],r=[],a=[],o=this.geometries,s=0;s<o.length;s++){if("polygon"===o[s].type)fromPoints(o[s].exterior,r,a),min(n,n,r),max(i,i,a)}return 0===s&&(n[0]=n[1]=i[0]=i[1]=0),this._rect=new BoundingRect(n[0],n[1],i[0]-n[0],i[1]-n[1])},e.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var i=0,r=n.length;i<r;i++)if("polygon"===n[i].type){var a=n[i].exterior,o=n[i].interiors;if(contain$2(a,e[0],e[1])){for(var s=0;s<(o?o.length:0);s++)if(contain$2(o[s],e[0],e[1]))continue e;return!0}}return!1},e.prototype.transformTo=function(e,t,n,i){var r=this.getBoundingRect(),a=r.width/r.height;n?i||(i=n/a):n=a*i;for(var o=new BoundingRect(e,t,n,i),s=r.calculateTransform(o),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var c=l[u].exterior,h=l[u].interiors,p=0;p<c.length;p++)applyTransform(c[p],c[p],s);for(var d=0;d<(h?h.length:0);d++)for(p=0;p<h[d].length;p++)applyTransform(h[d][p],h[d][p],s)}(r=this._rect).copy(o),this.center=[r.x+r.width/2,r.y+r.height/2]},e.prototype.cloneShallow=function(t){null==t&&(t=this.name);var n=new e(t,this.geometries,this.center);return n._rect=this._rect,n.transformTo=null,n},e}();function decode(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;null==n&&(n=1024);for(var i=t.features,r=0;r<i.length;r++){var a=i[r].geometry;if("Polygon"===a.type)for(var o=a.coordinates,s=0;s<o.length;s++)o[s]=decodePolygon(o[s],a.encodeOffsets[s],n);else if("MultiPolygon"===a.type)for(o=a.coordinates,s=0;s<o.length;s++)for(var l=o[s],u=0;u<l.length;u++)l[u]=decodePolygon(l[u],a.encodeOffsets[s][u],n)}return t.UTF8Encoding=!1,t}function decodePolygon(e,t,n){for(var i=[],r=t[0],a=t[1],o=0;o<e.length;o+=2){var s=e.charCodeAt(o)-64,l=e.charCodeAt(o+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,i.push([s/n,l/n])}return i}function parseGeoJSON(e,t){return map(filter((e=decode(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,i=e.geometry,r=[];if("Polygon"===i.type){var a=i.coordinates;r.push({type:"polygon",exterior:a[0],interiors:a.slice(1)})}"MultiPolygon"===i.type&&each(a=i.coordinates,(function(e){e[0]&&r.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new Region(n[t||"name"],r,n.cp);return o.properties=n,o}))}var inner$4=makeInner();function createAxisLabels(e){return"category"===e.type?makeCategoryLabels(e):makeRealNumberLabels(e)}function createAxisTicks(e,t){return"category"===e.type?makeCategoryTicks(e,t):{ticks:map(e.scale.getTicks(),(function(e){return e.value}))}}function makeCategoryLabels(e){var t=e.getLabelModel(),n=makeCategoryLabelsActually(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function makeCategoryLabelsActually(e,t){var n,i=getListCache(e,"labels"),r=getOptionCategoryInterval(t),a=listCacheGet(i,r);return a||listCacheSet(i,r,{labels:isFunction(r)?makeLabelsByCustomizedCategoryInterval(e,r):makeLabelsByNumericCategoryInterval(e,n="auto"===r?makeAutoCategoryInterval(e):r),labelCategoryInterval:n})}function makeCategoryTicks(e,t){var n,i,r=getListCache(e,"ticks"),a=getOptionCategoryInterval(t),o=listCacheGet(r,a);if(o)return o;if(t.get("show")&&!e.scale.isBlank()||(n=[]),isFunction(a))n=makeLabelsByCustomizedCategoryInterval(e,a,!0);else if("auto"===a){var s=makeCategoryLabelsActually(e,e.getLabelModel());i=s.labelCategoryInterval,n=map(s.labels,(function(e){return e.tickValue}))}else n=makeLabelsByNumericCategoryInterval(e,i=a,!0);return listCacheSet(r,a,{ticks:n,tickCategoryInterval:i})}function makeRealNumberLabels(e){var t=e.scale.getTicks(),n=makeLabelFormatter(e);return{labels:map(t,(function(t,i){return{formattedLabel:n(t,i),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}function getListCache(e,t){return inner$4(e)[t]||(inner$4(e)[t]=[])}function listCacheGet(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function listCacheSet(e,t,n){return e.push({key:t,value:n}),n}function makeAutoCategoryInterval(e){var t=inner$4(e).autoInterval;return null!=t?t:inner$4(e).autoInterval=e.calculateCategoryInterval()}function calculateCategoryInterval(e){var t=fetchAutoCategoryIntervalCalculationParams(e),n=makeLabelFormatter(e),i=(t.axisRotate-t.labelRotate)/180*Math.PI,r=e.scale,a=r.getExtent(),o=r.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),p=0,d=0;l<=a[1];l+=s){var f,g,m=getBoundingRect(n({value:l}),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,p=Math.max(p,f,7),d=Math.max(d,g,7)}var y=p/c,v=d/h;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var _=Math.max(0,Math.floor(Math.min(y,v))),x=inner$4(e.model),S=e.getExtent(),b=x.lastAutoInterval,T=x.lastTickCount;return null!=b&&null!=T&&Math.abs(b-_)<=1&&Math.abs(T-o)<=1&&b>_&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?_=b:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=S[0],x.axisExtent1=S[1]),_}function fetchAutoCategoryIntervalCalculationParams(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()}}function makeLabelsByNumericCategoryInterval(e,t,n){var i=makeLabelFormatter(e),r=e.scale,a=r.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=r.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=shouldShowAllLabels(e),p=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;p&&u!==a[0]&&g(a[0]);for(var f=u;f<=a[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:r.getLabel(t),tickValue:e})}return d&&f-l!==a[1]&&g(a[1]),s}function makeLabelsByCustomizedCategoryInterval(e,t,n){var i=e.scale,r=makeLabelFormatter(e),a=[];return each(i.getTicks(),(function(e){var o=i.getLabel(e),s=e.value;t(e.value,o)&&a.push(n?s:{formattedLabel:r(e),rawLabel:o,tickValue:s})})),a}var NORMALIZED_EXTENT=[0,1],Axis=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]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return getPixelPrecision(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,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&fixExtentWithBands(n=n.slice(),i.count()),linearMap(e,NORMALIZED_EXTENT,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&fixExtentWithBands(n=n.slice(),i.count());var r=linearMap(e,n,NORMALIZED_EXTENT,t);return this.scale.scale(r)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=map(createAxisTicks(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawIndex(e):e),tickValue:e}}),this);return fixOnBandTicksCoords(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),map(this.scale.getMinorTicks(e),(function(e){return map(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return createAxisLabels(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 i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(){return calculateCategoryInterval(this)},e}();function fixExtentWithBands(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}function fixOnBandTicksCoords(e,t,n,i){var r=t.length;if(e.onBand&&!n&&r){var a,o,s=e.getExtent();if(1===r)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[r-1].tickValue-t[0].tickValue,u=(t[r-1].coord-t[0].coord)/l;each(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[r-1].tickValue,a={coord:t[r-1].coord+u*o},t.push(a)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift()),i&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]}),h(s[1],a.coord)&&(i?a.coord=s[1]:t.pop()),i&&h(a.coord,s[1])&&t.push({coord:s[1]})}function h(e,t){return e=round$1(e),t=round$1(t),c?e>t:e<t}}var parseGeoJson=parseGeoJSON,number={};each(["linearMap","round","asc","getPrecision","getPrecisionSafe","getPixelPrecision","getPercentWithPrecision","MAX_SAFE_INTEGER","remRadian","isRadianAroundZero","parseDate","quantity","quantityExponent","nice","quantile","reformIntervals","isNumeric","numericToNumber"],(function(e){number[e]=numberUtil[e]}));var format$1={};each(["addCommas","toCamelCase","normalizeCssArray","encodeHTML","formatTpl","getTooltipMarker","formatTime","capitalFirst","truncateText","getTextRect"],(function(e){format$1[e]=formatUtil[e]}));var time={parse:parseDate,format:format},ecUtil={};each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){ecUtil[e]=zrUtil[e]}));var GRAPHIC_KEYS=["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Ellipse","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],graphic$1={};each(GRAPHIC_KEYS,(function(e){graphic$1[e]=graphic[e]}));var RELATIONAL_EXPRESSION_OP_ALIAS_MAP={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},RegExpEvaluator=function(){function e(e){if(null==(this._condVal=isString(e)?new RegExp(e):isRegExp(e)?e:null)){var t="";0,throwError(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return"string"===t?this._condVal.test(e):"number"===t&&this._condVal.test(e+"")},e}(),ConstConditionInternal=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),AndConditionInternal=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}(),OrConditionInternal=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}(),NotConditionInternal=function(){function e(){}return e.prototype.evaluate=function(){return!this.child.evaluate()},e}(),RelationalConditionInternal=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,i=0;i<this.subCondList.length;i++)if(!this.subCondList[i].evaluate(e?n:t))return!1;return!0},e}();function parseOption(e,t){if(!0===e||!1===e){var n=new ConstConditionInternal;return n.value=e,n}var i="";return isObjectNotArray(e)||throwError(i),e.and?parseAndOrOption("and",e,t):e.or?parseAndOrOption("or",e,t):e.not?parseNotOption(e,t):parseRelationalOption(e,t)}function parseAndOrOption(e,t,n){var i=t[e],r="";isArray(i)||throwError(r),i.length||throwError(r);var a="and"===e?new AndConditionInternal:new OrConditionInternal;return a.children=map(i,(function(e){return parseOption(e,n)})),a.children.length||throwError(r),a}function parseNotOption(e,t){var n=e.not,i="";isObjectNotArray(n)||throwError(i);var r=new NotConditionInternal;return r.child=parseOption(n,t),r.child||throwError(i),r}function parseRelationalOption(e,t){for(var n="",i=t.prepareGetValue(e),r=[],a=keys(e),o=e.parser,s=o?getRawValueParser(o):null,l=0;l<a.length;l++){var u=a[l];if("parser"!==u&&!t.valueGetterAttrMap.get(u)){var c=hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP,u)?RELATIONAL_EXPRESSION_OP_ALIAS_MAP[u]:u,h=e[u],p=s?s(h):h,d=createFilterComparator(c,p)||"reg"===c&&new RegExpEvaluator(p);d||throwError(n),r.push(d)}}r.length||throwError(n);var f=new RelationalConditionInternal;return f.valueGetterParam=i,f.valueParser=s,f.getValue=t.getValue,f.subCondList=r,f}function isObjectNotArray(e){return isObject(e)&&!isArrayLike(e)}var ConditionalExpressionParsed=function(){function e(e,t){this._cond=parseOption(e,t)}return e.prototype.evaluate=function(){return this._cond.evaluate()},e}();function parseConditionalExpression(e,t){return new ConditionalExpressionParsed(e,t)}var filterTransform={type:"echarts:filter",transform:function(e){for(var t,n=e.upstream,i=parseConditionalExpression(e.config,{valueGetterAttrMap:createHashMap({dimension:!0}),prepareGetValue:function(e){var t="",i=e.dimension;hasOwn(e,"dimension")||throwError(t);var r=n.getDimensionInfo(i);return r||throwError(t),{dimIdx:r.index}},getValue:function(e){return n.retrieveValueFromItem(t,e.dimIdx)}}),r=[],a=0,o=n.count();a<o;a++)t=n.getRawDataItem(a),i.evaluate()&&r.push(t);return{data:r}}},sampleLog="";var sortTransform={type:"echarts:sort",transform:function(e){var t=e.upstream,n=e.config,i="",r=normalizeToArray(n);r.length||throwError(i);var a=[];each(r,(function(e){var n=e.dimension,r=e.order,o=e.parser,s=e.incomparable;if(null==n&&throwError(i),"asc"!==r&&"desc"!==r&&throwError(i),s&&"min"!==s&&"max"!==s){var l="";0,throwError(l)}if("asc"!==r&&"desc"!==r){var u="";0,throwError(u)}var c=t.getDimensionInfo(n);c||throwError(i);var h=o?getRawValueParser(o):null;o&&!h&&throwError(i),a.push({dimIdx:c.index,parser:h,comparator:new SortOrderComparator(r,s)})}));var o=t.sourceFormat;o!==SOURCE_FORMAT_ARRAY_ROWS&&o!==SOURCE_FORMAT_OBJECT_ROWS&&throwError(i);for(var s=[],l=0,u=t.count();l<u;l++)s.push(t.getRawDataItem(l));return s.sort((function(e,n){for(var i=0;i<a.length;i++){var r=a[i],o=t.retrieveValueFromItem(e,r.dimIdx),s=t.retrieveValueFromItem(n,r.dimIdx);r.parser&&(o=r.parser(o),s=r.parser(s));var l=r.comparator.evaluate(o,s);if(0!==l)return l}return 0})),{data:s}}};registerTransform(filterTransform),registerTransform(sortTransform);var LineSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.legendSymbol="line",n}return __extends(t,e),t.prototype.getInitialData=function(e){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:!0})},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={zlevel:0,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,lineStyle:{width:"bolder"}},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},t}(SeriesModel);function getDefaultLabel(e,t){var n=e.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i)return retrieveRawValue(e,t,n[0]);if(i){for(var r=[],a=0;a<n.length;a++)r.push(retrieveRawValue(e,t,n[a]));return r.join(" ")}}function getDefaultInterpolatedLabel(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!isArray(t))return t+"";for(var i=[],r=0;r<n.length;r++){var a=e.getDimensionInfo(n[r]);a&&i.push(t[a.index])}return i.join(" ")}SeriesModel.registerClass(LineSeriesModel);var Symbol=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a.updateData(t,n,i,r),a}return __extends(t,e),t.prototype._createSymbol=function(e,t,n,i,r){this.removeAll();var a=createSymbol(e,-1,-1,2,2,null,r);a.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),a.drift=driftSymbol,this._symbolType=e,this.add(a)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){enterEmphasis(this.childAt(0))},t.prototype.downplay=function(){leaveEmphasis(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){var t=this.childAt(0);t.draggable=e,t.cursor=e?"move":t.cursor},t.prototype.updateData=function(e,n,i,r){this.silent=!1;var a=e.getItemVisual(n,"symbol")||"circle",o=e.hostModel,s=t.getSymbolSize(e,n),l=a!==this._symbolType,u=r&&r.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(a,e,n,s,c)}else{(p=this.childAt(0)).silent=!1;var h={scaleX:s[0]/2,scaleY:s[1]/2};u?p.attr(h):updateProps(p,h,o,n)}if(this._updateCommon(e,n,s,i,r),l){var p=this.childAt(0);if(!u){h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,initProps(p,h,o,n)}}u&&this.childAt(0).stopAnimation("remove"),this._seriesModel=o},t.prototype._updateCommon=function(e,t,n,i,r){var a,o,s,l,u,c,h,p,d,f=this.childAt(0),g=e.hostModel;if(i&&(a=i.emphasisItemStyle,o=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,c=i.symbolOffset,h=i.labelStatesModels,p=i.hoverScale,d=i.cursorStyle),!i||e.hasItemOption){var m=i&&i.itemModel?i.itemModel:e.getItemModel(t),y=m.getModel("emphasis");a=y.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),o=m.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),u=y.get("blurScope"),c=m.getShallow("symbolOffset"),h=getLabelStatesModels(m),p=y.getShallow("scale"),d=m.getShallow("cursor")}var v=e.getItemVisual(t,"symbolRotate");f.attr("rotation",(v||0)*Math.PI/180||0),c&&(f.x=parsePercent$2(c[0],n[0]),f.y=parsePercent$2(c[1],n[1])),d&&f.attr("cursor",d);var _=e.getItemVisual(t,"style"),x=_.fill;if(f instanceof ZRImage){var S=f.style;f.useStyle(extend({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},_))}else f.__isEmptyBrush?f.useStyle(extend({},_)):f.useStyle(_),f.style.decal=null,f.setColor(x,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var b=e.getItemVisual(t,"liftZ"),T=this._z2;null!=b?null==T&&(this._z2=f.z2,f.z2+=b):null!=T&&(f.z2=T,this._z2=null);var M=r&&r.useNameLabel;setLabelStyle(f,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):getDefaultLabel(e,t)},inheritColor:x,defaultOpacity:_.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var A=f.ensureState("emphasis");if(A.style=a,f.ensureState("select").style=s,f.ensureState("blur").style=o,p){var I=Math.max(1.1,3/this._sizeY);A.scaleX=this._sizeX*I,A.scaleY=this._sizeY*I}this.setSymbolScale(1),enableHoverEmphasis(this,l,u)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t){var n=this.childAt(0),i=this._seriesModel,r=getECData(this).dataIndex,a=t&&t.animation;if(this.silent=n.silent=!0,t&&t.fadeLabel){var o=n.getTextContent();o&&removeElement(o,{style:{opacity:0}},i,{dataIndex:r,removeOpt:a,cb:function(){n.removeTextContent()}})}else n.removeTextContent();removeElement(n,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:r,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){var n=e.getItemVisual(t,"symbolSize");return n instanceof Array?n.slice():[+n,+n]},t}(Group);function driftSymbol(e,t){this.parent.drift(e,t)}function symbolNeedsDraw(e,t,n,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function normalizeUpdateOpt(e){return null==e||isObject(e)||(e={isIgnore:e}),e||{}}function makeSeriesScope(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"),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverScale:n.get("scale"),labelStatesModels:getLabelStatesModels(t),cursorStyle:t.get("cursor")}}var SymbolDraw=function(){function e(e){this.group=new Group,this._SymbolCtor=e||Symbol}return e.prototype.updateData=function(e,t){t=normalizeUpdateOpt(t);var n=this.group,i=e.hostModel,r=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=makeSeriesScope(e),l={disableAnimation:o},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};r||n.removeAll(),e.diff(r).add((function(i){var r=u(i);if(symbolNeedsDraw(e,r,i,t)){var o=new a(e,i,s,l);o.setPosition(r),e.setItemGraphicEl(i,o),n.add(o)}})).update((function(c,h){var p=r.getItemGraphicEl(h),d=u(c);if(symbolNeedsDraw(e,d,c,t)){if(p){p.updateData(e,c,s,l);var f={x:d[0],y:d[1]};o?p.attr(f):updateProps(p,f,i)}else(p=new a(e,c)).setPosition(d);n.add(p),e.setItemGraphicEl(c,p)}else n.remove(p)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&t.fadeOut((function(){n.remove(t)}))})).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.isPersistent=function(){return!0},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl((function(t,n){var i=e._getSymbolPoint(n);t.setPosition(i),t.markRedraw()}))},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=makeSeriesScope(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function i(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}n=normalizeUpdateOpt(n);for(var r=e.start;r<e.end;r++){var a=t.getItemLayout(r);if(symbolNeedsDraw(t,a,r,n)){var o=new this._SymbolCtor(t,r,this._seriesScope);o.traverse(i),o.setPosition(a),this.group.add(o),t.setItemGraphicEl(r,o)}}},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}))})):t.removeAll()},e}();function prepareDataCoordInfo(e,t,n){var i=e.getBaseAxis(),r=e.getOtherAxis(i),a=getValueStart(r,n),o=i.dim,s=r.dim,l=t.mapDimension(s),u=t.mapDimension(o),c="x"===s||"radius"===s?1:0,h=map(e.dimensions,(function(e){return t.mapDimension(e)})),p=!1,d=t.getCalculationInfo("stackResultDimension");return isDimensionStacked(t,h[0])&&(p=!0,h[0]=d),isDimensionStacked(t,h[1])&&(p=!0,h[1]=d),{dataDimsForPoint:h,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!p,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function getValueStart(e,t){var n=0,i=e.scale.getExtent();return"start"===t?n=i[0]:"end"===t?n=i[1]:i[0]>0?n=i[0]:i[1]<0&&(n=i[1]),n}function getStackedOnPoint(e,t,n,i){var r=NaN;e.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,i),o[1-a]=r,t.dataToPoint(o)}var supportFloat32Array="undefined"!=typeof Float32Array,Float32ArrayCtor=supportFloat32Array?Float32Array:Array;function createFloat32Array(e){return isArray(e)?supportFloat32Array?new Float32Array(e):e:new Float32ArrayCtor(e)}function diffData(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}function lineAnimationDiff(e,t,n,i,r,a,o,s){for(var l=diffData(e,t),u=[],c=[],h=[],p=[],d=[],f=[],g=[],m=prepareDataCoordInfo(r,t,o),y=prepareDataCoordInfo(a,e,s),v=e.getLayout("points")||[],_=t.getLayout("points")||[],x=0;x<l.length;x++){var S=l[x],b=!0,T=void 0,M=void 0;switch(S.cmd){case"=":T=2*S.idx,M=2*S.idx1;var A=v[T],I=v[T+1],C=_[M],w=_[M+1];(isNaN(A)||isNaN(I))&&(A=C,I=w),u.push(A,I),c.push(C,w),h.push(n[T],n[T+1]),p.push(i[M],i[M+1]),g.push(t.getRawIndex(S.idx1));break;case"+":var P=S.idx,L=m.dataDimsForPoint,E=r.dataToPoint([t.get(L[0],P),t.get(L[1],P)]);M=2*P,u.push(E[0],E[1]),c.push(_[M],_[M+1]);var D=getStackedOnPoint(m,r,t,P);h.push(D[0],D[1]),p.push(i[M],i[M+1]),g.push(t.getRawIndex(P));break;case"-":var R=S.idx,O=e.getRawIndex(R),k=y.dataDimsForPoint;if(T=2*R,O!==R){var N=a.dataToPoint([e.get(k[0],R),e.get(k[1],R)]),B=getStackedOnPoint(y,a,e,R);u.push(v[T],v[T+1]),c.push(N[0],N[1]),h.push(n[T],n[T+1]),p.push(B[0],B[1]),g.push(O)}else b=!1}b&&(d.push(S),f.push(f.length))}f.sort((function(e,t){return g[e]-g[t]}));var V=u.length,F=createFloat32Array(V),$=createFloat32Array(V),z=createFloat32Array(V),G=createFloat32Array(V),H=[];for(x=0;x<f.length;x++){var U=f[x],Y=2*x,W=2*U;F[Y]=u[W],F[Y+1]=u[W+1],$[Y]=c[W],$[Y+1]=c[W+1],z[Y]=h[W],z[Y+1]=h[W+1],G[Y]=p[W],G[Y+1]=p[W+1],H[x]=d[U]}return{current:F,next:$,stackedOnCurrent:z,stackedOnNext:G,status:H}}var mathMin$5=Math.min,mathMax$5=Math.max;function isPointNull(e,t){return isNaN(e)||isNaN(t)}function drawSegment(e,t,n,i,r,a,o,s,l){for(var u,c,h,p,d,f,g=n,m=0;m<i;m++){var y=t[2*g],v=t[2*g+1];if(g>=r||g<0)break;if(isPointNull(y,v)){if(l){g+=a;continue}break}if(g===n)e[a>0?"moveTo":"lineTo"](y,v),h=y,p=v;else{var _=y-u,x=v-c;if(_*_+x*x<.5){g+=a;continue}if(o>0){var S=g+a,b=t[2*S],T=t[2*S+1],M=m+1;if(l)for(;isPointNull(b,T)&&M<i;)M++,b=t[2*(S+=a)],T=t[2*S+1];var A=.5,I=0,C=0,w=void 0,P=void 0;if(M>=i||isPointNull(b,T))d=y,f=v;else{I=b-u,C=T-c;var L=y-u,E=b-y,D=v-c,R=T-v,O=void 0,k=void 0;"x"===s?(O=Math.abs(L),k=Math.abs(E),d=y-O*o,f=v,w=y+O*o,P=v):"y"===s?(O=Math.abs(D),k=Math.abs(R),d=y,f=v-O*o,w=y,P=v+O*o):(O=Math.sqrt(L*L+D*D),d=y-I*o*(1-(A=(k=Math.sqrt(E*E+R*R))/(k+O))),f=v-C*o*(1-A),P=v+C*o*A,w=mathMin$5(w=y+I*o*A,mathMax$5(b,y)),P=mathMin$5(P,mathMax$5(T,v)),w=mathMax$5(w,mathMin$5(b,y)),f=v-(C=(P=mathMax$5(P,mathMin$5(T,v)))-v)*O/k,d=mathMin$5(d=y-(I=w-y)*O/k,mathMax$5(u,y)),f=mathMin$5(f,mathMax$5(c,v)),w=y+(I=y-(d=mathMax$5(d,mathMin$5(u,y))))*k/O,P=v+(C=v-(f=mathMax$5(f,mathMin$5(c,v))))*k/O)}e.bezierCurveTo(h,p,d,f,y,v),h=w,p=P}else e.lineTo(y,v)}u=y,c=v,g+=a}return m}var ECPolylineShape=function(){this.smooth=0,this.smoothConstraint=!0},ECPolyline=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ECPolylineShape},t.prototype.buildPath=function(e,t){var n=t.points,i=0,r=n.length/2;if(t.connectNulls){for(;r>0&&isPointNull(n[2*r-2],n[2*r-1]);r--);for(;i<r&&isPointNull(n[2*i],n[2*i+1]);i++);}for(;i<r;)i+=drawSegment(e,n,i,r,r,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,i,r=this.path.data,a=PathProxy.CMD,o="x"===t,s=[],l=0;l<r.length;){var u=void 0,c=void 0,h=void 0,p=void 0,d=void 0,f=void 0,g=void 0;switch(r[l++]){case a.M:n=r[l++],i=r[l++];break;case a.L:if(u=r[l++],c=r[l++],(g=o?(e-n)/(u-n):(e-i)/(c-i))<=1&&g>=0){var m=o?(c-i)*g+i:(u-n)*g+n;return o?[e,m]:[m,e]}n=u,i=c;break;case a.C:u=r[l++],c=r[l++],h=r[l++],p=r[l++],d=r[l++],f=r[l++];var y=o?cubicRootAt(n,u,h,d,e,s):cubicRootAt(i,c,p,f,e,s);if(y>0)for(var v=0;v<y;v++){var _=s[v];if(_<=1&&_>=0){m=o?cubicAt(i,c,p,f,_):cubicAt(n,u,h,d,_);return o?[e,m]:[m,e]}}n=d,i=f}}},t}(Path),ECPolygonShape=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(ECPolylineShape),ECPolygon=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new ECPolygonShape},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,r=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&isPointNull(n[2*a-2],n[2*a-1]);a--);for(;r<a&&isPointNull(n[2*r],n[2*r+1]);r++);}for(;r<a;){var s=drawSegment(e,n,r,a,a,1,t.smooth,o,t.connectNulls);drawSegment(e,i,r+s-1,s,a,-1,t.stackedOnSmooth,o,t.connectNulls),r+=s+1,e.closePath()}},t}(Path);function createGridClipPath(e,t,n,i,r){var a=e.getArea(),o=a.x,s=a.y,l=a.width,u=a.height,c=n.get(["lineStyle","width"])||2;o-=c/2,s-=c/2,l+=c,u+=c,o=Math.floor(o),l=Math.round(l);var h=new Rect({shape:{x:o,y:s,width:l,height:u}});if(t){var p=e.getBaseAxis(),d=p.isHorizontal(),f=p.inverse;d?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=u),h.shape.height=0),initProps(h,{shape:{width:l,height:u,x:o,y:s}},n,null,i,"function"==typeof r?function(e){r(e,h)}:null)}return h}function createPolarClipPath(e,t,n){var i=e.getArea(),r=round$1(i.r0,1),a=round$1(i.r,1),o=new Sector({shape:{cx:round$1(e.cx,1),cy:round$1(e.cy,1),r0:r,r:a,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});t&&("angle"===e.getBaseAxis().dim?o.shape.endAngle=i.startAngle:o.shape.r=r,initProps(o,{shape:{endAngle:i.endAngle,r:a}},n));return o}function createClipPath(e,t,n,i,r){return e?"polar"===e.type?createPolarClipPath(e,t,n):"cartesian2d"===e.type?createGridClipPath(e,t,n,i,r):null:null}function isCoordinateSystemType(e,t){return e.type===t}function isPointsSame(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function bboxFromPoints(e){for(var t=1/0,n=1/0,i=-1/0,r=-1/0,a=0;a<e.length;){var o=e[a++],s=e[a++];isNaN(o)||(t=Math.min(o,t),i=Math.max(o,i)),isNaN(s)||(n=Math.min(s,n),r=Math.max(s,r))}return[[t,n],[i,r]]}function getBoundingDiff(e,t){var n=bboxFromPoints(e),i=n[0],r=n[1],a=bboxFromPoints(t),o=a[0],s=a[1];return Math.max(Math.abs(i[0]-o[0]),Math.abs(i[1]-o[1]),Math.abs(r[0]-s[0]),Math.abs(r[1]-s[1]))}function getSmooth(e){return"number"==typeof e?e:e?.5:0}function getStackedOnPoints(e,t,n){if(!n.valueDim)return[];for(var i=t.count(),r=createFloat32Array(2*i),a=0;a<i;a++){var o=getStackedOnPoint(n,e,t,a);r[2*a]=o[0],r[2*a+1]=o[1]}return r}function turnPointsIntoStep(e,t,n){for(var i=t.getBaseAxis(),r="x"===i.dim||"radius"===i.dim?0:1,a=[],o=0,s=[],l=[],u=[];o<e.length-2;o+=2)switch(u[0]=e[o+2],u[1]=e[o+3],l[0]=e[o],l[1]=e[o+1],a.push(l[0],l[1]),n){case"end":s[r]=u[r],s[1-r]=l[1-r],a.push(s[0],s[1]);break;case"middle":var c=(l[r]+u[r])/2,h=[];s[r]=h[r]=c,s[1-r]=l[1-r],h[1-r]=u[1-r],a.push(s[0],s[1]),a.push(h[0],h[1]);break;default:s[r]=l[r],s[1-r]=u[1-r],a.push(s[0],s[1])}return a.push(e[o++],e[o++]),a}function getVisualGradient(e,t){var n=e.getVisual("visualMeta");if(n&&n.length&&e.count()&&"cartesian2d"===t.type){for(var i,r,a=n.length-1;a>=0;a--){var o=n[a].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(i=l&&l.coordDim)||"y"===i){r=n[a];break}}if(r){var u=t.getAxis(i),c=map(r.stops,(function(e){return{offset:0,coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),h=c.length,p=r.outerColors.slice();h&&c[0].coord>c[h-1].coord&&(c.reverse(),p.reverse());var d=c[0].coord-10,f=c[h-1].coord+10,g=f-d;if(g<.001)return"transparent";each(c,(function(e){e.offset=(e.coord-d)/g})),c.push({offset:h?c[h-1].offset:.5,color:p[1]||"transparent"}),c.unshift({offset:h?c[0].offset:.5,color:p[0]||"transparent"});var m=new LinearGradient(0,0,0,0,c,!0);return m[i]=d,m[i+"2"]=f,m}}}function getIsIgnoreFunc(e,t,n){var i=e.get("showAllSymbol"),r="auto"===i;if(!i||r){var a=n.getAxesByScale("ordinal")[0];if(a&&(!r||!canShowAllSymbolForCategory(a,t))){var o=t.mapDimension(a.dim),s={};return each(a.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function canShowAllSymbolForCategory(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var r=t.count(),a=Math.max(1,Math.round(r/5)),o=0;o<r;o+=a)if(1.5*Symbol.getSymbolSize(t,o)[e.isHorizontal()?1:0]>i)return!1;return!0}function isPointNull$1(e,t){return isNaN(e)||isNaN(t)}function getLastIndexNotNull(e){for(var t=e.length/2;t>0&&isPointNull$1(e[2*t-2],e[2*t-1]);t--);return t-1}function getPointAtIndex(e,t){return[e[2*t],e[2*t+1]]}function getIndexRange(e,t,n){for(var i,r,a=e.length/2,o="x"===n?0:1,s=0,l=-1,u=0;u<a;u++)if(r=e[2*u+o],!isNaN(r)&&!isNaN(e[2*u+1-o]))if(0!==u){if(i<=t&&r>=t||i>=t&&r<=t){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(t-i)/(r-i)}}function createLineClipPath(e,t,n,i){if(isCoordinateSystemType(t,"cartesian2d")){var r=i.getModel("endLabel"),a=r.get("show"),o=r.get("valueAnimation"),s=i.getData(),l={lastFrameIndex:0},u=a?function(n,i){e._endLabelOnDuring(n,i,s,l,o,r,t)}:null,c=t.getBaseAxis().isHorizontal(),h=createGridClipPath(t,n,i,(function(){var t=e._endLabel;t&&n&&null!=l.originalX&&t.attr({x:l.originalX,y:l.originalY})}),u);if(!i.get("clip",!0)){var p=h.shape,d=Math.max(p.width,p.height);c?(p.y-=d,p.height+=2*d):(p.x-=d,p.width+=2*d)}return u&&u(1,h),h}return createPolarClipPath(t,n,i)}function getEndLabelStateSpecified(e,t){var n=t.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,a=i?r?"right":"left":"center",o=i?"middle":r?"top":"bottom";return{normal:{align:e.get("align")||a,verticalAlign:e.get("verticalAlign")||o,padding:e.get("distance")||0}}}var LineView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(){var e=new Group,t=new SymbolDraw;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem,a=this.group,o=e.getData(),s=e.getModel("lineStyle"),l=e.getModel("areaStyle"),u=o.getLayout("points")||[],c="polar"===r.type,h=this._coordSys,p=this._symbolDraw,d=this._polyline,f=this._polygon,g=this._lineGroup,m=e.get("animation"),y=!l.isEmpty(),v=l.get("origin"),_=prepareDataCoordInfo(r,o,v),x=y&&getStackedOnPoints(r,o,_),S=e.get("showSymbol"),b=S&&!c&&getIsIgnoreFunc(e,o,r),T=this._data;T&&T.eachItemGraphicEl((function(e,t){e.__temp&&(a.remove(e),T.setItemGraphicEl(t,null))})),S||p.remove(),a.add(g);var M,A=!c&&e.get("step");r&&r.getArea&&e.get("clip",!0)&&(null!=(M=r.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M,d&&h.type===r.type&&A===this._step?(y&&!f?f=this._newPolygon(u,x):f&&!y&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,r),g.setClipPath(createLineClipPath(this,r,!1,e)),S&&p.updateData(o,{isIgnore:b,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),isPointsSame(this._stackedOnPoints,x)&&isPointsSame(this._points,u)||(m?this._doUpdateAnimation(o,x,r,n,A,v):(A&&(u=turnPointsIntoStep(u,r,A),x&&(x=turnPointsIntoStep(x,r,A))),d.setShape({points:u}),f&&f.setShape({points:u,stackedOnPoints:x})))):(S&&p.updateData(o,{isIgnore:b,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),m&&this._initSymbolLabelAnimation(o,r,M),A&&(u=turnPointsIntoStep(u,r,A),x&&(x=turnPointsIntoStep(x,r,A))),d=this._newPolyline(u),y&&(f=this._newPolygon(u,x)),c||this._initOrUpdateEndLabel(e,r),g.setClipPath(createLineClipPath(this,r,!0,e)));var I=getVisualGradient(o,r)||o.getVisual("style")[o.getVisual("drawType")],C=e.get(["emphasis","focus"]),w=e.get(["emphasis","blurScope"]);(d.useStyle(defaults(s.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),setStatesStylesFromModel(d,e,"lineStyle"),d.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=d.style.lineWidth+1);getECData(d).seriesIndex=e.seriesIndex,enableHoverEmphasis(d,C,w);var P=getSmooth(e.get("smooth")),L=e.get("smoothMonotone"),E=e.get("connectNulls");if(d.setShape({smooth:P,smoothMonotone:L,connectNulls:E}),f){var D=o.getCalculationInfo("stackedOnSeries"),R=0;f.useStyle(defaults(l.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),D&&(R=getSmooth(D.get("smooth"))),f.setShape({smooth:P,stackedOnSmooth:R,smoothMonotone:L,connectNulls:E}),setStatesStylesFromModel(f,e,"areaStyle"),getECData(f).seriesIndex=e.seriesIndex,enableHoverEmphasis(f,C,w)}var O=function(e){i._changePolyState(e)};o.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=O)})),this._polyline.onHoverStateChange=O,this._data=o,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=A,this._valueOrigin=v},t.prototype.dispose=function(){},t.prototype.highlight=function(e,t,n,i){var r=e.getData(),a=queryDataIndex(r,i);if(this._changePolyState("emphasis"),!(a instanceof Array)&&null!=a&&a>=0){var o=r.getLayout("points"),s=r.getItemGraphicEl(a);if(!s){var l=o[2*a],u=o[2*a+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;(s=new Symbol(r,a)).x=l,s.y=u,s.setZ(e.get("zlevel"),e.get("z")),s.__temp=!0,r.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else ChartView.prototype.highlight.call(this,e,t,n,i)},t.prototype.downplay=function(e,t,n,i){var r=e.getData(),a=queryDataIndex(r,i);if(this._changePolyState("normal"),null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else ChartView.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;setStatesFlag(this._polyline,e),t&&setStatesFlag(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new ECPolyline({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 ECPolygon({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,r,a=t.getBaseAxis(),o=a.inverse;"cartesian2d"===t.type?(i=a.isHorizontal(),r=!1):"polar"===t.type&&(i="angle"===a.dim,r=!0);var s=e.hostModel,l=s.get("animationDuration");"function"==typeof l&&(l=l(null));var u=s.get("animationDelay")||0,c="function"==typeof u?u(null):u;e.eachItemGraphicEl((function(e,a){var s=e;if(s){var h=[e.x,e.y],p=void 0,d=void 0,f=void 0;if(r){var g=n,m=t.pointToCoord(h);i?(p=g.startAngle,d=g.endAngle,f=-m[1]/180*Math.PI):(p=g.r0,d=g.r,f=m[0])}else{var y=n;i?(p=y.x,d=y.x+y.width,f=e.x):(p=y.y+y.height,d=y.y,f=e.y)}var v=d===p?0:(f-p)/(d-p);o&&(v=1-v);var _="function"==typeof u?u(a):l*v+c,x=s.getSymbolPath(),S=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,delay:_}),S&&S.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t){var n=e.getModel("endLabel");if(n.get("show")){var i=e.getData(),r=this._polyline,a=this._endLabel;a||((a=this._endLabel=new ZRText({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);var o=getLastIndexNotNull(i.getLayout("points"));o>=0&&setLabelStyle(a,getLabelStatesModels(e,"endLabel"),{labelFetcher:e,labelDataIndex:o,defaultText:function(e,t,n){return n?getDefaultInterpolatedLabel(i,n):getDefaultLabel(i,e)},enableTextSetter:!0},getEndLabelStateSpecified(n,t))}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,r,a,o){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),p=a.get("precision"),d=o.getBaseAxis(),f=d.isHorizontal(),g=d.inverse,m=t.shape,y=g?f?m.x:m.y+m.height:f?m.x+m.width:m.y,v=f?"x":"y",_=getIndexRange(u,y,v),x=_.range,S=x[1]-x[0],b=void 0;if(S>=1){if(S>1&&!h){var T=getPointAtIndex(u,x[0]);s.attr({x:T[0],y:T[1]}),r&&(b=c.getRawValue(x[0]))}else{(T=l.getPointOn(y,v))&&s.attr({x:T[0],y:T[1]});var M=c.getRawValue(x[0]),A=c.getRawValue(x[1]);r&&(b=interpolateRawValues(n,p,M,A,_.t))}i.lastFrameIndex=x[0]}else{var I=1===e||i.lastFrameIndex>0?x[0]:0;T=getPointAtIndex(u,I);r&&(b=c.getRawValue(I)),s.attr({x:T[0],y:T[1]})}r&&labelInner(s).setLabelText(b)}},t.prototype._doUpdateAnimation=function(e,t,n,i,r,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=lineAnimationDiff(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),c=u.current,h=u.stackedOnCurrent,p=u.next,d=u.stackedOnNext;if(r&&(c=turnPointsIntoStep(u.current,n,r),h=turnPointsIntoStep(u.stackedOnCurrent,n,r),p=turnPointsIntoStep(u.next,n,r),d=turnPointsIntoStep(u.stackedOnNext,n,r)),getBoundingDiff(c,p)>3e3||s&&getBoundingDiff(h,d)>3e3)return o.setShape({points:p}),void(s&&s.setShape({points:p,stackedOnPoints:d}));o.shape.__points=u.current,o.shape.points=c;var f={shape:{points:p}};u.current!==c&&(f.shape.__points=u.next),o.stopAnimation(),updateProps(o,f,l),s&&(s.setShape({points:c,stackedOnPoints:h}),s.stopAnimation(),updateProps(s,{shape:{stackedOnPoints:d}},l),o.shape.points!==s.shape.points&&(s.shape.points=o.shape.points));for(var g=[],m=u.status,y=0;y<m.length;y++){if("="===m[y].cmd){var v=e.getItemGraphicEl(m[y].idx1);v&&g.push({el:v,ptIdx:y})}}o.animators&&o.animators.length&&o.animators[0].during((function(){s&&s.dirtyShape();for(var e=o.shape.__points,t=0;t<g.length;t++){var n=g[t].el,i=2*g[t].ptIdx;n.x=e[i],n.y=e[i+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,i){e.__temp&&(t.remove(e),n.setItemGraphicEl(i,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(ChartView);function pointsLayout(e,t){return{seriesType:e,plan:createRenderPlanner(),reset:function(e){var n=e.getData(),i=e.coordinateSystem,r=e.pipelineContext,a=t||r.large;if(i){var o=map(i.dimensions,(function(e){return n.mapDimension(e)})).slice(0,2),s=o.length,l=n.getCalculationInfo("stackResultDimension");isDimensionStacked(n,o[0])&&(o[0]=l),isDimensionStacked(n,o[1])&&(o[1]=l);var u=n.getDimensionInfo(o[0]),c=n.getDimensionInfo(o[1]),h=u&&u.index,p=c&&c.index;return s&&{progress:function(e,t){for(var n=e.end-e.start,r=a&&createFloat32Array(n*s),o=[],l=[],u=e.start,c=0;u<e.end;u++){var d=void 0;if(1===s){var f=t.getByDimIdx(h,u);d=i.dataToPoint(f,null,l)}else o[0]=t.getByDimIdx(h,u),o[1]=t.getByDimIdx(p,u),d=i.dataToPoint(o,null,l);a?(r[c++]=d[0],r[c++]=d[1]):t.setItemLayout(u,d.slice())}a&&t.setLayout("points",r)}}}}}}ChartView.registerClass(LineView);var samplers={average:function(e){for(var t=0,n=0,i=0;i<e.length;i++)isNaN(e[i])||(t+=e[i],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]}},indexSampler=function(e){return Math.round(e.length/2)};function dataSample(e){return{seriesType:e,reset:function(e,t,n){var i=e.getData(),r=e.get("sampling"),a=e.coordinateSystem,o=i.count();if(o>10&&"cartesian2d"===a.type&&r){var s=a.getBaseAxis(),l=a.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),p=Math.round(o/h);if(p>1){"lttb"===r&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/p));var d=void 0;"string"==typeof r?d=samplers[r]:"function"==typeof r&&(d=r),d&&e.setData(i.downSample(i.mapDimension(l.dim),1/p,d,indexSampler))}}}}}var defaultOption={show:!0,zlevel: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,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},categoryAxis=merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},defaultOption),valueAxis=merge({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}}},defaultOption),timeAxis=merge({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},valueAxis),logAxis=defaults({scale:!0,logBase:10},valueAxis),axisDefault={category:categoryAxis,value:valueAxis,time:timeAxis,log:logAxis},AXIS_TYPES={value:1,category:1,time:1,log:1};function axisModelCreator(e,t,n){each(AXIS_TYPES,(function(i,r){var a=merge(merge({},axisDefault[r],!0),n,!0),o=function(t){function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t.apply(this,n)||this;return a.type=e+"Axis."+r,a}return __extends(n,t),n.prototype.mergeDefaultAndTheme=function(e,t){var n=fetchLayoutMode(this),i=n?getLayoutParams(e):{};merge(e,t.getTheme().get(r+"Axis")),merge(e,this.getDefaultOption()),e.type=getAxisType(e),n&&mergeLayoutParam(e,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=OrdinalMeta.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=e+"Axis."+r,n.defaultOption=a,n}(t);ComponentModel.registerClass(o)})),ComponentModel.registerSubTypeDefaulter(e+"Axis",getAxisType)}function getAxisType(e){return e.type||(e.data?"category":"value")}var CartesianAxisModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",SINGLE_REFERRING).models[0]},t.type="cartesian2dAxis",t}(ComponentModel);mixin(CartesianAxisModel,AxisModelCommonMixin);var extraOption={offset:0,categorySortInfo:[]};axisModelCreator("x",CartesianAxisModel,extraOption),axisModelCreator("y",CartesianAxisModel,extraOption);var PI$6=Math.PI,AxisBuilder=function(){function e(e,t){this.group=new Group,this.opt=t,this.axisModel=e,defaults(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Group({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!builders[e]},e.prototype.add=function(e){builders[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var i,r,a=remRadian(t-e);return isRadianAroundZero(a)?(r=n>0?"top":"bottom",i="center"):isRadianAroundZero(a-PI$6)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=a>0&&a<PI$6?n>0?"right":"left":n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:r}},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}(),builders={axisLine:function(e,t,n,i){var r=t.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0];o&&(applyTransform(s,s,o),applyTransform(l,l,o));var u=extend({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Line({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});c.anid="line",n.add(c);var h=t.get(["axisLine","symbol"]),p=t.get(["axisLine","symbolSize"]),d=t.get(["axisLine","symbolOffset"])||0;if("number"==typeof d&&(d=[d,d]),null!=h){"string"==typeof h&&(h=[h,h]),"string"!=typeof p&&"number"!=typeof p||(p=[p,p]);var f=p[0],g=p[1];each([{rotate:e.rotation+Math.PI/2,offset:d[0],r:0},{rotate:e.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,i){if("none"!==h[i]&&null!=h[i]){var r=createSymbol(h[i],-f/2,-g/2,f,g,u.stroke,!0),a=t.r+t.offset;r.attr({rotation:t.rotate,x:s[0]+a*Math.cos(e.rotation),y:s[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(e,t,n,i){var r=buildAxisMajorTicks(n,i,t,e);fixMinMaxLabelShow(t,buildAxisLabel(n,i,t,e),r),buildAxisMinorTicks(n,i,t,e.tickDirection)},axisName:function(e,t,n,i){var r=retrieve(e.axisName,t.get("name"));if(r){var a,o,s=t.get("nameLocation"),l=e.nameDirection,u=t.getModel("nameTextStyle"),c=t.get("nameGap")||0,h=t.axis.getExtent(),p=h[0]>h[1]?-1:1,d=["start"===s?h[0]-p*c:"end"===s?h[1]+p*c:(h[0]+h[1])/2,isNameLocationCenter(s)?e.labelOffset+l*c:0],f=t.get("nameRotate");null!=f&&(f=f*PI$6/180),isNameLocationCenter(s)?a=AxisBuilder.innerTextLayout(e.rotation,null!=f?f:e.rotation,l):(a=endTextLayout(e.rotation,s,f||0,h),null!=(o=e.axisNameAvailableWidth)&&(o=Math.abs(o/Math.sin(a.rotation)),!isFinite(o)&&(o=null)));var g=u.getFont(),m=t.get("nameTruncate",!0)||{},y=m.ellipsis,v=retrieve(e.nameTruncateMaxWidth,m.maxWidth,o),_=t.get("tooltip",!0),x=t.mainType,S={componentType:x,name:r,$vars:["name"]};S[x+"Index"]=t.componentIndex;var b=new ZRText({x:d[0],y:d[1],rotation:a.rotation,silent:AxisBuilder.isLabelSilent(t),style:createTextStyle(u,{text:r,font:g,overflow:"truncate",width:v,ellipsis:y,fill:u.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:u.get("align")||a.textAlign,verticalAlign:u.get("verticalAlign")||a.textVerticalAlign}),z2:1});if(b.tooltip=_&&_.show?extend({content:r,formatter:function(){return r},formatterParams:S},_):null,b.__fullText=r,b.anid="name",t.get("triggerEvent")){var T=AxisBuilder.makeAxisEventDataBase(t);T.targetType="axisName",T.name=r,getECData(b).eventData=T}i.add(b),b.updateTransform(),n.add(b),b.decomposeTransform()}}};function endTextLayout(e,t,n,i){var r,a,o=remRadian(n-e),s=i[0]>i[1],l="start"===t&&!s||"start"!==t&&s;return isRadianAroundZero(o-PI$6/2)?(a=l?"bottom":"top",r="center"):isRadianAroundZero(o-1.5*PI$6)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*PI$6&&o>PI$6/2?l?"left":"right":l?"right":"left"),{rotation:o,textAlign:r,textVerticalAlign:a}}function fixMinMaxLabelShow(e,t,n){if(!shouldShowAllLabels(e.axis)){var i=e.get(["axisLabel","showMinLabel"]),r=e.get(["axisLabel","showMaxLabel"]);n=n||[];var a=(t=t||[])[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],p=n[n.length-2];!1===i?(ignoreEl(a),ignoreEl(u)):isTwoLabelOverlapped(a,o)&&(i?(ignoreEl(o),ignoreEl(c)):(ignoreEl(a),ignoreEl(u))),!1===r?(ignoreEl(s),ignoreEl(h)):isTwoLabelOverlapped(l,s)&&(r?(ignoreEl(l),ignoreEl(p)):(ignoreEl(s),ignoreEl(h)))}}function ignoreEl(e){e&&(e.ignore=!0)}function isTwoLabelOverlapped(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var r=identity([]);return rotate(r,r,-e.rotation),n.applyTransform(mul$1([],r,e.getLocalTransform())),i.applyTransform(mul$1([],r,t.getLocalTransform())),n.intersect(i)}}function isNameLocationCenter(e){return"middle"===e||"center"===e}function createTicks(e,t,n,i,r){for(var a=[],o=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=n,t&&(applyTransform(o,o,t),applyTransform(s,s,t));var c=new Line({subPixelOptimize:!0,shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});c.anid=r+"_"+e[l].tickValue,a.push(c)}return a}function buildAxisMajorTicks(e,t,n,i){var r=n.axis,a=n.getModel("axisTick"),o=a.get("show");if("auto"===o&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick")),o&&!r.scale.isBlank()){for(var s=a.getModel("lineStyle"),l=i.tickDirection*a.get("length"),u=createTicks(r.getTicksCoords(),t.transform,l,defaults(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}}function buildAxisMinorTicks(e,t,n,i){var r=n.axis,a=n.getModel("minorTick");if(a.get("show")&&!r.scale.isBlank()){var o=r.getMinorTicksCoords();if(o.length)for(var s=a.getModel("lineStyle"),l=i*a.get("length"),u=defaults(s.getLineStyle(),defaults(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<o.length;c++)for(var h=createTicks(o[c],t.transform,l,u,"minorticks_"+c),p=0;p<h.length;p++)e.add(h[p])}}function buildAxisLabel(e,t,n,i){var r=n.axis;if(retrieve(i.axisLabelShow,n.get(["axisLabel","show"]))&&!r.scale.isBlank()){var a=n.getModel("axisLabel"),o=a.get("margin"),s=r.getViewLabels(),l=(retrieve(i.labelRotate,a.get("rotate"))||0)*PI$6/180,u=AxisBuilder.innerTextLayout(i.rotation,l,i.labelDirection),c=n.getCategories&&n.getCategories(!0),h=[],p=AxisBuilder.isLabelSilent(n),d=n.get("triggerEvent");return each(s,(function(s,l){var f="ordinal"===r.scale.type?r.scale.getRawIndex(s.tickValue):s.tickValue,g=s.formattedLabel,m=s.rawLabel,y=a;if(c&&c[f]){var v=c[f];isObject(v)&&v.textStyle&&(y=new Model(v.textStyle,a,n.ecModel))}var _=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),x=r.dataToCoord(f),S=new ZRText({x:x,y:i.labelOffset+i.labelDirection*o,rotation:u.rotation,silent:p,z2:10,style:createTextStyle(y,{text:g,align:y.getShallow("align",!0)||u.textAlign,verticalAlign:y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||u.textVerticalAlign,fill:"function"==typeof _?_("category"===r.type?m:"value"===r.type?f+"":f,l):_})});if(S.anid="label_"+f,d){var b=AxisBuilder.makeAxisEventDataBase(n);b.targetType="axisLabel",b.value=m,getECData(S).eventData=b}t.add(S),S.updateTransform(),h.push(S),e.add(S),S.decomposeTransform()})),h}}function collect(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return collectAxesInfo(n,e,t),n.seriesInvolved&&collectSeriesInfo(n,e),n}function collectAxesInfo(e,t,n){var i=t.getComponent("tooltip"),r=t.getComponent("axisPointer"),a=r.get("link",!0)||[],o=[];each(n.getCoordinateSystems(),(function(n){if(n.axisPointerEnabled){var s=makeKey(n.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var u=n.model.getModel("tooltip",i);if(each(n.getAxes(),curry(d,!1,null)),n.getTooltipAxes&&i&&u.get("show")){var c="axis"===u.get("trigger"),h="cross"===u.get(["axisPointer","type"]),p=n.getTooltipAxes(u.get(["axisPointer","axis"]));(c||h)&&each(p.baseAxes,curry(d,!h||"cross",c)),h&&each(p.otherAxes,curry(d,"cross",!1))}}function d(i,s,c){var h=c.model.getModel("axisPointer",r),p=h.get("show");if(p&&("auto"!==p||i||isHandleTrigger(h))){null==s&&(s=h.get("triggerTooltip"));var d=(h=i?makeAxisPointerModel(c,u,r,t,i,s):h).get("snap"),f=makeKey(c.model),g=s||d||"category"===c.type,m=e.axesInfo[f]={key:f,axis:c,coordSys:n,axisPointerModel:h,triggerTooltip:s,involveSeries:g,snap:d,useHandle:isHandleTrigger(h),seriesModels:[],linkGroup:null};l[f]=m,e.seriesInvolved=e.seriesInvolved||g;var y=getLinkGroupIndex(a,c);if(null!=y){var v=o[y]||(o[y]={axesInfo:{}});v.axesInfo[f]=m,v.mapper=a[y].mapper,m.linkGroup=v}}}}))}function makeAxisPointerModel(e,t,n,i,r,a){var o=t.getModel("axisPointer"),s={};each(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=clone(o.get(e))})),s.snap="category"!==e.type&&!!a,"cross"===o.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=o.get(["label","show"]);if(l.show=null==u||u,!a){var c=s.lineStyle=o.get("crossStyle");c&&defaults(l,c.textStyle)}}return e.model.getModel("axisPointer",new Model(s,n,i))}function collectSeriesInfo(e,t){t.eachSeries((function(t){var n=t.coordinateSystem,i=t.get(["tooltip","trigger"],!0),r=t.get(["tooltip","show"],!0);n&&"none"!==i&&!1!==i&&"item"!==i&&!1!==r&&!1!==t.get(["axisPointer","show"],!0)&&each(e.coordSysAxesInfo[makeKey(n.model)],(function(e){var i=e.axis;n.getAxis(i.dim)===i&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}))}function getLinkGroupIndex(e,t){for(var n=t.model,i=t.dim,r=0;r<e.length;r++){var a=e[r]||{};if(checkPropInLink(a[i+"AxisId"],n.id)||checkPropInLink(a[i+"AxisIndex"],n.componentIndex)||checkPropInLink(a[i+"AxisName"],n.name))return r}}function checkPropInLink(e,t){return"all"===e||isArray(e)&&indexOf(e,t)>=0||e===t}function fixValue(e){var t=getAxisInfo(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,r=n.option,a=n.get("status"),o=n.get("value");null!=o&&(o=i.parse(o));var s=isHandleTrigger(n);null==a&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),r.value=o,s&&(r.status=t.axis.scale.isBlank()?"hide":"show")}}function getAxisInfo(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[makeKey(e)]}function getAxisPointerModel(e){var t=getAxisInfo(e);return t&&t.axisPointerModel}function isHandleTrigger(e){return!!e.get(["handle","show"])}function makeKey(e){return e.type+"||"+e.id}var axisPointerClazz={},AxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(t,n,i,r){this.axisPointerClass&&fixValue(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,i,!0)},t.prototype.updateAxisPointer=function(e,t,n,i){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,i){var r=t.getAxisPointerClass(this.axisPointerClass);if(r){var a=getAxisPointerModel(e);a?(this._axisPointer||(this._axisPointer=new r)).render(e,a,n,i):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){axisPointerClazz[e]=t},t.getAxisPointerClass=function(e){return e&&axisPointerClazz[e]},t.type="axis",t}(ComponentView);function layout$1(e,t,n){n=n||{};var i=e.coordinateSystem,r=t.axis,a={},o=r.getAxesOnZeroOf()[0],s=r.position,l=o?"onZero":s,u=r.dim,c=i.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],p={left:0,right:1,top:0,bottom:1,onZero:2},d=t.get("offset")||0,f="x"===u?[h[2]-d,h[3]+d]:[h[0]-d,h[1]+d];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));f[p.onZero]=Math.max(Math.min(g,f[1]),f[0])}a.position=["y"===u?f[p[l]]:h[0],"x"===u?f[p[l]]:h[3]],a.rotation=Math.PI/2*("x"===u?0:1);a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],a.labelOffset=o?f[p[s]]-f[p.onZero]:0,t.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),retrieve(n.labelInside,t.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=t.get(["axisLabel","rotate"]);return a.labelRotate="top"===l?-m:m,a.z2=1,a}function isCartesian2DSeries(e){return"cartesian2d"===e.get("coordinateSystem")}function findAxisModels(e){var t={xAxisModel:null,yAxisModel:null};return each(t,(function(n,i){var r=i.replace(/Model$/,""),a=e.getReferringComponents(r,SINGLE_REFERRING).models[0];t[i]=a})),t}var inner$5=makeInner();function rectCoordAxisBuildSplitArea(e,t,n,i){var r=n.axis;if(!r.scale.isBlank()){var a=n.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=i.coordinateSystem.getRect(),u=r.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var c=s.length,h=inner$5(e).splitAreaColors,p=createHashMap(),d=0;if(h)for(var f=0;f<u.length;f++){var g=h.get(u[f].tickValue);if(null!=g){d=(g+(c-1)*f)%c;break}}var m=r.toGlobalCoord(u[0].coord),y=o.getAreaStyle();s=isArray(s)?s:[s];for(f=1;f<u.length;f++){var v=r.toGlobalCoord(u[f].coord),_=void 0,x=void 0,S=void 0,b=void 0;r.isHorizontal()?(_=m,x=l.y,S=v-_,b=l.height,m=_+S):(_=l.x,x=m,S=l.width,m=x+(b=v-x));var T=u[f-1].tickValue;null!=T&&p.set(T,d),t.add(new Rect({anid:null!=T?"area_"+T:null,shape:{x:_,y:x,width:S,height:b},style:defaults({fill:s[d]},y),autoBatch:!0,silent:!0})),d=(d+1)%c}inner$5(e).splitAreaColors=p}}}function rectCoordAxisHandleRemove(e){inner$5(e).splitAreaColors=null}var axisBuilderAttrs=["axisLine","axisTickLabel","axisName"],selfBuilderAttrs=["splitArea","splitLine","minorSplitLine"],CartesianAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return __extends(t,e),t.prototype.render=function(t,n,i,r){this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new Group,this.group.add(this._axisGroup),t.get("show")){var o=t.getCoordSysModel(),s=layout$1(o,t),l=new AxisBuilder(t,extend({handleAutoShown:function(e){for(var n=o.coordinateSystem.getCartesians(),i=0;i<n.length;i++){var r=n[i].getOtherAxis(t.axis).type;if("value"===r||"log"===r)return!0}return!1}},s));each(axisBuilderAttrs,l.add,l),this._axisGroup.add(l.getGroup()),each(selfBuilderAttrs,(function(e){t.get([e,"show"])&&axisElementBuilders[e](this,this._axisGroup,t,o)}),this),groupTransition(a,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)}},t.prototype.remove=function(){rectCoordAxisHandleRemove(this)},t.type="cartesianAxis",t}(AxisView),axisElementBuilders={splitLine:function(e,t,n,i){var r=n.axis;if(!r.scale.isBlank()){var a=n.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=isArray(s)?s:[s];for(var l=i.coordinateSystem.getRect(),u=r.isHorizontal(),c=0,h=r.getTicksCoords({tickModel:a}),p=[],d=[],f=o.getLineStyle(),g=0;g<h.length;g++){var m=r.toGlobalCoord(h[g].coord);u?(p[0]=m,p[1]=l.y,d[0]=m,d[1]=l.y+l.height):(p[0]=l.x,p[1]=m,d[0]=l.x+l.width,d[1]=m);var y=c++%s.length,v=h[g].tickValue;t.add(new Line({anid:null!=v?"line_"+h[g].tickValue:null,subPixelOptimize:!0,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:d[0],y2:d[1]},style:defaults({stroke:s[y]},f),silent:!0}))}}},minorSplitLine:function(e,t,n,i){var r=n.axis,a=n.getModel("minorSplitLine").getModel("lineStyle"),o=i.coordinateSystem.getRect(),s=r.isHorizontal(),l=r.getMinorTicksCoords();if(l.length)for(var u=[],c=[],h=a.getLineStyle(),p=0;p<l.length;p++)for(var d=0;d<l[p].length;d++){var f=r.toGlobalCoord(l[p][d].coord);s?(u[0]=f,u[1]=o.y,c[0]=f,c[1]=o.y+o.height):(u[0]=o.x,u[1]=f,c[0]=o.x+o.width,c[1]=f),t.add(new Line({anid:"minor_line_"+l[p][d].tickValue,subPixelOptimize:!0,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:h,silent:!0}))}},splitArea:function(e,t,n,i){rectCoordAxisBuildSplitArea(e,t,n,i)}},CartesianXAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="xAxis",t}(CartesianAxisView),CartesianYAxisView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=CartesianXAxisView.type,t}return __extends(t,e),t.type="yAxis",t}(CartesianAxisView);function prepareDataExtentOnAxis(e,t,n){e.eachSeries((function(e){if(isCartesian2DSeries(e)){var i=findAxisModels(e),r=i.xAxisModel,a=i.yAxisModel,o=r.axis,s=a.axis,l=o.scale.rawExtentInfo,u=s.scale.rawExtentInfo,c=e.getData();l&&l.frozen||u&&u.frozen||(n.push({seriesModel:e,xAxisModel:r,yAxisModel:a}),unionAxisExtentFromData(prepareAxisRecord(t,r).condExtent,c,o.dim),unionAxisExtentFromData(prepareAxisRecord(t,a).condExtent,c,s.dim))}}))}function calculateFilteredExtent(e,t){each(t,(function(t){var n=t.xAxisModel,i=t.yAxisModel,r=n.axis,a=i.axis,o=prepareAxisRecord(e,n),s=prepareAxisRecord(e,i);o.rawExtentInfo=ensureScaleRawExtentInfo(r.scale,n,o.condExtent),s.rawExtentInfo=ensureScaleRawExtentInfo(a.scale,i,s.condExtent),o.rawExtentResult=o.rawExtentInfo.calculate(),s.rawExtentResult=s.rawExtentInfo.calculate();var l,u,c=t.seriesModel.getData(),h={},p={};function d(e,t){var n=t.condExtent,i=t.rawExtentResult;"category"===e.type&&(n[0]<i.min||i.max<n[1])&&each(getDataDimensionsOnAxis(c,e.dim),(function(t){hasOwn(h,t)||(h[t]=!0,l=e)}))}function f(e,t){var n=t.rawExtentResult;"category"===e.type||n.minFixed&&n.maxFixed||each(getDataDimensionsOnAxis(c,e.dim),(function(e){hasOwn(h,e)||hasOwn(p,e)||(p[e]=!0,u=t)}))}d(r,o),d(a,s),f(r,o),f(a,s);var g=keys(h),m=keys(p),y=map(m,(function(){return initExtent()})),v=g.length,_=m.length;if(v&&_){var x=1===v?g[0]:null,S=1===_?m[0]:null,b=c.count();if(x&&S)for(var T=0;T<b;T++){var M=c.get(x,T);l.scale.isInExtentRange(M)&&unionExtent(y[0],c.get(S,T))}else for(T=0;T<b;T++)for(var A=0;A<v;A++){M=c.get(g[A],T);if(l.scale.isInExtentRange(M)){for(var I=0;I<_;I++)unionExtent(y[I],c.get(m[I],T));break}}each(y,(function(e,t){var n=m[t];c.setApproximateExtent(e,n);var i=u.tarExtent=u.tarExtent||initExtent();unionExtent(i,e[0]),unionExtent(i,e[1])}))}}))}function shrinkAxisExtent(e){e.each((function(e){var t=e.tarExtent;if(t){var n=e.rawExtentResult,i=e.rawExtentInfo;!n.minFixed&&t[0]>n.min&&i.modifyDataMinMax("min",t[0]),!n.maxFixed&&t[1]<n.max&&i.modifyDataMinMax("max",t[1])}}))}function prepareAxisRecord(e,t){return e.get(t.uid)||e.set(t.uid,{condExtent:initExtent()})}function initExtent(){return[1/0,-1/0]}function unionExtent(e,t){t<e[0]&&(e[0]=t),t>e[1]&&(e[1]=t)}ComponentView.registerClass(CartesianXAxisView),ComponentView.registerClass(CartesianYAxisView),registerProcessor(PRIORITY.PROCESSOR.FILTER+10,{getTargetSeries:function(e){var t=createHashMap();return e.eachSeries((function(e){isCartesian2DSeries(e)&&t.set(e.uid,e)})),t},overallReset:function(e,t){var n=[],i=createHashMap();prepareDataExtentOnAxis(e,i,n),calculateFilteredExtent(i,n),shrinkAxisExtent(i)}});var GridModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(ComponentModel),GridView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return __extends(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new Rect({shape:e.coordinateSystem.getRect(),style:defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(ComponentView);ComponentView.registerClass(GridView),ComponentModel.registerClass(GridModel),registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})),registerLayout(pointsLayout("line",!0)),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,dataSample("line"));var Cartesian=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 map(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),filter(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}(),cartesian2DDimensions=["x","y"];function canCalculateAffineTransform(e){return"interval"===e.type||"time"===e.type}var Cartesian2D=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=cartesian2DDimensions,t}return __extends(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(canCalculateAffineTransform(e)&&canCalculateAffineTransform(t)){var n=e.getExtent(),i=t.getExtent(),r=this.dataToPoint([n[0],i[0]]),a=this.dataToPoint([n[1],i[1]]),o=n[1]-n[0],s=i[1]-i[0];if(o&&s){var l=(a[0]-r[0])/o,u=(a[1]-r[1])/s,c=r[0]-n[0]*l,h=r[1]-i[0]*u,p=this._transform=[l,0,0,u,c,h];this._invTransform=invert([],p)}}},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.dataToPoint=function(e,t,n){n=n||[];var i=e[0],r=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return applyTransform(n,e,this._transform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.toGlobalCoord(a.dataToCoord(i)),n[1]=o.toGlobalCoord(o.dataToCoord(r)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),a=i.getExtent(),o=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),o),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t){if(t=t||[],this._invTransform)return applyTransform(t,e,this._invTransform);var n=this.getAxis("x"),i=this.getAxis("y");return t[0]=n.coordToData(n.toLocalCoord(e[0])),t[1]=i.coordToData(i.toLocalCoord(e[1])),t},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),n=Math.min(e[0],e[1]),i=Math.min(t[0],t[1]),r=Math.max(e[0],e[1])-n,a=Math.max(t[0],t[1])-i;return new BoundingRect(n,i,r,a)},t}(Cartesian),Axis2D=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.index=0,o.type=r||"value",o.position=a||"bottom",o}return __extends(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.setCategorySortInfo(e)},t}(Axis),Grid=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=cartesian2DDimensions,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;this._updateScale(e,this.model),each(n.x,(function(e){niceScaleExtent(e.scale,e.model)})),each(n.y,(function(e){niceScaleExtent(e.scale,e.model)}));var i={};each(n.x,(function(e){fixAxisOnZero(n,"y",e,i)})),each(n.y,(function(e){fixAxisOnZero(n,"x",e,i)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),r=!n&&e.get("containLabel"),a=getLayoutRect(i,{width:t.getWidth(),height:t.getHeight()});this._rect=a;var o=this._axesList;function s(){each(o,(function(e){var t=e.isHorizontal(),n=t?[0,a.width]:[0,a.height],i=e.inverse?1:0;e.setExtent(n[i],n[1-i]),updateAxisTransform(e,t?a.x:a.y)}))}s(),r&&(each(o,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=estimateLabelUnionRect(e);if(t){var n=e.isHorizontal()?"height":"width",i=e.model.get(["axisLabel","margin"]);a[n]-=t[n]+i,"top"===e.position?a.y+=t.height+i:"left"===e.position&&(a.x+=t.width+i)}}})),s()),each(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]}isObject(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===e||r[i].getAxis("y").index===t)return r[i]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,i=e.seriesModel,r=e.xAxisModel||i&&i.getReferringComponents("xAxis",SINGLE_REFERRING).models[0],a=e.yAxisModel||i&&i.getReferringComponents("yAxis",SINGLE_REFERRING).models[0],o=e.gridModel,s=this._coordsList;if(i)indexOf(s,t=i.coordinateSystem)<0&&(t=null);else if(r&&a)t=this.getCartesian(r.componentIndex,a.componentIndex);else if(r)n=this.getAxis("x",r.componentIndex);else if(a)n=this.getAxis("y",a.componentIndex);else if(o){o.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 i=this,r=this,a={left:!1,right:!1,top:!1,bottom:!1},o={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,i){if(isAxisUsedInTheGrid(n,e)){var l=n.get("position");"x"===t?"top"!==l&&"bottom"!==l&&(l=a.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=a.left?"right":"left"),a[l]=!0;var u=new Axis2D(t,createScaleByModel(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=r,u.index=i,r._axesList.push(u),o[t][i]=u,s[t]++}}}this._axesMap=o,each(o.x,(function(t,n){each(o.y,(function(r,a){var o="x"+n+"y"+a,s=new Cartesian2D(o);s.master=i,s.model=e,i._coordsMap[o]=s,i._coordsList.push(s),s.addAxis(t),s.addAxis(r)}))}))},e.prototype._updateScale=function(e,t){function n(e,t){each(getDataDimensionsOnAxis(e,t.dim),(function(n){t.scale.unionExtentFromData(e,n)}))}each(this._axesList,(function(e){if(e.scale.setExtent(1/0,-1/0),"category"===e.type){var t=e.model.get("categorySortInfo");e.scale.setCategorySortInfo(t)}})),e.eachSeries((function(e){if(isCartesian2DSeries(e)){var i=findAxisModels(e),r=i.xAxisModel,a=i.yAxisModel;if(!isAxisUsedInTheGrid(r,t)||!isAxisUsedInTheGrid(a,t))return;var o=this.getCartesian(r.componentIndex,a.componentIndex),s=e.getData(),l=o.getAxis("x"),u=o.getAxis("y");"list"===s.type&&(n(s,l),n(s,u))}}),this)},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return each(this.getCartesians(),(function(i){var r=null!=e&&"auto"!==e?i.getAxis(e):i.getBaseAxis(),a=i.getOtherAxis(r);indexOf(t,r)<0&&t.push(r),indexOf(n,a)<0&&n.push(a)})),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var i=[];return t.eachComponent("grid",(function(r,a){var o=new e(r,t,n);o.name="grid_"+a,o.resize(r,n,!0),r.coordinateSystem=o,i.push(o)})),t.eachSeries((function(e){if(isCartesian2DSeries(e)){var t=findAxisModels(e),n=t.xAxisModel,i=t.yAxisModel,r=n.getCoordSysModel();0;var a=r.coordinateSystem;e.coordinateSystem=a.getCartesian(n.componentIndex,i.componentIndex)}})),i},e.dimensions=cartesian2DDimensions,e}();function isAxisUsedInTheGrid(e,t){return e.getCoordSysModel()===t}function fixAxisOnZero(e,t,n,i){n.getAxesOnZeroOf=function(){return r?[r]:[]};var r,a=e[t],o=n.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)canOnZeroToAxis(a[l])&&(r=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&canOnZeroToAxis(a[u])&&!i[c(a[u])]){r=a[u];break}r&&(i[c(r)]=!0)}function c(e){return e.dim+"_"+e.index}}function canOnZeroToAxis(e){return e&&"category"!==e.type&&"time"!==e.type&&ifAxisCrossZero(e)}function updateAxisTransform(e,t){var n=e.getExtent(),i=n[0]+n[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return i-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return i-e+t}}CoordinateSystemManager.register("cartesian2d",Grid);var BaseBarSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e){var t=this.coordinateSystem;if(t){var n=t.dataToPoint(t.clampData(e)),i=this.getData(),r=i.getLayout("offset"),a=i.getLayout("size");return n[t.getBaseAxis().isHorizontal()?0:1]+=r+a/2,n}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(SeriesModel);SeriesModel.registerClass(BaseBarSeriesModel);var BarSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),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=inheritDefaultOption(BaseBarSeriesModel.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}(BaseBarSeriesModel);SeriesModel.registerClass(BarSeriesModel);var SausageShape=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},SausagePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SausageShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=.5*(a-r),s=r+o,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=Math.cos(l),p=Math.sin(l),d=Math.cos(u),f=Math.sin(u);(c?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(h*r+n,p*r+i),e.arc(h*s+n,p*s+i,o,-Math.PI+l,l,!c)),e.arc(n,i,a,l,u,!c),e.moveTo(d*a+n,f*a+i),e.arc(d*s+n,f*s+i,o,u-2*Math.PI,u-Math.PI,!c),0!==r&&(e.arc(n,i,r,u,l,c),e.moveTo(h*r+n,f*r+i)),e.closePath()},t}(Path),BAR_BORDER_WIDTH_QUERY=["itemStyle","borderWidth"],BAR_BORDER_RADIUS_QUERY=["itemStyle","borderRadius"],_eventPos=[0,0],mathMax$6=Math.max,mathMin$6=Math.min;function getClipArea(e,t){var n=e.getArea&&e.getArea();if(isCoordinateSystemType(e,"cartesian2d")){var i=e.getBaseAxis();if("category"!==i.type||!i.onBand){var r=t.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}var BarView=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){this._model=e,this.removeOnRenderedListener(n),this._updateDrawMode(e);var r=e.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,i))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._incrementalRenderLarge(e,t)},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,i){var r,a=this,o=this.group,s=e.getData(),l=this._data,u=e.coordinateSystem,c=u.getBaseAxis();"cartesian2d"===u.type?r=c.isHorizontal():"polar"===u.type&&(r="angle"===c.dim);var h=e.isAnimationEnabled()?e:null,p=c.model,d=e.get("realtimeSort");if(d&&s.count()){if(this._isFirstFrame)return this._initSort(s,r,c,n),void(this._isFirstFrame=!1);this._onRendered=function(){a._updateSort(s,(function(e){var t=s.getItemGraphicEl(e);if(t){var n=t.shape;return(r?n.y+n.height:n.x+n.width)||0}return 0}),c,n)},n.getZr().on("rendered",this._onRendered)}var f=e.get("clip",!0)||d,g=getClipArea(u,s);o.removeClipPath();var m=e.get("roundCap",!0),y=e.get("showBackground",!0),v=e.getModel("backgroundStyle"),_=v.get("borderRadius")||0,x=[],S=this._backgroundEls,b=i&&i.isInitSort,T=i&&"changeAxisOrder"===i.type;function M(e){var t=getLayout[u.type](s,e),n=createBackgroundEl(u,r,t);return n.useStyle(v.getItemStyle()),"cartesian2d"===u.type&&n.setShape("r",_),x[e]=n,n}s.diff(l).add((function(t){var n=s.getItemModel(t),i=getLayout[u.type](s,t,n);if(y&&M(t),s.hasValue(t)){var a=!1;f&&(a=clip[u.type](g,i));var l=elementCreator[u.type](e,s,t,i,r,h,c.model,!1,m);updateStyle(l,s,t,n,i,e,r,"polar"===u.type),b?l.attr({shape:i}):d?updateRealtimeAnimation(e,p,h,l,i,t,r,!1,!1):initProps(l,{shape:i},e,t),s.setItemGraphicEl(t,l),o.add(l),l.ignore=a}})).update((function(t,n){var i=s.getItemModel(t),a=getLayout[u.type](s,t,i);if(y){var A=void 0;0===S.length?A=M(n):((A=S[n]).useStyle(v.getItemStyle()),"cartesian2d"===u.type&&A.setShape("r",_),x[t]=A);var I=getLayout[u.type](s,t);updateProps(A,{shape:createBackgroundShape(r,I,u)},h,t)}var C=l.getItemGraphicEl(n);if(!s.hasValue(t))return o.remove(C),void(C=null);var w=!1;f&&(w=clip[u.type](g,a))&&o.remove(C),C||(C=elementCreator[u.type](e,s,t,a,r,h,c.model,!!C,m)),T||updateStyle(C,s,t,i,a,e,r,"polar"===u.type),b?C.attr({shape:a}):d?updateRealtimeAnimation(e,p,h,C,a,t,r,!0,T):updateProps(C,{shape:a},e,t,null),s.setItemGraphicEl(t,C),C.ignore=w,o.add(C)})).remove((function(t){var n=l.getItemGraphicEl(t);n&&removeElementWithFadeOut(n,e,t)})).execute();var A=this._backgroundGroup||(this._backgroundGroup=new Group);A.removeAll();for(var I=0;I<x.length;++I)A.add(x[I]);o.add(A),this._backgroundEls=x,this._data=s},t.prototype._renderLarge=function(e,t,n){this._clear(),createLarge(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),createLarge(t,this.group,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)?createClipPath(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._dataSort=function(e,t){var n=[];e.each((function(e){n.push({mappedValue:t(e),ordinalNumber:e,beforeSortIndex:null})})),n.sort((function(e,t){return t.mappedValue-e.mappedValue}));for(var i=0;i<n.length;++i)n[n[i].ordinalNumber].beforeSortIndex=i;return map(n,(function(e){return{ordinalNumber:e.ordinalNumber,beforeSortIndex:e.beforeSortIndex}}))},t.prototype._isDataOrderChanged=function(e,t,n){if((n?n.length:0)!==e.count())return!0;for(var i=Number.MAX_VALUE,r=0;r<n.length;++r){var a=t(n[r].ordinalNumber);if(a>i)return!0;i=a}return!1},t.prototype._updateSort=function(e,t,n,i){var r=n.scale.getCategorySortInfo();if(this._isDataOrderChanged(e,t,r))for(var a=this._dataSort(e,t),o=n.scale.getExtent(),s=o[0];s<o[1];++s)if(!r[s]||r[s].ordinalNumber!==a[s].ordinalNumber){this.removeOnRenderedListener(i);var l={type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:a};i.dispatchAction(l);break}},t.prototype._initSort=function(e,t,n,i){var r={type:"changeAxisOrder",componentType:n.dim+"Axis",isInitSort:!0,axisId:n.index,sortInfo:this._dataSort(e,(function(n){return parseFloat(e.get(t?"y":"x",n))||0}))};i.dispatchAction(r)},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){removeElementWithFadeOut(t,e,getECData(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}(ChartView),clip={cartesian2d:function(e,t){var n=t.width<0?-1:1,i=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var r=mathMax$6(t.x,e.x),a=mathMin$6(t.x+t.width,e.x+e.width),o=mathMax$6(t.y,e.y),s=mathMin$6(t.y+t.height,e.y+e.height);t.x=r,t.y=o,t.width=a-r,t.height=s-o;var l=t.width<0||t.height<0;return n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),l},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}var r=mathMin$6(t.r,e.r),a=mathMax$6(t.r0,e.r0);t.r=r,t.r0=a;var o=r-a<0;if(n<0){i=t.r;t.r=t.r0,t.r0=i}return o}},elementCreator={cartesian2d:function(e,t,n,i,r,a,o,s,l){var u=new Rect({shape:extend({},i),z2:1});(u.__dataIndex=n,u.name="item",a)&&(u.shape[r?"height":"width"]=0);return u},polar:function(e,t,n,i,r,a,o,s,l){var u=i.startAngle<i.endAngle,c=new(!r&&l?SausagePath:Sector)({shape:defaults({clockwise:u},i),z2:1});if(c.name="item",a){var h=r?"r":"endAngle",p={};c.shape[h]=r?0:i.startAngle,p[h]=i[h],(s?updateProps:initProps)(c,{shape:p},a)}return c}};function updateRealtimeAnimation(e,t,n,i,r,a,o,s,l){if(n||t){var u=void 0,c=void 0;o?(c={x:r.x,width:r.width},u={y:r.y,height:r.height}):(c={y:r.y,height:r.height},u={x:r.x,width:r.width}),l||(s?updateProps:initProps)(i,{shape:u},e,a,null),(s?updateProps:initProps)(i,{shape:c},t,a)}}var getLayout={cartesian2d:function(e,t,n){var i=e.getItemLayout(t),r=n?getLineWidth(n,i):0,a=i.width>0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*r/2,y:i.y+o*r/2,width:i.width-a*r,height:i.height-o*r}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle}}};function isZeroOnPolar(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function updateStyle(e,t,n,i,r,a,o,s){var l=t.getItemVisual(n,"style");s||e.setShape("r",i.get(BAR_BORDER_RADIUS_QUERY)||0),e.useStyle(l);var u=i.getShallow("cursor");if(u&&e.attr("cursor",u),!s){var c=o?r.height>0?"bottom":"top":r.width>0?"left":"right",h=getLabelStatesModels(i);setLabelStyle(e,h,{labelFetcher:a,labelDataIndex:n,defaultText:getDefaultLabel(a.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:c}),setLabelValueAnimation(e.getTextContent(),h,a.getRawValue(n),(function(e){return getDefaultInterpolatedLabel(t,e)}))}var p=i.getModel(["emphasis"]);enableHoverEmphasis(e,p.get("focus"),p.get("blurScope")),setStatesStylesFromModel(e,i),isZeroOnPolar(r)&&(e.style.fill="none",e.style.stroke="none",each(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}function getLineWidth(e,t){var n=e.get(BAR_BORDER_WIDTH_QUERY)||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),r=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,r)}var LagePathShape=function(){},LargePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new LagePathShape},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.__startPoint,r=this.__baseDimIdx,a=0;a<n.length;a+=2)i[r]=n[a+r],e.moveTo(i[0],i[1]),e.lineTo(n[a],n[a+1])},t}(Path);function createLarge(e,t,n){var i=e.getData(),r=[],a=i.getLayout("valueAxisHorizontal")?1:0;r[1-a]=i.getLayout("valueAxisStart");var o=i.getLayout("largeDataIndices"),s=i.getLayout("barWidth"),l=e.getModel("backgroundStyle");if(e.get("showBackground",!0)){var u=i.getLayout("largeBackgroundPoints"),c=[];c[1-a]=i.getLayout("backgroundStart");var h=new LargePath({shape:{points:u},incremental:!!n,silent:!0,z2:0});h.__startPoint=c,h.__baseDimIdx=a,h.__largeDataIndices=o,h.__barWidth=s,setLargeBackgroundStyle(h,l,i),t.add(h)}var p=new LargePath({shape:{points:i.getLayout("largePoints")},incremental:!!n});p.__startPoint=r,p.__baseDimIdx=a,p.__largeDataIndices=o,p.__barWidth=s,t.add(p),setLargeStyle(p,e,i),getECData(p).seriesIndex=e.seriesIndex,e.get("silent")||(p.on("mousedown",largePathUpdateDataIndex),p.on("mousemove",largePathUpdateDataIndex))}var largePathUpdateDataIndex=throttle((function(e){var t=largePathFindDataIndex(this,e.offsetX,e.offsetY);getECData(this).dataIndex=t>=0?t:null}),30,!1);function largePathFindDataIndex(e,t,n){var i=e.__baseDimIdx,r=1-i,a=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[r];_eventPos[0]=t,_eventPos[1]=n;for(var u=_eventPos[i],c=_eventPos[1-i],h=u-s,p=u+s,d=0,f=a.length/2;d<f;d++){var g=2*d,m=a[g+i],y=a[g+r];if(m>=h&&m<=p&&(l<=y?c>=l&&c<=y:c>=y&&c<=l))return o[d]}return-1}function setLargeStyle(e,t,n){var i=n.getVisual("style");e.useStyle(extend({},i)),e.style.fill=null,e.style.stroke=i.fill,e.style.lineWidth=n.getLayout("barWidth")}function setLargeBackgroundStyle(e,t,n){var i=t.get("borderColor")||t.get("color"),r=t.getItemStyle();e.useStyle(r),e.style.fill=null,e.style.stroke=i,e.style.lineWidth=n.getLayout("barWidth")}function createBackgroundShape(e,t,n){if(isCoordinateSystemType(n,"cartesian2d")){var i=t,r=n.getArea();return{x:e?i.x:r.x,y:e?r.y:i.y,width:e?i.width:r.width,height:e?r.height:i.height}}var a=t;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:e?r.r0:a.r0,r:e?r.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:2*Math.PI}}function createBackgroundEl(e,t,n){return new("polar"===e.type?Sector:Rect)({shape:createBackgroundShape(t,n,e),silent:!0,z2:0})}function createListSimply(e,t,n){t=isArray(t)&&{coordDimensions:t}||extend({},t);var i=e.getSource(),r=createDimensions(i,t),a=new List(r,e);return a.initData(i,n),a}ChartView.registerClass(BarView),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)}))})),registerLayout(PRIORITY.VISUAL.LAYOUT,curry(layout,"bar")),registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,largeLayout),registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}}),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,dataSample("bar"));var LegendVisualProvider=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}(),PieSeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useColorPaletteOnData=!0,t}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),r=[];return n.each(n.mapDimension("value"),(function(e){r.push(e)})),i.percent=getPercentWithPrecision(r,t,n.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},t.prototype._defaultLabelLine=function(e){defaultEmphasis(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={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,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},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(SeriesModel);SeriesModel.registerClass(PieSeriesModel);var RADIAN=Math.PI/180;function adjustSingleSide(e,t,n,i,r,a,o,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 p=e[h].label.x-u;e[h].linePoints[1][0]+=p,e[h].label.x=u}shiftLayoutOnY(e,l,l+o)&&function(e){for(var a={list:[],maxY:0},o={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?o:a,c=Math.abs(l.label.y-n);if(c>u.maxY){var h=l.label.x-t-l.len2*r,p=i+l.len,f=h<p?Math.sqrt(c*c/(1-h*h/p/p)):p;u.rB=f,u.maxY=c}u.list.push(l)}d(a),d(o)}(e)}function d(e){for(var a=e.rB,o=a*a,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=i+l.len,h=c*c,p=Math.sqrt((1-Math.abs(u*u/o))*h);l.label.x=t+(p+l.len2)*r}}}function avoidOverlap(e,t,n,i,r,a,o,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,p=0;p<e.length;p++){var d=e[p].label;isPositionCenter(e[p])||(d.x<t?(c=Math.min(c,d.x),l.push(e[p])):(h=Math.max(h,d.x),u.push(e[p])))}adjustSingleSide(u,t,n,i,1,r,a,o,s,h),adjustSingleSide(l,t,n,i,-1,r,a,o,s,c);for(p=0;p<e.length;p++){var f=e[p];d=f.label;if(!isPositionCenter(f)){var g=f.linePoints;if(g){var m="edge"===f.labelAlignTo,y=f.rect.width,v=void 0;(v=m?d.x<t?g[2][0]-f.labelDistance-o-f.edgeDistance:o+r-f.edgeDistance-g[2][0]-f.labelDistance:d.x<t?d.x-o-f.bleedMargin:o+r-d.x-f.bleedMargin)<f.rect.width&&(f.label.style.width=v,"edge"===f.labelAlignTo&&(y=v));var _=g[1][0]-g[2][0];m?d.x<t?g[2][0]=o+f.edgeDistance+y+f.labelDistance:g[2][0]=o+r-f.edgeDistance-y-f.labelDistance:(d.x<t?g[2][0]=d.x+f.labelDistance:g[2][0]=d.x-f.labelDistance,g[1][0]=g[2][0]+_),g[1][1]=g[2][1]=d.y}}}}function isPositionCenter(e){return"center"===e.position}function pieLabelLayout(e){var t,n,i=e.getData(),r=[],a=!1,o=(e.get("minShowLabelAngle")||0)*RADIAN,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,c=s.x,h=s.y,p=s.height;function d(e){e.ignore=!0}i.each((function(e){var s=i.getItemGraphicEl(e),h=s.shape,p=s.getTextContent(),f=s.getTextGuideLine(),g=i.getItemModel(e),m=g.getModel("label"),y=m.get("position")||g.get(["emphasis","label","position"]),v=m.get("distanceToLabelLine"),_=m.get("alignTo"),x=parsePercent$2(m.get("edgeDistance"),u),S=m.get("bleedMargin"),b=g.getModel("labelLine"),T=b.get("length");T=parsePercent$2(T,u);var M=b.get("length2");if(M=parsePercent$2(M,u),Math.abs(h.endAngle-h.startAngle)<o)return each(p.states,d),void(p.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}(p)){var A,I,C,w,P=(h.startAngle+h.endAngle)/2,L=Math.cos(P),E=Math.sin(P);t=h.cx,n=h.cy;var D,R="inside"===y||"inner"===y;if("center"===y)A=h.cx,I=h.cy,w="center";else{var O=(R?(h.r+h.r0)/2*L:h.r*L)+t,k=(R?(h.r+h.r0)/2*E:h.r*E)+n;if(A=O+3*L,I=k+3*E,!R){var N=O+L*(T+l-h.r),B=k+E*(T+l-h.r),V=N+(L<0?-1:1)*M;A="edge"===_?L<0?c+x:c+u-x:V+(L<0?-v:v),I=B,C=[[O,k],[N,B],[V,B]]}w=R?"center":"edge"===_?L>0?"right":"left":L>0?"left":"right"}var F=m.get("rotate");if(D="number"==typeof F?F*(Math.PI/180):F?L<0?-P+Math.PI:-P:0,a=!!D,p.x=A,p.y=I,p.rotation=D,p.setStyle({verticalAlign:"middle"}),R){p.setStyle({align:w});var $=p.states.select;$&&($.x+=p.x,$.y+=p.y)}else{var z=p.getBoundingRect().clone();z.applyTransform(p.getComputedTransform());var G=(p.style.margin||0)+2.1;z.y-=G/2,z.height+=G,r.push({label:p,labelLine:f,position:y,len:T,len2:M,minTurnAngle:b.get("minTurnAngle"),maxSurfaceAngle:b.get("maxSurfaceAngle"),surfaceNormal:new Point(L,E),linePoints:C,textAlign:w,labelDistance:v,labelAlignTo:_,edgeDistance:x,bleedMargin:S,rect:z})}s.setTextConfig({inside:R})}})),!a&&e.get("avoidLabelOverlap")&&avoidOverlap(r,t,n,l,u,p,c,h);for(var f=0;f<r.length;f++){var g=r[f],m=g.label,y=g.labelLine,v=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),v&&(each(m.states,d),m.ignore=!0);var _=m.states.select;_&&(_.x+=m.x,_.y+=m.y)}if(y){var x=g.linePoints;v||!x?(each(y.states,d),y.ignore=!0):(limitTurnAngle(x,g.minTurnAngle),limitSurfaceAngle(x,g.surfaceNormal,g.maxSurfaceAngle),y.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new Point(x[0][0],x[0][1])})}}}function getSectorCornerRadius(e,t){var n=e.get("borderRadius");return null==n?null:(isArray(n)||(n=[n,n]),{innerCornerRadius:parsePercent(n[0],t.r0),cornerRadius:parsePercent(n[1],t.r)})}var PiePiece=function(e){function t(t,n,i){var r=e.call(this)||this;r.z2=2;var a=new Polyline,o=new ZRText;return r.setTextGuideLine(a),r.setTextContent(o),r.updateData(t,n,i,!0),r}return __extends(t,e),t.prototype.updateData=function(e,t,n,i){var r=this,a=e.hostModel,o=e.getItemModel(t),s=o.getModel("emphasis"),l=e.getItemLayout(t),u=extend(getSectorCornerRadius(o.getModel("itemStyle"),l)||{},l);i?(r.setShape(u),"scale"===a.getShallow("animationType")?(r.shape.r=l.r0,initProps(r,{shape:{r:l.r}},a,t)):null!=n?(r.setShape({startAngle:n,endAngle:n}),initProps(r,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},a,t)):(r.shape.endAngle=l.startAngle,updateProps(r,{shape:{endAngle:l.endAngle}},a,t))):updateProps(r,{shape:u},a,t);r.useStyle(e.getItemVisual(t,"style")),setStatesStylesFromModel(r,o);var c=(l.startAngle+l.endAngle)/2,h=a.get("selectedOffset"),p=Math.cos(c)*h,d=Math.sin(c)*h,f=o.getShallow("cursor");f&&r.attr("cursor",f),this._updateLabel(a,e,t),r.ensureState("emphasis").shape=__assign({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},getSectorCornerRadius(s.getModel("itemStyle"),l)),extend(r.ensureState("select"),{x:p,y:d,shape:getSectorCornerRadius(o.getModel(["select","itemStyle"]),l)}),extend(r.ensureState("blur"),{shape:getSectorCornerRadius(o.getModel(["blur","itemStyle"]),l)});var g=r.getTextGuideLine(),m=r.getTextContent();extend(g.ensureState("select"),{x:p,y:d}),extend(m.ensureState("select"),{x:p,y:d}),enableHoverEmphasis(this,s.get("focus"),s.get("blurScope"))},t.prototype._updateLabel=function(e,t,n){var i=this,r=t.getItemModel(n),a=r.getModel("labelLine"),o=t.getItemVisual(n,"style"),s=o&&o.fill,l=o&&o.opacity;setLabelStyle(i,getLabelStatesModels(r),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var u=i.getTextContent();i.setTextConfig({position:null,rotation:null}),u.attr({z2:10}),setLabelLineStyle(this,getLabelLineStatesModels(r),{stroke:s,opacity:retrieve3(a.get(["lineStyle","opacity"]),l,1)})},t}(Sector),PieView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return __extends(t,e),t.prototype.init=function(){var e=new Group;this._sectorGroup=e},t.prototype.render=function(e,t,n,i){var r,a=e.getData(),o=this._data,s=this.group;if(!o&&a.count()>0){for(var l=a.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<a.count();++u)l=a.getItemLayout(u);l&&(r=l.startAngle)}a.diff(o).add((function(e){var t=new PiePiece(a,e,r);a.setItemGraphicEl(e,t),s.add(t)})).update((function(e,t){var n=o.getItemGraphicEl(t);n.updateData(a,e,r),n.off("click"),s.add(n),a.setItemGraphicEl(e,n)})).remove((function(t){removeElementWithFadeOut(o.getItemGraphicEl(t),e,t)})).execute(),pieLabelLayout(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=a)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,r=e[1]-n.cy,a=Math.sqrt(i*i+r*r);return a<=n.r&&a>=n.r0}},t.type="pie",t}(ChartView);ChartView.registerClass(PieView);var PI2$8=2*Math.PI,RADIAN$1=Math.PI/180;function getViewRect(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function pieLayout(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),i=t.mapDimension("value"),r=getViewRect(e,n),a=e.get("center"),o=e.get("radius");isArray(o)||(o=[0,o]),isArray(a)||(a=[a,a]);var s=parsePercent$2(r.width,n.getWidth()),l=parsePercent$2(r.height,n.getHeight()),u=Math.min(s,l),c=parsePercent$2(a[0],s)+r.x,h=parsePercent$2(a[1],l)+r.y,p=parsePercent$2(o[0],u/2),d=parsePercent$2(o[1],u/2),f=-e.get("startAngle")*RADIAN$1,g=e.get("minAngle")*RADIAN$1,m=0;t.each(i,(function(e){!isNaN(e)&&m++}));var y=t.getSum(i),v=Math.PI/(y||m)*2,_=e.get("clockwise"),x=e.get("roseType"),S=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var T=PI2$8,M=0,A=f,I=_?1:-1;if(t.setLayout({viewRect:r,r:d}),t.each(i,(function(e,n){var i;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:c,cy:h,r0:p,r:x?NaN:d});else{(i="area"!==x?0===y&&S?v:e*v:PI2$8/m)<g?(i=g,T-=g):M+=e;var r=A+I*i;t.setItemLayout(n,{angle:i,startAngle:A,endAngle:r,clockwise:_,cx:c,cy:h,r0:p,r:x?linearMap(e,b,[p,d]):d}),A=r}})),T<PI2$8&&m)if(T<=.001){var C=PI2$8/m;t.each(i,(function(e,n){if(!isNaN(e)){var i=t.getItemLayout(n);i.angle=C,i.startAngle=f+I*n*C,i.endAngle=f+I*(n+1)*C}}))}else v=T/M,A=f,t.each(i,(function(e,n){if(!isNaN(e)){var i=t.getItemLayout(n),r=i.angle===g?g:e*v;i.startAngle=A,i.endAngle=A+I*r,A+=I*r}}))}))}function dataFilter(e){return{seriesType:e,reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var i=e.getData();i.filterSelf((function(e){for(var t=i.getName(e),r=0;r<n.length;r++)if(!n[r].isSelected(t))return!1;return!0}))}}}}createLegacyDataSelectAction("pie",registerAction),registerLayout(curry(pieLayout,"pie")),registerProcessor(dataFilter("pie"));var ScatterSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),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.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}}},t}(SeriesModel);SeriesModel.registerClass(ScatterSeriesModel);var BOOST_SIZE_THRESHOLD=4,LargeSymbolPathShape=function(){},LargeSymbolPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new LargeSymbolPathShape},t.prototype.buildPath=function(e,t){var n=t.points,i=t.size,r=this.symbolProxy,a=r.shape,o=e.getContext?e.getContext():e;if(o&&i[0]<BOOST_SIZE_THRESHOLD)this._ctx=o;else{this._ctx=null;for(var s=0;s<n.length;){var l=n[s++],u=n[s++];isNaN(l)||isNaN(u)||(this.softClipShape&&!this.softClipShape.contain(l,u)||(a.x=l-i[0]/2,a.y=u-i[1]/2,a.width=i[0],a.height=i[1],r.buildPath(e,a,!0)))}}},t.prototype.afterBrush=function(){var e=this.shape,t=e.points,n=e.size,i=this._ctx;if(i)for(var r=0;r<t.length;){var a=t[r++],o=t[r++];isNaN(a)||isNaN(o)||(this.softClipShape&&!this.softClipShape.contain(a,o)||i.fillRect(a-n[0]/2,o-n[1]/2,n[0],n[1]))}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,i=n.points,r=n.size,a=Math.max(r[0],4),o=Math.max(r[1],4),s=i.length/2-1;s>=0;s--){var l=2*s,u=i[l]-a/2,c=i[l+1]-o/2;if(e>=u&&t>=c&&e<=u+a&&t<=c+o)return s}return-1},t}(Path),LargeSymbolDraw=function(){function e(){this.group=new Group}return e.prototype.isPersistent=function(){return!this._incremental},e.prototype.updateData=function(e,t){this.group.removeAll();var n=new LargeSymbolPath({rectHover:!0,cursor:"default"});n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,!1,t),this.group.add(n),this._incremental=null},e.prototype.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("points");this.group.eachChild((function(e){if(null!=e.startIndex){var n=2*(e.endIndex-e.startIndex),i=4*e.startIndex*2;t=new Float32Array(t.buffer,i,n)}e.setShape("points",t)}))}},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new IncrementalDisplayble({silent:!0})),this.group.add(this._incremental)):this._incremental=null},e.prototype.incrementalUpdate=function(e,t,n){var i;this._incremental?(i=new LargeSymbolPath,this._incremental.addDisplayable(i,!0)):((i=new LargeSymbolPath({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(i)),i.setShape({points:t.getLayout("points")}),this._setCommon(i,t,!!this._incremental,n)},e.prototype._setCommon=function(e,t,n,i){var r=t.hostModel;i=i||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=i.clipShape||null,e.symbolProxy=createSymbol(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<BOOST_SIZE_THRESHOLD;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("style"),l=s&&s.fill;if(l&&e.setColor(l),!n){var u=getECData(e);u.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){u.dataIndex=null;var n=e.findDataIndex(t.offsetX,t.offsetY);n>=0&&(u.dataIndex=n+(e.startIndex||0))}))}},e.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},e.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},e}(),ScatterView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),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 i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=pointsLayout("").reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get("clip",!0)?n:null},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new LargeSymbolDraw:new SymbolDraw,this._isLargeDraw=i,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}(ChartView);ChartView.registerClass(ScatterView),registerLayout(pointsLayout("scatter"));var IndicatorAxis=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.type="value",r.angle=0,r.name="",r}return __extends(t,e),t}(Axis),Radar=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=map(e.getIndicatorModels(),(function(e,t){var n="indicator_"+t,i=new IndicatorAxis(n,new IntervalScale);return i.name=e.get("name"),i.model=e,e.axis=i,this.dimensions.push(n),i}),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,i=Math.sqrt(t*t+n*n);t/=i,n/=i;for(var r,a=Math.atan2(-n,t),o=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(a-u.angle);c<o&&(r=u,s=l,o=c)}return[s,+(r&&r.coordToData(i))]},e.prototype.resize=function(e,t){var n=e.get("center"),i=t.getWidth(),r=t.getHeight(),a=Math.min(i,r)/2;this.cx=parsePercent$2(n[0],i),this.cy=parsePercent$2(n[1],r),this.startAngle=e.get("startAngle")*Math.PI/180;var o=e.get("radius");"string"!=typeof o&&"number"!=typeof o||(o=[0,o]),this.r0=parsePercent$2(o[0],a),this.r=parsePercent$2(o[1],a),each(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,i=this._model;each(n,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,r){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===i){var a=t.getData();each(n,(function(e){e.scale.unionExtentFromData(a,a.mapDimension(e.dim))}))}}),this);var r=i.get("splitNumber");function a(e){var t=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),n=e/t;return 2===n?n=5:n*=2,n*t}each(n,(function(e,t){var n=getScaleExtent(e.scale,e.model).extent;niceScaleExtent(e.scale,e.model);var i=e.model,o=e.scale,s=parseAxisModelMinMax(o,i.get("min",!0)),l=parseAxisModelMinMax(o,i.get("max",!0)),u=o.getInterval();if(null!=s&&null!=l)o.setExtent(+s,+l),o.setInterval((l-s)/r);else if(null!=s){var c=void 0;do{c=s+u*r,o.setExtent(+s,c),o.setInterval(u),u=a(u)}while(c<n[1]&&isFinite(c)&&isFinite(n[1]))}else if(null!=l){var h=void 0;do{h=l-u*r,o.setExtent(h,+l),o.setInterval(u),u=a(u)}while(h>n[0]&&isFinite(h)&&isFinite(n[0]))}else{o.getTicks().length-1>r&&(u=a(u));h=round$1((c=Math.ceil(n[1]/u)*u)-u*r);o.setExtent(h,c),o.setInterval(u)}}))},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 i=[];return t.eachComponent("radar",(function(r){var a=new e(r,t,n);i.push(a),r.coordinateSystem=a})),t.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},e.dimensions=[],e}();CoordinateSystemManager.register("radar",Radar);var valueAxisDefault=axisDefault.value;function defaultsShow(e,t){return defaults({show:t},e)}var RadarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),n=this.get("scale"),i=this.get("axisLine"),r=this.get("axisTick"),a=this.get("axisLabel"),o=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),u=this.get("axisNameGap"),c=this.get("triggerEvent"),h=map(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 p=o;null!=h.color&&(p=defaults({color:h.color},o));var d=merge(clone(h),{boundaryGap:e,splitNumber:t,scale:n,axisLine:i,axisTick:r,axisLabel:a,name:h.text,nameLocation:"end",nameGap:u,nameTextStyle:p,triggerEvent:c},!1);if(s||(d.name=""),"string"==typeof l){var f=d.name;d.name=l.replace("{value}",null!=f?f:"")}else"function"==typeof l&&(d.name=l(d.name,d));var g=new Model(d,null,this.ecModel);return mixin(g,AxisModelCommonMixin.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={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:merge({lineStyle:{color:"#bbb"}},valueAxisDefault.axisLine),axisLabel:defaultsShow(valueAxisDefault.axisLabel,!1),axisTick:defaultsShow(valueAxisDefault.axisTick,!1),splitLine:defaultsShow(valueAxisDefault.splitLine,!0),splitArea:defaultsShow(valueAxisDefault.splitArea,!0),indicator:[]},t}(ComponentModel);ComponentModel.registerClass(RadarModel);var axisBuilderAttrs$1=["axisLine","axisTickLabel","axisName"],RadarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(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;each(map(t.getIndicatorAxes(),(function(e){return new AxisBuilder(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){each(axisBuilderAttrs$1,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 i=e.get("shape"),r=e.getModel("splitLine"),a=e.getModel("splitArea"),o=r.getModel("lineStyle"),s=a.getModel("areaStyle"),l=r.get("show"),u=a.get("show"),c=o.get("color"),h=s.get("color"),p=isArray(c)?c:[c],d=isArray(h)?h:[h],f=[],g=[];if("circle"===i)for(var m=n[0].getTicksCoords(),y=t.cx,v=t.cy,_=0;_<m.length;_++){if(l)f[C(f,p,_)].push(new Circle({shape:{cx:y,cy:v,r:m[_].coord}}));if(u&&_<m.length-1)g[C(g,d,_)].push(new Ring({shape:{cx:y,cy:v,r0:m[_].coord,r:m[_+1].coord}}))}else{var x,S=map(n,(function(e,n){var i=e.getTicksCoords();return x=null==x?i.length-1:Math.min(i.length-1,x),map(i,(function(e){return t.coordToPoint(e.coord,n)}))})),b=[];for(_=0;_<=x;_++){for(var T=[],M=0;M<n.length;M++)T.push(S[M][_]);if(T[0]&&T.push(T[0].slice()),l)f[C(f,p,_)].push(new Polyline({shape:{points:T}}));if(u&&b)g[C(g,d,_-1)].push(new Polygon({shape:{points:T.concat(b)}}));b=T.slice().reverse()}}var A=o.getLineStyle(),I=s.getAreaStyle();each(g,(function(e,t){this.group.add(mergePath$1(e,{style:defaults({stroke:"none",fill:d[t%d.length]},I),silent:!0}))}),this),each(f,(function(e,t){this.group.add(mergePath$1(e,{style:defaults({fill:"none",stroke:p[t%p.length]},A),silent:!0}))}),this)}function C(e,t,n){var i=n%t.length;return e[i]=e[i]||[],i}},t.type="radar",t}(ComponentView);ComponentView.registerClass(RadarView);var RadarSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n.hasSymbolVisual=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this))},t.prototype.getInitialData=function(e,t){return createListSimply(this,{generateCoord:"indicator_",generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.coordinateSystem.getIndicatorAxes(),a=this.getData().getName(e),o=""===a?this.name:a,s=retrieveVisualColorForTooltipMarker(this,e);return createTooltipMarkup("section",{header:o,sortBlocks:!0,blocks:map(r,(function(t){var n=i.get(i.mapDimension(t.dim),e);return createTooltipMarkup("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,i=t.getValues(map(n.dimensions,(function(e){return t.mapDimension(e)})),e),r=0,a=i.length;r<a;r++)if(!isNaN(i[r])){var o=n.getIndicatorAxes();return n.coordToPoint(o[r].dataToCoord(i[r]),r)}},t.type="series.radar",t.dependencies=["radar"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4},t}(SeriesModel);function normalizeSymbolSize(e){return isArray(e)||(e=[+e,+e]),e}SeriesModel.registerClass(RadarSeriesModel);var RadarView$1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.coordinateSystem,r=this.group,a=e.getData(),o=this._data;function s(e,t){var n=e.getItemVisual(t,"symbol")||"circle";if("none"!==n){var i=normalizeSymbolSize(e.getItemVisual(t,"symbolSize")),r=createSymbol(n,-1,-1,2,2),a=e.getItemVisual(t,"symbolRotate")||0;return r.attr({style:{strokeNoScale:!0},z2:100,scaleX:i[0]/2,scaleY:i[1]/2,rotation:a*Math.PI/180||0}),r}}function l(t,n,i,r,a,o){i.removeAll();for(var l=0;l<n.length-1;l++){var u=s(r,a);u&&(u.__dimIdx=l,t[l]?(u.setPosition(t[l]),graphic[o?"initProps":"updateProps"](u,{x:n[l][0],y:n[l][1]},e,a)):u.setPosition(n[l]),i.add(u))}}function u(e){return map(e,(function(e){return[i.cx,i.cy]}))}a.diff(o).add((function(t){var n=a.getItemLayout(t);if(n){var i=new Polygon,r=new Polyline,o={shape:{points:n}};i.shape.points=u(n),r.shape.points=u(n),initProps(i,o,e,t),initProps(r,o,e,t);var s=new Group,c=new Group;s.add(r),s.add(i),s.add(c),l(r.shape.points,n,c,a,t,!0),a.setItemGraphicEl(t,s)}})).update((function(t,n){var i=o.getItemGraphicEl(n),r=i.childAt(0),s=i.childAt(1),u=i.childAt(2),c={shape:{points:a.getItemLayout(t)}};c.shape.points&&(l(r.shape.points,c.shape.points,u,a,t,!1),updateProps(r,c,e),updateProps(s,c,e),a.setItemGraphicEl(t,i))})).remove((function(e){r.remove(o.getItemGraphicEl(e))})).execute(),a.eachItemGraphicEl((function(e,t){var n=a.getItemModel(t),i=e.childAt(0),o=e.childAt(1),s=e.childAt(2),l=a.getItemVisual(t,"style"),u=l.fill;r.add(e),i.useStyle(defaults(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:u})),setStatesStylesFromModel(i,n,"lineStyle"),setStatesStylesFromModel(o,n,"areaStyle");var c=n.getModel("areaStyle"),h=c.isEmpty()&&c.parentModel.isEmpty();o.ignore=h,each(["emphasis","select","blur"],(function(e){var t=n.getModel([e,"areaStyle"]),i=t.isEmpty()&&t.parentModel.isEmpty();o.ensureState(e).ignore=i&&h})),o.useStyle(defaults(c.getAreaStyle(),{fill:u,opacity:.7,decal:l.decal}));var p=n.getModel("emphasis"),d=p.getModel("itemStyle").getItemStyle();s.eachChild((function(e){if(e instanceof ZRImage){var i=e.style;e.useStyle(extend({image:i.image,x:i.x,y:i.y,width:i.width,height:i.height},l))}else e.useStyle(l),e.setColor(u);e.ensureState("emphasis").style=clone(d);var r=a.get(a.dimensions[e.__dimIdx],t);(null==r||isNaN(r))&&(r=""),setLabelStyle(e,getLabelStatesModels(n),{labelFetcher:a.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:r,inheritColor:u,defaultOpacity:l.opacity})})),enableHoverEmphasis(e,p.get("focus"),p.get("blurScope"))})),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type="radar",t}(ChartView);function radarLayout(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),n=[],i=e.coordinateSystem;if(i){var r=i.getIndicatorAxes();each(r,(function(e,a){t.each(t.mapDimension(r[a].dim),(function(e,t){n[t]=n[t]||[];var r=i.dataToPoint(e,a);n[t][a]=isValidPoint(r)?r:getValueMissingPoint(i)}))})),t.each((function(e){var r=find(n[e],(function(e){return isValidPoint(e)}))||getValueMissingPoint(i);n[e].push(r.slice()),t.setItemLayout(e,n[e])}))}}))}function isValidPoint(e){return!isNaN(e[0])&&!isNaN(e[1])}function getValueMissingPoint(e){return[e.cx,e.cy]}function radarBackwardCompat(e){var t=e.polar;if(t){isArray(t)||(t=[t]);var n=[];each(t,(function(t,i){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],isArray(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):n.push(t)})),e.polar=n}each(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))}ChartView.registerClass(RadarView$1),registerLayout(radarLayout),registerProcessor(dataFilter("radar")),registerPreprocessor(radarBackwardCompat);for(var geoCoord=[126,25],points$1=[[[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]]],i=0;i<points$1.length;i++)for(var k=0;k<points$1[i].length;k++)points$1[i][k][0]/=10.5,points$1[i][k][1]/=-14,points$1[i][k][0]+=geoCoord[0],points$1[i][k][1]+=geoCoord[1];function fixNanhai(e,t){"china"===e&&t.push(new Region("南海诸岛",map(points$1,(function(e){return{type:"polygon",exterior:e}})),geoCoord))}var coordsOffsetMap={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};function fixTextCoords(e,t){if("china"===e){var n=coordsOffsetMap[t.name];if(n){var i=t.center;i[0]+=n[0]/10.5,i[1]+=-n[1]/14}}}var geoCoordMap={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};function fixGeoCoords(e,t){if("world"===e){var n=geoCoordMap[t.name];if(n){var i=t.center;i[0]=n[0],i[1]=n[1]}}}var points$2=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function fixDiaoyuIsland(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:points$2[0]})}var inner$6=makeInner(),geoJSONLoader={load:function(e,t,n){var i=inner$6(t).parsed;if(i)return i;var r,a=t.specialAreas||{},o=t.geoJSON;try{r=o?parseGeoJSON(o,n):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return fixNanhai(e,r),each(r,(function(t){var n=t.name;fixTextCoords(e,t),fixGeoCoords(e,t),fixDiaoyuIsland(e,t);var i=a[n];i&&t.transformTo(i.left,i.top,i.width,i.height)})),inner$6(t).parsed={regions:r,boundingRect:getBoundingRect$1(r)}}};function getBoundingRect$1(e){for(var t,n=0;n<e.length;n++){var i=e[n].getBoundingRect();(t=t||i.clone()).union(i)}return t}var inner$7=makeInner(),geoSVGLoader={load:function(e,t){var n=inner$7(t).originRoot;if(n)return{root:n,boundingRect:inner$7(t).boundingRect};var i=buildGraphic(t);return inner$7(t).originRoot=i.root,inner$7(t).boundingRect=i.boundingRect,i},makeGraphic:function(e,t,n){var i=inner$7(t),r=i.rootMap||(i.rootMap=createHashMap()),a=r.get(n);if(a)return a;var o=i.originRoot,s=i.boundingRect;return i.originRootHostKey?a=buildGraphic(t,s).root:(i.originRootHostKey=n,a=o),r.set(n,a)},removeGraphic:function(e,t,n){var i=inner$7(t),r=i.rootMap;r&&r.removeKey(n),n===i.originRootHostKey&&(i.originRootHostKey=null)}};function buildGraphic(e,t){var n,i,r=e.svgXML;try{assert(null!=(i=(n=r&&parseSVG(r,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root))}catch(e){throw new Error("Invalid svg format\n"+e.message)}var a=n.width,o=n.height,s=n.viewBoxRect;if(t||(t=null==a||null==o?i.getBoundingRect():new BoundingRect(0,0,0,0),null!=a&&(t.width=a),null!=o&&(t.height=o)),s){var l=makeViewBoxTransform(s,t.width,t.height),u=i;(i=new Group).add(u),u.scaleX=u.scaleY=l.scale,u.x=l.x,u.y=l.y}return i.setClipPath(new Rect({shape:t.plain()})),{root:i,boundingRect:t}}var loaders={geoJSON:geoJSONLoader,svg:geoSVGLoader},geoSourceManager={load:function(e,t,n){var i,r=[],a=createHashMap(),o=createHashMap();return each(retrieveMap(e),(function(s){var l=loaders[s.type].load(e,s,n);each(l.regions,(function(e){var n=e.name;t&&t.hasOwnProperty(n)&&(e=e.cloneShallow(n=t[n])),r.push(e),a.set(n,e),o.set(n,e.center)}));var u=l.boundingRect;u&&(i?i.union(u):i=u.clone())})),{regions:r,regionsMap:a,nameCoordMap:o,boundingRect:i||new BoundingRect(0,0,0,0)}},makeGraphic:function(e,t){var n=retrieveMap(e),i=[];return each(n,(function(n){var r=loaders[n.type].makeGraphic;r&&i.push(r(e,n,t))})),i},removeGraphic:function(e,t){each(retrieveMap(e),(function(n){var i=loaders[n.type].makeGraphic;i&&i(e,n,t)}))}};function mapNotExistsError(e){0}function retrieveMap(e){var t=mapDataStorage.retrieveMap(e)||[];return t}var MapSeries=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,i=n.getRegion(t);return i&&n.dataToPoint(i.center)}},n}return __extends(t,e),t.prototype.getInitialData=function(e){for(var t=createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)}),n=createHashMap(),i=[],r=0,a=t.count();r<a;r++){var o=t.getName(r);n.set(o,!0)}return each(geoSourceManager.load(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,(function(e){var t=e.name;n.get(t)||i.push(t)})),t.appendValues([],i),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 i=this.getData(),r=this.getRawValue(e),a=i.getName(e),o=this.seriesGroup,s=[],l=0;l<o.length;l++){var u=o[l].originalData.indexOfName(a),c=i.mapDimension("value");isNaN(o[l].originalData.get(c,u))||s.push(o[l].name)}return createTooltipMarkup("section",{header:s.join(", "),noHeader:!s.length,blocks:[createTooltipMarkup("nameValue",{name:a,value:r})]})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,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}(SeriesModel);SeriesModel.registerClass(MapSeries);var ATTR="\0_ec_interaction_mutex";function take(e,t,n){getStore(e)[t]=n}function release(e,t,n){var i=getStore(e);i[t]===n&&(i[t]=null)}function isTaken(e,t){return!!getStore(e)[t]}function getStore(e){return e[ATTR]||(e[ATTR]={})}registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){}));var RoamController=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var i=bind(n._mousedownHandler,n),r=bind(n._mousemoveHandler,n),a=bind(n._mouseupHandler,n),o=bind(n._mousewheelHandler,n),s=bind(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=defaults(clone(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(t.on("mousedown",i),t.on("mousemove",r),t.on("mouseup",a)),!0!==e&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",o),t.on("pinch",s))},n.disable=function(){t.off("mousedown",i),t.off("mousemove",r),t.off("mouseup",a),t.off("mousewheel",o),t.off("pinch",s)},n}return __extends(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(!(isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable)){var t=e.offsetX,n=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,n)&&(this._x=t,this._y=n,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(this._dragging&&isAvailableBehavior("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!isTaken(this._zr,"globalPan")){var t=e.offsetX,n=e.offsetY,i=this._x,r=this._y,a=t-i,o=n-r;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&stop(e.event),trigger(this,"pan","moveOnMouseMove",e,{dx:a,dy:o,oldX:i,oldY:r,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=isAvailableBehavior("zoomOnMouseWheel",e,this._opt),n=isAvailableBehavior("moveOnMouseWheel",e,this._opt),i=e.wheelDelta,r=Math.abs(i),a=e.offsetX,o=e.offsetY;if(0!==i&&(t||n)){if(t){var s=r>3?1.4:r>1?1.2:1.1;checkPointerAndTrigger(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(i);checkPointerAndTrigger(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:o,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){isTaken(this._zr,"globalPan")||checkPointerAndTrigger(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(Eventful);function checkPointerAndTrigger(e,t,n,i,r){e.pointerChecker&&e.pointerChecker(i,r.originX,r.originY)&&(stop(i.event),trigger(e,t,n,i,r))}function trigger(e,t,n,i,r){r.isAvailableBehavior=bind(isAvailableBehavior,null,n,i),e.trigger(t,r)}function isAvailableBehavior(e,t,n){var i=n[e];return!e||i&&(!isString(i)||t.event[i+"Key"])}function updateViewOnPan(e,t,n){var i=e.target;i.x+=t,i.y+=n,i.dirty()}function updateViewOnZoom(e,t,n,i){var r=e.target,a=e.zoomLimit,o=e.zoom=e.zoom||1;if(o*=t,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/e.zoom;e.zoom=o,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var IRRELEVANT_EXCLUDES={axisPointer:1,tooltip:1,brush:1};function onIrrelevantElement(e,t,n){var i=t.getComponentByElement(e.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!IRRELEVANT_EXCLUDES.hasOwnProperty(i.mainType)&&r&&r.model!==n}function getFixedItemStyle(e){var t=e.getItemStyle(),n=e.get("areaColor");return null!=n&&(t.fill=n),t}var MapDraw=function(){function e(e){var t=new Group;this.uid=getUID("ec_map_draw"),this._controller=new RoamController(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Group),t.add(this._backgroundGroup=new Group)}return e.prototype.draw=function(e,t,n,i,r){var a="geo"===e.mainType,o=e.getData&&e.getData();a&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u,c=this._regionsGroup,h=this.group,p=s.getTransformInfo(),d=!c.childAt(0)||r;if(d)h.transform=p.roamTransform,h.decomposeTransform(),h.dirty();else{var f=new Transformable;f.transform=p.roamTransform,f.decomposeTransform();var g={scaleX:f.scaleX,scaleY:f.scaleY,x:f.x,y:f.y};l=f.scaleX,u=f.scaleY,updateProps(h,g,e)}c.removeAll();var m=createHashMap(),y=o&&o.getVisual("visualMeta")&&o.getVisual("visualMeta").length>0;each(s.regions,(function(t){var i=m.get(t.name)||m.set(t.name,new Group),r=new CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(r);var s,f=e.getRegionModel(t.name)||e,g=f.getModel("itemStyle"),v=f.getModel("emphasis"),_=v.getModel("itemStyle"),x=f.getModel(["blur","itemStyle"]),S=f.getModel(["select","itemStyle"]),b=getFixedItemStyle(g),T=getFixedItemStyle(_),M=getFixedItemStyle(x),A=getFixedItemStyle(S);if(o){s=o.indexOfName(t.name);var I=o.getItemVisual(s,"style"),C=o.getItemVisual(s,"decal");y&&I.fill&&(b.fill=I.fill),C&&(b.decal=createOrUpdatePatternFromDecal(C,n))}var w=p.rawScaleX,P=p.rawScaleY,L=p.rawX,E=p.rawY,D=function(e){return[e[0]*w+L,e[1]*P+E]};each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],n=0;n<e.exterior.length;++n)t.push(D(e.exterior[n]));r.shape.paths.push(new Polygon({segmentIgnoreThreshold:1,shape:{points:t}}));for(n=0;n<(e.interiors?e.interiors.length:0);++n){for(var i=e.interiors[n],a=[],o=0;o<i.length;++o)a.push(D(i[o]));r.shape.paths.push(new Polygon({segmentIgnoreThreshold:1,shape:{points:a}}))}}})),r.setStyle(b),r.style.strokeNoScale=!0,r.culling=!0,r.ensureState("emphasis").style=T,r.ensureState("blur").style=M,r.ensureState("select").style=A;for(var R=!1,O=0;O<DISPLAY_STATES.length;O++){var k=DISPLAY_STATES[O];if(f.get("normal"===k?["label","show"]:[k,"label","show"])){R=!0;break}}var N=o&&isNaN(o.get(o.mapDimension("value"),s)),B=o&&o.getItemLayout(s);if(a||N&&R||B&&B.showLabel){var V=a?t.name:s,F=void 0;(!o||s>=0)&&(F=e);var $=D(t.center),z=new ZRText({x:$[0],y:$[1],scaleX:1/h.scaleX,scaleY:1/h.scaleY,z2:10,silent:!0});setLabelStyle(z,getLabelStatesModels(f),{labelFetcher:F,labelDataIndex:V,defaultText:t.name},{normal:{align:"center",verticalAlign:"middle"}}),r.setTextContent(z),r.setTextConfig({local:!0}),r.disableLabelAnimation=!0,d||updateProps(z,{scaleX:1/l,scaleY:1/u},e)}if(o)o.setItemGraphicEl(s,i);else{var G=e.getRegionModel(t.name);getECData(r).eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:G&&G.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),enableHoverEmphasis(i,v.get("focus"),v.get("blurScope")),c.add(i)})),this._updateController(e,t,n),this._updateMapSelectHandler(e,c,n,i)},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&geoSourceManager.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost=null},e.prototype._updateBackground=function(e){var t=e.map;this._mapName!==t&&each(geoSourceManager.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},e.prototype._updateController=function(e,t,n){var i=e.coordinateSystem,r=this._controller,a=this._controllerHost;a.zoomLimit=e.get("scaleLimit"),a.zoom=i.getZoom(),r.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}r.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,updateViewOnPan(a,e.dx,e.dy),n.dispatchAction(extend(s(),{dx:e.dx,dy:e.dy}))}),this),r.off("zoom").on("zoom",(function(e){this._mouseDownFlag=!1,updateViewOnZoom(a,e.scale,e.originX,e.originY),n.dispatchAction(extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY}));var t=this.group;this._regionsGroup.traverse((function(e){var n=e.getTextContent();n&&(n.scaleX=1/t.scaleX,n.scaleY=1/t.scaleY,n.markRedraw())}))}),this),r.setPointerChecker((function(t,r,a){return i.getViewRectAfterRoam().contain(r,a)&&!onIrrelevantElement(t,n,e)}))},e.prototype._updateMapSelectHandler=function(e,t,n,i){var r=this;t.off("mousedown"),e.get("selectedMode")&&(t.on("mousedown",(function(){r._mouseDownFlag=!0})),t.on("click",(function(e){r._mouseDownFlag&&(r._mouseDownFlag=!1)})))},e}(),MapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var r=this.group;if(r.removeAll(),!e.getHostGeoModel()){if(i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===e.id)(a=this._mapDraw)&&r.add(a.group);else if(e.needsDrawMap){var a=this._mapDraw||new MapDraw(n);r.add(a.group),a.draw(e,t,n,this,i),this._mapDraw=a}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 i=e.originalData,r=this.group;i.each(i.mapDimension("value"),(function(t,n){if(!isNaN(t)){var a=i.getItemLayout(n);if(a&&a.point){var o=a.point,s=a.offset,l=new Circle({style:{fill:e.getData().getVisual("style").fill},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),c=i.getName(n),h=u.indexOfName(c),p=i.getItemModel(n),d=p.getModel("label"),f=u.getItemGraphicEl(h);setLabelStyle(l,getLabelStatesModels(p),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(h,n)}}}),l.disableLabelAnimation=!0,d.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(e){l.useState(e)}}r.add(l)}}}))},t.type="map",t}(ChartView);function updateCenterAndZoom(e,t,n){var i=e.getZoom(),r=e.getCenter(),a=t.zoom,o=e.dataToPoint(r);if(null!=t.dx&&null!=t.dy&&(o[0]-=t.dx,o[1]-=t.dy,e.setCenter(e.pointToData(o))),null!=a){if(n){var s=n.min||0,l=n.max||1/0;a=Math.max(Math.min(i*a,l),s)/i}e.scaleX*=a,e.scaleY*=a;var u=(t.originX-e.x)*(a-1),c=(t.originY-e.y)*(a-1);e.x-=u,e.y-=c,e.updateTransform(),e.setCenter(e.pointToData(o)),e.setZoom(a*i)}return{center:e.getCenter(),zoom:e.getZoom()}}ChartView.registerClass(MapView),registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){var i=t.coordinateSystem;if("geo"===i.type){var r=updateCenterAndZoom(i,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom),"series"===n&&each(t.seriesGroup,(function(e){e.setCenter(r.center),e.setZoom(r.zoom)}))}}))}));var v2ApplyTransform=applyTransform,View=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new Transformable,n._rawTransformable=new Transformable,n.name=t,n}return __extends(t,e),t.prototype.setBoundingRect=function(e,t,n,i){return this._rect=new BoundingRect(e,t,n,i),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,i){this.transformTo(e,t,n,i),this._viewRect=new BoundingRect(e,t,n,i)},t.prototype.transformTo=function(e,t,n,i){var r=this.getBoundingRect(),a=this._rawTransformable;a.transform=r.calculateTransform(new BoundingRect(e,t,n,i)),a.decomposeTransform(),this._updateTransform()},t.prototype.setCenter=function(e){e&&(this._center=e,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(),i=this.getCenter(),r=this.getZoom();i=applyTransform([],i,e),n=applyTransform([],n,e),t.originX=i[0],t.originY=i[1],t.x=n[0]-i[0],t.y=n[1]-i[1],t.scaleX=t.scaleY=r,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),copy$1(this.transform||(this.transform=[]),t.transform||create$1()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],invert(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?slice(e):create$1(),rawScaleX:t.scaleX,rawScaleY:t.scaleY,rawX:t.x,rawY:t.y}},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 i=t?this._rawTransform:this.transform;return n=n||[],i?v2ApplyTransform(n,e,i):copy(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?v2ApplyTransform([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var i=getCoordSys(t);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var i=getCoordSys(t);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(Transformable);function getCoordSys(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var Geo=function(e){function t(t,n,i,r){var a=e.call(this,t)||this;a.dimensions=["lng","lat"],a.type="geo",a.map=n;var o=geoSourceManager.load(n,i);return a._nameCoordMap=o.nameCoordMap,a._regionsMap=o.regionsMap,a._invertLongitute=null==r||r,a.regions=o.regions,a._rect=o.boundingRect,a}return __extends(t,e),t.prototype.containCoord=function(e){for(var t=this.regions,n=0;n<t.length;n++)if(t[n].contain(e))return!0;return!1},t.prototype.transformTo=function(e,t,n,i){var r=this.getBoundingRect(),a=this._invertLongitute;r=r.clone(),a&&(r.y=-r.y-r.height);var o=this._rawTransformable;o.transform=r.calculateTransform(new BoundingRect(e,t,n,i)),o.decomposeTransform(),a&&(o.scaleY=-o.scaleY),o.updateTransform(),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++)if(t[n].contain(e))return t[n]},t.prototype.addGeoCoord=function(e,t){this._nameCoordMap.set(e,t)},t.prototype.getGeoCoord=function(e){return this._nameCoordMap.get(e)},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.dataToPoint=function(e,t,n){if("string"==typeof e&&(e=this.getGeoCoord(e)),e)return View.prototype.dataToPoint.call(this,e,t,n)},t.prototype.convertToPixel=function(e,t,n){var i=getCoordSys$1(t);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var i=getCoordSys$1(t);return i===this?i.pointToData(n):null},t}(View);function getCoordSys$1(e){var t=e.geoModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",SINGLE_REFERRING).models[0]||{}).coordinateSystem:null}function resizeGeo(e,t){var n=e.get("boundingCoords");if(null!=n){var i=n[0],r=n[1];isNaN(i[0])||isNaN(i[1])||isNaN(r[0])||isNaN(r[1])||this.setBoundingRect(i[0],i[1],r[0]-i[0],r[1]-i[1])}var a,o,s,l=this.getBoundingRect(),u=e.get("layoutCenter"),c=e.get("layoutSize"),h=t.getWidth(),p=t.getHeight(),d=l.width/l.height*this.aspectScale,f=!1;if(u&&c&&(a=[parsePercent$2(u[0],h),parsePercent$2(u[1],p)],o=parsePercent$2(c,Math.min(h,p)),isNaN(a[0])||isNaN(a[1])||isNaN(o)||(f=!0)),f)s={},d>1?(s.width=o,s.height=o/d):(s.height=o,s.width=o*d),s.y=a[1]-s.height/2,s.x=a[0]-s.width/2;else{var g=e.getBoxLayoutParams();g.aspect=d,s=getLayoutRect(g,{width:h,height:p})}this.setViewRect(s.x,s.y,s.width,s.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function setGeoCoords(e,t){each(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}mixin(Geo,View);var GeoCreator=function(){function e(){this.dimensions=Geo.prototype.dimensions}return e.prototype.create=function(e,t){var n=[];e.eachComponent("geo",(function(e,i){var r=e.get("map"),a=e.get("aspectScale"),o=!0,s=mapDataStorage.retrieveMap(r);s&&s[0]&&"svg"===s[0].type?(null==a&&(a=1),o=!1):null==a&&(a=.75);var l=new Geo(r+i,r,e.get("nameMap"),o);l.aspectScale=a,l.zoomLimit=e.get("scaleLimit"),n.push(l),e.coordinateSystem=l,l.model=e,l.resize=resizeGeo,l.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)}})),each(i,(function(e,i){var r=map(e,(function(e){return e.get("nameMap")})),a=new Geo(i,i,mergeAll(r));a.zoomLimit=retrieve.apply(null,map(e,(function(e){return e.get("scaleLimit")}))),n.push(a),a.resize=resizeGeo,a.aspectScale=e[0].get("aspectScale"),a.resize(e[0],t),each(e,(function(e){e.coordinateSystem=a,setGeoCoords(a,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n){for(var i=(e||[]).slice(),r=createHashMap(),a=0;a<i.length;a++)r.set(i[a].name,i[a]);return each(geoSourceManager.load(t,n).regions,(function(e){var t=e.name;!r.get(t)&&i.push({name:t})})),i},e}(),geoCreator=new GeoCreator;function mapSymbolLayout(e){var t={};e.eachSeriesByType("map",(function(n){var i=n.getMapType();if(!n.getHostGeoModel()&&!t[i]){var r={};each(n.seriesGroup,(function(t){var n=t.coordinateSystem,i=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&i.each(i.mapDimension("value"),(function(e,t){var a=i.getName(t),o=n.getRegion(a);if(o&&!isNaN(e)){var s=r[a]||0,l=n.dataToPoint(o.center);r[a]=s+1,i.setItemLayout(t,{point:l,offset:s})}}))}));var a=n.getData();a.each((function(e){var t=a.getName(e),n=a.getItemLayout(e)||{};n.showLabel=!r[t],a.setItemLayout(e,n)})),t[i]=!0}}))}function dataStatistics(e,t){var n={};return each(e,(function(e){e.each(e.mapDimension("value"),(function(t,i){var r="ec-"+e.getName(i);n[r]=n[r]||[],isNaN(t)||n[r].push(t)}))})),e[0].map(e[0].mapDimension("value"),(function(i,r){for(var a,o="ec-"+e[0].getName(r),s=0,l=1/0,u=-1/0,c=n[o].length,h=0;h<c;h++)l=Math.min(l,n[o][h]),u=Math.max(u,n[o][h]),s+=n[o][h];return a="min"===t?l:"max"===t?u:"average"===t?s/c:s,0===c?NaN:a}))}function mapDataStatistic(e){var t={};e.eachSeriesByType("map",(function(e){var n=e.getHostGeoModel(),i=n?"o"+n.id:"i"+e.getMapType();(t[i]=t[i]||[]).push(e)})),each(t,(function(e,t){for(var n=dataStatistics(map(e,(function(e){return e.getData()})),e[0].get("mapValueCalculation")),i=0;i<e.length;i++)e[i].originalData=e[i].getData();for(i=0;i<e.length;i++)e[i].seriesGroup=e,e[i].needsDrawMap=0===i&&!e[i].getHostGeoModel(),e[i].setData(n.cloneShallow()),e[i].mainSeries=e[0]}))}registerCoordinateSystem("geo",geoCreator),registerLayout(mapSymbolLayout),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,mapDataStatistic),createLegacyDataSelectAction("map",registerAction);var inner$8=makeInner();function linkList(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,linkAll(t,n,e),each(n,(function(n){each(t.TRANSFERABLE_METHODS,(function(t){n.wrapMethod(t,curry(transferInjection,e))}))})),t.wrapMethod("cloneShallow",curry(cloneShallowInjection,e)),each(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,curry(changeInjection,e))})),assert(n[t.dataType]===t)}function transferInjection(e,t){if(isMainData(this)){var n=extend({},inner$8(this).datas);n[this.dataType]=t,linkAll(t,n,e)}else linkSingle(t,this.dataType,inner$8(this).mainData,e);return t}function changeInjection(e,t){return e.struct&&e.struct.update(),t}function cloneShallowInjection(e,t){return each(inner$8(t).datas,(function(n,i){n!==t&&linkSingle(n.cloneShallow(),i,t,e)})),t}function getLinkedData(e){var t=inner$8(this).mainData;return null==e||null==t?t:inner$8(t).datas[e]}function getLinkedDataAll(){var e=inner$8(this).mainData;return null==e?[{data:e}]:map(keys(inner$8(e).datas),(function(t){return{type:t,data:inner$8(e).datas[t]}}))}function isMainData(e){return inner$8(e).mainData===e}function linkAll(e,t,n){inner$8(e).datas={},each(t,(function(t,i){linkSingle(t,i,e,n)}))}function linkSingle(e,t,n,i){inner$8(n).datas[t]=e,inner$8(e).mainData=n,e.dataType=t,i.struct&&(e[i.structAttr]=i.struct,i.struct[i.datasAttr[t]]=e),e.getLinkedData=getLinkedData,e.getLinkedDataAll=getLinkedDataAll}var TreeNode=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){"function"==typeof e&&(n=t,t=e,e=null),isString(e=e||{})&&(e={order:e});var i,r=e.order||"preorder",a=this[e.attr||"children"];"preorder"===r&&(i=t.call(n,this));for(var o=0;!i&&o<a.length;o++)a[o].eachNode(e,t,n);"postorder"===r&&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 i=this.children[n];i.updateDepthAndHeight(e+1),i.height>t&&(t=i.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t<i;t++){var r=n[t].getNodeById(e);if(r)return r}},e.prototype.contains=function(e){if(e===this)return!0;for(var t=0,n=this.children,i=n.length;t<i;t++){var r=n[t].contains(e);if(r)return r}},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.get(t.getDimension(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.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}(),Tree=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,i=t.length;n<i;n++)t[n].dataIndex=-1;for(n=0,i=e.count();n<i;n++)t[e.getRawIndex(n)].dataIndex=n},e.prototype.clearLayouts=function(){this.data.clearItemLayouts()},e.createTree=function(t,n,i){var r=new e(n),a=[],o=1;!function e(t,n){var i=t.value;o=Math.max(o,isArray(i)?i.length:1),a.push(t);var s=new TreeNode(convertOptionIdName(t.name,""),r);n?addChild(s,n):r.root=s,r._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(t),r.root.updateDepthAndHeight(0);var s=createDimensions(a,{coordDimensions:["value"],dimensionsCount:o}),l=new List(s,n);return l.initData(a),i&&i(l),linkList({mainData:l,struct:r,structAttr:"tree"}),r.update(),r},e}();function addChild(e,t){var n=t.children;e.parentNode!==t&&(n.push(e),e.parentNode=t)}var TreeSeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return __extends(t,e),t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=e.leaves||{},i=new Model(n,this,this.ecModel),r=Tree.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=r.getNodeByDataIndex(t);return n.children.length&&n.isExpand||(e.parentModel=i),e}))}));var a=0;r.eachNode("preorder",(function(e){e.depth>a&&(a=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),r.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 i=this.getData().tree,r=i.root.children[0],a=i.getNodeByDataIndex(e),o=a.getValue(),s=a.name;a&&a!==r;)s=a.parentNode.name+"."+s,a=a.parentNode;return createTooltipMarkup("nameValue",{name:s,value:o,noValue:isNaN(o)||null==o})},t.type="series.tree",t.layoutMode="box",t.defaultOption={zlevel:0,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",borderColor:"#c23531",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(SeriesModel);function init$2(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,i,r=[t];n=r.pop();)if(i=n.children,n.isExpand&&i.length)for(var a=i.length-1;a>=0;a--){var o=i[a];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},r.push(o)}}function firstWalk(e,t){var n=e.isExpand?e.children:[],i=e.parentNode.children,r=e.hierNode.i?i[e.hierNode.i-1]:null;if(n.length){executeShifts(e);var a=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(e.hierNode.prelim=r.hierNode.prelim+t(e,r),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else r&&(e.hierNode.prelim=r.hierNode.prelim+t(e,r));e.parentNode.hierNode.defaultAncestor=apportion(e,r,e.parentNode.hierNode.defaultAncestor||i[0],t)}function secondWalk(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function separation(e){return arguments.length?e:defaultSeparation}function radialCoordinate(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function getViewRect$1(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function executeShifts(e){for(var t=e.children,n=t.length,i=0,r=0;--n>=0;){var a=t[n];a.hierNode.prelim+=i,a.hierNode.modifier+=i,r+=a.hierNode.change,i+=a.hierNode.shift+r}}function apportion(e,t,n,i){if(t){for(var r=e,a=e,o=a.parentNode.children[0],s=t,l=r.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=nextRight(s),a=nextLeft(a),s&&a;){r=nextRight(r),o=nextLeft(o),r.hierNode.ancestor=e;var p=s.hierNode.prelim+h-a.hierNode.prelim-u+i(s,a);p>0&&(moveSubtree(nextAncestor(s,e,n),e,p),u+=p,l+=p),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=r.hierNode.modifier,c+=o.hierNode.modifier}s&&!nextRight(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=h-l),a&&!nextLeft(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,n=e)}return n}function nextRight(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function nextLeft(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function nextAncestor(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function moveSubtree(e,t,n){var i=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=i,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=i}function defaultSeparation(e,t){return e.parentNode===t.parentNode?1:2}SeriesModel.registerClass(TreeSeriesModel);var TreeEdgeShape=function(){this.parentPoint=[],this.childPoints=[]},TreePath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new TreeEdgeShape},t.prototype.buildPath=function(e,t){var n=t.childPoints,i=n.length,r=t.parentPoint,a=n[0],o=n[i-1];if(1===i)return e.moveTo(r[0],r[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=parsePercent$2(t.forkPosition,1),h=[];h[l]=r[l],h[u]=r[u]+(o[u]-r[u])*c,e.moveTo(r[0],r[1]),e.lineTo(h[0],h[1]),e.moveTo(a[0],a[1]),h[l]=a[l],e.lineTo(h[0],h[1]),h[l]=o[l],e.lineTo(h[0],h[1]),e.lineTo(o[0],o[1]);for(var p=1;p<i-1;p++){var d=n[p];e.moveTo(d[0],d[1]),h[l]=d[l],e.lineTo(h[0],h[1])}},t}(Path),TreeView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._mainGroup=new Group,n}return __extends(t,e),t.prototype.init=function(e,t){this._controller=new RoamController(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,t,n){var i=e.getData(),r=e.layoutInfo,a=this._mainGroup;"radial"===e.get("layout")?(a.x=r.x+r.width/2,a.y=r.y+r.height/2):(a.x=r.x,a.y=r.y),this._updateViewCoordSys(e),this._updateController(e,t,n);var o=this._data;i.diff(o).add((function(t){symbolNeedsDraw$1(i,t)&&updateNode(i,t,null,a,e)})).update((function(t,n){var r=o.getItemGraphicEl(n);symbolNeedsDraw$1(i,t)?updateNode(i,t,r,a,e):r&&removeNode(o,n,r,a,e)})).remove((function(t){var n=o.getItemGraphicEl(t);n&&removeNode(o,t,n,a,e)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===e.get("expandAndCollapse")&&i.eachItemGraphicEl((function(t,i){t.off("click").on("click",(function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:i})}))})),this._data=i},t.prototype._updateViewCoordSys=function(e){var t=e.getData(),n=[];t.each((function(e){var i=t.getItemLayout(e);!i||isNaN(i.x)||isNaN(i.y)||n.push([+i.x,+i.y])}));var i=[],r=[];fromPoints(n,i,r);var a=this._min,o=this._max;r[0]-i[0]==0&&(i[0]=a?a[0]:i[0]-1,r[0]=o?o[0]:r[0]+1),r[1]-i[1]==0&&(i[1]=a?a[1]:i[1]-1,r[1]=o?o[1]:r[1]+1);var s=e.coordinateSystem=new View;s.zoomLimit=e.get("scaleLimit"),s.setBoundingRect(i[0],i[1],r[0]-i[0],r[1]-i[1]),s.setCenter(e.get("center")),s.setZoom(e.get("zoom")),this.group.attr({x:s.x,y:s.y,scaleX:s.scaleX,scaleY:s.scaleY}),this._min=i,this._max=r},t.prototype._updateController=function(e,t,n){var i=this,r=this._controller,a=this._controllerHost,o=this.group;r.setPointerChecker((function(t,i,r){var a=o.getBoundingRect();return a.applyTransform(o.transform),a.contain(i,r)&&!onIrrelevantElement(t,n,e)})),r.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(t){updateViewOnPan(a,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){updateViewOnZoom(a,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),i._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,i=t.scaleX||1;return((t.getZoom()-1)*n+1)/i},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}(ChartView);function symbolNeedsDraw$1(e,t){var n=e.getItemLayout(t);return n&&!isNaN(n.x)&&!isNaN(n.y)}function updateNode(e,t,n,i,r){var a=!n,o=e.tree.getNodeByDataIndex(t),s=o.getModel(),l=o.getVisual("style").fill,u=!1===o.isExpand&&0!==o.children.length?l:"#fff",c=e.tree.root,h=o.parentNode===c?o:o.parentNode||o,p=e.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=p?{x:p.__oldX,y:p.__oldY,rawX:p.__radialOldRawX,rawY:p.__radialOldRawY}:d,g=o.getLayout();a?((n=new Symbol(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,i.add(n),e.setItemGraphicEl(t,n),n.__oldX=n.x,n.__oldY=n.y,updateProps(n,{x:g.x,y:g.y},r);var m=n.getSymbolPath();if("radial"===r.get("layout")){var y=c.children[0],v=y.getLayout(),_=y.children.length,x=void 0,S=void 0;if(g.x===v.x&&!0===o.isExpand){var b={x:(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,y:(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2};(x=Math.atan2(b.y-v.y,b.x-v.x))<0&&(x=2*Math.PI+x),(S=b.x<v.x)&&(x-=Math.PI)}else(x=Math.atan2(g.y-v.y,g.x-v.x))<0&&(x=2*Math.PI+x),0===o.children.length||0!==o.children.length&&!1===o.isExpand?(S=g.x<v.x)&&(x-=Math.PI):(S=g.x>v.x)||(x-=Math.PI);var T=S?"left":"right",M=s.getModel("label"),A=M.get("rotate"),I=A*(Math.PI/180),C=m.getTextContent();C&&(m.setTextConfig({position:M.get("position")||T,rotation:null==A?-x:I,origin:"center"}),C.setStyle("verticalAlign","middle"))}var w=s.get(["emphasis","focus"]),P="ancestor"===w?o.getAncestorsIndices():"descendant"===w?o.getDescendantIndices():null;P&&(getECData(n).focus=P),drawEdge(r,o,c,n,f,d,g,i),n.__edge&&(n.onHoverStateChange=function(t){if("blur"!==t){var i=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);i&&i.hoverState===HOVER_STATE_BLUR||setStatesFlag(n.__edge,t)}})}function drawEdge(e,t,n,i,r,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),p=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)t.parentNode&&t.parentNode!==n&&(g||(g=i.__edge=new BezierCurve({shape:getEdgeShape(c,h,p,r,r)})),updateProps(g,{shape:getEdgeShape(c,h,p,a,o)},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,y=[],v=0;v<m.length;v++){var _=m[v].getLayout();y.push([_.x,_.y])}g||(g=i.__edge=new TreePath({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:h,forkPosition:d}})),updateProps(g,{shape:{parentPoint:[o.x,o.y],childPoints:y}},e)}}else 0;g&&(g.useStyle(defaults({strokeNoScale:!0,fill:null},f)),setStatesStylesFromModel(g,l,"lineStyle"),setDefaultStateProxy(g),s.add(g))}function removeNode(e,t,n,i,r){for(var a,o=e.tree.getNodeByDataIndex(t),s=e.tree.root,l=o.parentNode===s?o:o.parentNode||o;null==(a=l.getLayout());)l=l.parentNode===s?l:l.parentNode||l;var u={duration:r.get("animationDurationUpdate"),easing:r.get("animationEasingUpdate")};removeElement(n,{x:a.x+1,y:a.y+1},r,{cb:function(){i.remove(n),e.setItemGraphicEl(t,null)},removeOpt:u}),n.fadeOut(null,{fadeLabel:!0,animation:u});var c=e.getItemGraphicEl(l.dataIndex).__edge,h=n.__edge||(!1===l.isExpand||1===l.children.length?c:void 0),p=r.get("edgeShape"),d=r.get("layout"),f=r.get("orient"),g=r.get(["lineStyle","curveness"]);h&&("curve"===p?removeElement(h,{shape:getEdgeShape(d,f,g,a,a),style:{opacity:0}},r,{cb:function(){i.remove(h)},removeOpt:u}):"polyline"===p&&"orthogonal"===r.get("layout")&&removeElement(h,{shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]]},style:{opacity:0}},r,{cb:function(){i.remove(h)},removeOpt:u}))}function getEdgeShape(e,t,n,i,r){var a,o,s,l,u,c,h,p;if("radial"===e){u=i.rawX,h=i.rawY,c=r.rawX,p=r.rawY;var d=radialCoordinate(u,h),f=radialCoordinate(u,h+(p-h)*n),g=radialCoordinate(c,p+(h-p)*n),m=radialCoordinate(c,p);return{x1:d.x||0,y1:d.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=i.x,h=i.y,c=r.x,p=r.y,"LR"!==t&&"RL"!==t||(a=u+(c-u)*n,o=h,s=c+(u-c)*n,l=p),"TB"!==t&&"BT"!==t||(a=u,o=h+(p-h)*n,s=c,l=p+(h-p)*n),{x1:u,y1:h,x2:c,y2:p,cpx1:a,cpy1:o,cpx2:s,cpy2:l}}function eachAfter(e,t,n){for(var i,r=[e],a=[];i=r.pop();)if(a.push(i),i.isExpand){var o=i.children;if(o.length)for(var s=0;s<o.length;s++)r.push(o[s])}for(;i=a.pop();)t(i,n)}function eachBefore(e,t){for(var n,i=[e];n=i.pop();)if(t(n),n.isExpand){var r=n.children;if(r.length)for(var a=r.length-1;a>=0;a--)i.push(r[a])}}function treeLayout(e,t){e.eachSeriesByType("tree",(function(e){commonLayout(e,t)}))}function commonLayout(e,t){var n=getViewRect$1(e,t);e.layoutInfo=n;var i=e.get("layout"),r=0,a=0,o=null;"radial"===i?(r=2*Math.PI,a=Math.min(n.height,n.width)/2,o=separation((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(r=n.width,a=n.height,o=separation());var s=e.getData().tree.root,l=s.children[0];if(l){init$2(s),eachAfter(l,firstWalk,o),s.hierNode.modifier=-l.hierNode.prelim,eachBefore(l,secondWalk);var u=l,c=l,h=l;eachBefore(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 p=u===c?1:o(u,c)/2,d=p-u.getLayout().x,f=0,g=0,m=0,y=0;if("radial"===i)f=r/(c.getLayout().x+p+d),g=a/(h.depth-1||1),eachBefore(l,(function(e){m=(e.getLayout().x+d)*f,y=(e.depth-1)*g;var t=radialCoordinate(m,y);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:y},!0)}));else{var v=e.getOrient();"RL"===v||"LR"===v?(g=a/(c.getLayout().x+p+d),f=r/(h.depth-1||1),eachBefore(l,(function(e){y=(e.getLayout().x+d)*g,m="LR"===v?(e.depth-1)*f:r-(e.depth-1)*f,e.setLayout({x:m,y:y},!0)}))):"TB"!==v&&"BT"!==v||(f=r/(c.getLayout().x+p+d),g=a/(h.depth-1||1),eachBefore(l,(function(e){m=(e.getLayout().x+d)*f,y="TB"===v?(e.depth-1)*g:a-(e.depth-1)*g,e.setLayout({x:m,y:y},!0)})))}}}function treeVisual(e){e.eachSeriesByType("tree",(function(e){var t=e.getData();t.tree.eachNode((function(e){var n=e.getModel().getModel("itemStyle").getItemStyle();extend(t.ensureUniqueItemVisual(e.dataIndex,"style"),n)}))}))}function retrieveTargetInfo(e,t,n){if(e&&indexOf(t,e.type)>=0){var i=n.getData().tree.root,r=e.targetNode;if("string"==typeof r&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=i.getNodeById(a)))return{node:r}}}function getPathToRoot(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function aboveViewRoot(e,t){return indexOf(getPathToRoot(e),t)>=0}function wrapTreePathInfo(e,t){for(var n=[];e;){var i=e.dataIndex;n.push({name:e.name,dataIndex:i,value:t.getRawValue(i)}),e=e.parentNode}return n.reverse(),n}function enableAriaDecalForTree(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var i=t;i&&i.depth>1;)i=i.parentNode;var r=getDecalFromPalette(e.ecModel,i.name||i.dataIndex+"",n);t.setVisual("decal",r)}))}ChartView.registerClass(TreeView),registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=e.dataIndex,i=t.getData().tree.getNodeByDataIndex(n);i.isExpand=!i.isExpand}))})),registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=updateCenterAndZoom(t.coordinateSystem,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))})),registerLayout(treeLayout),registerVisual(treeVisual);var TreemapSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};completeTreeValue(n);var i=e.levels||[],r=this.designatedVisualItemStyle={},a=new Model({itemStyle:r},this,t),o=map((i=e.levels=setDefault(i,t))||[],(function(e){return new Model(e,a,t)}),this),s=Tree.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),i=o[n.depth];return e.parentModel=i||a,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e);return createTooltipMarkup("nameValue",{name:i.getName(e),value:r})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=wrapTreePathInfo(i,this),n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},extend(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=createHashMap(),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(){enableAriaDecalForTree(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,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"}}},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%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(SeriesModel);function completeTreeValue(e){var t=0;each(e.children,(function(e){completeTreeValue(e);var n=e.value;isArray(n)&&(n=n[0]),t+=n}));var n=e.value;isArray(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),isArray(e.value)?e.value[0]=n:e.value=n}function setDefault(e,t){var n=normalizeToArray(t.get("color")),i=normalizeToArray(t.get("decals"));if(n){var r,a;each(e=e||[],(function(e){var t=new Model(e),n=t.get("color"),i=t.get("decal");(t.get(["itemStyle","color"])||n&&"none"!==n)&&(r=!0),(t.get(["itemStyle","decal"])||i&&"none"!==i)&&(a=!0)}));var o=e[0]||(e[0]={});return r||(o.color=n.slice()),!a&&i&&(o.decal=i.slice()),e}}SeriesModel.registerClass(TreemapSeriesModel);var TEXT_PADDING=8,ITEM_GAP=8,ARRAY_LENGTH=5,Breadcrumb=function(){function e(e){this.group=new Group,e.add(this.group)}return e.prototype.render=function(e,t,n,i){var r=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),r.get("show")&&n){var o=r.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,l,s),this._renderContent(e,l,o,s,i),positionElement(a,l.pos,l.box)}},e.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var r=convertOptionIdName(i.getModel().get("name"),""),a=n.getTextRect(r),o=Math.max(a.width+2*TEXT_PADDING,t.emptyItemWidth);t.totalWidth+=o+ITEM_GAP,t.renderList.push({node:i,text:r,width:o})}},e.prototype._renderContent=function(e,t,n,i,r){for(var a=0,o=t.emptyItemWidth,s=e.get(["breadcrumb","height"]),l=getAvailableSize(t.pos,t.box),u=t.totalWidth,c=t.renderList,h=c.length-1;h>=0;h--){var p=c[h],d=p.node,f=p.width,g=p.text;u>l.width&&(u-=f-o,f=o,g=null);var m=new Polygon({shape:{points:makeItemPoints(a,0,f,s,h===c.length-1,0===h)},style:defaults(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new ZRText({style:{text:g,fill:i.getTextColor(),font:i.getFont()}}),textConfig:{position:"inside"},z:10,onclick:curry(r,d)});m.disableLabelAnimation=!0,this.group.add(m),packEventData(m,e,d),a+=f+ITEM_GAP}},e.prototype.remove=function(){this.group.removeAll()},e}();function makeItemPoints(e,t,n,i,r,a){var o=[[r?e:e-ARRAY_LENGTH,t],[e+n,t],[e+n,t+i],[r?e:e-ARRAY_LENGTH,t+i]];return!a&&o.splice(2,0,[e+n+ARRAY_LENGTH,t+i/2]),!r&&o.push([e,t+i/2]),o}function packEventData(e,t,n){getECData(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&wrapTreePathInfo(n,t)}}var AnimationWrap=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,i,r){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:r}),!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())},i=0,r=this._storage.length;i<r;i++){var a=this._storage[i];a.el.animateTo(a.target,{duration:a.duration,delay:a.delay,easing:a.easing,setToFinal:!0,done:n,aborted:n})}return this},e}();function createWrap(){return new AnimationWrap}var Group$1=Group,Rect$1=Rect,DRAG_THRESHOLD=3,PATH_LABEL_NOAMAL="label",PATH_UPPERLABEL_NORMAL="upperLabel",Z_BASE=10,Z_BG=1,Z_CONTENT=2,getStateItemStyle=makeStyleMapper([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),getItemStyleNormal=function(e){var t=getStateItemStyle(e);return t.stroke=t.fill=t.lineWidth=null,t},inner$9=makeInner(),TreemapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._state="ready",n._storage=createStorage(),n}return __extends(t,e),t.prototype.render=function(e,t,n,i){if(!(indexOf(t.findComponents({mainType:"series",subType:"treemap",query:i}),e)<0)){this.seriesModel=e,this.api=n,this.ecModel=t;var r=retrieveTargetInfo(i,["treemapZoomToNode","treemapRootToNode"],e),a=i&&i.type,o=e.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===a&&r&&l?{rootNodeGroup:l.nodeGroup[r.node.getRawIndex()],direction:i.direction}:null,c=this._giveContainerGroup(o),h=this._doRender(c,e,u);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?h.renderFinally():this._doAnimation(c,h,e,u),this._resetController(n),this._renderBreadcrumb(e,n,r)}},t.prototype._giveContainerGroup=function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new Group$1,this._initEvents(t),this.group.add(t)),t.x=e.x,t.y=e.y,t},t.prototype._doRender=function(e,t,n){var i=t.getData().tree,r=this._oldTree,a=createStorage(),o=createStorage(),s=this._storage,l=[];!function e(i,r,u,c,h){c?(r=i,each(i,(function(e,t){!e.isRemoved()&&d(t,t)}))):new DataDiffer(r,i,p,p).add(d).update(d).remove(curry(d,null)).execute();function p(e){return e.getId()}function d(p,d){var f=null!=p?i[p]:null,g=null!=d?r[d]:null,m=function(e,i,r,u){return renderNode(t,o,s,n,a,l,e,i,r,u)}(f,g,u,h);m&&e(f&&f.viewChildren||[],g&&g.viewChildren||[],m,c,h+1)}}(i.root?[i.root]:[],r&&r.root?[r.root]:[],e,i===r||!r,0);var u=function(e){var t=createStorage();return e&&each(e,(function(e,n){var i=t[n];each(e,(function(e){e&&(i.push(e),inner$9(e).willDelete=!0)}))})),t}(s);return this._oldTree=i,this._storage=o,{lastsForAnimation:a,willDeleteEls:u,renderFinally:function(){each(u,(function(e){each(e,(function(e){e.parent&&e.parent.remove(e)}))})),each(l,(function(e){e.invisible=!0,e.dirty()}))}}},t.prototype._doAnimation=function(e,t,n,i){if(n.get("animation")){var r=n.get("animationDurationUpdate"),a=n.get("animationEasing"),o=(isFunction(r)?0:r)||0,s=(isFunction(a)?null:a)||"cubicOut",l=createWrap();each(t.willDeleteEls,(function(e,t){each(e,(function(e,n){if(!e.invisible){var r,a=e.parent,u=inner$9(a);if(i&&"drillDown"===i.direction)r=a===i.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),r="nodeGroup"===t?{x:c,y:h,style:{opacity:0}}:{shape:{x:c,y:h,width:0,height:0},style:{opacity:0}}}r&&l.add(e,r,o,0,s)}}))})),each(this._storage,(function(e,n){each(e,(function(e,i){var r=t.lastsForAnimation[n][i],a={};r&&(e instanceof Group?null!=r.oldX&&(a.x=e.x,a.y=e.y,e.x=r.oldX,e.y=r.oldY):(r.oldShape&&(a.shape=extend({},e.shape),e.setShape(r.oldShape)),r.fadein?(e.setStyle("opacity",0),a.style={opacity:1}):1!==e.style.opacity&&(a.style={opacity:1})),l.add(e,a,o,0,s))}))}),this),this._state="animating",l.finished(bind((function(){this._state="ready",t.renderFinally()}),this)).start()}},t.prototype._resetController=function(e){var t=this._controller;t||((t=this._controller=new RoamController(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",bind(this._onPan,this)),t.on("zoom",bind(this._onZoom,this)));var n=new BoundingRect(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,i){return n.contain(t,i)}))},t.prototype._clearController=function(){var e=this._controller;e&&(e.dispose(),e=null)},t.prototype._onPan=function(e){if("animating"!==this._state&&(Math.abs(e.dx)>DRAG_THRESHOLD||Math.abs(e.dy)>DRAG_THRESHOLD)){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;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var a=new BoundingRect(r.x,r.y,r.width,r.height),o=this.seriesModel.layoutInfo;t-=o.x,n-=o.y;var s=create$1();translate(s,s,[-t,-n]),scale$1(s,s,[e.scale,e.scale]),translate(s,s,[t,n]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.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 i=t.findTarget(e.offsetX,e.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)t._rootToNode(i);else if("zoomToNode"===n)t._zoomToNode(i);else if("link"===n){var a=r.hostTree.data.getItemModel(r.dataIndex),o=a.get("link",!0),s=a.get("target",!0)||"blank";o&&windowOpen(o,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var i=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 Breadcrumb(this.group))).render(e,t,n.node,(function(t){"animating"!==i._state&&(aboveViewRoot(e.getViewRoot(),t)?i._rootToNode({node:t}):i._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=createStorage(),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(i){var r=this._storage.background[i.getRawIndex()];if(r){var a=r.transformCoordToLocal(e,t),o=r.shape;if(!(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height))return!1;n={node:i,offsetX:a[0],offsetY:a[1]}}}),this),n},t.type="treemap",t}(ChartView);function createStorage(){return{nodeGroup:[],background:[],content:[]}}function renderNode(e,t,n,i,r,a,o,s,l,u){if(o){var c=o.getLayout(),h=e.getData(),p=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),c&&c.isInView){var d=c.width,f=c.height,g=c.borderWidth,m=c.invisible,y=o.getRawIndex(),v=s&&s.getRawIndex(),_=o.viewChildren,x=c.upperHeight,S=_&&_.length,b=p.getModel("itemStyle"),T=p.getModel(["emphasis","itemStyle"]),M=p.getModel(["blur","itemStyle"]),A=p.getModel(["select","itemStyle"]),I=b.get("borderRadius")||0,C=N("nodeGroup",Group$1);if(C){if(l.add(C),C.x=c.x||0,C.y=c.y||0,C.markRedraw(),inner$9(C).nodeWidth=d,inner$9(C).nodeHeight=f,c.isAboveViewRoot)return C;var w=N("background",Rect$1,u,Z_BG);w&&function(t,n,i){var r=getECData(n);if(r.dataIndex=o.dataIndex,r.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:d,height:f,r:I}),m)R(n);else{n.invisible=!1;var a=o.getVisual("style"),s=a.stroke,l=getItemStyleNormal(b);l.fill=s;var u=getStateItemStyle(T);u.fill=T.get("borderColor");var c=getStateItemStyle(M);c.fill=M.get("borderColor");var h=getStateItemStyle(A);if(h.fill=A.get("borderColor"),i){var p=d-2*g;O(n,s,p,x,a.opacity,{x:g,y:0,width:p,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,setDefaultStateProxy(n)}t.add(n)}(C,w,S&&c.upperLabelHeight);var P=p.get(["emphasis","focus"]),L=p.get(["emphasis","blurScope"]),E="ancestor"===P?o.getAncestorsIndices():"descendant"===P?o.getDescendantIndices():null;if(S)isHighDownDispatcher(C)&&setAsHighDownDispatcher(C,!1),w&&(setAsHighDownDispatcher(w,!0),h.setItemGraphicEl(o.dataIndex,w),enableHoverFocus(w,E||P,L));else{var D=N("content",Rect$1,u,Z_CONTENT);D&&function(t,n){var i=getECData(n);i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var r=Math.max(d-2*g,0),a=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:a,r:I}),m)R(n);else{n.invisible=!1;var s=o.getVisual("style"),l=s.fill,u=getItemStyleNormal(b);u.fill=l,u.decal=s.decal;var c=getStateItemStyle(T),h=getStateItemStyle(M),p=getStateItemStyle(A);O(n,l,r,s.opacity),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=p,setDefaultStateProxy(n)}t.add(n)}(C,D),w&&isHighDownDispatcher(w)&&setAsHighDownDispatcher(w,!1),setAsHighDownDispatcher(C,!0),h.setItemGraphicEl(o.dataIndex,C),enableHoverFocus(C,E||P,L)}return C}}}function R(e){!e.invisible&&a.push(e)}function O(t,n,i,r,a,s){var l=p.getModel(s?PATH_UPPERLABEL_NORMAL:PATH_LABEL_NOAMAL),u=retrieve(e.getFormattedLabel(o.dataIndex,"normal",null,null,l.get("formatter")),convertOptionIdName(p.get("name"),null));if(!s&&c.isLeafRoot){var h=e.get("drillDownIcon",!0);u=h?h+" "+u:u}var d=l.getShallow("show");setLabelStyle(t,getLabelStatesModels(p,s?PATH_UPPERLABEL_NORMAL:PATH_LABEL_NOAMAL),{defaultText:d?u:null,inheritColor:n,defaultOpacity:i,labelFetcher:e,labelDataIndex:o.dataIndex});var f=t.getTextContent(),g=f.style,m=normalizeCssArray(g.padding||0);s&&(t.setTextConfig({layoutRect:s}),f.disableLabelLayout=!0),f.beforeUpdate=function(){var e=Math.max((s?s.width:t.shape.width)-m[1]-m[3],0),n=Math.max((s?s.height:t.shape.height)-m[0]-m[2],0);g.width===e&&g.height===n||f.setStyle({width:e,height:n})},g.truncateMinChar=2,g.lineOverflow="truncate",k(g,s,c);var y=f.getState("emphasis");k(y?y.style:null,s,c)}function k(t,n,i){var r=t?t.text:null;if(!n&&i.isLeafRoot&&null!=r){var a=e.get("drillDownIcon",!0);t.text=a?a+" "+r:r}}function N(e,a,s,l){var u=null!=v&&n[e][v],c=r[e];return u?(n[e][v]=null,function(e,t){var n=e[y]={};t instanceof Group$1?(n.oldX=t.x,n.oldY=t.y):n.oldShape=extend({},t.shape)}(c,u)):m||((u=new a)instanceof Displayable&&(u.z=calculateZ(s,l)),function(e,t){var n=e[y]={},a=o.parentNode,s=t instanceof Group;if(a&&(!i||"drillDown"===i.direction)){var l=0,u=0,c=r.background[a.getRawIndex()];!i&&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}(c,u)),t[e][y]=u}}function calculateZ(e,t){var n=e*Z_BASE+t;return(n-1)/n}ChartView.registerClass(TreemapView);for(var noop$1=function(){},actionTypes=["treemapZoomToNode","treemapRender","treemapMove"],i$1=0;i$1<actionTypes.length;i$1++)registerAction({type:actionTypes[i$1],update:"updateView"},noop$1);registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,n){var i=retrieveTargetInfo(e,["treemapZoomToNode","treemapRootToNode"],t);if(i){var r=t.getViewRoot();r&&(e.direction=aboveViewRoot(r,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}}))}));var each$4=each,isObject$4=isObject,CATEGORY_DEFAULT_VISUAL_INDEX=-1,VisualMapping=function(){function e(t){var n=t.mappingMethod,i=t.type,r=this.option=clone(t);this.type=i,this.mappingMethod=n,this._normalizeData=normalizers[n];var a=e.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[n],"piecewise"===n?(normalizeVisualRange(r),preprocessForPiecewise(r)):"category"===n?r.categories?preprocessForSpecifiedCategory(r):normalizeVisualRange(r,!0):(assert("linear"!==n||r.dataExtent),normalizeVisualRange(r))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return bind(this._normalizeData,this)},e.listVisualTypes=function(){return keys(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){isObject(e)?each(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,i){var r,a=isArray(t)?[]:isObject(t)?{}:(r=!0,null);return e.eachVisual(t,(function(e,t){var o=n.call(i,e,t);r?a=o:a[t]=o})),a},e.retrieveVisuals=function(t){var n,i={};return t&&each$4(e.visualHandlers,(function(e,r){t.hasOwnProperty(r)&&(i[r]=t[r],n=!0)})),n?i:null},e.prepareVisualTypes=function(e){if(isArray(e))e=e.slice();else{if(!isObject$4(e))return[];var t=[];each$4(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 i,r=1/0,a=0,o=t.length;a<o;a++){var s=t[a].value;if(null!=s){if(s===e||"string"==typeof s&&s===e+"")return a;n&&h(s,a)}}for(a=0,o=t.length;a<o;a++){var l=t[a],u=l.interval,c=l.close;if(u){if(u[0]===-1/0){if(littleThan(c[1],e,u[1]))return a}else if(u[1]===1/0){if(littleThan(c[0],u[0],e))return a}else if(littleThan(c[0],u[0],e)&&littleThan(c[1],e,u[1]))return a;n&&h(u[0],a),n&&h(u[1],a)}}if(n)return e===1/0?t.length-1:e===-1/0?0:i;function h(t,n){var a=Math.abs(t-e);a<r&&(r=a,i=n)}},e.visualHandlers={color:{applyVisual:makeApplyVisual("color"),getColorMapper:function(){var e=this.option;return bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),doMapCategory.call(this,e)}:function(t,n,i){var r=!!i;return!n&&(t=this._normalizeData(t)),i=fastLerp(t,e.parsedVisual,i),r?i:stringify(i,"rgba")},this)},_normalizedToVisual:{linear:function(e){return stringify(fastLerp(e,this.option.parsedVisual),"rgba")},category:doMapCategory,piecewise:function(e,t){var n=getSpecifiedVisual.call(this,t);return null==n&&(n=stringify(fastLerp(e,this.option.parsedVisual),"rgba")),n},fixed:doMapFixed}},colorHue:makePartialColorVisualHandler((function(e,t){return modifyHSL(e,t)})),colorSaturation:makePartialColorVisualHandler((function(e,t){return modifyHSL(e,null,t)})),colorLightness:makePartialColorVisualHandler((function(e,t){return modifyHSL(e,null,null,t)})),colorAlpha:makePartialColorVisualHandler((function(e,t){return modifyAlpha(e,t)})),decal:{applyVisual:makeApplyVisual("decal"),_normalizedToVisual:{linear:null,category:doMapCategory,piecewise:null,fixed:null}},opacity:{applyVisual:makeApplyVisual("opacity"),_normalizedToVisual:createNormalizedToNumericVisual([0,1])},liftZ:{applyVisual:makeApplyVisual("liftZ"),_normalizedToVisual:{linear:doMapFixed,category:doMapFixed,piecewise:doMapFixed,fixed:doMapFixed}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:doMapToArray,category:doMapCategory,piecewise:function(e,t){var n=getSpecifiedVisual.call(this,t);return null==n&&(n=doMapToArray.call(this,e)),n},fixed:doMapFixed}},symbolSize:{applyVisual:makeApplyVisual("symbolSize"),_normalizedToVisual:createNormalizedToNumericVisual([0,1])}},e}();function preprocessForPiecewise(e){var t=e.pieceList;e.hasSpecialVisual=!1,each(t,(function(t,n){t.originIndex=n,null!=t.visual&&(e.hasSpecialVisual=!0)}))}function preprocessForSpecifiedCategory(e){var t=e.categories,n=e.categoryMap={},i=e.visual;if(each$4(t,(function(e,t){n[e]=t})),!isArray(i)){var r=[];isObject(i)?each$4(i,(function(e,t){var i=n[t];r[null!=i?i:CATEGORY_DEFAULT_VISUAL_INDEX]=e})):r[CATEGORY_DEFAULT_VISUAL_INDEX]=i,i=setVisualToOption(e,r)}for(var a=t.length-1;a>=0;a--)null==i[a]&&(delete n[t[a]],t.pop())}function normalizeVisualRange(e,t){var n=e.visual,i=[];isObject(n)?each$4(n,(function(e){i.push(e)})):null!=n&&i.push(n);t||1!==i.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(i[1]=i[0]),setVisualToOption(e,i)}function makePartialColorVisualHandler(e){return{applyVisual:function(t,n,i){var r=this.mapValueToVisual(t);i("color",e(n("color"),r))},_normalizedToVisual:createNormalizedToNumericVisual([0,1])}}function doMapToArray(e){var t=this.option.visual;return t[Math.round(linearMap(e,[0,1],[0,t.length-1],!0))]||{}}function makeApplyVisual(e){return function(t,n,i){i(e,this.mapValueToVisual(t))}}function doMapCategory(e){var t=this.option.visual;return t[this.option.loop&&e!==CATEGORY_DEFAULT_VISUAL_INDEX?e%t.length:e]}function doMapFixed(){return this.option.visual[0]}function createNormalizedToNumericVisual(e){return{linear:function(t){return linearMap(t,e,this.option.visual,!0)},category:doMapCategory,piecewise:function(t,n){var i=getSpecifiedVisual.call(this,n);return null==i&&(i=linearMap(t,e,this.option.visual,!0)),i},fixed:doMapFixed}}function getSpecifiedVisual(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var i=n[VisualMapping.findPieceIndex(e,n)];if(i&&i.visual)return i.visual[this.type]}}function setVisualToOption(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=map(t,(function(e){return parse(e)}))),t}var normalizers={linear:function(e){return linearMap(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=VisualMapping.findPieceIndex(e,t,!0);if(null!=n)return linearMap(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?CATEGORY_DEFAULT_VISUAL_INDEX:t},fixed:noop};function littleThan(e,t,n){return e?t<=n:t<n}var ITEM_STYLE_NORMAL="itemStyle",inner$a=makeInner(),treemapVisual={seriesType:"treemap",reset:function(e){var t=e.getData().tree.root;t.isRemoved()||travelTree(t,{},e.getViewRoot().getAncestors(),e)}};function travelTree(e,t,n,i){var r=e.getModel(),a=e.getLayout(),o=e.hostTree.data;if(a&&!a.invisible&&a.isInView){var s,l=r.getModel(ITEM_STYLE_NORMAL),u=buildVisuals(l,t,i),c=o.ensureUniqueItemVisual(e.dataIndex,"style"),h=l.get("borderColor"),p=l.get("borderColorSaturation");null!=p&&(h=calculateBorderColor(p,s=calculateColor(u))),c.stroke=h;var d=e.viewChildren;if(d&&d.length){var f=buildVisualMapping(e,r,a,l,u,d);each(d,(function(e,t){(e.depth>=n.length||e===n[e.depth])&&travelTree(e,mapVisual(r,u,e,t,f,i),n,i)}))}else s=calculateColor(u),c.fill=s}}function buildVisuals(e,t,n){var i=extend({},t),r=n.designatedVisualItemStyle;return each(["color","colorAlpha","colorSaturation"],(function(n){r[n]=t[n];var a=e.get(n);r[n]=null,null!=a&&(i[n]=a)})),i}function calculateColor(e){var t=getValueVisualDefine(e,"color");if(t){var n=getValueVisualDefine(e,"colorAlpha"),i=getValueVisualDefine(e,"colorSaturation");return i&&(t=modifyHSL(t,null,null,i)),n&&(t=modifyAlpha(t,n)),t}}function calculateBorderColor(e,t){return null!=t?modifyHSL(t,null,null,e):null}function getValueVisualDefine(e,t){var n=e[t];if(null!=n&&"none"!==n)return n}function buildVisualMapping(e,t,n,i,r,a){if(a&&a.length){var o=getRangeVisual(t,"color")||null!=r.color&&"none"!==r.color&&(getRangeVisual(t,"colorAlpha")||getRangeVisual(t,"colorSaturation"));if(o){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:o.name,dataExtent:u,visual:o.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var p=new VisualMapping(h);return inner$a(p).drColorMappingBy=c,p}}}function getRangeVisual(e,t){var n=e.get(t);return isArray(n)&&n.length?{name:t,range:n}:null}function mapVisual(e,t,n,i,r,a){var o=extend({},t);if(r){var s=r.type,l="color"===s&&inner$a(r).drColorMappingBy,u="index"===l?i:"id"===l?a.mapIdToIndex(n.getId()):n.getValue(e.get("visualDimension"));o[s]=r.mapValueToVisual(u)}return o}var mathMax$7=Math.max,mathMin$7=Math.min,retrieveValue=retrieve,each$5=each,PATH_BORDER_WIDTH=["itemStyle","borderWidth"],PATH_GAP_WIDTH=["itemStyle","gapWidth"],PATH_UPPER_LABEL_SHOW=["upperLabel","show"],PATH_UPPER_LABEL_HEIGHT=["upperLabel","height"],treemapLayout={seriesType:"treemap",reset:function(e,t,n,i){var r=n.getWidth(),a=n.getHeight(),o=e.option,s=getLayoutRect(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=o.size||[],u=parsePercent$2(retrieveValue(s.width,l[0]),r),c=parsePercent$2(retrieveValue(s.height,l[1]),a),h=i&&i.type,p=retrieveTargetInfo(i,["treemapZoomToNode","treemapRootToNode"],e),d="treemapRender"===h||"treemapMove"===h?i.rootRect:null,f=e.getViewRoot(),g=getPathToRoot(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?estimateRootSize(e,p,f,u,c):d?[d.width,d.height]:[u,c],y=o.sort;y&&"asc"!==y&&"desc"!==y&&(y="desc");var v={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),squarify(f,v,!1,0),_=f.getLayout(),each$5(g,(function(e,t){var n=(g[t+1]||f).getValue();e.setLayout(extend({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(calculateRootPosition(s,d,p),!0),e.setLayoutInfo(s),prunning(x,new BoundingRect(-s.x,-s.y,r,a),g,f,0)}};function squarify(e,t,n,i){var r,a;if(!e.isRemoved()){var o=e.getLayout();r=o.width,a=o.height;var s=e.getModel(),l=s.get(PATH_BORDER_WIDTH),u=s.get(PATH_GAP_WIDTH)/2,c=getUpperLabelHeight(s),h=Math.max(l,c),p=l-u,d=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0);var f=(r=mathMax$7(r-2*p,0))*(a=mathMax$7(a-p-d,0)),g=initChildren(e,s,f,t,n,i);if(g.length){var m={x:p,y:d,width:r,height:a},y=mathMin$7(r,a),v=1/0,_=[];_.area=0;for(var x=0,S=g.length;x<S;){var b=g[x];_.push(b),_.area+=b.getLayout().area;var T=worst(_,y,t.squareRatio);T<=v?(x++,v=T):(_.area-=_.pop().getLayout().area,position(_,y,m,u,!1),y=mathMin$7(m.width,m.height),_.length=_.area=0,v=1/0)}if(_.length&&position(_,y,m,u,!0),!n){var M=s.get("childrenVisibleMin");null!=M&&f<M&&(n=!0)}for(x=0,S=g.length;x<S;x++)squarify(g[x],t,n,i+1)}}}function initChildren(e,t,n,i,r,a){var o=e.children||[],s=i.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=i.leafDepth&&i.leafDepth<=a;if(r&&!l)return e.viewChildren=[];sort$1(o=filter(o,(function(e){return!e.isRemoved()})),s);var u=statistic(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=filterByThreshold(t,n,u.sum,s,o),0===u.sum)return e.viewChildren=[];for(var c=0,h=o.length;c<h;c++){var p=o[c].getValue()/u.sum*n;o[c].setLayout({area:p})}return l&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0),e.viewChildren=o,e.setLayout({dataExtent:u.dataExtent},!0),o}function filterByThreshold(e,t,n,i,r){if(!i)return n;for(var a=e.get("visibleMin"),o=r.length,s=o,l=o-1;l>=0;l--){var u=r["asc"===i?o-l-1:l].getValue();u/n*t<a&&(s=l,n-=u)}return"asc"===i?r.splice(0,o-s):r.splice(s,o-s),n}function sort$1(e,t){return t&&e.sort((function(e,n){var i="asc"===t?e.getValue()-n.getValue():n.getValue()-e.getValue();return 0===i?"asc"===t?e.dataIndex-n.dataIndex:n.dataIndex-e.dataIndex:i})),e}function statistic(e,t,n){for(var i=0,r=0,a=t.length;r<a;r++)i+=t[r].getValue();var o,s=e.get("visualDimension");return t&&t.length?"value"===s&&n?(o=[t[t.length-1].getValue(),t[0].getValue()],"asc"===n&&o.reverse()):(o=[1/0,-1/0],each$5(t,(function(e){var t=e.getValue(s);t<o[0]&&(o[0]=t),t>o[1]&&(o[1]=t)}))):o=[NaN,NaN],{sum:i,dataExtent:o}}function worst(e,t,n){for(var i=0,r=1/0,a=0,o=void 0,s=e.length;a<s;a++)(o=e[a].getLayout().area)&&(o<r&&(r=o),o>i&&(i=o));var l=e.area*e.area,u=t*t*n;return l?mathMax$7(u*i/l,l/(u*r)):1/0}function position(e,t,n,i,r){var a=t===n.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=n[s[a]],c=t?e.area/t:0;(r||c>n[l[o]])&&(c=n[l[o]]);for(var h=0,p=e.length;h<p;h++){var d=e[h],f={},g=c?d.getLayout().area/c:0,m=f[l[o]]=mathMax$7(c-2*i,0),y=n[s[a]]+n[l[a]]-u,v=h===p-1||y<g?y:g,_=f[l[a]]=mathMax$7(v-2*i,0);f[s[o]]=n[s[o]]+mathMin$7(i,m/2),f[s[a]]=u+mathMin$7(i,_/2),u+=v,d.setLayout(f,!0)}n[s[o]]+=c,n[l[o]]-=c}function estimateRootSize(e,t,n,i,r){var a,o=(t||{}).node,s=[i,r];if(!o||o===n)return s;for(var l=i*r,u=l*e.option.zoomToNodeRatio;a=o.parentNode;){for(var c=0,h=a.children,p=0,d=h.length;p<d;p++)c+=h[p].getValue();var f=o.getValue();if(0===f)return s;u*=c/f;var g=a.getModel(),m=g.get(PATH_BORDER_WIDTH);(u+=4*m*m+(3*m+Math.max(m,getUpperLabelHeight(g)))*Math.pow(u,.5))>MAX_SAFE_INTEGER&&(u=MAX_SAFE_INTEGER),o=a}u<l&&(u=l);var y=Math.pow(u/l,.5);return[i*y,r*y]}function calculateRootPosition(e,t,n){if(t)return{x:t.x,y:t.y};var i={x:0,y:0};if(!n)return i;var r=n.node,a=r.getLayout();if(!a)return i;for(var o=[a.width/2,a.height/2],s=r;s;){var l=s.getLayout();o[0]+=l.x,o[1]+=l.y,s=s.parentNode}return{x:e.width/2-o[0],y:e.height/2-o[1]}}function prunning(e,t,n,i,r){var a=e.getLayout(),o=n[r],s=o&&o===e;if(!(o&&!s||r===n.length&&e!==i)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(a),isAboveViewRoot:s},!0);var l=new BoundingRect(t.x-a.x,t.y-a.y,t.width,t.height);each$5(e.viewChildren||[],(function(e){prunning(e,l,n,i,r+1)}))}}function getUpperLabelHeight(e){return e.get(PATH_UPPER_LABEL_SHOW)?e.get(PATH_UPPER_LABEL_HEIGHT):0}function generateNodeKey(e){return"_EC_"+e}registerVisual(treemapVisual),registerLayout(treemapLayout);var Graph=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[generateNodeKey(e)]){var i=new GraphNode(e,t);return i.hostGraph=this,this.nodes.push(i),n[generateNodeKey(e)]=i,i}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[generateNodeKey(e)]},e.prototype.addEdge=function(e,t,n){var i=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),e instanceof GraphNode||(e=i[generateNodeKey(e)]),t instanceof GraphNode||(t=i[generateNodeKey(t)]),e&&t){var a=e.id+"-"+t.id,o=new GraphEdge(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),r[a]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof GraphNode&&(e=e.id),t instanceof GraphNode&&(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,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&e.call(t,n[r],r)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&e.call(t,n[r],r)},e.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof GraphNode||(t=this._nodesMap[generateNodeKey(t)]),t){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!e.call(i,t,null))for(var o=[t];o.length;){var s=o.shift(),l=s[r];for(a=0;a<l.length;a++){var u=l[a],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(e.call(i,c,s))return;o.push(c),c.__visited=!0}}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,i=this.edges,r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)n[e.getRawIndex(r)].dataIndex=r;t.filterSelf((function(e){var n=i[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}));for(r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)i[t.getRawIndex(r)].dataIndex=r},e.prototype.clone=function(){for(var t=new e(this._directed),n=this.nodes,i=this.edges,r=0;r<n.length;r++)t.addNode(n[r].id,n[r].dataIndex);for(r=0;r<i.length;r++){var a=i[r];t.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return t},e}(),GraphNode=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}(),GraphEdge=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}();function createGraphDataProxyMixin(e,t){return{getValue:function(n){var i=this[e][t];return i.get(i.getDimension(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,i)},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 createGraphFromNodeEdge(e,t,n,i,r){for(var a=new Graph(i),o=0;o<e.length;o++)a.addNode(retrieve(e[o].id,e[o].name,o),o);var s=[],l=[],u=0;for(o=0;o<t.length;o++){var c=t[o],h=c.source,p=c.target;a.addEdge(h,p,u)&&(l.push(c),s.push(retrieve(convertOptionIdName(c.id,null),h+" > "+p)),u++)}var d,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)d=createListFromArray(e,n);else{var g=CoordinateSystemManager.get(f),m=g&&g.dimensions||[];indexOf(m,"value")<0&&m.concat(["value"]);var y=createDimensions(e,{coordDimensions:m});(d=new List(y,n)).initData(e)}var v=new List(["value"],n);return v.initData(l,s),r&&r(d,v),linkList({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}mixin(GraphNode,createGraphDataProxyMixin("hostGraph","data")),mixin(GraphEdge,createGraphDataProxyMixin("hostGraph","edgeData"));var KEY_DELIMITER="--\x3e",getAutoCurvenessParams=function(e){return e.get("autoCurveness")||null},createCurveness=function(e,t){var n=getAutoCurvenessParams(e),i=20,r=[];if("number"==typeof n)i=n;else if(isArray(n))return void(e.__curvenessList=n);t>i&&(i=t);var a=i%2?i+2:i+3;r=[];for(var o=0;o<a;o++)r.push((o%2?o+1:o)/10*(o%2?-1:1));e.__curvenessList=r},getKeyOfEdges=function(e,t,n){var i=[e.id,e.dataIndex].join("."),r=[t.id,t.dataIndex].join(".");return[n.uid,i,r].join(KEY_DELIMITER)},getOppositeKey=function(e){var t=e.split(KEY_DELIMITER);return[t[0],t[2],t[1]].join(KEY_DELIMITER)},getEdgeFromMap=function(e,t){var n=getKeyOfEdges(e.node1,e.node2,t);return t.__edgeMap[n]},getTotalLengthBetweenNodes=function(e,t){return getEdgeMapLengthWithKey(getKeyOfEdges(e.node1,e.node2,t),t)+getEdgeMapLengthWithKey(getKeyOfEdges(e.node2,e.node1,t),t)},getEdgeMapLengthWithKey=function(e,t){var n=t.__edgeMap;return n[e]?n[e].length:0};function initCurvenessList(e){getAutoCurvenessParams(e)&&(e.__curvenessList=[],e.__edgeMap={},createCurveness(e))}function createEdgeMapForCurveness(e,t,n,i){if(getAutoCurvenessParams(n)){var r=getKeyOfEdges(e,t,n),a=n.__edgeMap,o=a[getOppositeKey(r)];a[r]&&!o?a[r].isForward=!0:o&&a[r]&&(o.isForward=!0,a[r].isForward=!1),a[r]=a[r]||[],a[r].push(i)}}function getCurvenessForEdge(e,t,n,i){var r=getAutoCurvenessParams(t),a=isArray(r);if(!r)return null;var o=getEdgeFromMap(e,t);if(!o)return null;for(var s=-1,l=0;l<o.length;l++)if(o[l]===n){s=l;break}var u=getTotalLengthBetweenNodes(e,t);createCurveness(t,u),e.lineStyle=e.lineStyle||{};var c=getKeyOfEdges(e.node1,e.node2,t),h=t.__curvenessList,p=a||u%2?0:1;if(o.isForward)return h[p+s];var d=getOppositeKey(c),f=getEdgeMapLengthWithKey(d,t),g=h[s+f+p];return i?a?r&&0===r[0]?(f+p)%2?g:-g:((f%2?0:1)+p)%2?g:-g:(f+p)%2?g:-g:h[s+f+p]}var GraphSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new LegendVisualProvider(i,i),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),defaultEmphasis(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],i=e.data||e.nodes||[],r=this;if(i&&n){initCurvenessList(this);var a=createGraphFromNodeEdge(i,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=r._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=Model.prototype.getModel;function i(e,t){var i=n.call(this,e,t);return i.resolveParentPath=a,i}function a(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=a,e.getModel=i,e}))}));return each(a.edges,(function(e){createEdgeMapForCurveness(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 i=this.getData(),r=this.getDataParams(e,n),a=i.graph.getEdgeByIndex(e),o=i.getName(a.node1.dataIndex),s=i.getName(a.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),createTooltipMarkup("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return defaultSeriesFormatTooltip({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=map(this.option.categories||[],(function(e){return null!=e.value?e:extend({value:0},e)})),t=new List(["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.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,focusNodeAdjacency:!1,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}(SeriesModel);SeriesModel.registerClass(GraphSeriesModel);var straightLineProto=Line.prototype,bezierCurveProto=BezierCurve.prototype,StraightLineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},CurveShape=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(StraightLineShape);function isStraightLine(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var ECLinePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new StraightLineShape},t.prototype.buildPath=function(e,t){isStraightLine(t)?straightLineProto.buildPath.call(this,e,t):bezierCurveProto.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return isStraightLine(this.shape)?straightLineProto.pointAt.call(this,e):bezierCurveProto.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=isStraightLine(t)?[t.x2-t.x1,t.y2-t.y1]:bezierCurveProto.tangentAt.call(this,e);return normalize(n,n)},t}(Path),SYMBOL_CATEGORIES=["fromSymbol","toSymbol"];function makeSymbolTypeKey(e){return"_"+e+"Type"}function createSymbol$1(e,t,n){var i=t.getItemVisual(n,e);if(i&&"none"!==i){var r=t.getItemVisual(n,e+"Size"),a=t.getItemVisual(n,e+"Rotate"),o=isArray(r)?r:[r,r],s=createSymbol(i,-o[0]/2,-o[1]/2,o[0],o[1]);return s.__specifiedRotation=null==a||isNaN(a)?void 0:+a*Math.PI/180||0,s.name=e,s}}function createLine(e){var t=new ECLinePath({name:"line",subPixelOptimize:!0});return setLinePoints(t.shape,e),t}function setLinePoints(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 Line$1=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createLine(t,n,i),r}return __extends(t,e),t.prototype._createLine=function(e,t,n){var i=e.hostModel,r=createLine(e.getItemLayout(t));r.shape.percent=0,initProps(r,{shape:{percent:1}},i,t),this.add(r),each(SYMBOL_CATEGORIES,(function(n){var i=createSymbol$1(n,e,t);this.add(i),this[makeSymbolTypeKey(n)]=e.getItemVisual(t,n)}),this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),a=e.getItemLayout(t),o={shape:{}};setLinePoints(o.shape,a),updateProps(r,o,i,t),each(SYMBOL_CATEGORIES,(function(n){var i=e.getItemVisual(t,n),r=makeSymbolTypeKey(n);if(this[r]!==i){this.remove(this.childOfName(n));var a=createSymbol$1(n,e,t);this.add(a)}this[r]=i}),this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),a=n&&n.emphasisLineStyle,o=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels;if(!n||e.hasItemOption){var u=e.getItemModel(t);a=u.getModel(["emphasis","lineStyle"]).getLineStyle(),o=u.getModel(["blur","lineStyle"]).getLineStyle(),s=u.getModel(["select","lineStyle"]).getLineStyle(),l=getLabelStatesModels(u)}var c=e.getItemVisual(t,"style"),h=c.stroke;r.useStyle(c),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=a,r.ensureState("blur").style=o,r.ensureState("select").style=s,each(SYMBOL_CATEGORIES,(function(e){var t=this.childOfName(e);if(t){t.setColor(h),t.style.opacity=c.opacity;for(var n=0;n<SPECIAL_STATES.length;n++){var i=SPECIAL_STATES[n],a=r.getState(i);if(a){var o=a.style||{},s=t.ensureState(i),l=s.style||(s.style={});null!=o.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=o.stroke),null!=o.opacity&&(l.opacity=o.opacity)}}t.markRedraw()}}),this);var p=i.getRawValue(t);setLabelStyle(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return i.getFormattedLabel(t,n,e.dataType)}},inheritColor:h||"#000",defaultOpacity:c.opacity,defaultText:(null==p?e.getName(t):isFinite(p)?round$1(p):p)+""});var d=this.getTextContent();if(d){var f=l.normal;d.__align=d.style.align,d.__verticalAlign=d.style.verticalAlign,d.__position=f.get("position")||"middle";var g=f.get("distance");isArray(g)||(g=[g,g]),d.__labelDistance=g}this.setTextConfig({position:null,local:!0,inside:!1}),enableHoverEmphasis(this)},t.prototype.highlight=function(){enterEmphasis(this)},t.prototype.downplay=function(){leaveEmphasis(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");setLinePoints(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),n=e.childOfName("toSymbol"),i=e.getTextContent();if(t||n||i&&!i.ignore){for(var r=1,a=this.parent;a;)a.scaleX&&(r/=a.scaleX),a=a.parent;var o=e.childOfName("line");if(this.__dirty||o.__dirty){var s=o.shape.percent,l=o.pointAt(0),u=o.pointAt(s),c=sub([],u,l);if(normalize(c,c),t&&(t.setPosition(l),T(t,0),t.scaleX=t.scaleY=r*s,t.markRedraw()),n&&(n.setPosition(u),T(n,1),n.scaleX=n.scaleY=r*s,n.markRedraw()),i&&!i.ignore){i.x=i.y=0,i.originX=i.originY=0;var h=void 0,p=void 0,d=i.__labelDistance,f=d[0]*r,g=d[1]*r,m=s/2,y=o.tangentAt(m),v=[y[1],-y[0]],_=o.pointAt(m);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var S=-Math.atan2(y[1],y[0]);u[0]<l[0]&&(S=Math.PI+S),i.rotation=S}var b=void 0;switch(i.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":b=-g,p="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":b=g,p="top";break;default:b=0,p="middle"}switch(i.__position){case"end":i.x=c[0]*f+u[0],i.y=c[1]*g+u[1],h=c[0]>.8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*f+l[0],i.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+b,h=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-b;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+b,h="center",i.originY=-b;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+u[0],i.y=u[1]+b,h=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-b}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||h})}}}function T(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(Group),LineDraw=function(){function e(e){this.group=new Group,this._LineCtor=e||Line$1}return e.prototype.isPersistent=function(){return!0},e.prototype.updateData=function(e){var t=this,n=this,i=n.group,r=n._lineData;n._lineData=e,r||i.removeAll();var a=makeSeriesScope$1(e);e.diff(r).add((function(n){t._doAdd(e,n,a)})).update((function(n,i){t._doUpdate(r,e,i,n,a)})).remove((function(e){i.remove(r.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=makeSeriesScope$1(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||isEffectObject(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){if(lineNeedsDraw(t.getItemLayout(i))){var r=new this._LineCtor(t,i,this._seriesScope);r.traverse(n),this.group.add(r),t.setItemGraphicEl(i,r)}}},e.prototype.remove=function(){this.group.removeAll()},e.prototype._doAdd=function(e,t,n){if(lineNeedsDraw(e.getItemLayout(t))){var i=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,i),this.group.add(i)}},e.prototype._doUpdate=function(e,t,n,i,r){var a=e.getItemGraphicEl(n);lineNeedsDraw(t.getItemLayout(i))?(a?a.updateData(t,i,r):a=new this._LineCtor(t,i,r),t.setItemGraphicEl(i,a),this.group.add(a)):this.group.remove(a)},e}();function isEffectObject(e){return e.animators&&e.animators.length>0}function makeSeriesScope$1(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["emphasis","lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),labelStatesModels:getLabelStatesModels(t)}}function isPointNaN(e){return isNaN(e[0])||isNaN(e[1])}function lineNeedsDraw(e){return!isPointNaN(e[0])&&!isPointNaN(e[1])}function getNodeGlobalScale(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=e.option.nodeScaleRatio,i=t.scaleX;return((t.getZoom()-1)*n+1)/i}function getSymbolSize(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var v1=[],v2=[],v3=[],quadraticAt$1=quadraticAt,v2DistSquare=distSquare,mathAbs$2=Math.abs;function intersectCurveCircle(e,t,n){for(var i,r=e[0],a=e[1],o=e[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){v1[0]=quadraticAt$1(r[0],a[0],o[0],c),v1[1]=quadraticAt$1(r[1],a[1],o[1],c),(d=mathAbs$2(v2DistSquare(v1,t)-l))<s&&(s=d,i=c)}for(var h=0;h<32;h++){var p=i+u;v2[0]=quadraticAt$1(r[0],a[0],o[0],i),v2[1]=quadraticAt$1(r[1],a[1],o[1],i),v3[0]=quadraticAt$1(r[0],a[0],o[0],p),v3[1]=quadraticAt$1(r[1],a[1],o[1],p);var d=v2DistSquare(v2,t)-l;if(mathAbs$2(d)<.01)break;var f=v2DistSquare(v3,t)-l;u/=2,d<0?f>=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function adjustEdge(e,t){var n=[],i=quadraticSubdivide,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[clone$1(l[0]),clone$1(l[1])],l[2]&&l.__original.push(clone$1(l[2])));var h=l.__original;if(null!=l[2]){if(copy(r[0],h[0]),copy(r[1],h[2]),copy(r[2],h[1]),u&&"none"!==u){var p=getSymbolSize(e.node1),d=intersectCurveCircle(r,h[0],p*t);i(r[0][0],r[1][0],r[2][0],d,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],d,n),r[0][1]=n[3],r[1][1]=n[4]}if(c&&"none"!==c){p=getSymbolSize(e.node2),d=intersectCurveCircle(r,h[1],p*t);i(r[0][0],r[1][0],r[2][0],d,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],d,n),r[1][1]=n[1],r[2][1]=n[2]}copy(l[0],r[0]),copy(l[1],r[2]),copy(l[2],r[1])}else{if(copy(a[0],h[0]),copy(a[1],h[1]),sub(o,a[1],a[0]),normalize(o,o),u&&"none"!==u){p=getSymbolSize(e.node1);scaleAndAdd(a[0],a[0],o,p*t)}if(c&&"none"!==c){p=getSymbolSize(e.node2);scaleAndAdd(a[1],a[1],o,-p*t)}copy(l[0],a[0]),copy(l[1],a[1])}}))}function isViewCoordSys(e){return"view"===e.type}var GraphView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){var n=new SymbolDraw,i=new LineDraw,r=this.group;this._controller=new RoamController(t.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if(isViewCoordSys(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):updateProps(s,l,e)}adjustEdge(e.getGraph(),getNodeGlobalScale(e));var u=e.getData();a.updateData(u);var c=e.getEdgeData();o.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var h=e.forceLayout,p=e.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,p),u.graph.eachNode((function(e){var t=e.dataIndex,n=e.getGraphicEl(),r=e.getModel();n.off("drag").off("dragend");var a=r.get("draggable");a&&n.on("drag",(function(){h&&(h.warmUp(),!i._layouting&&i._startForceLayoutIteration(h,p),h.setFixed(t),u.setItemLayout(t,[n.x,n.y]))})).on("dragend",(function(){h&&h.setUnfixed(t)})),n.setDraggable(a&&!!h),"adjacency"===r.get(["emphasis","focus"])&&(getECData(n).focus=e.getAdjacentDataIndices())})),u.graph.eachEdge((function(e){var t=e.getGraphicEl();"adjacency"===e.getModel().get(["emphasis","focus"])&&(getECData(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var d="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),f=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var n=u.getItemModel(t).get(["label","rotate"])||0,i=e.getSymbolPath();if(d){var r=u.getItemLayout(t),a=Math.atan2(r[1]-g,r[0]-f);a<0&&(a=2*Math.PI+a);var o=r[0]<f;o&&(a-=Math.PI);var s=o?"left":"right";i.setTextConfig({rotation:-a,position:s,origin:"center"});var l=i.ensureState("emphasis");extend(l.textConfig||(l.textConfig={}),{position:s})}else i.setTextConfig({rotation:n*=Math.PI/180})})),this._firstRender=!1},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;!function i(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(i,16):i())}))}()},t.prototype._updateController=function(e,t,n){var i=this,r=this._controller,a=this._controllerHost,o=this.group;r.setPointerChecker((function(t,i,r){var a=o.getBoundingRect();return a.applyTransform(o.transform),a.contain(i,r)&&!onIrrelevantElement(t,n,e)})),isViewCoordSys(e.coordinateSystem)?(r.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(t){updateViewOnPan(a,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){updateViewOnZoom(a,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),i._updateNodeAndLinkScale(),adjustEdge(e.getGraph(),getNodeGlobalScale(e)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):r.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=getNodeGlobalScale(e);t.eachItemGraphicEl((function(e,t){e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){adjustEdge(e.getGraph(),getNodeGlobalScale(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(ChartView);ChartView.registerClass(GraphView),registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){}));var actionInfo={type:"graphRoam",event:"graphRoam",update:"none"};function categoryFilter(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),i=e.getGraph().data,r=n.mapArray(n.getName);i.filterSelf((function(e){var n=i.getItemModel(e).getShallow("category");if(null!=n){"number"==typeof n&&(n=r[n]);for(var a=0;a<t.length;a++)if(!t[a].isSelected(n))return!1}return!0}))}))}function categoryVisual(e){var t={};e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),i=e.getData(),r={};n.each((function(i){var a=n.getName(i);r["ec-"+a]=i;var o=n.getItemModel(i),s=o.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(a,t)),n.setItemVisual(i,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=o.getShallow(l[u],!0);null!=c&&n.setItemVisual(i,l[u],c)}})),n.count()&&i.each((function(e){var t=i.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=r["ec-"+t]);var a=n.getItemVisual(t,"style");extend(i.ensureUniqueItemVisual(e,"style"),a);for(var o=["symbol","symbolSize","symbolKeepAspect"],s=0;s<o.length;s++)i.setItemVisual(e,o[s],n.getItemVisual(t,o[s]))}}))}))}function normalize$2(e){return e instanceof Array||(e=[e,e]),e}function graphEdgeVisual(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),n=e.getEdgeData(),i=normalize$2(e.get("edgeSymbol")),r=normalize$2(e.get("edgeSymbolSize"));n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var i=n.getItemModel(e),r=t.getEdgeByIndex(e),a=normalize$2(i.getShallow("symbol",!0)),o=normalize$2(i.getShallow("symbolSize",!0)),s=i.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(extend(l,s),l.stroke){case"source":var u=r.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=r.node2.getVisual("style");l.stroke=u&&u.fill}a[0]&&r.setVisual("fromSymbol",a[0]),a[1]&&r.setVisual("toSymbol",a[1]),o[0]&&r.setVisual("fromSymbolSize",o[0]),o[1]&&r.setVisual("toSymbolSize",o[1])}))}))}function simpleLayout(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")])})),simpleLayoutEdge(n,e)}}function simpleLayoutEdge(e,t){e.eachEdge((function(e,n){var i=retrieve3(e.getModel().get(["lineStyle","curveness"]),-getCurvenessForEdge(e,t,n,!0),0),r=clone$1(e.node1.getLayout()),a=clone$1(e.node2.getLayout()),o=[r,a];+i&&o.push([(r[0]+a[0])/2-(r[1]-a[1])*i,(r[1]+a[1])/2-(a[0]-r[0])*i]),e.setLayout(o)}))}function graphSimpleLayout(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),n=e.coordinateSystem;if(n&&"view"!==n.type){var i=e.getData(),r=[];each(n.dimensions,(function(e){r=r.concat(i.mapDimensionsAll(e))}));for(var a=0;a<i.count();a++){for(var o=[],s=!1,l=0;l<r.length;l++){var u=i.get(r[l],a);isNaN(u)||(s=!0),o.push(u)}s?i.setItemLayout(a,n.dataToPoint(o)):i.setItemLayout(a,[NaN,NaN])}simpleLayoutEdge(i.graph,e)}else t&&"none"!==t||simpleLayout(e)}))}registerAction(actionInfo,(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){var n=updateCenterAndZoom(t.coordinateSystem,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var PI$7=Math.PI,_symbolRadiansHalf=[];function circularLayout(e,t){var n=e.coordinateSystem;if(!n||"view"===n.type){var i=n.getBoundingRect(),r=e.getData(),a=r.graph,o=i.width/2+i.x,s=i.height/2+i.y,l=Math.min(i.width,i.height)/2,u=r.count();r.setLayout({cx:o,cy:s}),u&&(_layoutNodesBasedOn[t](e,a,r,l,o,s,u),a.eachEdge((function(t,n){var i,r=retrieve3(t.getModel().get(["lineStyle","curveness"]),getCurvenessForEdge(t,e,n),0),a=clone$1(t.node1.getLayout()),l=clone$1(t.node2.getLayout()),u=(a[0]+l[0])/2,c=(a[1]+l[1])/2;+r&&(i=[o*(r*=3)+u*(1-r),s*r+c*(1-r)]),t.setLayout([a,l,i])})))}}var _layoutNodesBasedOn={value:function(e,t,n,i,r,a,o){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||o);t.eachNode((function(e){var t=e.getValue("value"),n=u*(l?t:1)/2;s+=n,e.setLayout([i*Math.cos(s)+r,i*Math.sin(s)+a]),s+=n}))},symbolSize:function(e,t,n,i,r,a,o){var s=0;_symbolRadiansHalf.length=o;var l=getNodeGlobalScale(e);t.eachNode((function(e){var t=getSymbolSize(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var n=Math.asin(t/2/i);isNaN(n)&&(n=PI$7/2),_symbolRadiansHalf[e.dataIndex]=n,s+=2*n}));var u=(2*PI$7-s)/o/2,c=0;t.eachNode((function(e){var t=u+_symbolRadiansHalf[e.dataIndex];c+=t,e.setLayout([i*Math.cos(c)+r,i*Math.sin(c)+a]),c+=t}))}};function graphCircularLayout(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&circularLayout(e,"symbolSize")}))}var scaleAndAdd$1=scaleAndAdd;function forceLayout(e,t,n){for(var i=e,r=t,a=n.rect,o=a.width,s=a.height,l=[a.x+o/2,a.y+s/2],u=null==n.gravity?.1:n.gravity,c=0;c<i.length;c++){var h=i[c];h.p||(h.p=create(o*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=clone$1(h.p),h.edges=null}var p,d,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(e){i[e].fixed=!0},setUnfixed:function(e){i[e].fixed=!1},beforeStep:function(e){p=e},afterStep:function(e){d=e},step:function(e){p&&p(i,r);for(var t=[],n=i.length,a=0;a<r.length;a++){var o=r[a];if(!o.ignoreForceLayout){var s=o.n1;sub(t,(m=o.n2).p,s.p);var c=len(t)-o.d,h=m.w/(s.w+m.w);isNaN(h)&&(h=0),normalize(t,t),!s.fixed&&scaleAndAdd$1(s.p,s.p,t,h*c*g),!m.fixed&&scaleAndAdd$1(m.p,m.p,t,-(1-h)*c*g)}}for(a=0;a<n;a++){(_=i[a]).fixed||(sub(t,l,_.p),scaleAndAdd$1(_.p,_.p,t,u*g))}for(a=0;a<n;a++){s=i[a];for(var f=a+1;f<n;f++){var m;sub(t,(m=i[f]).p,s.p),0===(c=len(t))&&(set(t,Math.random()-.5,Math.random()-.5),c=1);var y=(s.rep+m.rep)/c/c;!s.fixed&&scaleAndAdd$1(s.pp,s.pp,t,y),!m.fixed&&scaleAndAdd$1(m.pp,m.pp,t,-y)}}var v=[];for(a=0;a<n;a++){var _;(_=i[a]).fixed||(sub(v,_.p,_.pp),scaleAndAdd$1(_.p,_.p,v,g),copy(_.pp,_.p))}var x=(g*=.992)<.01;d&&d(i,r,x),e&&e(x)}}}function graphForceLayout(e){e.eachSeriesByType("graph",(function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var n=e.preservedPoints||{},i=e.getGraph(),r=i.data,a=i.edgeData,o=e.getModel("force"),s=o.get("initLayout");e.preservedPoints?r.each((function(e){var t=r.getId(e);r.setItemLayout(e,n[t]||[NaN,NaN])})):s&&"none"!==s?"circular"===s&&circularLayout(e,"value"):simpleLayout(e);var l=r.getDataExtent("value"),u=a.getDataExtent("value"),c=o.get("repulsion"),h=o.get("edgeLength"),p=isArray(c)?c:[c,c],d=isArray(h)?h:[h,h];d=[d[1],d[0]];var f=r.mapArray("value",(function(e,t){var n=r.getItemLayout(t),i=linearMap(e,l,p);return isNaN(i)&&(i=(p[0]+p[1])/2),{w:i,rep:i,fixed:r.getItemModel(t).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}})),g=a.mapArray("value",(function(t,n){var r=i.getEdgeByIndex(n),a=linearMap(t,u,d);isNaN(a)&&(a=(d[0]+d[1])/2);var o=r.getModel(),s=retrieve3(r.getModel().get(["lineStyle","curveness"]),-getCurvenessForEdge(r,e,n,!0),0);return{n1:f[r.node1.dataIndex],n2:f[r.node2.dataIndex],d:a,curveness:s,ignoreForceLayout:o.get("ignoreForceLayout")}})),m=t.getBoundingRect(),y=forceLayout(f,g,{rect:m,gravity:o.get("gravity"),friction:o.get("friction")});y.beforeStep((function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].fixed&&copy(e[n].p,i.getNodeByIndex(n).getLayout())})),y.afterStep((function(e,t,a){for(var o=0,s=e.length;o<s;o++)e[o].fixed||i.getNodeByIndex(o).setLayout(e[o].p),n[r.getId(o)]=e[o].p;for(o=0,s=t.length;o<s;o++){var l=t[o],u=i.getEdgeByIndex(o),c=l.n1.p,h=l.n2.p,p=u.getLayout();(p=p?p.slice():[])[0]=p[0]||[],p[1]=p[1]||[],copy(p[0],c),copy(p[1],h),+l.curveness&&(p[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(p)}})),e.forceLayout=y,e.preservedPoints=n,y.step()}else e.forceLayout=null}))}function getViewRect$2(e,t,n){return getLayoutRect(extend(e.getBoxLayoutParams(),{aspect:n}),{width:t.getWidth(),height:t.getHeight()})}function createViewCoordSys(e,t){var n=[];return e.eachSeriesByType("graph",(function(e){var i=e.get("coordinateSystem");if(!i||"view"===i){var r=e.getData(),a=[],o=[];fromPoints(r.mapArray((function(e){var t=r.getItemModel(e);return[+t.get("x"),+t.get("y")]})),a,o),o[0]-a[0]==0&&(o[0]+=1,a[0]-=1),o[1]-a[1]==0&&(o[1]+=1,a[1]-=1);var s=(o[0]-a[0])/(o[1]-a[1]),l=getViewRect$2(e,t,s);isNaN(s)&&(a=[l.x,l.y],o=[l.x+l.width,l.y+l.height]);var u=o[0]-a[0],c=o[1]-a[1],h=l.width,p=l.height,d=e.coordinateSystem=new View;d.zoomLimit=e.get("scaleLimit"),d.setBoundingRect(a[0],a[1],u,c),d.setViewRect(l.x,l.y,h,p),d.setCenter(e.get("center")),d.setZoom(e.get("zoom")),n.push(d)}})),n}registerProcessor(categoryFilter),registerVisual(categoryVisual),registerVisual(graphEdgeVisual),registerLayout(graphSimpleLayout),registerLayout(PRIORITY.VISUAL.POST_CHART_LAYOUT,graphCircularLayout),registerLayout(graphForceLayout),registerCoordinateSystem("graphView",{dimensions:View.dimensions,create:createViewCoordSys});var GaugeSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListSimply(this,["value"])},t.type="series.gauge",t.defaultOption={zlevel:0,z:2,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},pointer:{icon:null,offsetCenter:[0,0],show:!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}(SeriesModel);SeriesModel.registerClass(GaugeSeriesModel);var PointerShape=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},PointerPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new PointerShape},t.prototype.buildPath=function(e,t){var n=Math.cos,i=Math.sin,r=t.r,a=t.width,o=t.angle,s=t.x-n(o)*a*(a>=r/3?1:2),l=t.y-i(o)*a*(a>=r/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(o)*a,t.y+i(o)*a),e.lineTo(t.x+n(t.angle)*r,t.y+i(t.angle)*r),e.lineTo(t.x-n(o)*a,t.y-i(o)*a),e.lineTo(s,l)},t}(Path);function parsePosition(e,t){var n=e.get("center"),i=t.getWidth(),r=t.getHeight(),a=Math.min(i,r);return{cx:parsePercent$2(n[0],t.getWidth()),cy:parsePercent$2(n[1],t.getHeight()),r:parsePercent$2(e.get("radius"),a/2)}}function formatLabel(e,t){var n=null==e?"":e+"";return t&&("string"==typeof t?n=t.replace("{value}",n):"function"==typeof t&&(n=t(e))),n}var PI2$9=2*Math.PI,GaugeView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i=e.get(["axisLine","lineStyle","color"]),r=parsePosition(e,n);this._renderMain(e,t,n,i,r),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,r){for(var a=this.group,o=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")?SausagePath:Sector,h=u.get("show"),p=u.getModel("lineStyle"),d=p.get("width"),f=(l-s)%PI2$9||l===s?(l-s)%PI2$9:PI2$9,g=s,m=0;h&&m<i.length;m++){var y=new c({shape:{startAngle:g,endAngle:l=s+f*Math.min(Math.max(i[m][0],0),1),cx:r.cx,cy:r.cy,clockwise:o,r0:r.r-d,r:r.r},silent:!0});y.setStyle({fill:i[m][1]}),y.setStyle(p.getLineStyle(["color","width"])),a.add(y),g=l}var v=function(e){if(e<=0)return i[0][1];var t;for(t=0;t<i.length;t++)if(i[t][0]>=e&&(0===t?0:i[t-1][0])<e)return i[t][1];return i[t-1][1]};if(!o){var _=s;s=l,l=_}this._renderTicks(e,t,n,v,r,s,l,o,d),this._renderTitleAndDetail(e,t,n,v,r),this._renderAnchor(e,r),this._renderPointer(e,t,n,v,r,s,l,o,d)},t.prototype._renderTicks=function(e,t,n,i,r,a,o,s,l){for(var u,c,h=this.group,p=r.cx,d=r.cy,f=r.r,g=+e.get("min"),m=+e.get("max"),y=e.getModel("splitLine"),v=e.getModel("axisTick"),_=e.getModel("axisLabel"),x=e.get("splitNumber"),S=v.get("splitNumber"),b=parsePercent$2(y.get("length"),f),T=parsePercent$2(v.get("length"),f),M=a,A=(o-a)/x,I=A/S,C=y.getModel("lineStyle").getLineStyle(),w=v.getModel("lineStyle").getLineStyle(),P=y.get("distance"),L=0;L<=x;L++){if(u=Math.cos(M),c=Math.sin(M),y.get("show")){var E=new Line({shape:{x1:u*(f-(D=P?P+l:l))+p,y1:c*(f-D)+d,x2:u*(f-b-D)+p,y2:c*(f-b-D)+d},style:C,silent:!0});"auto"===C.stroke&&E.setStyle({stroke:i(L/x)}),h.add(E)}if(_.get("show")){var D=_.get("distance")+P,R=formatLabel(round$1(L/x*(m-g)+g),_.get("formatter")),O=i(L/x);h.add(new ZRText({style:createTextStyle(_,{text:R,x:u*(f-b-D)+p,y:c*(f-b-D)+d,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0}))}if(v.get("show")&&L!==x){D=(D=v.get("distance"))?D+l:l;for(var k=0;k<=S;k++){u=Math.cos(M),c=Math.sin(M);var N=new Line({shape:{x1:u*(f-D)+p,y1:c*(f-D)+d,x2:u*(f-T-D)+p,y2:c*(f-T-D)+d},silent:!0,style:w});"auto"===w.stroke&&N.setStyle({stroke:i((L+k/S)/x)}),h.add(N),M+=I}M-=I}else M+=A}},t.prototype._renderPointer=function(e,t,n,i,r,a,o,s,l){var u=this.group,c=this._data,h=this._progressEls,p=[],d=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),y=m.mapDimension("value"),v=+e.get("min"),_=+e.get("max"),x=[v,_],S=[a,o];function b(t,n){var i,a=m.getItemModel(t).getModel("pointer"),o=parsePercent$2(a.get("width"),r.r),s=parsePercent$2(a.get("length"),r.r),l=e.get(["pointer","icon"]),u=a.get("offsetCenter"),c=a.get("keepAspect");return(i=l?createSymbol(l,parsePercent$2(u[0],r.r)-o/2,parsePercent$2(u[1],r.r)-s,o,s,null,c):new PointerPath({shape:{angle:-Math.PI/2,width:parsePercent$2(a.get("width"),r.r),r:parsePercent$2(a.get("length"),r.r)}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function T(e,t){var n=f.get("roundCap")?SausagePath:Sector,i=f.get("overlap"),o=i?f.get("width"):l/m.count(),u=i?r.r-o:r.r-(e+1)*o,c=i?r.r:r.r-e*o,h=new n({shape:{startAngle:a,endAngle:t,cx:r.cx,cy:r.cy,clockwise:s,r0:u,r:c}});return i&&(h.z2=_-m.get(y,e)%_),h}(g||d)&&(m.diff(c).add((function(t){if(d){var n=b(t,a);initProps(n,{rotation:-(linearMap(m.get(y,t),x,S,!0)+Math.PI/2)},e),u.add(n),m.setItemGraphicEl(t,n)}if(g){var i=T(t,a),r=f.get("clip");initProps(i,{shape:{endAngle:linearMap(m.get(y,t),x,S,r)}},e),u.add(i),p[t]=i}})).update((function(t,n){if(d){var i=c.getItemGraphicEl(n),r=i?i.rotation:a,o=b(t,r);o.rotation=r,updateProps(o,{rotation:-(linearMap(m.get(y,t),x,S,!0)+Math.PI/2)},e),u.add(o),m.setItemGraphicEl(t,o)}if(g){var s=h[n],l=T(t,s?s.shape.endAngle:a),v=f.get("clip");updateProps(l,{shape:{endAngle:linearMap(m.get(y,t),x,S,v)}},e),u.add(l),p[t]=l}})).execute(),m.each((function(e){var t=m.getItemModel(e),n=t.getModel("emphasis");if(d){var r=m.getItemGraphicEl(e);r.useStyle(m.getItemVisual(e,"style")),r.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===r.style.fill&&r.setStyle("fill",i(linearMap(m.get(y,e),x,[0,1],!0))),r.z2EmphasisLift=0,setStatesStylesFromModel(r,t),enableHoverEmphasis(r,n.get("focus"),n.get("blurScope"))}if(g){var a=p[e];a.useStyle(m.getItemVisual(e,"style")),a.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),a.z2EmphasisLift=0,setStatesStylesFromModel(a,t),enableHoverEmphasis(a,n.get("focus"),n.get("blurScope"))}})),this._progressEls=p)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),a=n.get("offsetCenter"),o=n.get("keepAspect"),s=createSymbol(r,t.cx-i/2+parsePercent$2(a[0],t.r),t.cy-i/2+parsePercent$2(a[1],t.r),i,i,null,o);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,r){var a=this,o=e.getData(),s=o.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new Group,h=[],p=[],d=e.isAnimationEnabled();o.diff(this._data).add((function(e){h[e]=new ZRText({silent:!0}),p[e]=new ZRText({silent:!0})})).update((function(e,t){h[e]=a._titleEls[t],p[e]=a._detailEls[t]})).execute(),o.each((function(t){var n=o.getItemModel(t),a=o.get(s,t),f=new Group,g=i(linearMap(a,[l,u],[0,1],!0)),m=n.getModel("title");if(m.get("show")){var y=m.get("offsetCenter"),v=r.cx+parsePercent$2(y[0],r.r),_=r.cy+parsePercent$2(y[1],r.r);(C=h[t]).attr({style:createTextStyle(m,{x:v,y:_,text:o.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:g})}),setLabelValueAnimation(C,{normal:m},e.getRawValue(t),(function(){return o.getName(t)})),d&&animateLabelValue(C,t,o,e),f.add(C)}var x=n.getModel("detail");if(x.get("show")){var S=x.get("offsetCenter"),b=r.cx+parsePercent$2(S[0],r.r),T=r.cy+parsePercent$2(S[1],r.r),M=parsePercent$2(x.get("width"),r.r),A=parsePercent$2(x.get("height"),r.r),I=e.get(["progress","show"])?o.getItemVisual(t,"style").fill:g,C=p[t],w=x.get("formatter");C.attr({style:createTextStyle(x,{x:b,y:T,text:formatLabel(a,w),width:isNaN(M)?null:M,height:isNaN(A)?null:A,align:"center",verticalAlign:"middle"},{inheritColor:I})}),setLabelValueAnimation(C,{normal:x},e.getRawValue(t),(function(e){return formatLabel(e,w)})),d&&animateLabelValue(C,t,o,e),f.add(C)}c.add(f)})),this.group.add(c),this._titleEls=h,this._detailEls=p},t.type="gauge",t}(ChartView);ChartView.registerClass(GaugeView);var FunnelSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)})},t.prototype._defaultLabelLine=function(e){defaultEmphasis(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(),i=e.prototype.getDataParams.call(this,t),r=n.mapDimension("value"),a=n.getSum(r);return i.percent=a?+(n.get(r,t)/a*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={zlevel:0,z:2,legendHoverLink:!0,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}(SeriesModel);ComponentModel.registerClass(FunnelSeriesModel);var opacityAccessPath=["itemStyle","opacity"],FunnelPiece=function(e){function t(t,n){var i=e.call(this)||this,r=i,a=new Polyline,o=new ZRText;return r.setTextContent(o),i.setTextGuideLine(a),i.updateData(t,n,!0),i}return __extends(t,e),t.prototype.updateData=function(e,t,n){var i=this,r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=a.getModel("emphasis"),l=a.get(opacityAccessPath);l=null==l?1:l,i.useStyle(e.getItemVisual(t,"style")),i.style.lineJoin="round",n?(i.setShape({points:o.points}),i.style.opacity=0,initProps(i,{style:{opacity:l}},r,t)):updateProps(i,{style:{opacity:l},shape:{points:o.points}},r,t),setStatesStylesFromModel(i,a),this._updateLabel(e,t),enableHoverEmphasis(this,s.get("focus"),s.get("blurScope"))},t.prototype._updateLabel=function(e,t){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),u=l.fill;setLabelStyle(r,getLabelStatesModels(o),{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;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Point(c[0][0],c[0][1]):null},updateProps(r,{style:{x:s.x,y:s.y}},a,t),r.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),setLabelLineStyle(n,getLabelLineStatesModels(o),{stroke:u})},t}(Polygon),FunnelView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this._data,a=this.group;i.diff(r).add((function(e){var t=new FunnelPiece(i,e);i.setItemGraphicEl(e,t),a.add(t)})).update((function(e,t){var n=r.getItemGraphicEl(t);n.updateData(i,e),a.add(n),i.setItemGraphicEl(e,n)})).remove((function(t){removeElementWithFadeOut(r.getItemGraphicEl(t),e,t)})).execute(),this._data=i},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(ChartView);function getViewRect$3(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function getSortedIndices(e,t){for(var n=e.mapDimension("value"),i=e.mapArray(n,(function(e){return e})),r=[],a="ascending"===t,o=0,s=e.count();o<s;o++)r[o]=o;return"function"==typeof t?r.sort(t):"none"!==t&&r.sort((function(e,t){return a?i[e]-i[t]:i[t]-i[e]})),r}function labelLayout(e){var t=e.hostModel.get("orient");e.each((function(n){var i,r,a,o,s=e.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),c=e.getItemLayout(n),h=c.points,p="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(p)"insideLeft"===l?(r=(h[0][0]+h[3][0])/2+5,a=(h[0][1]+h[3][1])/2,i="left"):"insideRight"===l?(r=(h[1][0]+h[2][0])/2-5,a=(h[1][1]+h[2][1])/2,i="right"):(r=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,a=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,i="center"),o=[[r,a],[r,a]];else{var d=void 0,f=void 0,g=void 0,m=void 0,y=u.get("length");0,"left"===l?(d=(h[3][0]+h[0][0])/2,f=(h[3][1]+h[0][1])/2,r=(g=d-y)-5,i="right"):"right"===l?(d=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,r=(g=d+y)+5,i="left"):"top"===l?(d=(h[3][0]+h[0][0])/2,a=(m=(f=(h[3][1]+h[0][1])/2)-y)-5,i="center"):"bottom"===l?(d=(h[1][0]+h[2][0])/2,a=(m=(f=(h[1][1]+h[2][1])/2)+y)+5,i="center"):"rightTop"===l?(d="horizontal"===t?h[3][0]:h[1][0],f="horizontal"===t?h[3][1]:h[1][1],"horizontal"===t?(a=(m=f-y)-5,i="center"):(r=(g=d+y)+5,i="top")):"rightBottom"===l?(d=h[2][0],f=h[2][1],"horizontal"===t?(a=(m=f+y)+5,i="center"):(r=(g=d+y)+5,i="bottom")):"leftTop"===l?(d=h[0][0],f="horizontal"===t?h[0][1]:h[1][1],"horizontal"===t?(a=(m=f-y)-5,i="center"):(r=(g=d-y)-5,i="right")):"leftBottom"===l?(d="horizontal"===t?h[1][0]:h[3][0],f="horizontal"===t?h[1][1]:h[2][1],"horizontal"===t?(a=(m=f+y)+5,i="center"):(r=(g=d-y)-5,i="right")):(d=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,"horizontal"===t?(a=(m=f+y)+5,i="center"):(r=(g=d+y)+5,i="left")),"horizontal"===t?r=g=d:a=m=f,o=[[d,f],[g,m]]}c.label={linePoints:o,x:r,y:a,verticalAlign:"middle",textAlign:i,inside:p}}))}function funnelLayout(e,t){e.eachSeriesByType("funnel",(function(e){var n=e.getData(),i=n.mapDimension("value"),r=e.get("sort"),a=getViewRect$3(e,t),o=e.get("orient"),s=a.width,l=a.height,u=getSortedIndices(n,r),c=a.x,h=a.y,p="horizontal"===o?[parsePercent$2(e.get("minSize"),l),parsePercent$2(e.get("maxSize"),l)]:[parsePercent$2(e.get("minSize"),s),parsePercent$2(e.get("maxSize"),s)],d=n.getDataExtent(i),f=e.get("min"),g=e.get("max");null==f&&(f=Math.min(d[0],0)),null==g&&(g=d[1]);var m=e.get("funnelAlign"),y=e.get("gap"),v=(("horizontal"===o?s:l)-y*(n.count()-1))/n.count(),_=function(e,t){if("horizontal"===o){var r=linearMap(n.get(i,e)||0,[f,g],p,!0),a=void 0;switch(m){case"top":a=h;break;case"center":a=h+(l-r)/2;break;case"bottom":a=h+(l-r)}return[[t,a],[t,a+r]]}var u,d=linearMap(n.get(i,e)||0,[f,g],p,!0);switch(m){case"left":u=c;break;case"center":u=c+(s-d)/2;break;case"right":u=c+s-d}return[[u,t],[u+d,t]]};"ascending"===r&&(v=-v,y=-y,"horizontal"===o?c+=s:h+=l,u=u.reverse());for(var x=0;x<u.length;x++){var S=u[x],b=u[x+1],T=n.getItemModel(S);if("horizontal"===o){var M=T.get(["itemStyle","width"]);null==M?M=v:(M=parsePercent$2(M,s),"ascending"===r&&(M=-M));var A=_(S,c),I=_(b,c+M);c+=M+y,n.setItemLayout(S,{points:A.concat(I.slice().reverse())})}else{var C=T.get(["itemStyle","height"]);null==C?C=v:(C=parsePercent$2(C,l),"ascending"===r&&(C=-C));A=_(S,h),I=_(b,h+C);h+=C+y,n.setItemLayout(S,{points:A.concat(I.slice().reverse())})}}labelLayout(n)}))}function parallelPreprocessor(e){createParallelIfNeeded(e),mergeAxisOptionFromParallel(e)}function createParallelIfNeeded(e){if(!e.parallel){var t=!1;each(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}}function mergeAxisOptionFromParallel(e){each(normalizeToArray(e.parallelAxis),(function(t){if(isObject(t)){var n=t.parallelIndex||0,i=normalizeToArray(e.parallel)[n];i&&i.parallelAxisDefault&&merge(t,i.parallelAxisDefault,!1)}}))}ChartView.registerClass(FunnelView),registerLayout(funnelLayout),registerProcessor(dataFilter("funnel"));var ParallelAxis=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.type=r||"value",o.axisIndex=a,o}return __extends(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(Axis);function sliderMove(e,t,n,i,r,a){e=e||0;var o=n[1]-n[0];if(null!=r&&(r=restrict(r,[0,o])),null!=a&&(a=Math.max(a,null!=r?r:0)),"all"===i){var s=Math.abs(t[1]-t[0]);s=restrict(s,[0,o]),r=a=restrict(s,[r,a]),i=0}t[0]=restrict(t[0],n),t[1]=restrict(t[1],n);var l=getSpanSign(t,i);t[i]+=e;var u,c=r||0,h=n.slice();return l.sign<0?h[0]+=c:h[1]-=c,t[i]=restrict(t[i],h),u=getSpanSign(t,i),null!=r&&(u.sign!==l.sign||u.span<r)&&(t[1-i]=t[i]+l.sign*r),u=getSpanSign(t,i),null!=a&&u.span>a&&(t[1-i]=t[i]+u.sign*a),t}function getSpanSign(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 restrict(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var each$6=each,mathMin$8=Math.min,mathMax$8=Math.max,mathFloor$2=Math.floor,mathCeil$1=Math.ceil,round$2=round$1,PI$8=Math.PI,Parallel=function(){function e(e,t,n){this.type="parallel",this._axesMap=createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var i=e.dimensions,r=e.parallelAxisIndex;each$6(i,(function(e,n){var i=r[n],a=t.getComponent("parallelAxis",i),o=this._axesMap.set(e,new ParallelAxis(e,createScaleByModel(a),[0,0],a.get("type"),i)),s="category"===o.type;o.onBand=s&&a.get("boundaryGap"),o.inverse=a.get("inverse"),a.axis=o,o.model=a,o.coordinateSystem=a.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,i=t.layoutBase,r=t.pixelDimIndex,a=e[1-r],o=e[r];return a>=n&&a<=n+t.axisLength&&o>=i&&o<=i+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 i=n.getData();each$6(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(i,i.mapDimension(e)),niceScaleExtent(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=getLayoutRect(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,i=["x","y"],r=["width","height"],a=t.get("layout"),o="horizontal"===a?0:1,s=n[r[o]],l=[0,s],u=this.dimensions.length,c=restrict$1(t.get("axisExpandWidth"),l),h=restrict$1(t.get("axisExpandCount")||0,[0,u]),p=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow");d?(e=restrict$1(d[1]-d[0],l),d[1]=d[0]+e):(e=restrict$1(c*(h-1),l),(d=[c*(t.get("axisExpandCenter")||mathFloor$2(u/2))-e/2])[1]=d[0]+e);var f=(s-e)/(u-h);f<3&&(f=0);var g=[mathFloor$2(round$2(d[0]/c,1))+1,mathCeil$1(round$2(d[1]/c,1))-1],m=f/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:n[i[o]],layoutLength:s,axisBase:n[i[1-o]],axisLength:n[r[1-o]],axisExpandable:p,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:d,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;t.each((function(e){var t=[0,i.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),each$6(n,(function(t,n){var a=(i.axisExpandable?layoutAxisWithExpand:layoutAxisWithoutExpand)(n,i),o={horizontal:{x:a.position,y:i.axisLength},vertical:{x:0,y:a.position}},s={horizontal:PI$8/2,vertical:0},l=[o[r].x+e.x,o[r].y+e.y],u=s[r],c=create$1();rotate(c,c,u),translate(c,c,l),this._axesLayout[t]={position:l,rotation:u,transform:c,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.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,i){null==n&&(n=0),null==i&&(i=e.count());var r=this._axesMap,a=this.dimensions,o=[],s=[];each(a,(function(t){o.push(e.mapDimension(t)),s.push(r.get(t).model)}));for(var l=this.hasAxisBrushed(),u=n;u<i;u++){var c=void 0;if(l){c="active";for(var h=e.getValues(o,u),p=0,d=a.length;p<d;p++){if("inactive"===s[p].getActiveState(h[p])){c="inactive";break}}}else c="normal";t(c,u)}},e.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,n=!1,i=0,r=e.length;i<r;i++)"normal"!==t.get(e[i]).model.getActiveState()&&(n=!0);return n},e.prototype.axisCoordToPoint=function(e,t){return applyTransform$1([e,0],this._axesLayout[t].transform)},e.prototype.getAxisLayout=function(e){return clone(this._axesLayout[e])},e.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),n=t.pixelDimIndex,i=t.axisExpandWindow.slice(),r=i[1]-i[0],a=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:i};var o,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<r*c[0]?(l="jump",o=s-r*c[2]):h&&u&&s>r*(1-c[0])?(l="jump",o=s-r*(1-c[2])):(o=s-r*c[1])>=0&&(o=s-r*(1-c[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?sliderMove(o,i,a,"all"):l="none";else{var p=i[1]-i[0];(i=[mathMax$8(0,a[1]*s/p-p/2)])[1]=mathMin$8(a[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:l}},e}();function restrict$1(e,t){return mathMin$8(mathMax$8(e,t[0]),t[1])}function layoutAxisWithoutExpand(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function layoutAxisWithExpand(e,t){var n,i,r=t.layoutLength,a=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,c=!1;return e<l[0]?(n=e*s,i=s):e<=l[1]?(n=t.axisExpandWindow0Pos+e*a-t.axisExpandWindow[0],u=a,c=!0):(n=r-(o-1-e)*s,i=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:i}}function create$2(e,t){var n=[];return e.eachComponent("parallel",(function(i,r){var a=new Parallel(i,e,t);a.name="parallel_"+r,a.resize(i,t),i.coordinateSystem=a,a.model=i,n.push(a)})),e.eachSeries((function(e){if("parallel"===e.get("coordinateSystem")){var t=e.getReferringComponents("parallel",SINGLE_REFERRING).models[0];e.coordinateSystem=t.coordinateSystem}})),n}CoordinateSystemManager.register("parallel",{create:create$2});var ParallelAxisModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.activeIntervals=[],n}return __extends(t,e),t.prototype.getAreaSelectStyle=function(){return makeStyleMapper([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},t.prototype.setActiveIntervals=function(e){var t=this.activeIntervals=clone(e);if(t)for(var n=t.length-1;n>=0;n--)asc(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 i=0,r=t.length;i<r;i++)if(t[i][0]<=e&&e<=t[i][1])return"active";return"inactive"},t}(ComponentModel),defaultOption$1={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};ComponentModel.registerClass(ParallelAxisModel),mixin(ParallelAxisModel,AxisModelCommonMixin),axisModelCreator("parallel",ParallelAxisModel,defaultOption$1);var ParallelModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&merge(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){each(["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=[];each(filter(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={zlevel:0,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}(ComponentModel);ComponentModel.registerClass(ParallelModel);var actionInfo$1={type:"axisAreaSelect",event:"axisAreaSelected"};registerAction(actionInfo$1,(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}));var BRUSH_PANEL_GLOBAL=!0,mathMin$9=Math.min,mathMax$9=Math.max,mathPow$2=Math.pow,COVER_Z=1e4,UNSELECT_THRESHOLD=6,MIN_RESIZE_LINE_WIDTH=6,MUTEX_RESOURCE_KEY="globalPan",DIRECTION_MAP={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},CURSOR_MAP={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},DEFAULT_BRUSH_OPT={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},baseUID=0,BrushController=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new Group,n._uid="brushController_"+baseUID++,each(pointerHandlers,(function(e,t){this._handlers[t]=bind(e,this)}),n),n}return __extends(t,e),t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||take(t,MUTEX_RESOURCE_KEY,this._uid),each(this._handlers,(function(e,n){t.on(n,e)})),this._brushType=e.brushType,this._brushOption=merge(clone(DEFAULT_BRUSH_OPT),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;release(e,MUTEX_RESOURCE_KEY,this._uid),each(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={};each(e,(function(e){t[e.panelId]=clone(e)}))}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},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){e=map(e,(function(e){return merge(clone(DEFAULT_BRUSH_OPT),e,!0)}));var t=this._covers,n=this._covers=[],i=this,r=this._creatingCover;return new DataDiffer(t,e,(function(e,t){return a(e.__brushOption,t)}),a).add(o).update(o).remove((function(e){t[e]!==r&&i.group.remove(t[e])})).execute(),this;function a(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function o(a,o){var s=e[a];if(null!=o&&t[o]===r)n[a]=t[o];else{var l=n[a]=null!=o?(t[o].__brushOption=s,t[o]):endCreating(i,createCover(i,s));updateCoverAfterCreation(i,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),clearCovers(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(Eventful);function createCover(e,t){var n=coverRenderers[t.brushType].createCover(e,t);return n.__brushOption=t,updateZ(n,t),e.group.add(n),n}function endCreating(e,t){var n=getCoverRenderer(t);return n.endCreating&&(n.endCreating(e,t),updateZ(t,t.__brushOption)),t}function updateCoverShape(e,t){var n=t.__brushOption;getCoverRenderer(t).updateCoverShape(e,t,n.range,n)}function updateZ(e,t){var n=t.z;null==n&&(n=COVER_Z),e.traverse((function(e){e.z=n,e.z2=n}))}function updateCoverAfterCreation(e,t){getCoverRenderer(t).updateCommon(e,t),updateCoverShape(e,t)}function getCoverRenderer(e){return coverRenderers[e.__brushOption.brushType]}function getPanelByPoint(e,t,n){var i,r=e._panels;if(!r)return BRUSH_PANEL_GLOBAL;var a=e._transform;return each(r,(function(e){e.isTargetByCursor(t,n,a)&&(i=e)})),i}function getPanelByCover(e,t){var n=e._panels;if(!n)return BRUSH_PANEL_GLOBAL;var i=t.__brushOption.panelId;return null!=i?n[i]:BRUSH_PANEL_GLOBAL}function clearCovers(e){var t=e._covers,n=t.length;return each(t,(function(t){e.group.remove(t)}),e),t.length=0,!!n}function trigger$1(e,t){var n=map(e._covers,(function(e){var t=e.__brushOption,n=clone(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}}));e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function shouldShowCover(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],i=t[0],r=n[0]-i[0],a=n[1]-i[1];return mathPow$2(r*r+a*a,.5)>UNSELECT_THRESHOLD}function getTrackEnds(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function createBaseRectCover(e,t,n,i){var r=new Group;return r.add(new Rect({name:"main",style:makeStyle(n),silent:!0,draggable:!0,cursor:"move",drift:curry(driftRect,e,t,r,["n","s","w","e"]),ondragend:curry(trigger$1,t,{isEnd:!0})})),each(i,(function(n){r.add(new Rect({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:curry(driftRect,e,t,r,n),ondragend:curry(trigger$1,t,{isEnd:!0})}))})),r}function updateBaseRect(e,t,n,i){var r=i.brushStyle.lineWidth||0,a=mathMax$9(r,MIN_RESIZE_LINE_WIDTH),o=n[0][0],s=n[1][0],l=o-r/2,u=s-r/2,c=n[0][1],h=n[1][1],p=c-a+r/2,d=h-a+r/2,f=c-o,g=h-s,m=f+r,y=g+r;updateRectShape(e,t,"main",o,s,f,g),i.transformable&&(updateRectShape(e,t,"w",l,u,a,y),updateRectShape(e,t,"e",p,u,a,y),updateRectShape(e,t,"n",l,u,m,a),updateRectShape(e,t,"s",l,d,m,a),updateRectShape(e,t,"nw",l,u,a,a),updateRectShape(e,t,"ne",p,u,a,a),updateRectShape(e,t,"sw",l,d,a,a),updateRectShape(e,t,"se",p,d,a,a))}function updateCommon(e,t){var n=t.__brushOption,i=n.transformable,r=t.childAt(0);r.useStyle(makeStyle(n)),r.attr({silent:!i,cursor:i?"move":"default"}),each([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var r=t.childOfName(n.join("")),a=1===n.length?getGlobalDirection1(e,n[0]):getGlobalDirection2(e,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?CURSOR_MAP[a]+"-resize":null})}))}function updateRectShape(e,t,n,i,r,a,o){var s=t.childOfName(n);s&&s.setShape(pointsToRect(clipByPanel(e,t,[[i,r],[i+a,r+o]])))}function makeStyle(e){return defaults({strokeNoScale:!0},e.brushStyle)}function formatRectRange(e,t,n,i){var r=[mathMin$9(e,n),mathMin$9(t,i)],a=[mathMax$9(e,n),mathMax$9(t,i)];return[[r[0],a[0]],[r[1],a[1]]]}function getTransform$1(e){return getTransform(e.group)}function getGlobalDirection1(e,t){return{left:"w",right:"e",top:"n",bottom:"s"}[transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],getTransform$1(e))]}function getGlobalDirection2(e,t){var n=[getGlobalDirection1(e,t[0]),getGlobalDirection1(e,t[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function driftRect(e,t,n,i,r,a){var o=n.__brushOption,s=e.toRectRange(o.range),l=toLocalDelta(t,r,a);each(i,(function(e){var t=DIRECTION_MAP[e];s[t[0]][t[1]]+=l[t[0]]})),o.range=e.fromRectRange(formatRectRange(s[0][0],s[1][0],s[0][1],s[1][1])),updateCoverAfterCreation(t,n),trigger$1(t,{isEnd:!1})}function driftPolygon(e,t,n,i){var r=t.__brushOption.range,a=toLocalDelta(e,n,i);each(r,(function(e){e[0]+=a[0],e[1]+=a[1]})),updateCoverAfterCreation(e,t),trigger$1(e,{isEnd:!1})}function toLocalDelta(e,t,n){var i=e.group,r=i.transformCoordToLocal(t,n),a=i.transformCoordToLocal(0,0);return[r[0]-a[0],r[1]-a[1]]}function clipByPanel(e,t,n){var i=getPanelByCover(e,t);return i&&i!==BRUSH_PANEL_GLOBAL?i.clipPath(n,e._transform):clone(n)}function pointsToRect(e){var t=mathMin$9(e[0][0],e[1][0]),n=mathMin$9(e[0][1],e[1][1]);return{x:t,y:n,width:mathMax$9(e[0][0],e[1][0])-t,height:mathMax$9(e[0][1],e[1][1])-n}}function resetCursor(e,t,n){if(e._brushType&&!isOutsideZrArea(e,t.offsetX,t.offsetY)){var i=e._zr,r=e._covers,a=getPanelByPoint(e,t,n);if(!e._dragging)for(var o=0;o<r.length;o++){var s=r[o].__brushOption;if(a&&(a===BRUSH_PANEL_GLOBAL||s.panelId===a.panelId)&&coverRenderers[s.brushType].contain(r[o],n[0],n[1]))return}a&&i.setCursorStyle("crosshair")}}function preventDefault(e){var t=e.event;t.preventDefault&&t.preventDefault()}function mainShapeContain(e,t,n){return e.childOfName("main").contain(t,n)}function updateCoverByMouse(e,t,n,i){var r,a=e._creatingCover,o=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),shouldShowCover(e)||a){if(o&&!a){"single"===s.brushMode&&clearCovers(e);var l=clone(s);l.brushType=determineBrushType(l.brushType,o),l.panelId=o===BRUSH_PANEL_GLOBAL?null:o.panelId,a=e._creatingCover=createCover(e,l),e._covers.push(a)}if(a){var u=coverRenderers[determineBrushType(e._brushType,o)];a.__brushOption.range=u.getCreatingRange(clipByPanel(e,a,e._track)),i&&(endCreating(e,a),u.updateCommon(e,a)),updateCoverShape(e,a),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&getPanelByPoint(e,t,n)&&clearCovers(e)&&(r={isEnd:i,removeOnClick:!0});return r}function determineBrushType(e,t){return"auto"===e?t.defaultBrushType:e}var pointerHandlers={mousedown:function(e){if(this._dragging)handleDragEnd(this,e);else if(!e.target||!e.target.draggable){preventDefault(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=getPanelByPoint(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,i=this.group.transformCoordToLocal(t,n);if(resetCursor(this,e,i),this._dragging){preventDefault(e);var r=updateCoverByMouse(this,e,i,!1);r&&trigger$1(this,r)}},mouseup:function(e){handleDragEnd(this,e)}};function handleDragEnd(e,t){if(e._dragging){preventDefault(t);var n=t.offsetX,i=t.offsetY,r=e.group.transformCoordToLocal(n,i),a=updateCoverByMouse(e,t,r,!0);e._dragging=!1,e._track=[],e._creatingCover=null,a&&trigger$1(e,a)}}function isOutsideZrArea(e,t,n){var i=e._zr;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}var coverRenderers={lineX:getLineRenderer(0),lineY:getLineRenderer(1),rect:{createCover:function(e,t){function n(e){return e}return createBaseRectCover({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=getTrackEnds(e);return formatRectRange(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,i){updateBaseRect(e,t,n,i)},updateCommon:updateCommon,contain:mainShapeContain},polygon:{createCover:function(e,t){var n=new Group;return n.add(new Polyline({name:"main",style:makeStyle(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Polygon({name:"main",draggable:!0,drift:curry(driftPolygon,e,t),ondragend:curry(trigger$1,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,i){t.childAt(0).setShape({points:clipByPanel(e,t,n)})},updateCommon:updateCommon,contain:mainShapeContain}};function getLineRenderer(e){return{createCover:function(t,n){return createBaseRectCover({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=getTrackEnds(t);return[mathMin$9(n[0][e],n[1][e]),mathMax$9(n[0][e],n[1][e])]},updateCoverShape:function(t,n,i,r){var a,o=getPanelByCover(t,n);if(o!==BRUSH_PANEL_GLOBAL&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[i,a];e&&l.reverse(),updateBaseRect(t,n,l,r)},updateCommon:updateCommon,contain:mainShapeContain}}function makeRectPanelClipPath(e){return e=normalizeRect(e),function(t){return clipPointsByRect(t,e)}}function makeLinearBrushOtherExtent(e,t){return e=normalizeRect(e),function(n){var i=null!=t?t:n,r=i?e.width:e.height,a=i?e.x:e.y;return[a,a+(r||0)]}}function makeRectIsTargetByCursor(e,t,n){var i=normalizeRect(e);return function(e,r){return i.contain(r[0],r[1])&&!onIrrelevantElement(e,t,n)}}function normalizeRect(e){return BoundingRect.create(e)}var elementList=["axisLine","axisTickLabel","axisName"],ParallelAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new BrushController(n.getZr())).on("brush",bind(this._onBrush,this))},t.prototype.render=function(e,t,n,i){if(!fromAxisAreaSelect(e,t,i)){this.axisModel=e,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Group,this.group.add(this._axisGroup),e.get("show")){var a=getCoordSysModel(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,c=extend({strokeContainThreshold:l},o.getAxisLayout(u)),h=new AxisBuilder(e,c);each(elementList,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,e,a,l,n),groupTransition(r,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,i,r,a){var o=n.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=BoundingRect.create({x:o[0],y:-r/2,width:s,height:r});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:makeRectPanelClipPath(u),isTargetByCursor:makeRectIsTargetByCursor(u,a,i),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(getCoverInfoList(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,i=n.axis,r=map(t,(function(e){return[i.coordToData(e.range[0],!0),i.coordToData(e.range[1],!0)]}));(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(ComponentView);function fromAxisAreaSelect(e,t,n){return n&&"axisAreaSelect"===n.type&&t.findComponents({mainType:"parallelAxis",query:n})[0]===e}function getCoverInfoList(e){var t=e.axis;return map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}function getCoordSysModel(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}ComponentView.registerClass(ParallelAxisView);var CLICK_THRESHOLD=5,ParallelView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},each(handlers,(function(e,t){n.getZr().on(t,this._handlers[t]=bind(e,this))}),this)),createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},t.prototype.dispose=function(e,t){each(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(extend({type:"parallelAxisExpand"},e))},t.type="parallel",t}(ComponentView);ComponentView.registerClass(ParallelView);var handlers={mousedown:function(e){checkTrigger(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(checkTrigger(this,"click")&&t){var n=[e.offsetX,e.offsetY];if(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)>CLICK_THRESHOLD)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&checkTrigger(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function checkTrigger(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}registerPreprocessor(parallelPreprocessor);var ParallelSeriesModel=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 __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:bind(makeDefaultEncode,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),i=[];return t.eachActiveState(n,(function(t,r){e===t&&i.push(n.getRawIndex(r))})),i},t.type="series.parallel",t.dependencies=["parallel"],t.defaultOption={zlevel:0,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}(SeriesModel);function makeDefaultEncode(e){var t=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(t){var n={};return each(t.dimensions,(function(e){var t=convertDimNameToNumber(e);n[e]=t})),n}}function convertDimNameToNumber(e){return+e.replace("dim","")}SeriesModel.registerClass(ParallelSeriesModel);var DEFAULT_SMOOTH=.3,ParallelView$1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Group,n._initialized=!1,n}return __extends(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,i){var r=this._dataGroup,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=makeSeriesScope$2(e);if(a.diff(o).add((function(e){updateElCommon(addEl(a,r,e,l,s),a,e,u)})).update((function(t,n){var i=o.getItemGraphicEl(n),r=createLinePoints(a,t,l,s);a.setItemGraphicEl(t,i),updateProps(i,{shape:{points:r}},e,t),updateElCommon(i,a,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);r.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=createGridClipShape(s,e,(function(){setTimeout((function(){r.removeClipPath()}))}));r.setClipPath(c)}this._data=a},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 i=t.getData(),r=t.coordinateSystem,a=r.dimensions,o=makeSeriesScope$2(t),s=e.start;s<e.end;s++){var l=addEl(i,this._dataGroup,s,a,r);l.incremental=!0,updateElCommon(l,i,s,o)}},t.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},t.type="parallel",t}(ChartView);function createGridClipShape(e,t,n){var i=e.model,r=e.getRect(),a=new Rect({shape:{x:r.x,y:r.y,width:r.width,height:r.height}}),o="horizontal"===i.get("layout")?"width":"height";return a.setShape(o,0),initProps(a,{shape:{width:r.width,height:r.height}},t,n),a}function createLinePoints(e,t,n,i){for(var r=[],a=0;a<n.length;a++){var o=n[a],s=e.get(e.mapDimension(o),t);isEmptyValue(s,i.getAxis(o).type)||r.push(i.dataToPoint(s,o))}return r}function addEl(e,t,n,i,r){var a=createLinePoints(e,n,i,r),o=new Polyline({shape:{points:a},z2:10});return t.add(o),e.setItemGraphicEl(n,o),o}function makeSeriesScope$2(e){var t=e.get("smooth",!0);return!0===t&&(t=DEFAULT_SMOOTH),eqNaN(t=numericToNumber(t))&&(t=0),{smooth:t}}function updateElCommon(e,t,n,i){e.useStyle(t.getItemVisual(n,"style")),e.style.fill=null,e.setShape("smooth",i.smooth);var r=t.getItemModel(n),a=r.getModel("emphasis");setStatesStylesFromModel(e,r,"lineStyle"),enableHoverEmphasis(e,a.get("focus"),a.get("blurScope"))}function isEmptyValue(e,t){return"category"===t?null==e:null==e||isNaN(e)}ChartView.registerClass(ParallelView$1);var opacityAccessPath$1=["lineStyle","opacity"],parallelVisual={seriesType:"parallel",reset:function(e,t){var n=e.coordinateSystem,i={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 r=i[e];if("normal"===e&&t.hasItemOption){var a=t.getItemModel(n).get(opacityAccessPath$1,!0);null!=a&&(r=a)}t.ensureUniqueItemVisual(n,"style").opacity=r}),e.start,e.end)}}}};registerVisual(PRIORITY.VISUAL.BRUSH,parallelVisual);var SankeySeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n=e.edges||e.links,i=e.data||e.nodes,r=e.levels;this.levelModels=[];for(var a=this.levelModels,o=0;o<r.length;o++)null!=r[o].depth&&r[o].depth>=0&&(a[r[o].depth]=new Model(r[o],this,t));if(i&&n)return createGraphFromNodeEdge(i,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getData().getItemLayout(t);if(i){var r=i.depth,a=n.levelModels[r];a&&(e.parentModel=a)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(i){var r=i.depth,a=n.levelModels[r];a&&(e.parentModel=a)}return e}))})).data},t.prototype.setNodePosition=function(e,t){var n=this.option.data[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 i(e){return isNaN(e)||null==e}if("edge"===n){var r=this.getDataParams(e,n),a=r.data,o=r.value;return createTooltipMarkup("nameValue",{name:a.source+" -- "+a.target,value:o,noValue:i(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value;return createTooltipMarkup("nameValue",{name:this.getDataParams(e,n).data.name,value:s,noValue:i(s)})},t.prototype.optionUpdated=function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},t.prototype.getDataParams=function(t,n){var i=e.prototype.getDataParams.call(this,t,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(t).getLayout().value;i.value=r}return i},t.type="series.sankey",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",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}(SeriesModel);SeriesModel.registerClass(SankeySeriesModel);var SankeyPathShape=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},SankeyPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SankeyPathShape},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(){enterEmphasis(this)},t.prototype.downplay=function(){leaveEmphasis(this)},t}(Path),SankeyView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this,r=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),c=e.getData("edge"),h=e.get("orient");this._model=e,a.removeAll(),a.x=o.x,a.y=o.y,r.eachEdge((function(t){var n=new SankeyPath,i=getECData(n);i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var r,o,u,p,d,f,g,m,y=t.getModel(),v=y.getModel("lineStyle"),_=v.get("curveness"),x=t.node1.getLayout(),S=t.node1.getModel(),b=S.get("localX"),T=S.get("localY"),M=t.node2.getLayout(),A=t.node2.getModel(),I=A.get("localX"),C=A.get("localY"),w=t.getLayout();switch(n.shape.extent=Math.max(1,w.dy),n.shape.orient=h,"vertical"===h?(r=(null!=b?b*s:x.x)+w.sy,o=(null!=T?T*l:x.y)+x.dy,u=(null!=I?I*s:M.x)+w.ty,d=r,f=o*(1-_)+(p=null!=C?C*l:M.y)*_,g=u,m=o*_+p*(1-_)):(r=(null!=b?b*s:x.x)+x.dx,o=(null!=T?T*l:x.y)+w.sy,d=r*(1-_)+(u=null!=I?I*s:M.x)*_,f=o,g=r*_+u*(1-_),m=p=(null!=C?C*l:M.y)+w.ty),n.setShape({x1:r,y1:o,x2:u,y2:p,cpx1:d,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(v.getItemStyle()),n.style.fill){case"source":n.style.fill=t.node1.getVisual("color"),n.style.decal=t.node1.getVisual("style").decal;break;case"target":n.style.fill=t.node2.getVisual("color"),n.style.decal=t.node2.getVisual("style").decal;break;case"gradient":var P=t.node1.getVisual("color"),L=t.node2.getVisual("color");"string"==typeof P&&"string"==typeof L&&(n.style.fill=new LinearGradient(0,0,1,0,[{color:P,offset:0},{color:L,offset:1}]))}var E=y.getModel("emphasis");setStatesStylesFromModel(n,y,"lineStyle",(function(e){return e.getItemStyle()})),a.add(n),c.setItemGraphicEl(t.dataIndex,n);var D=E.get("focus");enableHoverEmphasis(n,"adjacency"===D?t.getAdjacentDataIndices():D,E.get("blurScope")),getECData(n).dataType="edge"})),r.eachNode((function(t){var n=t.getLayout(),i=t.getModel(),r=i.get("localX"),o=i.get("localY"),c=i.getModel("emphasis"),h=new Rect({shape:{x:null!=r?r*s:n.x,y:null!=o?o*l:n.y,width:n.dx,height:n.dy},style:i.getModel("itemStyle").getItemStyle()});setLabelStyle(h,getLabelStatesModels(i),{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id}),h.disableLabelAnimation=!0,h.setStyle("fill",t.getVisual("color")),h.setStyle("decal",t.getVisual("style").decal),setStatesStylesFromModel(h,i),a.add(h),u.setItemGraphicEl(t.dataIndex,h),getECData(h).dataType="node";var p=c.get("focus");enableHoverEmphasis(h,"adjacency"===p?t.getAdjacentDataIndices():p,c.get("blurScope"))})),u.eachItemGraphicEl((function(t,r){u.getItemModel(r).get("draggable")&&(t.drift=function(t,a){i._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){i._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&a.setClipPath(createGridClipShape$1(a.getBoundingRect(),e,(function(){a.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(ChartView);function createGridClipShape$1(e,t,n){var i=new Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return initProps(i,{shape:{width:e.width+20}},t,n),i}function sankeyLayout(e,t){e.eachSeriesByType("sankey",(function(e){var n=e.get("nodeWidth"),i=e.get("nodeGap"),r=getViewRect$4(e,t);e.layoutInfo=r;var a=r.width,o=r.height,s=e.getGraph(),l=s.nodes,u=s.edges;computeNodeValues(l),layoutSankey(l,u,n,i,a,o,0!==filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function getViewRect$4(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function layoutSankey(e,t,n,i,r,a,o,s,l){computeNodeBreadths(e,t,n,r,a,s,l),computeNodeDepths(e,t,a,r,i,o,s),computeEdgeDepths(e,s)}function computeNodeValues(e){each(e,(function(e){var t=sum(e.outEdges,getEdgeValue),n=sum(e.inEdges,getEdgeValue),i=e.getValue()||0,r=Math.max(t,n,i);e.setLayout({value:r},!0)}))}function computeNodeBreadths(e,t,n,i,r,a,o){for(var s=[],l=[],u=[],c=[],h=0,p=0;p<t.length;p++)s[p]=1;for(p=0;p<e.length;p++)l[p]=e[p].inEdges.length,0===l[p]&&u.push(e[p]);for(var d=-1;u.length;){for(var f=0;f<u.length;f++){var g=u[f],m=g.hostGraph.data.getRawDataItem(g.dataIndex),y=null!=m.depth&&m.depth>=0;y&&m.depth>d&&(d=m.depth),g.setLayout({depth:y?m.depth:h},!0),"vertical"===a?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var v=0;v<g.outEdges.length;v++){var _=g.outEdges[v];s[t.indexOf(_)]=0;var x=_.node2;0==--l[e.indexOf(x)]&&c.indexOf(x)<0&&c.push(x)}}++h,u=c,c=[]}for(p=0;p<s.length;p++)if(1===s[p])throw new Error("Sankey is a DAG, the original data has cycle!");var S=d>h-1?d:h-1;o&&"left"!==o&&adjustNodeWithNodeAlign(e,o,a,S),scaleNodeBreadths(e,"vertical"===a?(r-n)/S:(i-n)/S,a)}function isNodeDepth(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function adjustNodeWithNodeAlign(e,t,n,i){if("right"===t){for(var r=[],a=e,o=0;a.length;){for(var s=0;s<a.length;s++){var l=a[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var c=l.inEdges[u];r.indexOf(c.node1)<0&&r.push(c.node1)}}a=r,r=[],++o}each(e,(function(e){isNodeDepth(e)||e.setLayout({depth:Math.max(0,i-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&moveSinksRight(e,i)}function moveSinksRight(e,t){each(e,(function(e){isNodeDepth(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}function scaleNodeBreadths(e,t,n){each(e,(function(e){var i=e.getLayout().depth*t;"vertical"===n?e.setLayout({y:i},!0):e.setLayout({x:i},!0)}))}function computeNodeDepths(e,t,n,i,r,a,o){var s=prepareNodesByBreadth(e,o);initializeNodeDepth(s,t,n,i,r,o),resolveCollisions(s,r,n,i,o);for(var l=1;a>0;a--)relaxRightToLeft(s,l*=.99,o),resolveCollisions(s,r,n,i,o),relaxLeftToRight(s,l,o),resolveCollisions(s,r,n,i,o)}function prepareNodesByBreadth(e,t){var n=[],i="vertical"===t?"y":"x",r=groupData(e,(function(e){return e.getLayout()[i]}));return r.keys.sort((function(e,t){return e-t})),each(r.keys,(function(e){n.push(r.buckets.get(e))})),n}function initializeNodeDepth(e,t,n,i,r,a){var o=1/0;each(e,(function(e){var t=e.length,s=0;each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===a?(i-(t-1)*r)/s:(n-(t-1)*r)/s;l<o&&(o=l)})),each(e,(function(e){each(e,(function(e,t){var n=e.getLayout().value*o;"vertical"===a?(e.setLayout({x:t},!0),e.setLayout({dx:n},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:n},!0))}))})),each(t,(function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)}))}function resolveCollisions(e,t,n,i,r){var a="vertical"===r?"x":"y";each(e,(function(e){var o,s,l;e.sort((function(e,t){return e.getLayout()[a]-t.getLayout()[a]}));for(var u=0,c=e.length,h="vertical"===r?"dx":"dy",p=0;p<c;p++)(l=u-(s=e[p]).getLayout()[a])>0&&(o=s.getLayout()[a]+l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]+s.getLayout()[h]+t;if((l=u-t-("vertical"===r?i:n))>0){o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o;for(p=c-2;p>=0;--p)(l=(s=e[p]).getLayout()[a]+s.getLayout()[h]+t-u)>0&&(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]}}))}function relaxRightToLeft(e,t,n){each(e.slice().reverse(),(function(e){each(e,(function(e){if(e.outEdges.length){var i=sum(e.outEdges,weightedTarget,n)/sum(e.outEdges,getEdgeValue);if(isNaN(i)){var r=e.outEdges.length;i=r?sum(e.outEdges,centerTarget,n)/r:0}if("vertical"===n){var a=e.getLayout().x+(i-center$1(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(i-center$1(e,n))*t;e.setLayout({y:o},!0)}}}))}))}function weightedTarget(e,t){return center$1(e.node2,t)*e.getValue()}function centerTarget(e,t){return center$1(e.node2,t)}function weightedSource(e,t){return center$1(e.node1,t)*e.getValue()}function centerSource(e,t){return center$1(e.node1,t)}function center$1(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function getEdgeValue(e){return e.getValue()}function sum(e,t,n){for(var i=0,r=e.length,a=-1;++a<r;){var o=+t(e[a],n);isNaN(o)||(i+=o)}return i}function relaxLeftToRight(e,t,n){each(e,(function(e){each(e,(function(e){if(e.inEdges.length){var i=sum(e.inEdges,weightedSource,n)/sum(e.inEdges,getEdgeValue);if(isNaN(i)){var r=e.inEdges.length;i=r?sum(e.inEdges,centerSource,n)/r:0}if("vertical"===n){var a=e.getLayout().x+(i-center$1(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(i-center$1(e,n))*t;e.setLayout({y:o},!0)}}}))}))}function computeEdgeDepths(e,t){var n="vertical"===t?"x":"y";each(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]}))})),each(e,(function(e){var t=0,n=0;each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),each(e.inEdges,(function(e){e.setLayout({ty:n},!0),n+=e.getLayout().dy}))}))}function sankeyVisual(e){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var n=1/0,i=-1/0;each(t,(function(e){var t=e.getLayout().value;t<n&&(n=t),t>i&&(i=t)})),each(t,(function(t){var r=new VisualMapping({type:"color",mappingMethod:"linear",dataExtent:[n,i],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),a=t.getModel().get(["itemStyle","color"]);null!=a?(t.setVisual("color",a),t.setVisual("style",{fill:a})):(t.setVisual("color",r),t.setVisual("style",{fill:r}))}))}}))}ChartView.registerClass(SankeyView),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])}))})),registerLayout(sankeyLayout),registerVisual(sankeyVisual);var WhiskerBoxCommonMixin=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,i,r=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=r.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(e.layout="vertical",n=a.getOrdinalMeta(),i=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],p=[r,a],d=p[u].get("type"),f=p[1-u].get("type"),g=e.data;if(g&&i){var m=[];each(g,(function(e,t){var n;isArray(e)?(n=e.slice(),e.unshift(t)):isArray(e.value)?(n=e.value.slice(),e.value.unshift(t)):n=e,m.push(n)})),e.data=m}var y=this.defaultValueDimensions,v=[{name:c,type:getDimensionTypeByAxis(d),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:getDimensionTypeByAxis(f),dimsDef:y.slice()}];return createListSimply(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:curry(makeSeriesEncodeForAxisCoordSys,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),BoxplotSeriesModel=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 __extends(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={zlevel:0,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}(SeriesModel);mixin(BoxplotSeriesModel,WhiskerBoxCommonMixin,!0),SeriesModel.registerClass(BoxplotSeriesModel);var BoxplotView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this.group,a=this._data;this._data||r.removeAll();var o="horizontal"===e.get("layout")?1:0;i.diff(a).add((function(e){if(i.hasValue(e)){var t=createNormalBox(i.getItemLayout(e),i,e,o,!0);i.setItemGraphicEl(e,t),r.add(t)}})).update((function(e,t){var n=a.getItemGraphicEl(t);if(i.hasValue(e)){var s=i.getItemLayout(e);n?updateNormalBoxData(s,n,i,e):n=createNormalBox(s,i,e,o),r.add(n),i.setItemGraphicEl(e,n)}else r.remove(n)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=i},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}(ChartView),BoxPathShape=function(){},BoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new BoxPathShape},t.prototype.buildPath=function(e,t){var n=t.points,i=0;for(e.moveTo(n[i][0],n[i][1]),i++;i<4;i++)e.lineTo(n[i][0],n[i][1]);for(e.closePath();i<n.length;i++)e.moveTo(n[i][0],n[i][1]),i++,e.lineTo(n[i][0],n[i][1])},t}(Path);function createNormalBox(e,t,n,i,r){var a=e.ends,o=new BoxPath({shape:{points:r?transInit(a,i,e):a}});return updateNormalBoxData(e,o,t,n,r),o}function updateNormalBoxData(e,t,n,i,r){var a=n.hostModel;(0,graphic[r?"initProps":"updateProps"])(t,{shape:{points:e.ends}},a,i),t.useStyle(n.getItemVisual(i,"style")),t.style.strokeNoScale=!0,t.z2=100;var o=n.getItemModel(i);setStatesStylesFromModel(t,o),enableHoverEmphasis(t,o.get(["emphasis","focus"]),o.get(["emphasis","blurScope"]))}function transInit(e,t,n){return map(e,(function(e){return(e=e.slice())[t]=n.initBaseline,e}))}function boxplotVisual(e,t){e.eachRawSeriesByType("boxplot",(function(e){e.getData().setVisual("legendSymbol","roundRect")}))}ChartView.registerClass(BoxplotView);var each$7=each;function boxplotLayout(e){var t=groupSeriesByAxis(e);each$7(t,(function(e){var t=e.seriesModels;t.length&&(calculateBase(e),each$7(t,(function(t,n){layoutSingleSeries(t,e.boxOffsetList[n],e.boxWidthList[n])})))}))}function groupSeriesByAxis(e){var t=[],n=[];return e.eachSeriesByType("boxplot",(function(e){var i=e.getBaseAxis(),r=indexOf(n,i);r<0&&(r=n.length,n[r]=i,t[r]={axis:i,seriesModels:[]}),t[r].seriesModels.push(e)})),t}function calculateBase(e){var t,n,i=e.axis,r=e.seriesModels,a=r.length,o=e.boxWidthList=[],s=e.boxOffsetList=[],l=[];if("category"===i.type)n=i.getBandWidth();else{var u=0;each$7(r,(function(e){u=Math.max(u,e.getData().count())})),t=i.getExtent(),Math.abs(t[1]-t[0])}each$7(r,(function(e){var t=e.get("boxWidth");isArray(t)||(t=[t,t]),l.push([parsePercent$2(t[0],n)||0,parsePercent$2(t[1],n)||0])}));var c=.8*n-2,h=c/a*.3,p=(c-h*(a-1))/a,d=p/2-c/2;each$7(r,(function(e,t){s.push(d),d+=h+p,o.push(Math.min(Math.max(p,l[t][0]),l[t][1]))}))}function layoutSingleSeries(e,t,n){var i=e.coordinateSystem,r=e.getData(),a=n/2,o="horizontal"===e.get("layout")?0:1,s=1-o,l=["x","y"],u=r.mapDimension(l[o]),c=r.mapDimensionsAll(l[s]);if(!(null==u||c.length<5))for(var h=0;h<r.count();h++){var p=r.get(u,h),d=_(p,c[2],h),f=_(p,c[0],h),g=_(p,c[1],h),m=_(p,c[3],h),y=_(p,c[4],h),v=[];x(v,g,!1),x(v,m,!0),v.push(f,g,y,m),S(v,f),S(v,y),S(v,d),r.setItemLayout(h,{initBaseline:d[s],ends:v})}function _(e,n,a){var l,u=r.get(n,a),c=[];return c[o]=e,c[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=i.dataToPoint(c))[o]+=t,l}function x(e,t,n){var i=t.slice(),r=t.slice();i[o]+=a,r[o]-=a,n?e.push(i,r):e.push(r,i)}function S(e,t){var n=t.slice(),i=t.slice();n[o]-=a,i[o]+=a,e.push(n,i)}}function prepareBoxplotData(e,t){for(var n=[],i=[],r=(t=t||{}).boundIQR,a="none"===r||0===r,o=0;o<e.length;o++){var s=asc(e[o].slice()),l=quantile(s,.25),u=quantile(s,.5),c=quantile(s,.75),h=s[0],p=s[s.length-1],d=(null==r?1.5:r)*(c-l),f=a?h:Math.max(h,l-d),g=a?p:Math.min(p,c+d),m=t.itemNameFormatter,y=isFunction(m)?m({value:o}):isString(m)?m.replace("{value}",o+""):o+"";n.push([y,f,l,u,c,g]);for(var v=0;v<s.length;v++){var _=s[v];if(_<f||_>g){var x=[y,_];i.push(x)}}}return{boxData:n,outliers:i}}var boxplotTransform={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==SOURCE_FORMAT_ARRAY_ROWS){var n="";0,throwError(n)}var i=prepareBoxplotData(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};registerVisual(boxplotVisual),registerLayout(boxplotLayout),registerTransform(boxplotTransform);var CandlestickSeriesModel=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 __extends(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var i=t.getItemLayout(e);return i&&n.rect(i.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(SeriesModel);mixin(CandlestickSeriesModel,WhiskerBoxCommonMixin,!0),SeriesModel.registerClass(CandlestickSeriesModel);var SKIP_PROPS=["color","borderColor"],CandlestickView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeClipPath(),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,i){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},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,i=this.group,r=t.getLayout("isSimpleBox"),a=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||i.removeAll(),t.diff(n).add((function(n){if(t.hasValue(n)){var o=t.getItemLayout(n);if(a&&isNormalBoxClipped(s,o))return;var l=createNormalBox$1(o,n,!0);initProps(l,{shape:{points:o.ends}},e,n),setBoxCommon(l,t,n,r),i.add(l),t.setItemGraphicEl(n,l)}})).update((function(o,l){var u=n.getItemGraphicEl(l);if(t.hasValue(o)){var c=t.getItemLayout(o);a&&isNormalBoxClipped(s,c)?i.remove(u):(u?updateProps(u,{shape:{points:c.ends}},e,o):u=createNormalBox$1(c),setBoxCommon(u,t,o,r),i.add(u),t.setItemGraphicEl(o,u))}else i.remove(u)})).remove((function(e){var t=n.getItemGraphicEl(e);t&&i.remove(t)})).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),createLarge$1(e,this.group);var t=e.get("clip",!0)?createClipPath(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n,i=t.getData(),r=i.getLayout("isSimpleBox");null!=(n=e.next());){var a=createNormalBox$1(i.getItemLayout(n));setBoxCommon(a,i,n,r),a.incremental=!0,this.group.add(a)}},t.prototype._incrementalRenderLarge=function(e,t){createLarge$1(t,this.group,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(ChartView);ChartView.registerClass(CandlestickView);var NormalBoxPathShape=function(){},NormalBoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="normalCandlestickBox",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new NormalBoxPathShape},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}(Path);function createNormalBox$1(e,t,n){var i=e.ends;return new NormalBoxPath({shape:{points:n?transInit$1(i,e):i},z2:100})}function isNormalBoxClipped(e,t){for(var n=!0,i=0;i<t.ends.length;i++)if(e.contain(t.ends[i][0],t.ends[i][1])){n=!1;break}return n}function setBoxCommon(e,t,n,i){var r=t.getItemModel(n);e.useStyle(t.getItemVisual(n,"style")),e.style.strokeNoScale=!0,e.__simpleBox=i,setStatesStylesFromModel(e,r)}function transInit$1(e,t){return map(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var LargeBoxPathShape=function(){},LargeBoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeCandlestickBox",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new LargeBoxPathShape},t.prototype.buildPath=function(e,t){for(var n=t.points,i=0;i<n.length;)if(this.__sign===n[i++]){var r=n[i++];e.moveTo(r,n[i++]),e.lineTo(r,n[i++])}else i+=3},t}(Path);function createLarge$1(e,t,n){var i=e.getData().getLayout("largePoints"),r=new LargeBoxPath({shape:{points:i},__sign:1});t.add(r);var a=new LargeBoxPath({shape:{points:i},__sign:-1});t.add(a),setLargeStyle$1(1,r,e),setLargeStyle$1(-1,a,e),n&&(r.incremental=!0,a.incremental=!0)}function setLargeStyle$1(e,t,n,i){var r=n.get(["itemStyle",e>0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]),a=n.getModel("itemStyle").getItemStyle(SKIP_PROPS);t.useStyle(a),t.style.fill=null,t.style.stroke=r}function candlestickPreprocessor(e){e&&isArray(e.series)&&each(e.series,(function(e){isObject(e)&&"k"===e.type&&(e.type="candlestick")}))}var positiveBorderColorQuery=["itemStyle","borderColor"],negativeBorderColorQuery=["itemStyle","borderColor0"],positiveColorQuery=["itemStyle","color"],negativeColorQuery=["itemStyle","color0"],candlestickVisual={seriesType:"candlestick",plan:createRenderPlanner(),performRawSeries:!0,reset:function(e,t){function n(e,t){return t.get(e>0?positiveColorQuery:negativeColorQuery)}function i(e,t){return t.get(e>0?positiveBorderColorQuery:negativeBorderColorQuery)}if(e.getData().setVisual("legendSymbol","roundRect"),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var r;null!=(r=e.next());){var a=t.getItemModel(r),o=t.getItemLayout(r).sign,s=a.getItemStyle();s.fill=n(o,a),s.stroke=i(o,a)||s.fill,extend(t.ensureUniqueItemVisual(r,"style"),s)}}}}},LargeArr$1="undefined"!=typeof Float32Array?Float32Array:Array,candlestickLayout={seriesType:"candlestick",plan:createRenderPlanner(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),i=calculateCandleWidth(e,n),r=["x","y"],a=n.mapDimension(r[0]),o=n.mapDimensionsAll(r[1]),s=o[0],l=o[1],u=o[2],c=o[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(null==a||o.length<4))return{progress:e.pipelineContext.large?function(e,n){var i,r,o=new LargeArr$1(4*e.count),h=0,p=[],d=[];for(;null!=(r=e.next());){var f=n.get(a,r),g=n.get(s,r),m=n.get(l,r),y=n.get(u,r),v=n.get(c,r);isNaN(f)||isNaN(y)||isNaN(v)?(o[h++]=NaN,h+=3):(o[h++]=getSign(n,r,g,m,l),p[0]=f,p[1]=y,i=t.dataToPoint(p,null,d),o[h++]=i?i[0]:NaN,o[h++]=i?i[1]:NaN,p[1]=v,i=t.dataToPoint(p,null,d),o[h++]=i?i[1]:NaN)}n.setLayout("largePoints",o)}:function(e,n){var r;for(;null!=(r=e.next());){var o=n.get(a,r),h=n.get(s,r),p=n.get(l,r),d=n.get(u,r),f=n.get(c,r),g=Math.min(h,p),m=Math.max(h,p),y=b(g,o),v=b(m,o),_=b(d,o),x=b(f,o),S=[];T(S,v,0),T(S,y,1),S.push(A(x),A(v),A(_),A(y)),n.setItemLayout(r,{sign:getSign(n,r,h,p,l),initBaseline:h>p?v[1]:y[1],ends:S,brushRect:M(d,f,o)})}function b(e,n){var i=[];return i[0]=n,i[1]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(i)}function T(e,t,n){var r=t.slice(),a=t.slice();r[0]=subPixelOptimize$1(r[0]+i/2,1,!1),a[0]=subPixelOptimize$1(a[0]-i/2,1,!0),n?e.push(r,a):e.push(a,r)}function M(e,t,n){var r=b(e,n),a=b(t,n);return r[0]-=i/2,a[0]-=i/2,{x:r[0],y:r[1],width:i,height:a[1]-r[1]}}function A(e){return e[0]=subPixelOptimize$1(e[0],1),e}}}}};function getSign(e,t,n,i,r){return n>i?-1:n<i?1:t>0?e.get(r,t-1)<=i?1:-1:1}function calculateCandleWidth(e,t){var n,i=e.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/t.count()),a=parsePercent$2(retrieve2(e.get("barMaxWidth"),r),r),o=parsePercent$2(retrieve2(e.get("barMinWidth"),1),r),s=e.get("barWidth");return null!=s?parsePercent$2(s,r):Math.max(Math.min(r/2,a),o)}registerPreprocessor(candlestickPreprocessor),registerVisual(candlestickVisual),registerLayout(candlestickLayout);var EffectScatterSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),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",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10},t}(SeriesModel);SeriesModel.registerClass(EffectScatterSeriesModel);var EFFECT_RIPPLE_NUMBER=3;function normalizeSymbolSize$1(e){return isArray(e)||(e=[+e,+e]),e}function updateRipplePath(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 EffectSymbol=function(e){function t(t,n){var i=e.call(this)||this,r=new Symbol(t,n),a=new Group;return i.add(r),i.add(a),i.updateData(t,n),i}return __extends(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,i=this.childAt(1),r=0;r<EFFECT_RIPPLE_NUMBER;r++){var a=createSymbol(t,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var o=-r/EFFECT_RIPPLE_NUMBER*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scale:[e.rippleScale/2,e.rippleScale/2]}).delay(o).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(o).start(),i.add(a)}updateRipplePath(i,e)},t.prototype.updateEffectAnimation=function(e){for(var t=this._effectCfg,n=this.childAt(1),i=["symbolType","period","rippleScale"],r=0;r<i.length;r++){var a=i[r];if(t[a]!==e[a])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}updateRipplePath(n,e)},t.prototype.highlight=function(){enterEmphasis(this)},t.prototype.downplay=function(){leaveEmphasis(this)},t.prototype.updateData=function(e,t){var n=this,i=e.hostModel;this.childAt(0).updateData(e,t);var r=this.childAt(1),a=e.getItemModel(t),o=e.getItemVisual(t,"symbol"),s=normalizeSymbolSize$1(e.getItemVisual(t,"symbolSize")),l=e.getItemVisual(t,"style"),u=l&&l.fill;r.setScale(s),r.traverse((function(e){e.setStyle("fill",u)}));var c=a.getShallow("symbolOffset");c&&(r.x=parsePercent$2(c[0],s[0]),r.y=parsePercent$2(c[1],s[1]));var h=e.getItemVisual(t,"symbolRotate");r.rotation=(h||0)*Math.PI/180||0;var p={};p.showEffectOn=i.get("showEffectOn"),p.rippleScale=a.get(["rippleEffect","scale"]),p.brushType=a.get(["rippleEffect","brushType"]),p.period=1e3*a.get(["rippleEffect","period"]),p.effectOffset=t/e.count(),p.z=i.getShallow("z")||0,p.zlevel=i.getShallow("zlevel")||0,p.symbolType=o,p.color=u,p.rippleEffectColor=a.get(["rippleEffect","color"]),this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"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,enableHoverEmphasis(this)},t.prototype.fadeOut=function(e){this.off("mouseover").off("mouseout"),e&&e()},t}(Group);inherits(EffectSymbol,Group);var EffectScatterView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(){this._symbolDraw=new SymbolDraw(EffectSymbol)},t.prototype.render=function(e,t,n){var i=e.getData(),r=this._symbolDraw;r.updateData(i),this.group.add(r.group)},t.prototype.updateTransform=function(e,t,n){var i=e.getData();this.group.dirty();var r=pointsLayout("").reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout()},t.prototype._updateGroupTransform=function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=clone$2(t.getRoamTransform()),this.group.decomposeTransform())},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0)},t.type="effectScatter",t}(ChartView);ChartView.registerClass(EffectScatterView),registerLayout(pointsLayout("effectScatter"));var Uint32Arr="undefined"==typeof Uint32Array?Array:Uint32Array,Float64Arr="undefined"==typeof Float64Array?Array:Float64Array;function compatEc2(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=map(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),mergeAll([t,e[0],e[1]])})))}var LinesSeriesModel=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 __extends(t,e),t.prototype.init=function(t){t.data=t.data||[],compatEc2(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(compatEc2(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=concatArray(this._flatCoords,t.flatCoords),this._flatCoordsOffset=concatArray(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");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],i=this._flatCoordsOffset[2*e+1],r=0;r<i;r++)t[r]=t[r]||[],t[r][0]=this._flatCoords[n+2*r],t[r][1]=this._flatCoords[n+2*r+1];return i}var a=this._getCoordsFromItemModel(e);for(r=0;r<a.length;r++)t[r]=t[r]||[],t[r][0]=a[r][0],t[r][1]=a[r][1];return a.length},t.prototype._processFlatCoordsArray=function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var n=e.length,i=new Uint32Arr(n),r=new Float64Arr(n),a=0,o=0,s=0,l=0;l<n;){s++;var u=e[l++];i[o++]=a+t,i[o++]=u;for(var c=0;c<u;c++){var h=e[l++],p=e[l++];r[a++]=h,r[a++]=p}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},t.prototype.getInitialData=function(e,t){var n=new List(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,i,r){if(e instanceof Array)return NaN;n.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},t.prototype.formatTooltip=function(e,t,n){var i=this.getData().getItemModel(e),r=i.get("name");if(r)return r;var a=i.get("fromName"),o=i.get("toName"),s=[];return null!=a&&s.push(a),null!=o&&s.push(o),createTooltipMarkup("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.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",zlevel:0,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}(SeriesModel);SeriesModel.registerClass(LinesSeriesModel);var EffectLine=function(e){function t(t,n,i){var r=e.call(this)||this;return r.add(r.createLine(t,n,i)),r._updateEffectSymbol(t,n),r}return __extends(t,e),t.prototype.createLine=function(e,t,n){return new Line$1(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel("effect"),i=n.get("symbolSize"),r=n.get("symbol");isArray(i)||(i=[i,i]);var a=e.getItemVisual(t,"style"),o=n.get("color")||a&&a.stroke,s=this.childAt(1);this._symbolType!==r&&(this.remove(s),(s=createSymbol(r,-.5,-.5,1,1,o)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",o),s.setStyle(n.getItemStyle(["color"])),s.scaleX=i[0],s.scaleY=i[1],s.setColor(o),this._symbolType=r,this._symbolScale=i,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var i=this.childAt(1);if(i){var r=this,a=e.getItemLayout(n),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=retrieve(t.get("delay"),(function(t){return t/e.count()*o/3}));if(i.ignore=!0,this._updateAnimationPoints(i,a),l>0&&(o=this._getLineLength(i)/l*1e3),(o!==this._period||s!==this._loop)&&(i.stopAnimation(),o>0)){var c=void 0;c="function"==typeof u?u(n):u,i.__t>0&&(c=-o*i.__t),i.__t=0;var h=i.animate("",s).when(o,{__t:1}).delay(c).during((function(){r._updateSymbolPosition(i)}));s||h.done((function(){r.remove(i)})),h.start()}this._period=o,this._loop=s}},t.prototype._getLineLength=function(e){return dist(e.__p1,e.__cp1)+dist(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,i=e.__cp1,r=e.__t,a=[e.x,e.y],o=a.slice(),s=quadraticAt,l=quadraticDerivativeAt;a[0]=s(t[0],i[0],n[0],r),a[1]=s(t[1],i[1],n[1],r);var u=l(t[0],i[0],n[0],r),c=l(t[1],i[1],n[1],r);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*dist(o,a),1===r&&(a[0]=o[0]+(a[0]-o[0])/2,a[1]=o[1]+(a[1]-o[1])/2)):1===e.__lastT?e.scaleY=2*dist(t,a):e.scaleY=this._symbolScale[1]),e.__lastT=e.__t,e.ignore=!1,e.x=a[0],e.y=a[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}(Group),Polyline$1=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createPolyline(t,n,i),r}return __extends(t,e),t.prototype._createPolyline=function(e,t,n){var i=e.getItemLayout(t),r=new Polyline({shape:{points:i}});this.add(r),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var i=e.hostModel;updateProps(this.childAt(0),{shape:{points:e.getItemLayout(t)}},i,t),this._updateCommonStl(e,t,n)},t.prototype._updateCommonStl=function(e,t,n){var i=this.childAt(0),r=e.getItemModel(t),a=n&&n.emphasisLineStyle;n&&!e.hasItemOption||(a=r.getModel(["emphasis","lineStyle"]).getLineStyle()),i.useStyle(e.getItemVisual(t,"style")),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=a,enableHoverEmphasis(this)},t.prototype.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},t}(Group),EffectPolyline=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return __extends(t,e),t.prototype.createLine=function(e,t,n){return new Polyline$1(e,t,n)},t.prototype._updateAnimationPoints=function(e,t){this._points=t;for(var n=[0],i=0,r=1;r<t.length;r++){var a=t[r-1],o=t[r];i+=dist(a,o),n.push(i)}if(0!==i){for(r=0;r<n.length;r++)n[r]/=i;this._offsets=n,this._length=i}else this._length=0},t.prototype._getLineLength=function(){return this._length},t.prototype._updateSymbolPosition=function(e){var t=e.__t,n=this._points,i=this._offsets,r=n.length;if(i){var a,o=this._lastFrame;if(t<this._lastFramePercent){for(a=Math.min(o+1,r-1);a>=0&&!(i[a]<=t);a--);a=Math.min(a,r-2)}else{for(a=o;a<r&&!(i[a]>t);a++);a=Math.min(a-1,r-2)}var s=(t-i[a])/(i[a+1]-i[a]),l=n[a],u=n[a+1];e.x=l[0]*(1-s)+s*u[0],e.y=l[1]*(1-s)+s*u[1];var c=u[0]-l[0],h=u[1]-l[1];e.rotation=-Math.atan2(h,c)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=t,e.ignore=!1}},t}(EffectLine),LargeLinesPathShape=function(){this.polyline=!1,this.curveness=0,this.segs=[]},LargeLinesPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LargeLinesPathShape},t.prototype.buildPath=function(e,t){var n=t.segs,i=t.curveness;if(t.polyline)for(var r=0;r<n.length;){var a=n[r++];if(a>0){e.moveTo(n[r++],n[r++]);for(var o=1;o<a;o++)e.lineTo(n[r++],n[r++])}}else for(r=0;r<n.length;){var s=n[r++],l=n[r++],u=n[r++],c=n[r++];if(e.moveTo(s,l),i>0){var h=(s+u)/2-(l-c)*i,p=(l+c)/2-(u-s)*i;e.quadraticCurveTo(h,p,u,c)}else e.lineTo(u,c)}},t.prototype.findDataIndex=function(e,t){var n=this.shape,i=n.segs,r=n.curveness,a=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s<i.length;){var l=i[s++];if(l>0)for(var u=i[s++],c=i[s++],h=1;h<l;h++){if(containStroke(u,c,p=i[s++],d=i[s++],a,e,t))return o}o++}else for(o=0,s=0;s<i.length;){u=i[s++],c=i[s++];var p=i[s++],d=i[s++];if(r>0){if(containStroke$2(u,c,(u+p)/2-(c-d)*r,(c+d)/2-(p-u)*r,p,d,a,e,t))return o}else if(containStroke(u,c,p,d,a,e,t))return o;o++}return-1},t}(Path),LargeLineDraw=function(){function e(){this.group=new Group}return e.prototype.isPersistent=function(){return!this._incremental},e.prototype.updateData=function(e){this.group.removeAll();var t=new LargeLinesPath({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new IncrementalDisplayble({silent:!0})),this.group.add(this._incremental)):this._incremental=null},e.prototype.incrementalUpdate=function(e,t){var n=new LargeLinesPath;n.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(n,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(n,!0):(n.rectHover=!0,n.cursor="default",n.__startIndex=e.start,this.group.add(n))},e.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},e.prototype._setCommon=function(e,t,n){var i=t.hostModel;e.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),e.useStyle(i.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var r=t.getVisual("style");if(r&&r.stroke&&e.setStyle("stroke",r.stroke),e.setStyle("fill",null),!n){var a=getECData(e);a.seriesIndex=i.seriesIndex,e.on("mousemove",(function(t){a.dataIndex=null;var n=e.findDataIndex(t.offsetX,t.offsetY);n>0&&(a.dataIndex=n+e.__startIndex)}))}},e.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},e}(),linesLayout={seriesType:"lines",plan:createRenderPlanner(),reset:function(e){var t=e.coordinateSystem,n=e.get("polyline"),i=e.pipelineContext.large;return{progress:function(r,a){var o=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,c=r.start;c<r.end;c++)u+=e.getLineCoordsCount(c);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var h=0,p=[];for(c=r.start;c<r.end;c++){var d=e.getLineCoords(c,o);n&&(s[h++]=d);for(var f=0;f<d;f++)p=t.dataToPoint(o[f],!1,p),s[h++]=p[0],s[h++]=p[1]}a.setLayout("linesPoints",s)}else for(c=r.start;c<r.end;c++){var g=a.getItemModel(c),m=(d=e.getLineCoords(c,o),[]);if(n)for(var y=0;y<d;y++)m.push(t.dataToPoint(o[y]));else{m[0]=t.dataToPoint(o[0]),m[1]=t.dataToPoint(o[1]);var v=g.get(["lineStyle","curveness"]);+v&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*v,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*v])}a.setItemLayout(c,m)}}}}},LinesView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this._updateLineDraw(i,e),a=e.get("zlevel"),o=e.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();(l||s.painter.getLayer(a).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&o)&&(l||s.configLayer(a,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)}));r.updateData(i);var u=e.get("clip",!0)&&createClipPath(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=a,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateLineDraw(i,e).incrementalPrepareUpdate(i),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.updateTransform=function(e,t,n){var i=e.getData(),r=e.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var a=linesLayout.reset(e,t,n);a.progress&&a.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,i=this._showEffect(t),r=!!t.get("polyline"),a=t.pipelineContext.large;return n&&i===this._hasEffet&&r===this._isPolyline&&a===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=a?new LargeLineDraw:new LineDraw(r?i?EffectPolyline:Polyline$1:i?EffectLine:Line$1),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=a,this.group.removeAll()),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.type="lines",t}(ChartView);function normalize$3(e){return e instanceof Array||(e=[e,e]),e}ChartView.registerClass(LinesView);var linesVisual={seriesType:"lines",reset:function(e){var t=normalize$3(e.get("symbol")),n=normalize$3(e.get("symbolSize")),i=e.getData();return i.setVisual("fromSymbol",t&&t[0]),i.setVisual("toSymbol",t&&t[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(e,t){var n=e.getItemModel(t),i=normalize$3(n.getShallow("symbol",!0)),r=normalize$3(n.getShallow("symbolSize",!0));i[0]&&e.setItemVisual(t,"fromSymbol",i[0]),i[1]&&e.setItemVisual(t,"toSymbol",i[1]),r[0]&&e.setItemVisual(t,"fromSymbolSize",r[0]),r[1]&&e.setItemVisual(t,"toSymbolSize",r[1])}:null}}};registerLayout(linesLayout),registerVisual(linesVisual);var HeatmapSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=CoordinateSystemManager.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(SeriesModel);SeriesModel.registerClass(HeatmapSeriesModel);var GRADIENT_LEVELS=256,HeatmapLayer=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,i,r,a){var o=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),p=e.length;c.width=t,c.height=n;for(var d=0;d<p;++d){var f=e[d],g=f[0],m=f[1],y=i(f[2]);h.globalAlpha=y,h.drawImage(o,g-u,m-u)}if(!c.width||!c.height)return c;for(var v=h.getImageData(0,0,c.width,c.height),_=v.data,x=0,S=_.length,b=this.minOpacity,T=this.maxOpacity-b;x<S;){y=_[x+3]/256;var M=4*Math.floor(y*(GRADIENT_LEVELS-1));if(y>0){var A=a(y)?s:l;y>0&&(y=y*T+b),_[x++]=A[M],_[x++]=A[M+1],_[x++]=A[M+2],_[x++]=A[M+3]*y*256}else x+=4}return h.putImageData(v,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),r=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,r),i[a++]=r[0],i[a++]=r[1],i[a++]=r[2],i[a++]=r[3];return i},e}();function getIsInPiecewiseRange(e,t,n){var i=e[1]-e[0],r=(t=map(t,(function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}}))).length,a=0;return function(e){var i;for(i=a;i<r;i++){if((o=t[i].interval)[0]<=e&&e<=o[1]){a=i;break}}if(i===r)for(i=a-1;i>=0;i--){var o;if((o=t[i].interval)[0]<=e&&e<=o[1]){a=i;break}}return i>=0&&i<r&&n[i]}}function getIsInContinuousRange(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]}}function isGeoCoordSys(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var HeatmapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(i=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):isGeoCoordSys(r)&&this._renderOnGeo(r,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,r){var a,o,s,l,u=e.coordinateSystem;if(isCoordinateSystemType(u,"cartesian2d")){var c=u.getAxis("x"),h=u.getAxis("y");0,a=c.getBandWidth(),o=h.getBandWidth(),s=c.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,d=e.getData(),f=e.getModel(["emphasis","itemStyle"]).getItemStyle(),g=e.getModel(["blur","itemStyle"]).getItemStyle(),m=e.getModel(["select","itemStyle"]).getItemStyle(),y=getLabelStatesModels(e),v=e.get(["emphasis","focus"]),_=e.get(["emphasis","blurScope"]),x=isCoordinateSystemType(u,"cartesian2d")?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],S=n;S<i;S++){var b=void 0,T=d.getItemVisual(S,"style");if(isCoordinateSystemType(u,"cartesian2d")){var M=d.get(x[0],S),A=d.get(x[1],S);if(isNaN(d.get(x[2],S))||M<s[0]||M>s[1]||A<l[0]||A>l[1])continue;var I=u.dataToPoint([M,A]);b=new Rect({shape:{x:Math.floor(Math.round(I[0])-a/2),y:Math.floor(Math.round(I[1])-o/2),width:Math.ceil(a),height:Math.ceil(o)},style:T})}else{if(isNaN(d.get(x[1],S)))continue;b=new Rect({z2:1,shape:u.dataToRect([d.get(x[0],S)]).contentShape,style:T})}var C=d.getItemModel(S);if(d.hasItemOption){var w=C.getModel("emphasis");f=w.getModel("itemStyle").getItemStyle(),g=C.getModel(["blur","itemStyle"]).getItemStyle(),m=C.getModel(["select","itemStyle"]).getItemStyle(),v=w.get("focus"),_=w.get("blurScope"),y=getLabelStatesModels(C)}var P=e.getRawValue(S),L="-";P&&null!=P[2]&&(L=P[2]+""),setLabelStyle(b,y,{labelFetcher:e,labelDataIndex:S,defaultOpacity:T.opacity,defaultText:L}),b.ensureState("emphasis").style=f,b.ensureState("blur").style=g,b.ensureState("select").style=m,enableHoverEmphasis(b,v,_),b.incremental=r,r&&(b.states.emphasis.hoverLayer=!0),p.add(b),d.setItemGraphicEl(S,b)}},t.prototype._renderOnGeo=function(e,t,n,i){var r=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new HeatmapLayer;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),p=Math.min(l.width+l.x,i.getWidth()),d=Math.min(l.height+l.y,i.getHeight()),f=p-c,g=d-h,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],y=o.mapArray(m,(function(t,n,i){var r=e.dataToPoint([t,n]);return r[0]-=c,r[1]-=h,r.push(i),r})),v=n.getExtent(),_="visualMap.continuous"===n.type?getIsInContinuousRange(v,n.option.range):getIsInPiecewiseRange(v,n.getPieceList(),n.option.selected);s.update(y,f,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var x=new ZRImage({style:{width:f,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(x)},t.type="heatmap",t}(ChartView);ChartView.registerClass(HeatmapView);var PictorialBarSeriesModel=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 __extends(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=inheritDefaultOption(BaseBarSeriesModel.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%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(BaseBarSeriesModel);SeriesModel.registerClass(PictorialBarSeriesModel);var BAR_BORDER_WIDTH_QUERY$1=["itemStyle","borderWidth"],LAYOUT_ATTRS=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],pathForLineWidth=new Circle,PictorialBarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this.group,r=e.getData(),a=this._data,o=e.coordinateSystem,s=o.getBaseAxis().isHorizontal(),l=o.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:LAYOUT_ATTRS[+s],categoryDim:LAYOUT_ATTRS[1-+s]};return r.diff(a).add((function(e){if(r.hasValue(e)){var t=getItemModel(r,e),n=getSymbolMeta(r,e,t,u),a=createBar(r,u,n);r.setItemGraphicEl(e,a),i.add(a),updateCommon$1(a,u,n)}})).update((function(e,t){var n=a.getItemGraphicEl(t);if(r.hasValue(e)){var o=getItemModel(r,e),s=getSymbolMeta(r,e,o,u),l=getShapeStr(r,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),r.setItemGraphicEl(e,null),n=null),n?updateBar(n,u,s):n=createBar(r,u,s,!0),r.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=s,i.add(n),updateCommon$1(n,u,s)}else i.remove(n)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&removeBar(a,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=r,this.group},t.prototype.remove=function(e,t){var n=this.group,i=this._data;e.get("animation")?i&&i.eachItemGraphicEl((function(t){removeBar(i,getECData(t).dataIndex,e,t)})):n.removeAll()},t.type="pictorialBar",t}(ChartView);function getSymbolMeta(e,t,n,i){var r=e.getItemLayout(t),a=n.get("symbolRepeat"),o=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:r,itemModel:n,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};prepareBarLength(n,a,r,i,h),prepareSymbolSize(e,t,r,a,o,h.boundingLength,h.pxSign,u,i,h),prepareLineWidth(n,h.symbolScale,l,i,h);var p=h.symbolSize,d=n.get("symbolOffset");return isArray(d)&&(d=[parsePercent$2(d[0],p[0]),parsePercent$2(d[1],p[1])]),prepareLayoutInfo(n,p,r,a,o,d,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function prepareBarLength(e,t,n,i,r){var a,o=i.valueDim,s=e.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[o.wh]<=0);if(isArray(s)){var h=[convertToCoordOnAxis(l,s[0])-u,convertToCoordOnAxis(l,s[1])-u];h[1]<h[0]&&h.reverse(),a=h[c]}else a=null!=s?convertToCoordOnAxis(l,s)-u:t?i.coordSysExtent[o.index][c]-u:n[o.wh];r.boundingLength=a,t&&(r.repeatCutLength=n[o.wh]),r.pxSign=a>0?1:a<0?-1:0}function convertToCoordOnAxis(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function prepareSymbolSize(e,t,n,i,r,a,o,s,l,u){var c,h=l.valueDim,p=l.categoryDim,d=Math.abs(n[p.wh]),f=e.getItemVisual(t,"symbolSize");(c=isArray(f)?f.slice():null==f?["100%","100%"]:[f,f])[p.index]=parsePercent$2(c[p.index],d),c[h.index]=parsePercent$2(c[h.index],i?d:Math.abs(a)),u.symbolSize=c,(u.symbolScale=[c[0]/s,c[1]/s])[h.index]*=(l.isHorizontal?-1:1)*o}function prepareLineWidth(e,t,n,i,r){var a=e.get(BAR_BORDER_WIDTH_QUERY$1)||0;a&&(pathForLineWidth.attr({scaleX:t[0],scaleY:t[1],rotation:n}),pathForLineWidth.updateTransform(),a/=pathForLineWidth.getLineScale(),a*=t[i.valueDim.index]),r.valueLineWidth=a}function prepareLayoutInfo(e,t,n,i,r,a,o,s,l,u,c,h){var p=c.categoryDim,d=c.valueDim,f=h.pxSign,g=Math.max(t[d.index]+s,0),m=g;if(i){var y=Math.abs(l),v=retrieve(e.get("symbolMargin"),"15%")+"",_=!1;v.lastIndexOf("!")===v.length-1&&(_=!0,v=v.slice(0,v.length-1));var x=parsePercent$2(v,t[d.index]),S=Math.max(g+2*x,0),b=_?0:2*x,T=isNumeric(i),M=T?i:toIntTimes((y+b)/S);S=g+2*(x=(y-M*g)/2/(_?M:M-1)),b=_?0:2*x,T||"fixed"===i||(M=u?toIntTimes((Math.abs(u)+b)/S):0),m=M*S-b,h.repeatTimes=M,h.symbolMargin=x}var A=f*(m/2),I=h.pathPosition=[];I[p.index]=n[p.wh]/2,I[d.index]="start"===o?A:"end"===o?l-A:l/2,a&&(I[0]+=a[0],I[1]+=a[1]);var C=h.bundlePosition=[];C[p.index]=n[p.xy],C[d.index]=n[d.xy];var w=h.barRectShape=extend({},n);w[d.wh]=f*Math.max(Math.abs(n[d.wh]),Math.abs(I[d.index]+A)),w[p.wh]=n[p.wh];var P=h.clipShape={};P[p.xy]=-n[p.xy],P[p.wh]=c.ecSize[p.wh],P[d.xy]=0,P[d.wh]=n[d.wh]}function createPath(e){var t=e.symbolPatternSize,n=createSymbol(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function createOrUpdateRepeatSymbols(e,t,n,i){var r=e.__pictorialBundle,a=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,u=n.repeatTimes||0,c=0,h=a[t.valueDim.index]+o+2*n.symbolMargin;for(eachPath(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=u,c<u?updateAttr(e,null,f(c),n,i):updateAttr(e,null,{scaleX:0,scaleY:0},n,i,(function(){r.remove(e)})),c++}));c<u;c++){var p=createPath(n);p.__pictorialAnimationIndex=c,p.__pictorialRepeatTimes=u,r.add(p);var d=f(c);updateAttr(p,{x:d.x,y:d.y,scaleX:0,scaleY:0},{scaleX:d.scaleX,scaleY:d.scaleY,rotation:d.rotation},n,i)}function f(e){var t=s.slice(),i=n.pxSign,r=e;return("start"===n.symbolRepeatDirection?i>0:i<0)&&(r=u-1-e),t[l.index]=h*(r-u/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function createOrUpdateSingleSymbol(e,t,n,i){var r=e.__pictorialBundle,a=e.__pictorialMainPath;a?updateAttr(a,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(a=e.__pictorialMainPath=createPath(n),r.add(a),updateAttr(a,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function createOrUpdateBarRect(e,t,n){var i=extend({},t.barRectShape),r=e.__pictorialBarRect;r?updateAttr(r,null,{shape:i},t,n):(r=e.__pictorialBarRect=new Rect({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(r))}function createOrUpdateClip(e,t,n,i){if(n.symbolClip){var r=e.__pictorialClipPath,a=extend({},n.clipShape),o=t.valueDim,s=n.animationModel,l=n.dataIndex;if(r)updateProps(r,{shape:a},s,l);else{a[o.wh]=0,r=new Rect({shape:a}),e.__pictorialBundle.setClipPath(r),e.__pictorialClipPath=r;var u={};u[o.wh]=n.clipShape[o.wh],graphic[i?"updateProps":"initProps"](r,{shape:u},s,l)}}}function getItemModel(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=getAnimationDelayParams,n.isAnimationEnabled=isAnimationEnabled,n}function getAnimationDelayParams(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function isAnimationEnabled(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function createBar(e,t,n,i){var r=new Group,a=new Group;return r.add(a),r.__pictorialBundle=a,a.x=n.bundlePosition[0],a.y=n.bundlePosition[1],n.symbolRepeat?createOrUpdateRepeatSymbols(r,t,n):createOrUpdateSingleSymbol(r,t,n),createOrUpdateBarRect(r,n,i),createOrUpdateClip(r,t,n,i),r.__pictorialShapeStr=getShapeStr(e,n),r.__pictorialSymbolMeta=n,r}function updateBar(e,t,n){var i=n.animationModel,r=n.dataIndex;updateProps(e.__pictorialBundle,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,r),n.symbolRepeat?createOrUpdateRepeatSymbols(e,t,n,!0):createOrUpdateSingleSymbol(e,t,n,!0),createOrUpdateBarRect(e,n,!0),createOrUpdateClip(e,t,n,!0)}function removeBar(e,t,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var a=[];eachPath(i,(function(e){a.push(e)})),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),each(a,(function(e){removeElement(e,{scaleX:0,scaleY:0},n,t,(function(){i.parent&&i.parent.remove(i)}))})),e.setItemGraphicEl(t,null)}function getShapeStr(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function eachPath(e,t,n){each(e.__pictorialBundle.children(),(function(i){i!==e.__pictorialBarRect&&t.call(n,i)}))}function updateAttr(e,t,n,i,r,a){t&&e.attr(t),i.symbolClip&&!r?n&&e.attr(n):n&&graphic[r?"updateProps":"initProps"](e,n,i.animationModel,i.dataIndex,a)}function updateCommon$1(e,t,n){var i=n.dataIndex,r=n.itemModel,a=r.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),u=r.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),p=a.get("scale");eachPath(e,(function(e){if(e instanceof ZRImage){var t=e.style;e.useStyle(extend({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var i=e.ensureState("emphasis");i.style=o,p&&(i.scaleX=1.1*e.scaleX,i.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,u&&(e.cursor=u),e.z2=n.z2}));var d=t.valueDim.posDesc[+(n.boundingLength>0)];setLabelStyle(e.__pictorialBarRect,getLabelStatesModels(r),{labelFetcher:t.seriesModel,labelDataIndex:i,defaultText:getDefaultLabel(t.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:d}),enableHoverEmphasis(e,c,h)}function toIntTimes(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}ChartView.registerClass(PictorialBarView),registerLayout(curry(layout,"pictorialBar"));var SingleAxis=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.type=r||"value",o.position=a||"bottom",o}return __extends(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}(Axis),Single=function(){function e(e,t,n){this.type="single",this.dimension="single",this.dimensions=["single"],this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var i=this.dimension,r=new SingleAxis(i,createScaleByModel(e),[0,0],e.get("type"),e.get("position")),a="category"===r.type;r.onBand=a&&e.get("boundaryGap"),r.inverse=e.get("inverse"),r.orient=e.get("orient"),e.axis=r,r.model=e,r.coordinateSystem=this,this._axis=r},e.prototype.update=function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();each(t.mapDimensionsAll(this.dimension),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},e.prototype.resize=function(e,t){this._rect=getLayoutRect({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(),i=n?[0,e.width]:[0,e.height],r=t.reverse?1:0;t.setExtent(i[r],i[1-r]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),i=n[0]+n[1],r=e.isHorizontal();e.toGlobalCoord=r?function(e){return e+t}:function(e){return i-e+t},e.toLocalCoord=r?function(e){return e-t}:function(e){return i-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(),i=[],r="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),i[r]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},e.prototype.convertToPixel=function(e,t,n){return getCoordSys$2(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return getCoordSys$2(t)===this?this.pointToData(n):null},e}();function getCoordSys$2(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function create$3(e,t){var n=[];return e.eachComponent("singleAxis",(function(i,r){var a=new Single(i,e,t);a.name="single_"+r,a.resize(i,t),i.coordinateSystem=a,n.push(a)})),e.eachSeries((function(e){if("singleAxis"===e.get("coordinateSystem")){var t=e.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0];e.coordinateSystem=t&&t.coordinateSystem}})),n}function layout$2(e,t){t=t||{};var n=e.coordinateSystem,i=e.axis,r={},a=i.position,o=i.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]}};r.position=["vertical"===o?u.vertical[a]:l[0],"horizontal"===o?u.horizontal[a]:l[3]];r.rotation=Math.PI/2*{horizontal:0,vertical:1}[o];r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),retrieve(t.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),r.labelRotation="top"===a?-c:c,r.z2=1,r}CoordinateSystemManager.register("single",{create:create$3,dimensions:Single.prototype.dimensions});var axisBuilderAttrs$2=["axisLine","axisTickLabel","axisName"],selfBuilderAttrs$1=["splitArea","splitLine"],SingleAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}return __extends(t,e),t.prototype.render=function(t,n,i,r){var a=this.group;a.removeAll();var o=this._axisGroup;this._axisGroup=new Group;var s=layout$2(t),l=new AxisBuilder(t,s);each(axisBuilderAttrs$2,l.add,l),a.add(this._axisGroup),a.add(l.getGroup()),each(selfBuilderAttrs$1,(function(e){t.get([e,"show"])&&axisElementBuilders$1[e](this,this.group,this._axisGroup,t)}),this),groupTransition(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)},t.prototype.remove=function(){rectCoordAxisHandleRemove(this)},t.type="singleAxis",t}(AxisView),axisElementBuilders$1={splitLine:function(e,t,n,i){var r=i.axis;if(!r.scale.isBlank()){var a=i.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=i.coordinateSystem.getRect(),u=r.isHorizontal(),c=[],h=0,p=r.getTicksCoords({tickModel:a}),d=[],f=[],g=0;g<p.length;++g){var m=r.toGlobalCoord(p[g].coord);u?(d[0]=m,d[1]=l.y,f[0]=m,f[1]=l.y+l.height):(d[0]=l.x,d[1]=m,f[0]=l.x+l.width,f[1]=m);var y=h++%s.length;c[y]=c[y]||[],c[y].push(new Line({subPixelOptimize:!0,shape:{x1:d[0],y1:d[1],x2:f[0],y2:f[1]},silent:!0}))}var v=o.getLineStyle(["color"]);for(g=0;g<c.length;++g)t.add(mergePath$1(c[g],{style:defaults({stroke:s[g%s.length]},v),silent:!0}))}},splitArea:function(e,t,n,i){rectCoordAxisBuildSplitArea(e,n,i,i)}};ComponentView.registerClass(SingleAxisView);var SingleAxisModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(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}(ComponentModel);function findPointFromSeries(e,t){var n,i=[],r=e.seriesIndex;if(null==r||!(n=t.getSeriesByIndex(r)))return{point:[]};var a=n.getData(),o=queryDataIndex(a,e);if(null==o||o<0||isArray(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,h=u.dim,p="x"===c||"radius"===c?1:0,d=a.mapDimension(h),f=[];f[p]=a.get(d,o),f[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),o),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(a.getValues(map(l.dimensions,(function(e){return a.mapDimension(e)})),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}ComponentModel.registerClass(SingleAxisModel),mixin(SingleAxisModel,AxisModelCommonMixin.prototype),axisModelCreator("single",SingleAxisModel,SingleAxisModel.defaultOption);var inner$b=makeInner();function axisTrigger(e,t,n){var i=e.currTrigger,r=[e.x,e.y],a=e,o=e.dispatchAction||bind(n.dispatchAction,n),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){illegalPoint(r)&&(r=findPointFromSeries({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=illegalPoint(r),u=a.axesInfo,c=s.axesInfo,h="leave"===i||illegalPoint(r),p={},d={},f={list:[],map:{}},g={showPointer:curry(showPointer,d),showTooltip:curry(showTooltip,f)};each(s.coordSysMap,(function(e,t){var n=l||e.containPoint(r);each(s.coordSysAxesInfo[t],(function(e,t){var i=e.axis,a=findInputAxisInfo(u,e);if(!h&&n&&(!u||a)){var o=a&&a.value;null!=o||l||(o=i.pointToData(r)),null!=o&&processOnAxis(e,o,g,!1,p)}}))}));var m={};return each(c,(function(e,t){var n=e.linkGroup;n&&!d[t]&&each(n.axesInfo,(function(t,i){var r=d[i];if(t!==e&&r){var a=r.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,makeMapperParam(t),makeMapperParam(e)))),m[e.key]=a}}))})),each(m,(function(e,t){processOnAxis(c[t],e,g,!0,p)})),updateModelActually(d,c,p),dispatchTooltipActually(f,r,e,o),dispatchHighDownActually(c,o,n),p}}function processOnAxis(e,t,n,i,r){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t))if(e.involveSeries){var o=buildPayloadsBySeries(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==r.seriesIndex&&extend(r,s[0]),!i&&e.snap&&a.containData(l)&&null!=l&&(t=l),n.showPointer(e,t,s),n.showTooltip(e,o,l)}else n.showPointer(e,t)}function buildPayloadsBySeries(e,t){var n=t.axis,i=n.dim,r=e,a=[],o=Number.MAX_VALUE,s=-1;return each(t.seriesModels,(function(t,l){var u,c,h=t.getData().mapDimensionsAll(i);if(t.getAxisTooltipData){var p=t.getAxisTooltipData(h,e,n);c=p.dataIndices,u=p.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 d=e-u,f=Math.abs(d);f<=o&&((f<o||d>=0&&s<0)&&(o=f,s=d,r=u,a.length=0),each(c,(function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:a,snapToValue:r}}function showPointer(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function showTooltip(e,t,n,i){var r=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=makeKey(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:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function updateModelActually(e,t,n){var i=n.axesInfo=[];each(t,(function(t,n){var r=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:r.value})}))}function dispatchTooltipActually(e,t,n,i){if(!illegalPoint(t)&&e.list.length){var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}else i({type:"hideTip"})}function dispatchHighDownActually(e,t,n){var i=n.getZr(),r="axisPointerLastHighlights",a=inner$b(i)[r]||{},o=inner$b(i)[r]={};each(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&each(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];each(a,(function(e,t){!o[t]&&l.push(e)})),each(o,(function(e,t){!a[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})}function findInputAxisInfo(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function makeMapperParam(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function illegalPoint(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var inner$c=makeInner(),each$8=each;function register(e,t,n){if(!env.node){var i=t.getZr();inner$c(i).records||(inner$c(i).records={}),initGlobalListeners(i,t),(inner$c(i).records[e]||(inner$c(i).records[e]={})).handler=n}}function initGlobalListeners(e,t){function n(n,i){e.on(n,(function(n){var r=makeDispatchAction(t);each$8(inner$c(e).records,(function(e){e&&i(e,n,r.dispatchAction)})),dispatchTooltipFinally(r.pendings,t)}))}inner$c(e).initialized||(inner$c(e).initialized=!0,n("click",curry(doEnter,"click")),n("mousemove",curry(doEnter,"mousemove")),n("globalout",onLeave))}function dispatchTooltipFinally(e,t){var n,i=e.showTip.length,r=e.hideTip.length;i?n=e.showTip[i-1]:r&&(n=e.hideTip[r-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function onLeave(e,t,n){e.handler("leave",null,n)}function doEnter(e,t,n,i){t.handler(e,n,i)}function makeDispatchAction(e){var t={showTip:[],hideTip:[]},n=function(i){var r=t[i.type];r?r.push(i):(i.dispatchAction=n,e.dispatchAction(i))};return{dispatchAction:n,pendings:t}}function unregister(e,t){if(!env.node){var n=t.getZr();(inner$c(n).records||{})[e]&&(inner$c(n).records[e]=null)}}var AxisPointerView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),r=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";register("axisPointer",n,(function(e,t,n){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){unregister("axisPointer",t)},t.prototype.dispose=function(e,t){unregister("axisPointer",t)},t.type="axisPointer",t}(ComponentView);ComponentView.registerClass(AxisPointerView);var inner$d=makeInner(),clone$3=clone,bind$1=bind,BaseAxisPointer=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var r=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==r||this._lastStatus!==a){this._lastValue=r,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||"hide"===a)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,r,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(o){var h=curry(updateProps$1,t,c);this.updatePointerEl(o,l,h),this.updateLabelEl(o,l,h,t)}else o=this._group=new Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),n.getZr().add(o);updateMandatoryProps(o,t,!0),this._renderHandle(r)}},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"),i=e.axis,r="category"===i.type,a=t.get("snap");if(!a&&!r)return!1;if("auto"===n||null==n){var o=this.animationThreshold;if(r&&i.getBandWidth()>o)return!0;if(a){var s=getAxisInfo(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,r){},e.prototype.createPointerEl=function(e,t,n,i){var r=t.pointer;if(r){var a=inner$d(e).pointerEl=new graphic[r.type](clone$3(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var r=inner$d(e).labelEl=new ZRText(clone$3(t.label));e.add(r),updateLabelShowHide(r,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=inner$d(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var r=inner$d(e).labelEl;r&&(r.setStyle(t.label.style),n(r,{x:t.label.x,y:t.label.y}),updateLabelShowHide(r,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,a=n.getModel("handle"),o=n.get("status");if(!a.get("show")||!o||"hide"===o)return r&&i.remove(r),void(this._handle=null);this._handle||(t=!0,r=this._handle=createIcon(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){stop(e.event)},onmousedown:bind$1(this._onHandleDragMove,this,0,0),drift:bind$1(this._onHandleDragMove,this),ondragend:bind$1(this._onHandleDragEnd,this)}),i.add(r)),updateMandatoryProps(r,n,!1),r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");isArray(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,createOrUpdate(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){updateProps$1(this._axisPointerModel,!t&&this._moveAnimation,this._handle,getHandleTransProps(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(getHandleTransProps(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(getHandleTransProps(i)),inner$d(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,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null)},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 updateProps$1(e,t,n,i){propsEqual(inner$d(n).lastProp,i)||(inner$d(n).lastProp=i,t?updateProps(n,i,e):(n.stopAnimation(),n.attr(i)))}function propsEqual(e,t){if(isObject(e)&&isObject(t)){var n=!0;return each(t,(function(t,i){n=n&&propsEqual(e[i],t)})),!!n}return e===t}function updateLabelShowHide(e,t){e[t.get(["label","show"])?"show":"hide"]()}function getHandleTransProps(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function updateMandatoryProps(e,t,n){var i=t.get("z"),r=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=r&&(e.zlevel=r),e.silent=n)}))}function buildElStyle(e){var t,n=e.get("type"),i=e.getModel(n+"Style");return"line"===n?(t=i.getLineStyle()).fill=null:"shadow"===n&&((t=i.getAreaStyle()).stroke=null),t}function buildLabelElOption(e,t,n,i,r){var a=getValueLabel(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),o=n.getModel("label"),s=normalizeCssArray$1(o.get("padding")||0),l=o.getFont(),u=getBoundingRect(a,l),c=r.position,h=u.width+s[1]+s[3],p=u.height+s[0]+s[2],d=r.align;"right"===d&&(c[0]-=h),"center"===d&&(c[0]-=h/2);var f=r.verticalAlign;"bottom"===f&&(c[1]-=p),"middle"===f&&(c[1]-=p/2),confineInContainer(c,h,p,i);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:createTextStyle(o,{text:a,font:l,fill:o.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function confineInContainer(e,t,n,i){var r=i.getWidth(),a=i.getHeight();e[0]=Math.min(e[0]+t,r)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function getValueLabel(e,t,n,i,r){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:r.precision}),o=r.formatter;if(o){var s={value:getAxisRawValue(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};each(i,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,r=t&&t.getDataParams(i);r&&s.seriesData.push(r)})),isString(o)?a=o.replace("{value}",a):isFunction(o)&&(a=o(s))}return a}function getTransformedPosition(e,t,n){var i=create$1();return rotate(i,i,n.rotation),translate(i,i,n.position),applyTransform$1([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function buildCartesianSingleLabelElOption(e,t,n,i,r,a){var o=AxisBuilder.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),buildLabelElOption(t,i,r,a,{position:getTransformedPosition(i.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function makeLineShape(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function makeRectShape(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function makeSectorShape(e,t,n,i,r,a){return{cx:e,cy:t,r0:n,r:i,startAngle:r,endAngle:a,clockwise:!0}}var CartesianAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis,o=a.grid,s=i.get("type"),l=getCartesian(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var c=buildElStyle(i),h=pointerShapeBuilder[s](a,u,l);h.style=c,e.graphicKey=h.type,e.pointer=h}buildCartesianSingleLabelElOption(t,e,layout$1(o.model,n),n,i,r)},t.prototype.getHandleTransform=function(e,t,n){var i=layout$1(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=getTransformedPosition(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,a=r.grid,o=r.getGlobalExtent(!0),s=getCartesian(a,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[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}(BaseAxisPointer);function getCartesian(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var pointerShapeBuilder={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:makeLineShape([t,n[0]],[t,n[1]],getAxisDimIndex(e))}},shadow:function(e,t,n){var i=Math.max(1,e.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:makeRectShape([t-i/2,n[0]],[i,r],getAxisDimIndex(e))}}};function getAxisDimIndex(e){return"x"===e.dim?0:1}AxisView.registerAxisPointerClass("CartesianAxisPointer",CartesianAxisPointer);var AxisPointerModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="axisPointer",t.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!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}(ComponentModel);ComponentModel.registerClass(AxisPointerModel),registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!isArray(t)&&(e.axisPointer.link=[t])}})),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=collect(e,t)})),registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},axisTrigger);var XY=["x","y"],WH=["width","height"],SingleAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis,o=a.coordinateSystem,s=getGlobalExtent(o,1-getPointDimIndex(a)),l=o.dataToPoint(t)[0],u=i.get("type");if(u&&"none"!==u){var c=buildElStyle(i),h=pointerShapeBuilder$1[u](a,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}buildCartesianSingleLabelElOption(t,e,layout$2(n),n,i,r)},t.prototype.getHandleTransform=function(e,t,n){var i=layout$2(t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=getTransformedPosition(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,a=r.coordinateSystem,o=getPointDimIndex(r),s=getGlobalExtent(a,o),l=[e.x,e.y];l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=getGlobalExtent(a,1-o),c=(u[1]+u[0])/2,h=[c,c];return h[o]=l[o],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},t}(BaseAxisPointer),pointerShapeBuilder$1={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:makeLineShape([t,n[0]],[t,n[1]],getPointDimIndex(e))}},shadow:function(e,t,n){var i=e.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:makeRectShape([t-i/2,n[0]],[i,r],getPointDimIndex(e))}}};function getPointDimIndex(e){return e.isHorizontal()?0:1}function getGlobalExtent(e,t){var n=e.getRect();return[n[XY[t]],n[XY[t]]+n[WH[t]]]}AxisView.registerAxisPointerClass("SingleAxisPointer",SingleAxisPointer),extendComponentView({type:"single"});var DATA_NAME_INDEX=2,ThemeRiverSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},i=groupData(e,(function(e){return n.hasOwnProperty(e[0]+"")||(n[e[0]+""]=-1),e[2]})),r=[];i.buckets.each((function(e,t){r.push({name:t,dataList:e})}));for(var a=r.length,o=0;o<a;++o){for(var s=r[o].name,l=0;l<r[o].dataList.length;++l){var u=r[o].dataList[l][0]+"";n[u]=o}for(var u in n)n.hasOwnProperty(u)&&n[u]!==o&&(n[u]=o,e[t]=[u,0,s],t++)}return e},t.prototype.getInitialData=function(e,t){for(var n=this.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0].get("type"),i=filter(e.data,(function(e){return void 0!==e[2]})),r=this.fixData(i||[]),a=[],o=this.nameMap=createHashMap(),s=0,l=0;l<r.length;++l)a.push(r[l][DATA_NAME_INDEX]),o.get(r[l][DATA_NAME_INDEX])||(o.set(r[l][DATA_NAME_INDEX],s),s++);var u=createDimensions(r,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:getDimensionTypeByAxis(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),c=new List(u,this);return c.initData(r),c},t.prototype.getLayerSeries=function(){for(var e=this.getData(),t=e.count(),n=[],i=0;i<t;++i)n[i]=i;var r=e.mapDimension("single"),a=groupData(n,(function(t){return e.get("name",t)})),o=[];return a.buckets.each((function(t,n){t.sort((function(t,n){return e.get(r,t)-e.get(r,n)})),o.push({name:n,indices:t})})),o},t.prototype.getAxisTooltipData=function(e,t,n){isArray(e)||(e=e?[e]:[]);for(var i,r=this.getData(),a=this.getLayerSeries(),o=[],s=a.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,c=-1,h=a[l].indices.length,p=0;p<h;++p){var d=r.get(e[0],a[l].indices[p]),f=Math.abs(d-t);f<=u&&(i=d,u=f,c=a[l].indices[p])}o.push(c)}return{dataIndices:o,nestestValue:i}},t.prototype.formatTooltip=function(e,t,n){var i=this.getData();return createTooltipMarkup("nameValue",{name:i.getName(e),value:i.get(i.mapDimension("value"),e)})},t.type="series.themeRiver",t.dependencies=["singleAxis"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},t}(SeriesModel);SeriesModel.registerClass(ThemeRiverSeriesModel);var ThemeRiverView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this,a=this.group,o=e.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(e){return e.name}a.x=0,a.y=l.y+u[0];var h=new DataDiffer(this._layersSeries||[],o,c,c),p=[];function d(t,n,s){var l=r._layers;if("remove"!==t){for(var u,c,h=[],d=[],f=o[n].indices,g=0;g<f.length;g++){var m=i.getItemLayout(f[g]),y=m.x,v=m.y0,_=m.y;h.push(y,v),d.push(y,v+_),u=i.getItemVisual(f[g],"style")}var x=i.getItemLayout(f[0]),S=e.getModel("label").get("margin"),b=e.getModel("emphasis");if("add"===t){var T=p[n]=new Group;c=new ECPolygon({shape:{points:h,stackedOnPoints:d,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),T.add(c),a.add(T),e.isAnimationEnabled()&&c.setClipPath(createGridClipShape$2(c.getBoundingRect(),e,(function(){c.removeClipPath()})))}else{T=l[s];c=T.childAt(0),a.add(T),p[n]=T,updateProps(c,{shape:{points:h,stackedOnPoints:d}},e)}setLabelStyle(c,getLabelStatesModels(e),{labelDataIndex:f[g-1],defaultText:i.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),c.setTextConfig({position:null,local:!0});var M=c.getTextContent();M&&(M.x=x.x-S,M.y=x.y0+x.y/2),c.useStyle(u),i.setItemGraphicEl(n,c),setStatesStylesFromModel(c,e),enableHoverEmphasis(c,b.get("focus"),b.get("blurScope"))}else a.remove(l[n])}h.add(bind(d,this,"add")).update(bind(d,this,"update")).remove(bind(d,this,"remove")).execute(),this._layersSeries=o,this._layers=p},t.type="themeRiver",t}(ChartView);function createGridClipShape$2(e,t,n){var i=new Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return initProps(i,{shape:{x:e.x-50,width:e.width+100,height:e.height+20}},t,n),i}function themeRiverLayout(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),n=e.coordinateSystem,i={},r=n.getRect();i.rect=r;var a=e.get("boundaryGap"),o=n.getAxis();(i.boundaryGap=a,"horizontal"===o.orient)?(a[0]=parsePercent$2(a[0],r.height),a[1]=parsePercent$2(a[1],r.height),doThemeRiverLayout(t,e,r.height-a[0]-a[1])):(a[0]=parsePercent$2(a[0],r.width),a[1]=parsePercent$2(a[1],r.width),doThemeRiverLayout(t,e,r.width-a[0]-a[1]));t.setLayout("layoutInfo",i)}))}function doThemeRiverLayout(e,t,n){if(e.count())for(var i,r=t.coordinateSystem,a=t.getLayerSeries(),o=e.mapDimension("single"),s=e.mapDimension("value"),l=map(a,(function(t){return map(t.indices,(function(t){var n=r.dataToPoint(e.get(o,t));return n[1]=e.get(s,t),n}))})),u=computeBaseline(l),c=u.y0,h=n/u.max,p=a.length,d=a[0].indices.length,f=0;f<d;++f){i=c[f]*h,e.setItemLayout(a[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:i,y:l[0][f][1]*h});for(var g=1;g<p;++g)i+=l[g-1][f][1]*h,e.setItemLayout(a[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:i,y:l[g][f][1]*h})}}function computeBaseline(e){for(var t=e.length,n=e[0].length,i=[],r=[],a=0,o=0;o<n;++o){for(var s=0,l=0;l<t;++l)s+=e[l][o][1];s>a&&(a=s),i.push(s)}for(var u=0;u<n;++u)r[u]=(a-i[u])/2;a=0;for(var c=0;c<n;++c){var h=i[c]+r[c];h>a&&(a=h)}return{y0:r,max:a}}ChartView.registerClass(ThemeRiverView),registerLayout(themeRiverLayout),registerProcessor(dataFilter("themeRiver"));var SunburstSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};completeTreeValue$1(n);var i=map(e.levels||[],(function(e){return new Model(e,this,t)}),this),r=Tree.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=r.getNodeByDataIndex(t),a=i[n.depth];return a&&(e.parentModel=a),e}))}));return r.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=wrapTreePathInfo(i,this),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(){enableAriaDecalForTree(this)},t.type="series.sunburst",t.defaultOption={zlevel:0,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:[],levels:[],sort:"desc"},t}(SeriesModel);function completeTreeValue$1(e){var t=0;each(e.children,(function(e){completeTreeValue$1(e);var n=e.value;isArray(n)&&(n=n[0]),t+=n}));var n=e.value;isArray(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),isArray(e.value)?e.value[0]=n:e.value=n}SeriesModel.registerClass(SunburstSeriesModel);var DEFAULT_SECTOR_Z=2,DEFAULT_TEXT_Z=4,SunburstPiece=function(e){function t(t,n,i,r){var a=e.call(this)||this;a.z2=DEFAULT_SECTOR_Z,a.textConfig={inside:!0},getECData(a).seriesIndex=n.seriesIndex;var o=new ZRText({z2:DEFAULT_TEXT_Z,silent:t.getModel().get(["label","silent"])});return a.setTextContent(o),a.updateData(!0,t,n,i,r),a}return __extends(t,e),t.prototype.updateData=function(e,t,n,i,r){this.node=t,t.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var a=this;getECData(a).dataIndex=t.dataIndex;var o=t.getModel(),s=o.getModel("emphasis"),l=t.getLayout(),u=extend({},l);u.label=null;var c=t.getVisual("style");c.lineJoin="bevel";var h=t.getVisual("decal");h&&(c.decal=createOrUpdatePatternFromDecal(h,r));var p=getSectorCornerRadius(o.getModel("itemStyle"),u);extend(u,p),each(SPECIAL_STATES,(function(e){var t=a.ensureState(e),n=o.getModel([e,"itemStyle"]);t.style=n.getItemStyle();var i=getSectorCornerRadius(n,u);i&&(t.shape=i)})),e?(a.setShape(u),a.shape.r=l.r0,updateProps(a,{shape:{r:l.r}},n,t.dataIndex)):updateProps(a,{shape:u},n),a.useStyle(c),this._updateLabel(n);var d=o.getShallow("cursor");d&&a.attr("cursor",d),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var f=s.get("focus");enableHoverEmphasis(this,("ancestor"===f?t.getAncestorsIndices():"descendant"===f?t.getDescendantIndices():null)||f,s.get("blurScope"))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),i=n.getModel("label"),r=this.node.getLayout(),a=r.endAngle-r.startAngle,o=(r.startAngle+r.endAngle)/2,s=Math.cos(o),l=Math.sin(o),u=this,c=u.getTextContent(),h=this.node.dataIndex,p=i.get("minAngle")/180*Math.PI,d=i.get("show")&&!(null!=p&&Math.abs(a)<p);function f(e,t){var n=e.get(t);return null==n?i.get(t):n}c.ignore=!d,each(DISPLAY_STATES,(function(i){var a="normal"===i?n.getModel("label"):n.getModel([i,"label"]),p="normal"===i,d=p?c:c.ensureState(i),g=e.getFormattedLabel(h,i);p&&(g=g||t.node.name),d.style=createTextStyle(a,{},null,"normal"!==i,!0),g&&(d.style.text=g);var m=a.get("show");null==m||p||(d.ignore=!m);var y,v=f(a,"position"),_=p?u:u.states[i],x=_.style.fill;_.textConfig={outsideFill:"inherit"===a.get("color")?x:null,inside:"outside"!==v};var S=f(a,"distance")||0,b=f(a,"align");"outside"===v?(y=r.r+S,b=o>Math.PI/2?"right":"left"):b&&"center"!==b?"left"===b?(y=r.r0+S,o>Math.PI/2&&(b="right")):"right"===b&&(y=r.r-S,o>Math.PI/2&&(b="left")):(y=(r.r+r.r0)/2,b="center"),d.style.align=b,d.style.verticalAlign=f(a,"verticalAlign")||"middle",d.x=y*s+r.cx,d.y=y*l+r.cy;var T=f(a,"rotate"),M=0;"radial"===T?(M=-o)<-Math.PI/2&&(M+=Math.PI):"tangential"===T?(M=Math.PI/2-o)>Math.PI/2?M-=Math.PI:M<-Math.PI/2&&(M+=Math.PI):"number"==typeof T&&(M=T*Math.PI/180),d.rotation=M})),c.dirtyStyle()},t}(Sector),ROOT_TO_NODE_ACTION="sunburstRootToNode";registerAction({type:ROOT_TO_NODE_ACTION,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,n){var i=retrieveTargetInfo(e,[ROOT_TO_NODE_ACTION],t);if(i){var r=t.getViewRoot();r&&(e.direction=aboveViewRoot(r,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}}))}));var HIGHLIGHT_ACTION="sunburstHighlight";registerAction({type:HIGHLIGHT_ACTION,update:"none"},(function(e,t,n){e=extend({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t){var n=retrieveTargetInfo(e,[HIGHLIGHT_ACTION],t);n&&(e.dataIndex=n.node.dataIndex)})),n.dispatchAction(extend(e,{type:"highlight"}))}));var UNHIGHLIGHT_ACTION="sunburstUnhighlight";registerAction({type:UNHIGHLIGHT_ACTION,update:"updateView"},(function(e,t,n){e=extend({},e),n.dispatchAction(extend(e,{type:"downplay"}))}));var SunburstView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this;this.seriesModel=e,this.api=n,this.ecModel=t;var a=e.getData(),o=a.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(i,r){if(0===i.length&&0===r.length)return;function s(e){return e.getId()}function c(s,c){!function(i,r){u||!i||i.getValue()||(i=null);if(i!==o&&r!==o)if(r&&r.piece)i?(r.piece.updateData(!1,i,e,t,n),a.setItemGraphicEl(i.dataIndex,r.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(r);else if(i){var s=new SunburstPiece(i,e,t,n);l.add(s),a.setItemGraphicEl(i.dataIndex,s)}}(null==s?null:i[s],null==c?null:r[c])}new DataDiffer(r,i,s,s).add(c).update(c).remove(curry(c,null)).execute()}(c,h),function(i,a){a.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,e,t,n):(r.virtualPiece=new SunburstPiece(i,e,t,n),l.add(r.virtualPiece)),a.piece.off("click"),r.virtualPiece.on("click",(function(e){r._rootToNode(a.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(o,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(i){if(!n&&i.piece&&i.piece===t.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(i);else if("link"===r){var a=i.getModel(),o=a.get("link");if(o)windowOpen(o,a.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:ROOT_TO_NODE_ACTION,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,r=e[1]-n.cy,a=Math.sqrt(i*i+r*r);return a<=n.r&&a>=n.r0}},t.type="sunburst",t}(ChartView);ChartView.registerClass(SunburstView);var RADIAN$2=Math.PI/180;function sunburstLayout(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),i=e.get("radius");isArray(i)||(i=[0,i]),isArray(t)||(t=[t,t]);var r=n.getWidth(),a=n.getHeight(),o=Math.min(r,a),s=parsePercent$2(t[0],r),l=parsePercent$2(t[1],a),u=parsePercent$2(i[0],o/2),c=parsePercent$2(i[1],o/2),h=-e.get("startAngle")*RADIAN$2,p=e.get("minAngle")*RADIAN$2,d=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&initChildren$1(f,m);var y=0;each(f.children,(function(e){!isNaN(e.getValue())&&y++}));var v=f.getValue(),_=Math.PI/(v||y)*2,x=f.depth>0,S=f.height-(x?-1:1),b=(c-u)/(S||1),T=e.get("clockwise"),M=e.get("stillShowZeroSum"),A=T?1:-1,I=function(e,t){if(e){var n=t;if(e!==d){var i=e.getValue(),r=0===v&&M?_:i*_;r<p&&(r=p),n=t+A*r;var a=e.depth-g-(x?-1:1),c=u+b*a,h=u+b*(a+1),f=e.getModel();null!=f.get("r0")&&(c=parsePercent$2(f.get("r0"),o/2)),null!=f.get("r")&&(h=parsePercent$2(f.get("r"),o/2)),e.setLayout({angle:r,startAngle:t,endAngle:n,clockwise:T,cx:s,cy:l,r0:c,r:h})}if(e.children&&e.children.length){var m=0;each(e.children,(function(e){m+=I(e,t+m)}))}return n-t}};if(x){var C=u,w=u+b,P=2*Math.PI;d.setLayout({angle:P,startAngle:h,endAngle:h+P,clockwise:T,cx:s,cy:l,r0:C,r:w})}I(f,h)}))}function initChildren$1(e,t){var n=e.children||[];e.children=sort$2(n,t),n.length&&each(e.children,(function(e){initChildren$1(e,t)}))}function sort$2(e,t){if("function"==typeof t){var n=map(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)})),map(n,(function(t){return e[t.index]}))}var i="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(i?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(i?-1:1):n}))}function sunburstVisual(e){var t={};e.eachSeriesByType("sunburst",(function(e){var n=e.getData(),i=n.tree;i.eachNode((function(r){var a=r.getModel().getModel("itemStyle").getItemStyle();a.fill||(a.fill=function(e,n,i){for(var r=e;r&&r.depth>1;)r=r.parentNode;var a=n.getColorFromPalette(r.name||r.dataIndex+"",t);return e.depth>1&&"string"==typeof a&&(a=lift(a,(e.depth-1)/(i-1)*.5)),a}(r,e,i.root.height)),extend(n.ensureUniqueItemVisual(r.dataIndex,"style"),a)}))}))}function dataToCoordSize(e,t){return t=t||[0,0],map(["x","y"],(function(n,i){var r=this.getAxis(n),a=t[i],o=e[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o))}),this)}function cartesianPrepareCustom(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:bind(dataToCoordSize,e)}}}function dataToCoordSize$1(e,t){return t=t||[0,0],map([0,1],(function(n){var i=t[n],r=e[n]/2,a=[],o=[];return a[n]=i-r,o[n]=i+r,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])}),this)}function geoPrepareCustom(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:bind(dataToCoordSize$1,e)}}}function dataToCoordSize$2(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function singlePrepareCustom(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:bind(dataToCoordSize$2,e)}}}function dataToCoordSize$3(e,t){return t=t||[0,0],map(["Radius","Angle"],(function(n,i){var r=this["get"+n+"Axis"](),a=t[i],o=e[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}function polarPrepareCustom(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=t.dataToRadius(i[0]),a=n.dataToAngle(i[1]),o=e.coordToPoint([r,a]);return o.push(r,a*Math.PI/180),o},size:bind(dataToCoordSize$3,e)}}}function calendarPrepareCustom(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)}}}}registerLayout(curry(sunburstLayout,"sunburst")),registerProcessor(curry(dataFilter,"sunburst")),registerVisual(sunburstVisual);var deprecatedLogs={};function isEC4CompatibleStyle(e,t,n,i){return e&&(e.legacy||!1!==e.legacy&&!n&&!i&&"tspan"!==t&&("text"===t||hasOwn(e,"text")))}function convertFromEC4CompatibleStyle(e,t,n){var i,r,a,o=e;if("text"===t)a=o;else{a={},hasOwn(o,"text")&&(a.text=o.text),hasOwn(o,"rich")&&(a.rich=o.rich),hasOwn(o,"textFill")&&(a.fill=o.textFill),hasOwn(o,"textStroke")&&(a.stroke=o.textStroke),r={type:"text",style:a,silent:!0},i={};var s=hasOwn(o,"textPosition");n?i.position=s?o.textPosition:"inside":s&&(i.position=o.textPosition),hasOwn(o,"textPosition")&&(i.position=o.textPosition),hasOwn(o,"textOffset")&&(i.offset=o.textOffset),hasOwn(o,"textRotation")&&(i.rotation=o.textRotation),hasOwn(o,"textDistance")&&(i.distance=o.textDistance)}return convertEC4CompatibleRichItem(a,e),each(a.rich,(function(e){convertEC4CompatibleRichItem(e,e)})),{textConfig:i,textContent:r}}function convertEC4CompatibleRichItem(e,t){t&&(t.font=t.textFont||t.font,hasOwn(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),hasOwn(t,"textAlign")&&(e.align=t.textAlign),hasOwn(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),hasOwn(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),hasOwn(t,"textWidth")&&(e.width=t.textWidth),hasOwn(t,"textHeight")&&(e.height=t.textHeight),hasOwn(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),hasOwn(t,"textPadding")&&(e.padding=t.textPadding),hasOwn(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),hasOwn(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),hasOwn(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),hasOwn(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),hasOwn(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),hasOwn(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),hasOwn(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function convertToEC4StyleForCustomSerise(e,t,n){var i=e;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,a=e.fill||"#000";convertToEC4RichItem(i,t);var o=null==i.textFill;return r?o&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=a),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(o&&(i.textFill=n.outsideFill||a),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=t.text,i.rich=t.rich,each(t.rich,(function(e){convertToEC4RichItem(e,e)})),i}function convertToEC4RichItem(e,t){t&&(hasOwn(t,"fill")&&(e.textFill=t.fill),hasOwn(t,"stroke")&&(e.textStroke=t.fill),hasOwn(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),hasOwn(t,"font")&&(e.font=t.font),hasOwn(t,"fontStyle")&&(e.fontStyle=t.fontStyle),hasOwn(t,"fontWeight")&&(e.fontWeight=t.fontWeight),hasOwn(t,"fontSize")&&(e.fontSize=t.fontSize),hasOwn(t,"fontFamily")&&(e.fontFamily=t.fontFamily),hasOwn(t,"align")&&(e.textAlign=t.align),hasOwn(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),hasOwn(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),hasOwn(t,"width")&&(e.textWidth=t.width),hasOwn(t,"height")&&(e.textHeight=t.height),hasOwn(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),hasOwn(t,"padding")&&(e.textPadding=t.padding),hasOwn(t,"borderColor")&&(e.textBorderColor=t.borderColor),hasOwn(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),hasOwn(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),hasOwn(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),hasOwn(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),hasOwn(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),hasOwn(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),hasOwn(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),hasOwn(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),hasOwn(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),hasOwn(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function warnDeprecated(e,t){}var inner$e=makeInner(),TRANSFORM_PROPS={x:1,y:1,scaleX:1,scaleY:1,originX:1,originY:1,rotation:1},transformPropNamesStr=keys(TRANSFORM_PROPS).join(", "),STYLE_VISUAL_TYPE={color:"fill",borderColor:"stroke"},NON_STYLE_VISUAL_PROPS={symbol:1,symbolSize:1,symbolKeepAspect:1,legendSymbol:1,visualMeta:1,liftZ:1,decal:1},EMPHASIS="emphasis",NORMAL="normal",BLUR="blur",SELECT="select",STATES=[NORMAL,EMPHASIS,BLUR,SELECT],PATH_ITEM_STYLE={normal:["itemStyle"],emphasis:[EMPHASIS,"itemStyle"],blur:[BLUR,"itemStyle"],select:[SELECT,"itemStyle"]},PATH_LABEL={normal:["label"],emphasis:[EMPHASIS,"label"],blur:[BLUR,"label"],select:[SELECT,"label"]},GROUP_DIFF_PREFIX="e\0\0",attachedTxInfoTmp={normal:{},emphasis:{},blur:{},select:{}},LEGACY_TRANSFORM_PROPS={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},tmpTransformable=new Transformable,prepareCustoms={cartesian2d:cartesianPrepareCustom,geo:geoPrepareCustom,singleAxis:singlePrepareCustom,polar:polarPrepareCustom,calendar:calendarPrepareCustom},CustomSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(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 createListFromArray(this.getSource(),this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=inner$e(i).info),r},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},t}(SeriesModel);ComponentModel.registerClass(CustomSeriesModel);var checkNonStyleTansitionRefer,checkTransformPropRefer,CustomSeriesView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this._data,a=e.getData(),o=this.group,s=makeRenderItem(e,a,t,n),l=e.__transientTransitionOpt;if(!l||null!=l.from&&null!=l.to){var u=new MorphPreparation(e,l),c=l?"multiple":"oneToOne";new DataDiffer(r?r.getIndices():[],a.getIndices(),createGetKey(r,c,l&&l.from),createGetKey(a,c,l&&l.to),null,c).add((function(t){createOrUpdateItem(n,null,t,s(t,i),e,o,a,null)})).remove((function(t){doRemoveEl(r.getItemGraphicEl(t),e,o)})).update((function(t,l){u.reset("oneToOne");var c=r.getItemGraphicEl(l);u.findAndAddFrom(c),u.hasFrom()&&(removeElementDirectly(c,o),c=null),createOrUpdateItem(n,c,t,s(t,i),e,o,a,u),u.applyMorphing()})).updateManyToOne((function(t,l){u.reset("manyToOne");for(var c=0;c<l.length;c++){var h=r.getItemGraphicEl(l[c]);u.findAndAddFrom(h),removeElementDirectly(h,o)}createOrUpdateItem(n,null,t,s(t,i),e,o,a,u),u.applyMorphing()})).updateOneToMany((function(t,l){u.reset("oneToMany");var c=t.length,h=r.getItemGraphicEl(l);u.findAndAddFrom(h),removeElementDirectly(h,o);for(var p=0;p<c;p++)createOrUpdateItem(n,null,t[p],s(t[p],i),e,o,a,u);u.applyMorphing()})).execute()}else r&&r.each((function(t){doRemoveEl(r.getItemGraphicEl(t),e,o)})),a.each((function(t){createOrUpdateItem(n,null,t,s(t,i),e,o,a,null)}));var h=e.get("clip",!0)?createClipPath(e.coordinateSystem,!1,e):null;h?o.setClipPath(h):o.removeClipPath(),this._data=a},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,i,r){var a=t.getData(),o=makeRenderItem(t,a,n,i);function s(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var l=e.start;l<e.end;l++){createOrUpdateItem(null,null,l,o(l,r),t,this.group,a,null).traverse(s)}},t.prototype.filterForExposedEvent=function(e,t,n,i){var r=t.element;if(null==r||n.name===r)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===r)return!0;return!1},t.type="custom",t}(ChartView);function createGetKey(e,t,n){if(e){if("oneToOne"===t)return function(t,n){return e.getId(n)};var i=e.getDimension(n),r=e.getDimensionInfo(i);if(!r){var a="";0,throwError(a)}var o=r.ordinalMeta;return function(t,n){var r=e.get(i,n);return o&&(r=o.categories[r]),null==r||eqNaN(r)?t+"":"_ec_"+r}}}function createEl(e){var t,n=e.type;if("path"===n){var i=e.shape,r=null!=i.width&&null!=i.height?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,a=getPathData(i);t=makePath(a,null,r,i.layout||"center"),inner$e(t).customPathData=a}else if("image"===n)t=new ZRImage({}),inner$e(t).customImagePath=e.style.image;else if("text"===n)t=new ZRText({});else if("group"===n)t=new Group;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var o=getShapeClass(n);if(!o){var s="";0,throwError(s)}t=new o}return inner$e(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function updateElNormal(e,t,n,i,r,a,o,s,l,u){var c={},h={},p=t.isGroup?null:t;!n&&prepareShapeOrExtraTransitionFrom("shape",t,null,r,c,l),prepareShapeOrExtraAllPropsFinal("shape",r,h),!n&&prepareShapeOrExtraTransitionFrom("extra",t,null,r,c,l),prepareShapeOrExtraAllPropsFinal("extra",r,h),!n&&prepareTransformTransitionFrom(t,null,r,c,l),prepareTransformAllPropsFinal(r,h);var d=o&&o.normal.cfg;if(d&&t.setTextConfig(d),"text"===t.type&&a){var f=a;hasOwn(f,"textFill")&&(f.fill=f.textFill),hasOwn(f,"textStroke")&&(f.stroke=f.textStroke)}if(a){var g=void 0,m=isPath$1(t)?a.decal:null;e&&m&&(m.dirty=!0,g=createOrUpdatePatternFromDecal(m,e)),a.__decalPattern=g}return!n&&prepareStyleTransitionFrom(t,null,r,a,c,l),p&&hasOwn(r,"invisible")&&(p.invisible=r.invisible),n||(applyPropsFinal(t,h,a),applyTransitionFrom(t,i,r,s,c,l)),hasOwn(r,"silent")&&(t.silent=r.silent),hasOwn(r,"ignore")&&(t.ignore=r.ignore),u||hasOwn(r,"info")&&(inner$e(t).info=r.info),a?t.dirty():t.markRedraw(),n?h:null}function applyPropsFinal(e,t,n){var i=e.isGroup?null:e;if(i&&n){var r=n.__decalPattern,a=void 0;r&&(a=n.decal,n.decal=r),i.useStyle(n),r&&(n.decal=a);for(var o=i.animators,s=0;s<o.length;s++){var l=o[s];"style"===l.targetName&&l.changeTarget(i.style)}}t&&e.attr(t)}function applyTransitionFrom(e,t,n,i,r,a){if(r){var o=n.during;inner$e(e).userDuring=o;var s={dataIndex:t,isFrom:!0,during:o?bind(duringCall,{el:e,userDuring:o}):null};a?initProps(e,r,i,s):updateProps(e,r,i,s)}}function prepareShapeOrExtraTransitionFrom(e,t,n,i,r,a){var o=i[e];if(o){var s,l=t[e],u=o.enterFrom;if(a&&u){!s&&(s=r[e]={});for(var c=keys(u),h=0;h<c.length;h++){s[_=c[h]]=u[_]}}if(!a&&l&&(null==n||"shape"!==e))if(o.transition){!s&&(s=r[e]={});var p=normalizeToArray(o.transition);for(h=0;h<p.length;h++){var d=l[_=p[h]];0,s[_]=d}}else if(indexOf(i.transition,e)>=0){!s&&(s=r[e]={});var f=keys(l);for(h=0;h<f.length;h++){d=l[_=f[h]];isNonStyleTransitionEnabled(o[_],d)&&(s[_]=d)}}var g=o.leaveTo;if(g){var m=getOrCreateLeaveToPropsFromEl(t),y=m[e]||(m[e]={}),v=keys(g);for(h=0;h<v.length;h++){var _;y[_=v[h]]=g[_]}}}}function prepareShapeOrExtraAllPropsFinal(e,t,n){var i=t[e];if(i)for(var r=n[e]={},a=keys(i),o=0;o<a.length;o++){var s=a[o];r[s]=cloneValue(i[s])}}function prepareTransformTransitionFrom(e,t,n,i,r){var a=n.enterFrom;if(r&&a)for(var o=keys(a),s=0;s<o.length;s++){0,i[f=o[s]]=a[f]}if(!r)if(t){var l=calcOldElLocalTransformBasedOnNewElParent(t,e);setTransformPropToTransitionFrom(i,"x",l),setTransformPropToTransitionFrom(i,"y",l),setTransformPropToTransitionFrom(i,"scaleX",l),setTransformPropToTransitionFrom(i,"scaleY",l),setTransformPropToTransitionFrom(i,"originX",l),setTransformPropToTransitionFrom(i,"originY",l),setTransformPropToTransitionFrom(i,"rotation",l)}else if(n.transition){var u=normalizeToArray(n.transition);for(s=0;s<u.length;s++){if("style"!==(f=u[s])&&"shape"!==f&&"extra"!==f){var c=e[f];0,i[f]=c}}}else setTransformPropToTransitionFrom(i,"x",e),setTransformPropToTransitionFrom(i,"y",e);var h=n.leaveTo;if(h){var p=getOrCreateLeaveToPropsFromEl(e),d=keys(h);for(s=0;s<d.length;s++){var f;0,p[f=d[s]]=h[f]}}}function prepareTransformAllPropsFinal(e,t){setLagecyTransformProp(e,t,"position"),setLagecyTransformProp(e,t,"scale"),setLagecyTransformProp(e,t,"origin"),setTransformProp(e,t,"x"),setTransformProp(e,t,"y"),setTransformProp(e,t,"scaleX"),setTransformProp(e,t,"scaleY"),setTransformProp(e,t,"originX"),setTransformProp(e,t,"originY"),setTransformProp(e,t,"rotation")}function prepareStyleTransitionFrom(e,t,n,i,r,a){if(i){var o,s=(t||e).style,l=i.enterFrom;if(a&&l){var u=keys(l);!o&&(o=r.style={});for(var c=0;c<u.length;c++){o[x=u[c]]=l[x]}}if(!a&&s)if(i.transition){var h=normalizeToArray(i.transition);!o&&(o=r.style={});for(c=0;c<h.length;c++){var p=s[x=h[c]];o[x]=p}}else if(e.getAnimationStyleProps&&indexOf(n.transition,"style")>=0){var d=e.getAnimationStyleProps(),f=d?d.style:null;if(f){!o&&(o=r.style={});var g=keys(i);for(c=0;c<g.length;c++){if(f[x=g[c]]){p=s[x];o[x]=p}}}}var m=i.leaveTo;if(m){var y=keys(m),v=getOrCreateLeaveToPropsFromEl(e),_=v.style||(v.style={});for(c=0;c<y.length;c++){var x;_[x=y[c]]=m[x]}}}}function calcOldElLocalTransformBasedOnNewElParent(e,t){if(!e||e===t||e.parent===t.parent)return e;var n=tmpTransformable.transform||(tmpTransformable.transform=identity([])),i=e.getComputedTransform();i?copy$1(n,i):identity(n);var r=t.parent;return r&&r.getComputedTransform(),tmpTransformable.originX=e.originX,tmpTransformable.originY=e.originY,tmpTransformable.parent=r,tmpTransformable.decomposeTransform(),tmpTransformable}function isNonStyleTransitionEnabled(e,t){return isArrayLike(e)?e!==t:null!=e&&isFinite(e)}function getOrCreateLeaveToPropsFromEl(e){var t=inner$e(e);return t.leaveToProps||(t.leaveToProps={})}ChartView.registerClass(CustomSeriesView);var tmpDuringScope={},customDuringAPI={setTransform:function(e,t){return tmpDuringScope.el[e]=t,this},getTransform:function(e){return tmpDuringScope.el[e]},setShape:function(e,t){return(tmpDuringScope.el.shape||(tmpDuringScope.el.shape={}))[e]=t,tmpDuringScope.isShapeDirty=!0,this},getShape:function(e){var t=tmpDuringScope.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=tmpDuringScope.el.style;return n&&(n[e]=t,tmpDuringScope.isStyleDirty=!0),this},getStyle:function(e){var t=tmpDuringScope.el.style;if(t)return t[e]},setExtra:function(e,t){return(tmpDuringScope.el.extra||(tmpDuringScope.el.extra={}))[e]=t,this},getExtra:function(e){var t=tmpDuringScope.el.extra;if(t)return t[e]}};function assertNotReserved(e){0}function duringCall(){var e=this,t=e.el;if(t){var n=inner$e(t).userDuring,i=e.userDuring;n===i?(tmpDuringScope.el=t,tmpDuringScope.isShapeDirty=!1,tmpDuringScope.isStyleDirty=!1,i(customDuringAPI),tmpDuringScope.isShapeDirty&&t.dirtyShape&&t.dirtyShape(),tmpDuringScope.isStyleDirty&&t.dirtyStyle&&t.dirtyStyle()):e.el=e.userDuring=null}}function updateElOnState(e,t,n,i,r,a,o){var s=t.isGroup?null:t,l=r&&r[e].cfg;if(s){var u=s.ensureState(e);if(!1===i){var c=s.getState(e);c&&(c.style=null)}else u.style=i||null;l&&(u.textConfig=l),setDefaultStateProxy(s)}}function updateZ$1(e,t,n,i){if(!e.isGroup){var r=e,a=n.currentZ,o=n.currentZLevel;r.z=a,r.zlevel=o;var s=t.z2;null!=s&&(r.z2=s||0);for(var l=0;l<STATES.length;l++)updateZForEachState(r,t,STATES[l])}}function updateZForEachState(e,t,n){var i=n===NORMAL,r=i?t:retrieveStateOption(t,n),a=r?r.z2:null;null!=a&&((i?e:e.ensureState(n)).z2=a||0)}function setLagecyTransformProp(e,t,n,i){var r=e[n],a=LEGACY_TRANSFORM_PROPS[n];r&&(i?(t[a[0]]=i[a[0]],t[a[1]]=i[a[1]]):(t[a[0]]=r[0],t[a[1]]=r[1]))}function setTransformProp(e,t,n,i){null!=e[n]&&(t[n]=i?i[n]:e[n])}function setTransformPropToTransitionFrom(e,t,n){n&&(e[t]=n[t])}function makeRenderItem(e,t,n,i){var r=e.get("renderItem"),a=e.coordinateSystem,o={};a&&(o=a.prepareCustoms?a.prepareCustoms(a):prepareCustoms[a.type](a));for(var s,l,u=defaults({getWidth:i.getWidth,getHeight:i.getHeight,getZr:i.getZr,getDevicePixelRatio:i.getDevicePixelRatio,value:function(e,n){return null==n&&(n=s),t.get(t.getDimension(e||0),n)},style:function(n,i){0;null==i&&(i=s);var r=t.getItemVisual(i,"style"),a=r&&r.fill,o=r&&r.opacity,l=v(i,NORMAL).getItemStyle();null!=a&&(l.fill=a),null!=o&&(l.opacity=o);var u={inheritColor:isString(a)?a:"#000"},c=_(i,NORMAL),h=createTextStyle(c,null,u,!1,!0);h.text=c.getShallow("show")?retrieve2(e.getFormattedLabel(i,NORMAL),getDefaultLabel(t,i)):null;var p=createTextConfig(c,u,!1);return S(n,l),l=convertToEC4StyleForCustomSerise(l,h,p),n&&x(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=s);var i=t.getDimensionInfo(e||0);if(!i)return;var r=t.get(i.name,n),a=i&&i.ordinalMeta;return a?a.categories[r]:r},styleEmphasis:function(n,i){0;null==i&&(i=s);var r=v(i,EMPHASIS).getItemStyle(),a=_(i,EMPHASIS),o=createTextStyle(a,null,null,!0,!0);o.text=a.getShallow("show")?retrieve3(e.getFormattedLabel(i,EMPHASIS),e.getFormattedLabel(i,NORMAL),getDefaultLabel(t,i)):null;var l=createTextConfig(a,null,!0);return S(n,r),r=convertToEC4StyleForCustomSerise(r,o,l),n&&x(r,n),r.legacy=!0,r},visual:function(e,n){if(null==n&&(n=s),hasOwn(STYLE_VISUAL_TYPE,e)){var i=t.getItemVisual(n,"style");return i?i[STYLE_VISUAL_TYPE[e]]:null}if(hasOwn(NON_STYLE_VISUAL_PROPS,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===a.type){return getLayoutOnAxis(defaults({axis:a.getBaseAxis()},e))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return getFont(e,n)}},o.api||{}),c={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:wrapEncodeDef(e.getData())},h={},p={},d={},f={},g=0;g<STATES.length;g++){var m=STATES[g];d[m]=e.getModel(PATH_ITEM_STYLE[m]),f[m]=e.getModel(PATH_LABEL[m])}function y(e){return e===s?l||(l=t.getItemModel(e)):t.getItemModel(e)}function v(e,n){return t.hasItemOption?e===s?h[n]||(h[n]=y(e).getModel(PATH_ITEM_STYLE[n])):y(e).getModel(PATH_ITEM_STYLE[n]):d[n]}function _(e,n){return t.hasItemOption?e===s?p[n]||(p[n]=y(e).getModel(PATH_LABEL[n])):y(e).getModel(PATH_LABEL[n]):f[n]}return function(e,n){return s=e,l=null,h={},p={},r&&r(defaults({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},c),u)};function x(e,t){for(var n in t)hasOwn(t,n)&&(e[n]=t[n])}function S(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function wrapEncodeDef(e){var t={};return each(e.dimensions,(function(n,i){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var a=r.coordDim;(t[a]=t[a]||[])[r.coordDimIndex]=i}})),t}function createOrUpdateItem(e,t,n,i,r,a,o,s){if(i)return(t=doCreateOrUpdateEl(e,t,n,i,r,a,!0,s))&&o.setItemGraphicEl(n,t),enableHoverEmphasis(t,i.focus,i.blurScope),t;removeElementDirectly(t,a)}function doCreateOrUpdateEl(e,t,n,i,r,a,o,s){var l=-1;t&&doesElNeedRecreate(t,i)&&(l=a.childrenRef().indexOf(t),t=null);var u=!t;t?t.clearStates():t=createEl(i);var c=(inner$e(t).canMorph=i.morph&&isPath$1(t))&&s&&s.hasFrom(),h=u&&!c;attachedTxInfoTmp.normal.cfg=attachedTxInfoTmp.normal.conOpt=attachedTxInfoTmp.emphasis.cfg=attachedTxInfoTmp.emphasis.conOpt=attachedTxInfoTmp.blur.cfg=attachedTxInfoTmp.blur.conOpt=attachedTxInfoTmp.select.cfg=attachedTxInfoTmp.select.conOpt=null,attachedTxInfoTmp.isLegacy=!1,doCreateOrUpdateAttachedTx(t,n,i,r,h,attachedTxInfoTmp),doCreateOrUpdateClipPath(t,n,i,r,h);var p=updateElNormal(e,t,c,n,i,i.style,attachedTxInfoTmp,r,h,!1);c&&s.addTo(t,i,n,p);for(var d=0;d<STATES.length;d++){var f=STATES[d];if(f!==NORMAL){var g=retrieveStateOption(i,f);updateElOnState(f,t,g,retrieveStyleOptionOnState(i,g,f),attachedTxInfoTmp)}}return updateZ$1(t,i,r),"group"===i.type&&mergeChildren(e,t,n,i,r,s),l>=0?a.replaceAt(t,l):a.add(t),t}function doesElNeedRecreate(e,t){var n=inner$e(e),i=t.type,r=t.shape,a=t.style;return null!=i&&i!==n.customGraphicType||"path"===i&&hasOwnPathData(r)&&getPathData(r)!==n.customPathData||"image"===i&&hasOwn(a,"image")&&a.image!==n.customImagePath}function doCreateOrUpdateClipPath(e,t,n,i,r){var a=n.clipPath;if(!1===a)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&doesElNeedRecreate(o,a)&&(o=null),o||(o=createEl(a),e.setClipPath(o)),updateElNormal(null,o,null,t,a,null,null,i,r,!1)}}function doCreateOrUpdateAttachedTx(e,t,n,i,r,a){if(!e.isGroup){processTxInfo(n,null,a),processTxInfo(n,EMPHASIS,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(null!=o||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===o)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=createEl(o),e.setTextContent(c));var h=o&&o.style;updateElNormal(null,c,null,t,o,h,null,i,r,!0);for(var p=0;p<STATES.length;p++){var d=STATES[p];if(d!==NORMAL){var f=a[d].conOpt;updateElOnState(d,c,f,retrieveStyleOptionOnState(o,f,d),null)}}h?c.dirty():c.markRedraw()}}}}function processTxInfo(e,t,n){var i=t?retrieveStateOption(e,t):e,r=t?retrieveStyleOptionOnState(e,i,EMPHASIS):e.style,a=e.type,o=i?i.textConfig:null,s=e.textContent,l=s?t?retrieveStateOption(s,t):s:null;if(r&&(n.isLegacy||isEC4CompatibleStyle(r,a,!!o,!!l))){n.isLegacy=!0;var u=convertFromEC4CompatibleStyle(r,a,!t);!o&&u.textConfig&&(o=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text")}var h=t?n[t]:n.normal;h.cfg=o,h.conOpt=l}function retrieveStateOption(e,t){return t?e?e[t]:null:e}function retrieveStyleOptionOnState(e,t,n){var i=t&&t.style;return null==i&&n===EMPHASIS&&e&&(i=e.styleEmphasis),i}function mergeChildren(e,t,n,i,r,a){var o=i.children,s=o?o.length:0,l=i.$mergeChildren,u="byName"===l||i.diffChildrenByName,c=!1===l;if(s||u||c)if(u)diffGroupChildren({api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:r,group:t,morphPreparation:a});else{c&&t.removeAll();for(var h=0;h<s;h++)o[h]&&doCreateOrUpdateEl(e,t.childAt(h),n,o[h],r,t,!1,a);for(var p=t.childCount()-1;p>=h;p--)doRemoveEl(t.childAt(p),r,t)}}function diffGroupChildren(e){new DataDiffer(e.oldChildren,e.newChildren,getKey,getKey,e).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute()}function getKey(e,t){var n=e&&e.name;return null!=n?n:GROUP_DIFF_PREFIX+t}function processAddUpdate(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,r=null!=t?n.oldChildren[t]:null;doCreateOrUpdateEl(n.api,r,n.dataIndex,i,n.seriesModel,n.group,!1,n.morphPreparation)}function processRemove(e){var t=this.context;doRemoveEl(t.oldChildren[e],t.seriesModel,t.group)}function doRemoveEl(e,t,n){if(e){var i=inner$e(e).leaveToProps;i?updateProps(e,i,t,{cb:function(){n.remove(e)}}):n.remove(e)}}function getPathData(e){return e&&(e.pathData||e.d)}function hasOwnPathData(e){return e&&(hasOwn(e,"pathData")||hasOwn(e,"d"))}function isPath$1(e){return e&&e instanceof Path}function removeElementDirectly(e,t){e&&t.remove(e)}var MorphPreparation=function(){function e(e,t){this._fromList=[],this._toList=[],this._toElOptionList=[],this._allPropsFinalList=[],this._toDataIndices=[],this._morphConfigList=[],this._seriesModel=e,this._transOpt=t}return e.prototype.hasFrom=function(){return!!this._fromList.length},e.prototype.findAndAddFrom=function(e){if(e&&(inner$e(e).canMorph&&this._fromList.push(e),e.isGroup))for(var t=e.childrenRef(),n=0;n<t.length;n++)this.findAndAddFrom(t[n])},e.prototype.addTo=function(e,t,n,i){e&&(this._toList.push(e),this._toElOptionList.push(t),this._toDataIndices.push(n),this._allPropsFinalList.push(i))},e.prototype.applyMorphing=function(){var e=this._type,t=this._fromList,n=this._toList.length,i=t.length;if(i&&n)if("oneToOne"===e)for(var r=0;r<n;r++)this._oneToOneForSingleTo(r,r);else if("manyToOne"===e)for(var a=Math.max(1,Math.floor(i/n)),o=(r=0,0);r<n;r++,o+=a){var s=r+1>=n?i-o:a;this._manyToOneForSingleTo(r,o>=i?null:o,s)}else if("oneToMany"===e)for(var l=Math.max(1,Math.floor(n/i)),u=0,c=0;u<n;u+=l,c++){var h=u+l>=n?n-u:l;this._oneToManyForSingleFrom(u,h,c>=i?null:c)}},e.prototype._oneToOneForSingleTo=function(e,t){var n=this._toList[e],i=this._toElOptionList[e],r=this._toDataIndices[e],a=this._allPropsFinalList[e],o=this._fromList[t],s=this._getOrCreateMorphConfig(r),l=s.duration;if(o&&isCombiningPath(o)){if(applyPropsFinal(n,a,i.style),l){var u=combine([o],n,s,copyPropsWhenDivided);this._processResultIndividuals(u,e,null)}}else{var c=l&&o&&(o!==n||isInAnyMorphing(o))?o:null,h={};prepareShapeOrExtraTransitionFrom("shape",n,c,i,h,!1),prepareShapeOrExtraTransitionFrom("extra",n,c,i,h,!1),prepareTransformTransitionFrom(n,c,i,h,!1),prepareStyleTransitionFrom(n,c,i,i.style,h,!1),applyPropsFinal(n,a,i.style),c&&morphPath(c,n,s),applyTransitionFrom(n,r,i,this._seriesModel,h,!1)}},e.prototype._manyToOneForSingleTo=function(e,t,n){var i=this._toList[e],r=this._toElOptionList[e];applyPropsFinal(i,this._allPropsFinalList[e],r.style);var a=this._getOrCreateMorphConfig(this._toDataIndices[e]);if(a.duration&&null!=t){for(var o=[],s=t;s<n;s++)o.push(this._fromList[s]);var l=combine(o,i,a,copyPropsWhenDivided);this._processResultIndividuals(l,e,null)}},e.prototype._oneToManyForSingleFrom=function(e,t,n){for(var i=null==n?null:this._fromList[n],r=this._toList,a=[],o=e;o<t;o++){var s=r[o];applyPropsFinal(s,this._allPropsFinalList[o],this._toElOptionList[o].style),a.push(s)}var l=this._getOrCreateMorphConfig(this._toDataIndices[e]);if(l.duration&&i){var u=separate(i,a,l,copyPropsWhenDivided);this._processResultIndividuals(u,e,t)}},e.prototype._processResultIndividuals=function(e,t,n){for(var i=null!=n,r=0;r<e.count;r++){var a=e.fromIndividuals[r],o=e.toIndividuals[r],s=t+(i?r:0),l=this._toElOptionList[s],u=this._toDataIndices[s],c={};prepareTransformTransitionFrom(o,a,l,c,!1),prepareStyleTransitionFrom(o,a,l,l.style,c,!1),applyTransitionFrom(o,u,l,this._seriesModel,c,!1)}},e.prototype._getOrCreateMorphConfig=function(e){var t,n,i,r=this._morphConfigList,a=r[e];if(a)return a;var o=this._seriesModel,s=this._transOpt;if(o.isAnimationEnabled()){var l=void 0;if(o&&o.ecModel){var u=o.ecModel.getUpdatePayload();l=u&&u.animation}if(l)t=l.duration||0,n=l.easing||"cubicOut",i=l.delay||0;else{n=o.get("animationEasingUpdate");var c=o.get("animationDelayUpdate");i=isFunction(c)?c(e):c;var h=o.get("animationDurationUpdate");t=isFunction(h)?h(e):h}}return a={duration:t||0,delay:i,easing:n,dividingMethod:s?s.dividingMethod:null},r[e]=a,a},e.prototype.reset=function(e){this._type=e,this._fromList.length=this._toList.length=this._toElOptionList.length=this._allPropsFinalList.length=this._toDataIndices.length=0},e}();function copyPropsWhenDivided(e,t,n){t.style=n?clone(e.style):e.style,t.zlevel=e.zlevel,t.z=e.z,t.z2=e.z2}function getSeriesStackId$1(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function getAxisKey$1(e,t){return t.dim+e.model.componentIndex}function barLayoutPolar(e,t,n){var i={},r=calRadialBar(filter(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,a=n.getBaseAxis(),o=getAxisKey$1(n,a),s=getSeriesStackId$1(e),l=r[o][s],u=l.offset,c=l.width,h=n.getOtherAxis(a),p=e.coordinateSystem.cx,d=e.coordinateSystem.cy,f=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;i[s]=i[s]||[];for(var m=t.mapDimension(h.dim),y=t.mapDimension(a.dim),v=isDimensionStacked(t,m),_="radius"!==a.dim||!e.get("roundCap",!0),x=h.dataToCoord(0),S=0,b=t.count();S<b;S++){var T=t.get(m,S),M=t.get(y,S),A=T>=0?"p":"n",I=x;v&&(i[s][M]||(i[s][M]={p:x,n:x}),I=i[s][M][A]);var C=void 0,w=void 0,P=void 0,L=void 0;if("radius"===h.dim){var E=h.dataToCoord(T)-x,D=a.dataToCoord(M);Math.abs(E)<f&&(E=(E<0?-1:1)*f),C=I,w=I+E,L=(P=D-u)-c,v&&(i[s][M][A]=w)}else{var R=h.dataToCoord(T,_)-x,O=a.dataToCoord(M);Math.abs(R)<g&&(R=(R<0?-1:1)*g),w=(C=O+u)+c,P=I,L=I+R,v&&(i[s][M][A]=L)}t.setItemLayout(S,{cx:p,cy:d,r0:C,r:w,startAngle:-P*Math.PI/180,endAngle:-L*Math.PI/180})}}}))}function calRadialBar(e){var t={};each(e,(function(e,n){var i=e.getData(),r=e.coordinateSystem,a=r.getBaseAxis(),o=getAxisKey$1(r,a),s=a.getExtent(),l="category"===a.type?a.getBandWidth():Math.abs(s[1]-s[0])/i.count(),u=t[o]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;t[o]=u;var h=getSeriesStackId$1(e);c[h]||u.autoWidthCount++,c[h]=c[h]||{width:0,maxWidth:0};var p=parsePercent$2(e.get("barWidth"),l),d=parsePercent$2(e.get("barMaxWidth"),l),f=e.get("barGap"),g=e.get("barCategoryGap");p&&!c[h].width&&(p=Math.min(u.remainedWidth,p),c[h].width=p,u.remainedWidth-=p),d&&(c[h].maxWidth=d),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return each(t,(function(e,t){n[t]={};var i=e.stacks,r=e.bandWidth,a=parsePercent$2(e.categoryGap,r),o=parsePercent$2(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),each(i,(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-a)/(l+(l-1)*o),u=Math.max(u,0);var c,h=0;each(i,(function(e,t){e.width||(e.width=u),c=e,h+=e.width*(1+o)})),c&&(h-=c.width*o);var p=-h/2;each(i,(function(e,i){n[t][i]=n[t][i]||{offset:p,width:e.width},p+=e.width*(1+o)}))})),n}var PolarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(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={zlevel:0,z:0,center:["50%","50%"],radius:"80%"},t}(ComponentModel);ComponentModel.registerClass(PolarModel);var PolarAxisModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",SINGLE_REFERRING).models[0]},t.type="polarAxis",t}(ComponentModel);mixin(PolarAxisModel,AxisModelCommonMixin);var AngleAxisModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="angleAxis",t}(PolarAxisModel),RadiusAxisModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="radiusAxis",t}(PolarAxisModel),angleAxisExtraOption={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},radiusAxisExtraOption={splitNumber:5};axisModelCreator("angle",AngleAxisModel,angleAxisExtraOption),axisModelCreator("radius",RadiusAxisModel,radiusAxisExtraOption);var RadiusAxis=function(e){function t(t,n){return e.call(this,"radius",t,n)||this}return __extends(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t}(Axis);RadiusAxis.prototype.dataToRadius=Axis.prototype.dataToCoord,RadiusAxis.prototype.radiusToData=Axis.prototype.coordToData;var inner$f=makeInner(),AngleAxis=function(e){function t(t,n){return e.call(this,"angle",t,n||[0,360])||this}return __extends(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,i=n.getExtent(),r=n.count();if(i[1]-i[0]<1)return 0;var a=i[0],o=e.dataToCoord(a+1)-e.dataToCoord(a),s=Math.abs(o),l=getBoundingRect(null==a?"":a+"",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=inner$f(e.model),p=h.lastAutoInterval,d=h.lastTickCount;return null!=p&&null!=d&&Math.abs(p-c)<=1&&Math.abs(d-r)<=1&&p>c?c=p:(h.lastTickCount=r,h.lastAutoInterval=c),c},t}(Axis);AngleAxis.prototype.dataToAngle=Axis.prototype.dataToCoord,AngleAxis.prototype.angleToData=Axis.prototype.coordToData;var Polar=function(){function e(e){this.dimensions=["radius","angle"],this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new RadiusAxis,this._angleAxis=new AngleAxis,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,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),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,i=this.getAngleAxis(),r=i.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);i.inverse?a=o-360:o=a+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<a?1:-1;l<a||l>o;)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(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,i=t-this.cy,r=n*n+i*i,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}},e.prototype.convertToPixel=function(e,t,n){return getCoordSys$3(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return getCoordSys$3(t)===this?this.pointToData(n):null},e}();function getCoordSys$3(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function resizePolar(e,t,n){var i=t.get("center"),r=n.getWidth(),a=n.getHeight();e.cx=parsePercent$2(i[0],r),e.cy=parsePercent$2(i[1],a);var o=e.getRadiusAxis(),s=Math.min(r,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:isArray(l)||(l=[0,l]);var u=[parsePercent$2(l[0],s),parsePercent$2(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function updatePolarScale(e,t){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();each(getDataDimensionsOnAxis(t,"radius"),(function(e){r.scale.unionExtentFromData(t,e)})),each(getDataDimensionsOnAxis(t,"angle"),(function(e){i.scale.unionExtentFromData(t,e)}))}})),niceScaleExtent(i.scale,i.model),niceScaleExtent(r.scale,r.model),"category"===i.type&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function isAngleAxisModel(e){return"angleAxis"===e.mainType}function setAxis(e,t){if(e.type=t.get("type"),e.scale=createScaleByModel(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),isAngleAxisModel(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle");e.setExtent(n,n+(e.inverse?-360:360))}t.axis=e,e.model=t}var polarCreator={dimensions:Polar.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,i){var r=new Polar(i+"");r.update=updatePolarScale;var a=r.getRadiusAxis(),o=r.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");setAxis(a,s),setAxis(o,l),resizePolar(r,e,t),n.push(r),e.coordinateSystem=r,r.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",SINGLE_REFERRING).models[0];0,e.coordinateSystem=t.coordinateSystem}})),n}};CoordinateSystemManager.register("polar",polarCreator);var elementList$1=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function getAxisLineShape(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var i=e.coordToPoint([t[0],n]),r=e.coordToPoint([t[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function getRadiusIdx(e){return e.getRadiusAxis().inverse?0:1}function fixAngleOverlap(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 AngleAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return __extends(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),a=n.getTicksCoords(),o=n.getMinorTicksCoords(),s=map(n.getViewLabels(),(function(e){return(e=clone(e)).coord=n.dataToCoord(e.tickValue),e}));fixAngleOverlap(s),fixAngleOverlap(a),each(elementList$1,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||angelAxisElementsBuilders[t](this.group,e,i,a,o,r,s)}),this)}},t.type="angleAxis",t}(AxisView),angelAxisElementsBuilders={axisLine:function(e,t,n,i,r,a){var o,s=t.getModel(["axisLine","lineStyle"]),l=getRadiusIdx(n),u=l?0:1;(o=0===a[u]?new Circle({shape:{cx:n.cx,cy:n.cy,r:a[l]},style:s.getLineStyle(),z2:1,silent:!0}):new Ring({shape:{cx:n.cx,cy:n.cy,r:a[l],r0:a[u]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(o)},axisTick:function(e,t,n,i,r,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[getRadiusIdx(n)],u=map(i,(function(e){return new Line({shape:getAxisLineShape(n,[l,l+s],e.coord)})}));e.add(mergePath$1(u,{style:defaults(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,i,r,a){if(r.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[getRadiusIdx(n)],c=[],h=0;h<r.length;h++)for(var p=0;p<r[h].length;p++)c.push(new Line({shape:getAxisLineShape(n,[u,u+l],r[h][p].coord)}));e.add(mergePath$1(c,{style:defaults(s.getModel("lineStyle").getLineStyle(),defaults(o.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(e,t,n,i,r,a,o){var s=t.getCategories(!0),l=t.getModel("axisLabel"),u=l.get("margin"),c=t.get("triggerEvent");each(o,(function(i,r){var o=l,h=i.tickValue,p=a[getRadiusIdx(n)],d=n.coordToPoint([p+u,i.coord]),f=n.cx,g=n.cy,m=Math.abs(d[0]-f)/p<.3?"center":d[0]>f?"left":"right",y=Math.abs(d[1]-g)/p<.3?"middle":d[1]>g?"top":"bottom";if(s&&s[h]){var v=s[h];isObject(v)&&v.textStyle&&(o=new Model(v.textStyle,l,l.ecModel))}var _=new ZRText({silent:AxisBuilder.isLabelSilent(t),style:createTextStyle(o,{x:d[0],y:d[1],fill:o.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:m,verticalAlign:y})});if(e.add(_),c){var x=AxisBuilder.makeAxisEventDataBase(t);x.targetType="axisLabel",x.value=i.rawLabel,getECData(_).eventData=x}}),this)},splitLine:function(e,t,n,i,r,a){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<i.length;c++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new Line({shape:getAxisLineShape(n,a,i[c].coord)}))}for(c=0;c<u.length;c++)e.add(mergePath$1(u[c],{style:defaults({stroke:s[c%s.length]},o.getLineStyle()),silent:!0,z:t.get("z")}))},minorSplitLine:function(e,t,n,i,r,a){if(r.length){for(var o=t.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<r.length;l++)for(var u=0;u<r[l].length;u++)s.push(new Line({shape:getAxisLineShape(n,a,r[l][u].coord)}));e.add(mergePath$1(s,{style:o.getLineStyle(),silent:!0,z:t.get("z")}))}},splitArea:function(e,t,n,i,r,a){if(i.length){var o=t.getModel("splitArea").getModel("areaStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=Math.PI/180,h=-i[0].coord*c,p=Math.min(a[0],a[1]),d=Math.max(a[0],a[1]),f=t.get("clockwise"),g=1,m=i.length;g<=m;g++){var y=g===m?i[0].coord:i[g].coord,v=l++%s.length;u[v]=u[v]||[],u[v].push(new Sector({shape:{cx:n.cx,cy:n.cy,r0:p,r:d,startAngle:h,endAngle:-y*c,clockwise:f},silent:!0})),h=-y*c}for(g=0;g<u.length;g++)e.add(mergePath$1(u[g],{style:defaults({fill:s[g%s.length]},o.getAreaStyle()),silent:!0}))}}};ComponentView.registerClass(AngleAxisView);var axisBuilderAttrs$3=["axisLine","axisTickLabel","axisName"],selfBuilderAttrs$2=["splitLine","splitArea","minorSplitLine"],RadiusAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return __extends(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=this._axisGroup,i=this._axisGroup=new Group;this.group.add(i);var r=e.axis,a=r.polar,o=a.getAngleAxis(),s=r.getTicksCoords(),l=r.getMinorTicksCoords(),u=o.getExtent()[0],c=r.getExtent(),h=layoutAxis(a,e,u),p=new AxisBuilder(e,h);each(axisBuilderAttrs$3,p.add,p),i.add(p.getGroup()),groupTransition(n,i,e),each(selfBuilderAttrs$2,(function(t){e.get([t,"show"])&&!r.scale.isBlank()&&axisElementBuilders$2[t](this.group,e,a,u,c,s,l)}),this)}},t.type="radiusAxis",t}(AxisView),axisElementBuilders$2={splitLine:function(e,t,n,i,r,a){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<a.length;c++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new Circle({shape:{cx:n.cx,cy:n.cy,r:a[c].coord}}))}for(c=0;c<u.length;c++)e.add(mergePath$1(u[c],{style:defaults({stroke:s[c%s.length],fill:null},o.getLineStyle()),silent:!0}))},minorSplitLine:function(e,t,n,i,r,a,o){if(o.length){for(var s=t.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<o.length;u++)for(var c=0;c<o[u].length;c++)l.push(new Circle({shape:{cx:n.cx,cy:n.cy,r:o[u][c].coord}}));e.add(mergePath$1(l,{style:defaults({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(e,t,n,i,r,a){if(a.length){var o=t.getModel("splitArea").getModel("areaStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=a[0].coord,h=1;h<a.length;h++){var p=l++%s.length;u[p]=u[p]||[],u[p].push(new Sector({shape:{cx:n.cx,cy:n.cy,r0:c,r:a[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),c=a[h].coord}for(h=0;h<u.length;h++)e.add(mergePath$1(u[h],{style:defaults({fill:s[h%s.length]},o.getAreaStyle()),silent:!0}))}}};function layoutAxis(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}}AxisView.registerClass(RadiusAxisView);var PolarAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis;"angle"===a.dim&&(this.animationThreshold=Math.PI/18);var o=a.polar,s=o.getOtherAxis(a).getExtent(),l=a.dataToCoord(t),u=i.get("type");if(u&&"none"!==u){var c=buildElStyle(i),h=pointerShapeBuilder$2[u](a,o,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}var p=i.get(["label","margin"]);buildLabelElOption(e,n,i,r,getLabelPosition(t,n,i,o,p))},t}(BaseAxisPointer);function getLabelPosition(e,t,n,i,r){var a=t.axis,o=a.dataToCoord(e),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,h=i.getRadiusAxis().getExtent();if("radius"===a.dim){var p=create$1();rotate(p,p,s),translate(p,p,[i.cx,i.cy]),l=applyTransform$1([o,-r],p);var d=t.getModel("axisLabel").get("rotate")||0,f=AxisBuilder.innerTextLayout(s,d*Math.PI/180,-1);u=f.textAlign,c=f.textVerticalAlign}else{var g=h[1];l=i.coordToPoint([g+r,o]);var m=i.cx,y=i.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",c=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}var pointerShapeBuilder$2={line:function(e,t,n,i){return"angle"===e.dim?{type:"Line",shape:makeLineShape(t.coordToPoint([i[0],n]),t.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,i){var r=Math.max(1,e.getBandWidth()),a=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:makeSectorShape(t.cx,t.cy,i[0],i[1],(-n-r/2)*a,(r/2-n)*a)}:{type:"Sector",shape:makeSectorShape(t.cx,t.cy,n-r/2,n+r/2,0,2*Math.PI)}}};AxisView.registerAxisPointerClass("PolarAxisPointer",PolarAxisPointer),registerLayout(curry(barLayoutPolar,"bar")),extendComponentView({type:"polar"});var GeoView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){var n=new MapDraw(t);this._mapDraw=n,this.group.add(n.group),this._api=t},t.prototype.render=function(e,t,n,i){var r=this._mapDraw;e.get("show")?r.draw(e,t,n,this,i):this._mapDraw.group.removeAll(),r.group.on("click",this._handleRegionClick,this),r.group.silent=e.get("silent"),this._model=e,this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){for(var t,n=e.target;n&&null==(t=getECData(n).eventData);)n=n.__hostTarget||n.parent;t&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var i=this;this._mapDraw.group.traverse((function(e){var t=getECData(e).eventData;if(t)return i._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0}))},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type="geo",t}(ComponentView);ComponentView.registerClass(GeoView);var GeoModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),defaultEmphasis(t,"label",["show"])},t.prototype.optionUpdated=function(){var e=this.option,t=this;e.regions=geoCreator.getFilledRegions(e.regions,e.map,e.nameMap);var n={};this._optionModelMap=reduce(e.regions||[],(function(e,i){var r=i.name;return r&&(e.set(r,new Model(i,t)),i.selected&&(n[r]=!0)),e}),createHashMap()),e.selectedMap||(e.selectedMap=n)},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new Model(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),i="normal"===t?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),r={name:e};return"function"==typeof i?(r.status=t,i(r)):"string"==typeof i?i.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.prototype._initSelectedMapFromData=function(){},t.type="geo",t.layoutMode="box",t.defaultOption={zlevel:0,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",color:"#eee"},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}(ComponentModel);function makeAction(e,t){t.update="geo:updateSelectStatus",registerAction(t,(function(t,n){var i={};return n.eachComponent({mainType:"geo",query:t},(function(n){n[e](t.name),each(n.coordinateSystem.regions,(function(e){i[e.name]=n.isSelected(e.name)||!1}))})),{selected:i,name:t.name}}))}ComponentModel.registerClass(GeoModel),makeAction("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),makeAction("select",{type:"geoSelect",event:"geoselected"}),makeAction("unSelect",{type:"geoUnSelect",event:"geounselected"});var PROXIMATE_ONE_DAY=864e5,Calendar=function(){function e(t,n,i){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=parseDate(e)).getFullYear(),n=e.getMonth()+1,i=n<10?"0"+n:""+n,r=e.getDate(),a=r<10?"0"+r:""+r,o=e.getDay();return{y:t+"",m:i,d:a,day:o=Math.abs((o+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+a,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,i=["width","height"],r=this._model.getCellSize().slice(),a=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[n,7]:[7,n];each([0,1],(function(e){u(r,e)&&(a[i[e]]=r[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=getLayoutRect(a,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}each([0,1],(function(e){u(r,e)||(r[e]=l[i[e]]/o[e])})),this._sw=r[0],this._sh=r[1]},e.prototype.dataToPoint=function(e,t){isArray(e)&&(e=e[0]),null==t&&(t=!0);var n=this.getDateInfo(e),i=this._rangeInfo,r=n.formatedDate;if(t&&!(n.time>=i.start.time&&n.time<i.end.time+PROXIMATE_ONE_DAY))return[NaN,NaN];var a=n.day,o=this._getRangeInfo([i.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]:[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*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,i=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,t-1,i):this._getDateByWeeksAndDay(t,n-1,i)},e.prototype.convertToPixel=function(e,t,n){var i=getCoordSys$4(t);return i===this?i.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){var i=getCoordSys$4(t);return i===this?i.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(isArray(t)&&1===t.length&&(t=t[0]),isArray(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 i=this.getDateInfo(n),r=i.date;r.setMonth(r.getMonth()+1);var a=this.getNextNDay(r,-1);e=[i.formatedDate,a.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(e=[n,n])}if(!e)return t;var o=this._getRangeInfo(e);return o.start.time>o.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 i=Math.floor(n[1].time/PROXIMATE_ONE_DAY)-Math.floor(n[0].time/PROXIMATE_ONE_DAY)+1,r=new Date(n[0].time),a=r.getDate(),o=n[1].date.getDate();r.setDate(a+i-1);var s=r.getDate();if(s!==o)for(var l=r.getTime()-n[1].time>0?1:-1;(s=r.getDate())!==o&&(r.getTime()-n[1].time)*l>0;)i-=l,r.setDate(s-l);var u=Math.floor((i+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:i,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||0===e&&t<i.fweek||e===i.weeks&&t>i.lweek)return null;var r=7*(e-1)-i.fweek+t,a=new Date(i.start.time);return a.setDate(+i.start.d+r),this.getDateInfo(a)},e.create=function(t,n){var i=[];return t.eachComponent("calendar",(function(r){var a=new e(r,t,n);i.push(a),r.coordinateSystem=a})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},e.dimensions=["time","value"],e}();function getCoordSys$4(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}CoordinateSystemManager.register("calendar",Calendar);var CalendarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n,i){var r=getLayoutParams(t);e.prototype.init.apply(this,arguments),mergeAndNormalizeLayoutParams(t,r)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),mergeAndNormalizeLayoutParams(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={zlevel:0,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%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(ComponentModel);function mergeAndNormalizeLayoutParams(e,t){var n,i=e.cellSize;1===(n=isArray(i)?i:e.cellSize=[i,i]).length&&(n[1]=n[0]);var r=map([0,1],(function(e){return sizeCalculable(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));mergeLayoutParam(e,t,{type:"box",ignoreSize:r})}ComponentModel.registerClass(CalendarModel);var MONTH_TEXT={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},WEEK_TEXT={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]},CalendarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this.group;i.removeAll();var r=e.coordinateSystem,a=r.getRangeInfo(),o=r.getOrient();this._renderDayRect(e,a,i),this._renderLines(e,a,o,i),this._renderYearText(e,a,o,i),this._renderMonthText(e,o,i),this._renderWeekText(e,a,o,i)},t.prototype._renderDayRect=function(e,t,n){for(var i=e.coordinateSystem,r=e.getModel("itemStyle").getItemStyle(),a=i.getCellWidth(),o=i.getCellHeight(),s=t.start.time;s<=t.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new Rect({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:r});n.add(u)}},t.prototype._renderLines=function(e,t,n,i){var r=this,a=e.coordinateSystem,o=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,c=0;u.time<=t.end.time;c++){p(u.formatedDate),0===c&&(u=a.getDateInfo(t.start.y+"-"+t.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=a.getDateInfo(h)}function p(t){r._firstDayOfMonth.push(a.getDateInfo(t)),r._firstDayPoints.push(a.dataToRect([t],!1).tl);var l=r._getLinePointsOfOneWeek(e,t,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,o,i)}p(a.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),o,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),o,i)},t.prototype._getEdgesPoints=function(e,t,n){var i=[e[0].slice(),e[e.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-t/2,i[1][r]=i[1][r]+t/2,i},t.prototype._drawSplitline=function(e,t,n){var i=new Polyline({z2:20,shape:{points:e},style:t});n.add(i)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var i=e.coordinateSystem,r=i.getDateInfo(t),a=[],o=0;o<7;o++){var s=i.getNextNDay(r.time,o),l=i.dataToRect([s.time],!1);a[2*s.day]=l.tl,a[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return a},t.prototype._formatterLabel=function(e,t){return"string"==typeof e&&e?formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},t.prototype._yearTextPositionControl=function(e,t,n,i,r){var a=t[0],o=t[1],s=["center","bottom"];"bottom"===i?(o+=r,s=["center","top"]):"left"===i?a-=r:"right"===i?(a+=r,s=["center","top"]):o-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:a,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,i){var r=e.getModel("yearLabel");if(r.get("show")){var a=r.get("margin"),o=r.get("position");o||(o="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]},p=t.start.y;+t.end.y>+t.start.y&&(p=p+"-"+t.end.y);var d=r.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:p},g=this._formatterLabel(d,f),m=new ZRText({z2:30,style:createTextStyle(r,{text:g})});m.attr(this._yearTextPositionControl(m,h[o],n,o,a)),i.add(m)}},t.prototype._monthTextPositionControl=function(e,t,n,i,r){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===n?(l+=r,t&&(a="center"),"start"===i&&(o="bottom")):(s+=r,t&&(o="middle"),"start"===i&&(a="right")),{x:s,y:l,align:a,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n){var i=e.getModel("monthLabel");if(i.get("show")){var r=i.get("nameMap"),a=i.get("margin"),o=i.get("position"),s=i.get("align"),l=[this._tlpoints,this._blpoints];isString(r)&&(r=MONTH_TEXT[r.toUpperCase()]||[]);var u="start"===o?0:1,c="horizontal"===t?0:1;a="start"===o?-a:a;for(var h="center"===s,p=0;p<l[u].length-1;p++){var d=l[u][p].slice(),f=this._firstDayOfMonth[p];if(h){var g=this._firstDayPoints[p];d[c]=(g[c]+l[0][p+1][c])/2}var m=i.get("formatter"),y=r[+f.m-1],v={yyyy:f.y,yy:(f.y+"").slice(2),MM:f.m,M:+f.m,nameMap:y},_=this._formatterLabel(m,v),x=new ZRText({z2:30,style:extend(createTextStyle(i,{text:_}),this._monthTextPositionControl(d,h,t,o,a))});n.add(x)}}},t.prototype._weekTextPositionControl=function(e,t,n,i,r){var a="center",o="middle",s=e[0],l=e[1],u="start"===n;return"horizontal"===t?(s=s+i+(u?1:-1)*r[0]/2,a=u?"right":"left"):(l=l+i+(u?1:-1)*r[1]/2,o=u?"bottom":"top"),{x:s,y:l,align:a,verticalAlign:o}},t.prototype._renderWeekText=function(e,t,n,i){var r=e.getModel("dayLabel");if(r.get("show")){var a=e.coordinateSystem,o=r.get("position"),s=r.get("nameMap"),l=r.get("margin"),u=a.getFirstDayOfWeek();isString(s)&&(s=WEEK_TEXT[s.toUpperCase()]||[]);var c=a.getNextNDay(t.end.time,7-t.lweek).time,h=[a.getCellWidth(),a.getCellHeight()];l=parsePercent$2(l,h["horizontal"===n?0:1]),"start"===o&&(c=a.getNextNDay(t.start.time,-(7+t.fweek)).time,l=-l);for(var p=0;p<7;p++){var d,f=a.getNextNDay(c,p),g=a.dataToRect([f.time],!1).center;d=Math.abs((p+u)%7);var m=new ZRText({z2:30,style:extend(createTextStyle(r,{text:s[d]}),this._weekTextPositionControl(g,n,o,l,h))});i.add(m)}}},t.type="calendar",t}(ComponentView);ComponentView.registerClass(CalendarView);var inner$g=makeInner(),_nonShapeGraphicElements={path:null,compoundPath:null,group:Group,image:ZRImage,text:ZRText};registerPreprocessor((function(e){var t=e.graphic;isArray(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}));var GraphicComponentModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.mergeOption=function(t,n){var i=this.option.elements;this.option.elements=null,e.prototype.mergeOption.call(this,t,n),this.option.elements=i},t.prototype.optionUpdated=function(e,t){var n=this.option,i=(t?n:e).elements,r=n.elements=t?[]:n.elements,a=[];this._flatten(i,a,null);var o=mappingToExists(r,a,"normalMerge"),s=this._elOptionsToUpdate=[];each(o,(function(e,t){var n=e.newOption;n&&(s.push(n),setKeyInfoToNewElOption(e,n),mergeNewElOptionToExist(r,t,n),setLayoutInfoToExist(r[t],n))}),this);for(var l=r.length-1;l>=0;l--)null==r[l]?r.splice(l,1):delete r[l].$action},t.prototype._flatten=function(e,t,n){each(e,(function(e){if(e){n&&(e.parentOption=n),t.push(e);var i=e.children;"group"===e.type&&i&&this._flatten(i,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}(ComponentModel);ComponentModel.registerClass(GraphicComponentModel);var GraphicComponentView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(){this._elMap=createHashMap()},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,i=this.group;each(t,(function(t){var r=convertOptionIdName(t.id,null),a=null!=r?n.get(r):null,o=convertOptionIdName(t.parentId,null),s=null!=o?n.get(o):i,l=t.type,u=t.style;"text"===l&&u&&t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=u.verticalAlign=u.align=null);var c=t.textContent,h=t.textConfig;if(u&&isEC4CompatibleStyle(u,l,!!h,!!c)){var p=convertFromEC4CompatibleStyle(u,l,!0);!h&&p.textConfig&&(h=t.textConfig=p.textConfig),!c&&p.textContent&&(c=p.textContent)}var d=getCleanedElOption(t);var f=t.$action||"merge";"merge"===f?a?a.attr(d):createEl$1(r,s,d,n):"replace"===f?(removeEl(a,n),createEl$1(r,s,d,n)):"remove"===f&&removeEl(a,n);var g=n.get(r);if(g&&c)if("merge"===f){var m=g.getTextContent();m?m.attr(c):g.setTextContent(new ZRText(c))}else"replace"===f&&g.setTextContent(new ZRText(c));if(g){var y=inner$g(g);y.__ecGraphicWidthOption=t.width,y.__ecGraphicHeightOption=t.height,setEventData(g,e,t)}}))}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,i=this.group,r=this._elMap,a=t.getWidth(),o=t.getHeight(),s=0;s<n.length;s++){if((d=null!=(p=convertOptionIdName((h=n[s]).id,null))?r.get(p):null)&&d.isGroup){var l=(f=d.parent)===i,u=inner$g(d),c=inner$g(f);u.__ecGraphicWidth=parsePercent$2(u.__ecGraphicWidthOption,l?a:c.__ecGraphicWidth)||0,u.__ecGraphicHeight=parsePercent$2(u.__ecGraphicHeightOption,l?o:c.__ecGraphicHeight)||0}}for(s=n.length-1;s>=0;s--){var h,p,d;if(d=null!=(p=convertOptionIdName((h=n[s]).id,null))?r.get(p):null){var f=d.parent;c=inner$g(f);positionElement(d,h,f===i?{width:a,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight},null,{hv:h.hv,boundingMode:h.bounding})}}},t.prototype._clear=function(){var e=this._elMap;e.each((function(t){removeEl(t,e)})),this._elMap=createHashMap()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(ComponentView);function createEl$1(e,t,n,i){var r=n.type;var a=hasOwn(_nonShapeGraphicElements,r)?_nonShapeGraphicElements[r]:getShapeClass(r);var o=new a(n);t.add(o),i.set(e,o),inner$g(o).__ecGraphicId=e}function removeEl(e,t){var n=e&&e.parent;n&&("group"===e.type&&e.traverse((function(e){removeEl(e,t)})),t.removeKey(inner$g(e).__ecGraphicId),n.remove(e))}function getCleanedElOption(e){return e=extend({},e),each(["id","parentId","$action","hv","bounding","textContent"].concat(LOCATION_PARAMS),(function(t){delete e[t]})),e}function isSetLoc(e,t){var n;return each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}function setKeyInfoToNewElOption(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),null==t.parentId){var i=t.parentOption;i?t.parentId=i.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function mergeNewElOptionToExist(e,t,n){var i=extend({},n),r=e[t],a=n.$action||"merge";"merge"===a?r?(merge(r,i,!0),mergeLayoutParam(r,i,{ignoreSize:!0}),copyLayoutParams(n,r)):e[t]=i:"replace"===a?e[t]=i:"remove"===a&&r&&(e[t]=null)}function setLayoutInfoToExist(e,t){if(e&&(e.hv=t.hv=[isSetLoc(t,["left","right"]),isSetLoc(t,["top","bottom"])],"group"===e.type)){var n=e,i=t;null==n.width&&(n.width=i.width=0),null==n.height&&(n.height=i.height=0)}}function setEventData(e,t,n){var i=getECData(e).eventData;e.silent||e.ignore||i||(i=getECData(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),i&&(i.info=n.info)}ComponentView.registerClass(GraphicComponentView);var ToolboxFeature=function(){},features={};function registerFeature(e,t){features[e]=t}function getFeature(e){return features[e]}var ToolboxModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;each(this.option.feature,(function(e,n){var i=getFeature(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),merge(e,i.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,zlevel:0,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}},t}(ComponentModel);function layout$3(e,t,n){var i=t.getBoxLayoutParams(),r=t.get("padding"),a={width:n.getWidth(),height:n.getHeight()},o=getLayoutRect(i,a,r);box(t.get("orient"),e,t.get("itemGap"),o.width,o.height),positionElement(e,i,a,r)}function makeBackground(e,t){var n=normalizeCssArray$1(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new Rect({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:i,silent:!0,z2:-1})}ComponentModel.registerClass(ToolboxModel);var ToolboxView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this.group;if(r.removeAll(),e.get("show")){var a=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];each(o,(function(e,t){l.push(t)})),new DataDiffer(this._featureNames||[],l).add(u).update(u).remove(curry(u,null)).execute(),this._featureNames=l,layout$3(r,e,n),r.add(makeBackground(r.getBoundingRect(),e)),r.eachChild((function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=e.getTextContent(),l=s&&s.states.emphasis;if(l&&!isFunction(l)&&t){var u=l.style||(l.style={}),c=getBoundingRect(t,ZRText.makeFont(u)),h=e.x+r.x,p=!1;e.y+r.y+a+c.height>n.getHeight()&&(o.position="top",p=!0);var d=p?-5-c.height:a+8;h+c.width/2>n.getWidth()?(o.position=["100%",d],u.align="right"):h-c.width/2<0&&(o.position=[0,d],u.align="left")}}))}function u(u,c){var h,p=l[u],d=l[c],f=o[p],g=new Model(f,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===p&&(f.title=i.newTitle),p&&!d){if(isUserFeatureName(p))h={onclick:g.option.onclick,featureName:p};else{var m=getFeature(p);if(!m)return;h=new m}s[p]=h}else if(!(h=s[d]))return;if(h.uid=getUID("toolbox-feature"),h.model=g,h.ecModel=t,h.api=n,h instanceof ToolboxFeature){if(!p&&d)return void(h.dispose&&h.dispose(t,n));if(!g.get("show")||h.unusable)return void(h.remove&&h.remove(t,n))}!function(i,o,s){var l,u,c=i.getModel("iconStyle"),h=i.getModel(["emphasis","iconStyle"]),p=o instanceof ToolboxFeature&&o.getIcons?o.getIcons():i.get("icon"),d=i.get("title")||{};"string"==typeof p?(l={})[s]=p:l=p;"string"==typeof d?(u={})[s]=d:u=d;var f=i.iconPaths={};each(l,(function(s,l){var p=createIcon(s,{},{x:-a/2,y:-a/2,width:a,height:a});p.setStyle(c.getItemStyle()),p.ensureState("emphasis").style=h.getItemStyle();var d=new ZRText({style:{text:u[l],align:h.get("textAlign"),borderRadius:h.get("textBorderRadius"),padding:h.get("textPadding"),fill:null},ignore:!0});p.setTextContent(d);var g=e.getModel("tooltip");g&&g.get("show")&&(p.tooltip=extend({content:u[l],formatter:g.get("formatter",!0)||function(){return u[l]},formatterParams:{componentType:"toolbox",name:l,title:u[l],$vars:["name","title"]},position:g.get("position",!0)||"bottom"},g.option)),p.__title=u[l],p.on("mouseover",(function(){var t=h.getItemStyle(),n="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({fill:h.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:h.get("textBackgroundColor")}),p.setTextConfig({position:h.get("textPosition")||n}),d.ignore=!e.get("showTitle"),enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",l])&&leaveEmphasis(this),d.hide()})),("emphasis"===i.get(["iconStatus",l])?enterEmphasis:leaveEmphasis)(p),r.add(p),p.on("click",bind(o.onclick,o,t,n,l)),f[l]=p}))}(g,h,p),g.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?enterEmphasis:leaveEmphasis)(i[e])},h instanceof ToolboxFeature&&h.render&&h.render(g,t,n,i)}},t.prototype.updateView=function(e,t,n,i){each(this._features,(function(e){e instanceof ToolboxFeature&&e.updateView&&e.updateView(e.model,t,n,i)}))},t.prototype.remove=function(e,t){each(this._features,(function(n){n instanceof ToolboxFeature&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){each(this._features,(function(n){n instanceof ToolboxFeature&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox",t}(ComponentView);function isUserFeatureName(e){return 0===e.indexOf("my")}ComponentView.registerClass(ToolboxView);var SaveAsImage=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType()?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||env.browser.ie||env.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(a.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,i+"."+r)}else{var c=n.get("lang"),h='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(c&&c[0]||"")+'" /></body>';window.open().document.write(h)}else{var p=document.createElement("a");p.download=i+"."+r,p.target="_blank",p.href=a;var d=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});p.dispatchEvent(d)}},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.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:e.getLocale(["toolbox","saveAsImage","lang"])}},t}(ToolboxFeature);SaveAsImage.prototype.unusable=!env.canvasSupported,registerFeature("saveAsImage",SaveAsImage);var INNER_STACK_KEYWORD="__ec_magicType_stack__",radioTypes=[["line","bar"],["stack"]],MagicType=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return each(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.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i=this.model,r=i.get(["seriesIndex",n]);if(seriesOptGenreator[n]){var a,o={series:[]};each(radioTypes,(function(e){indexOf(e,n)>=0&&each(e,(function(e){i.setIconStatus(e,"normal")}))})),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(e){var t=e.subType,r=e.id,a=seriesOptGenreator[n](t,r,e,i);a&&(defaults(a,e.option),o.series.push(a));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,SINGLE_REFERRING).models[0].componentIndex;o[u]=o[u]||[];for(var h=0;h<=c;h++)o[u][c]=o[u][c]||{};o[u][c].boundaryGap="bar"===n}}})),"stack"===n&&(a=merge({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title)),t.dispatchAction({type:"changeMagicType",currentType:n,newOption:o,newTitle:a,featureName:"magicType"})}},t}(ToolboxFeature),seriesOptGenreator={line:function(e,t,n,i){if("bar"===e)return merge({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return merge({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var r=n.get("stack")===INNER_STACK_KEYWORD;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),merge({id:t,stack:r?"":INNER_STACK_KEYWORD},i.get(["option","stack"])||{},!0)}};registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),registerFeature("magicType",MagicType);var BLOCK_SPLITER=new Array(60).join("-"),ITEM_SPLITER="\t";function groupSeries(e){var t={},n=[],i=[];return e.eachRawSeries((function(e){var r=e.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(e);else{var a=r.getBaseAxis();if("category"===a.type){var o=a.dim+"_"+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:r.getOtherAxis(a),series:[]},i.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:i}}function assembleSeriesWithCategoryAxis(e){var t=[];return each(e,(function(e,n){var i=e.categoryAxis,r=e.valueAxis.dim,a=[" "].concat(map(e.series,(function(e){return e.name}))),o=[i.model.getCategories()];each(e.series,(function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),(function(e){return e})))}));for(var s=[a.join(ITEM_SPLITER)],l=0;l<o[0].length;l++){for(var u=[],c=0;c<o.length;c++)u.push(o[c][l]);s.push(u.join(ITEM_SPLITER))}t.push(s.join("\n"))})),t.join("\n\n"+BLOCK_SPLITER+"\n\n")}function assembleOtherSeries(e){return map(e,(function(e){var t=e.getRawData(),n=[e.name],i=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,r=arguments[e-1],a=t.getName(r),o=0;o<e-1;o++)i[o]=arguments[o];n.push((a?a+ITEM_SPLITER:"")+i.join(ITEM_SPLITER))})),n.join("\n")})).join("\n\n"+BLOCK_SPLITER+"\n\n")}function getContentFromModel(e){var t=groupSeries(e);return{value:filter([assembleSeriesWithCategoryAxis(t.seriesGroupByCategoryAxis),assembleOtherSeries(t.other)],(function(e){return!!e.replace(/[\n\t\s]/g,"")})).join("\n\n"+BLOCK_SPLITER+"\n\n"),meta:t.meta}}function trim$1(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function isTSVFormat(e){if(e.slice(0,e.indexOf("\n")).indexOf(ITEM_SPLITER)>=0)return!0}var itemSplitRegex=new RegExp("["+ITEM_SPLITER+"]+","g");function parseTSVContents(e){for(var t=e.split(/\n+/g),n=[],i=map(trim$1(t.shift()).split(itemSplitRegex),(function(e){return{name:e,data:[]}})),r=0;r<t.length;r++){var a=trim$1(t[r]).split(itemSplitRegex);n.push(a.shift());for(var o=0;o<a.length;o++)i[o]&&(i[o].data[r]=a[o])}return{series:i,categories:n}}function parseListContents(e){for(var t=e.split(/\n+/g),n=trim$1(t.shift()),i=[],r=0;r<t.length;r++){var a=trim$1(t[r]);if(a){var o=a.split(itemSplitRegex),s="",l=void 0,u=!1;isNaN(o[0])?(u=!0,s=o[0],o=o.slice(1),i[r]={name:s,value:[]},l=i[r].value):l=i[r]=[];for(var c=0;c<o.length;c++)l.push(+o[c]);1===l.length&&(u?i[r].value=l[0]:i[r]=l[0])}}return{name:n,data:i}}function parseContents(e,t){var n=e.split(new RegExp("\n*"+BLOCK_SPLITER+"\n*","g")),i={series:[]};return each(n,(function(e,n){if(isTSVFormat(e)){var r=parseTSVContents(e),a=t[n],o=a.axisDim+"Axis";a&&(i[o]=i[o]||[],i[o][a.axisIndex]={data:r.categories},i.series=i.series.concat(r.series))}else{r=parseListContents(e);i.series.push(r)}})),i}var DataView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){var n=t.getDom(),i=this.model;this._dom&&n.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",r.style.backgroundColor=i.get("backgroundColor")||"#fff";var a=document.createElement("h4"),o=i.get("lang")||[];a.innerHTML=o[0]||i.get("title"),a.style.cssText="margin: 10px 20px;",a.style.color=i.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="display:block;width:100%;overflow:auto;";var u=i.get("optionToContent"),c=i.get("contentToOption"),h=getContentFromModel(e);if("function"==typeof u){var p=u(t.getOption());"string"==typeof p?s.innerHTML=p:isDom(p)&&s.appendChild(p)}else s.appendChild(l),l.readOnly=i.get("readOnly"),l.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",l.style.color=i.get("textColor"),l.style.borderColor=i.get("textareaBorderColor"),l.style.backgroundColor=i.get("textareaColor"),l.value=h.value;var d=h.meta,f=document.createElement("div");f.style.cssText="position:absolute;bottom:0;left:0;right:0;";var g="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",m=document.createElement("div"),y=document.createElement("div");g+=";background-color:"+i.get("buttonColor"),g+=";color:"+i.get("buttonTextColor");var v=this;function _(){n.removeChild(r),v._dom=null}addEventListener(m,"click",_),addEventListener(y,"click",(function(){if(null==c&&null!=u||null!=c&&null==u)_();else{var e;try{e="function"==typeof c?c(s,t.getOption()):parseContents(l.value,d)}catch(e){throw _(),new Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),_()}})),m.innerHTML=o[1],y.innerHTML=o[2],y.style.cssText=g,m.style.cssText=g,!i.get("readOnly")&&f.appendChild(y),f.appendChild(m),r.appendChild(a),r.appendChild(s),r.appendChild(f),s.style.height=n.clientHeight-80+"px",n.appendChild(r),this._dom=r},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.getLocale(["toolbox","dataView","title"]),lang:e.getLocale(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(ToolboxFeature);function tryMergeDataOption(e,t){return map(e,(function(e,n){var i=t&&t[n];if(isObject(i)&&!isArray(i)){isObject(e)&&!isArray(e)||(e={value:e});var r=null!=i.name&&null==e.name;return e=defaults(e,i),r&&delete e.name,e}return e}))}registerFeature("dataView",DataView),registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var n=[];each(e.newOption.series,(function(e){var i=t.getSeriesByName(e.name)[0];if(i){var r=i.get("data");n.push({name:e.name,data:tryMergeDataOption(e.data,r)})}else n.push(extend({type:"scatter"},e))})),t.mergeOption(defaults({series:n},e.newOption))}));var COORD_CONVERTS=["dataToPoint","pointToData"],INCLUDE_FINDER_MAIN_TYPES=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],BrushTargetManager=function(){function e(e,t,n){var i=this;this._targetInfoList=[];var r=parseFinder$1(t,e);each(targetInfoBuilders,(function(e,t){(!n||!n.include||indexOf(n.include,t)>=0)&&e(r,i._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 i=coordConvert[e.brushType](0,n,t);e.__rangeOffset={offset:diffProcessor[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){each(e,(function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&each(i.coordSyses,(function(i){var r=coordConvert[e.brushType](1,i,e.range);n(e,r.values,i,t)}))}),this)},e.prototype.setInputRanges=function(e,t){each(e,(function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var i=coordConvert[e.brushType](0,n.coordSys,e.coordRange),r=e.__rangeOffset;e.range=r?diffProcessor[e.brushType](i.values,r.offset,getScales(i.xyMinMax,r.xyMinMax)):i.values}}),this)},e.prototype.makePanelOpts=function(e,t){return map(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:makeRectPanelClipPath(i),isTargetByCursor:makeRectIsTargetByCursor(i,e,n.coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(i)}}))},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&indexOf(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=parseFinder$1(t,e),r=0;r<n.length;r++){var a=n[r],o=e.panelId;if(o){if(a.panelId===o)return a}else for(var s=0;s<targetInfoMatchers.length;s++)if(targetInfoMatchers[s](i,a))return a}return!0},e}();function formatMinMax(e){return e[0]>e[1]&&e.reverse(),e}function parseFinder$1(e,t){return parseFinder(e,t,{includeMainTypes:INCLUDE_FINDER_MAIN_TYPES})}var targetInfoBuilders={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,r=e.gridModels,a=createHashMap(),o={},s={};(n||i||r)&&(each(n,(function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0})),each(i,(function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0})),each(r,(function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),a.each((function(e){var r=e.coordinateSystem,a=[];each(r.getCartesians(),(function(e,t){(indexOf(n,e.getAxis("x").model)>=0||indexOf(i,e.getAxis("y").model)>=0)&&a.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:panelRectBuilders.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){each(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:panelRectBuilders.geo})}))}},targetInfoMatchers=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,r=e.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],panelRectBuilders={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(getTransform(e)),t}},coordConvert={lineX:curry(axisConvert,0),lineY:curry(axisConvert,1),rect:function(e,t,n){var i=t[COORD_CONVERTS[e]]([n[0][0],n[1][0]]),r=t[COORD_CONVERTS[e]]([n[0][1],n[1][1]]),a=[formatMinMax([i[0],r[0]]),formatMinMax([i[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:map(n,(function(n){var r=t[COORD_CONVERTS[e]](n);return i[0][0]=Math.min(i[0][0],r[0]),i[1][0]=Math.min(i[1][0],r[1]),i[0][1]=Math.max(i[0][1],r[0]),i[1][1]=Math.max(i[1][1],r[1]),r})),xyMinMax:i}}};function axisConvert(e,t,n,i){var r=n.getAxis(["x","y"][e]),a=formatMinMax(map([0,1],(function(e){return t?r.coordToData(r.toLocalCoord(i[e])):r.toGlobalCoord(r.dataToCoord(i[e]))}))),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var diffProcessor={lineX:curry(axisDiffProcessor,0),lineY:curry(axisDiffProcessor,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 map(e,(function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]}))}};function axisDiffProcessor(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function getScales(e,t){var n=getSize(e),i=getSize(t),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function getSize(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var each$9=each,inner$h=makeInner();function push(e,t){var n=getStoreSnapshots(e);each$9(t,(function(t,i){for(var r=n.length-1;r>=0;r--){if(n[r][i])break}if(r<0){var a=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(a){var o=a.getPercentRange();n[0][i]={dataZoomId:i,start:o[0],end:o[1]}}}})),n.push(t)}function pop(e){var t=getStoreSnapshots(e),n=t[t.length-1];t.length>1&&t.pop();var i={};return each$9(n,(function(e,n){for(var r=t.length-1;r>=0;r--)if(e=t[r][n]){i[n]=e;break}})),i}function clear$1(e){inner$h(e).snapshots=null}function count(e){return getStoreSnapshots(e).length}function getStoreSnapshots(e){var t=inner$h(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}ComponentModel.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var DATA_ZOOM_AXIS_DIMENSIONS=["x","y","radius","angle","single"],SERIES_COORDS=["cartesian2d","polar","singleAxis"];function isCoordSupported(e){var t=e.get("coordinateSystem");return indexOf(SERIES_COORDS,t)>=0}function getAxisMainType(e){return e+"Axis"}function findEffectedDataZooms(e,t){var n,i=createHashMap(),r=[],a=createHashMap();e.eachComponent({mainType:"dataZoom",query:t},(function(e){a.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",o)}while(n);function o(e){!a.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var r=i.get(e);r&&r[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){a.set(e.uid,!0),r.push(e),e.eachTargetAxis((function(e,t){(i.get(e)||i.set(e,[]))[t]=!0}))}return r}function collectReferCoordSysModelInfo(e){var t=e.ecModel,n={infoList:[],infoMap:createHashMap()};return e.eachTargetAxis((function(e,i){var r=t.getComponent(getAxisMainType(e),i);if(r){var a=r.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(r)}}})),n}var DataZoomAxisInfo=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}(),DataZoomModel=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 __extends(t,e),t.prototype.init=function(e,t,n){var i=retrieveRawOption(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=retrieveRawOption(e);merge(this.option,e,!0),merge(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;each([["start","startValue"],["end","endValue"]],(function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=createHashMap();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 each(DATA_ZOOM_AXIS_DIMENSIONS,(function(n){var i=this.getReferringComponents(getAxisMainType(n),MULTIPLE_REFERRING);if(i.specified){t=!0;var r=new DataZoomAxisInfo;each(i.models,(function(e){r.add(e.componentIndex)})),e.set(n,r)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0;if(i){var r="vertical"===t?"y":"x";a(n.findComponents({mainType:r+"Axis"}),r)}i&&a(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function a(t,n){var r=t[0];if(r){var a=new DataZoomAxisInfo;if(a.add(r.componentIndex),e.set(n,a),i=!1,"x"===n||"y"===n){var o=r.getReferringComponents("grid",SINGLE_REFERRING).models[0];o&&each(t,(function(e){r.componentIndex!==e.componentIndex&&o===e.getReferringComponents("grid",SINGLE_REFERRING).models[0]&&a.add(e.componentIndex)}))}}}i&&each(DATA_ZOOM_AXIS_DIMENSIONS,(function(t){if(i){var r=n.findComponents({mainType:getAxisMainType(t),filter:function(e){return"category"===e.get("type",!0)}});if(r[0]){var a=new DataZoomAxisInfo;a.add(r[0].componentIndex),e.set(t,a),i=!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");each([["start","startValue"],["end","endValue"]],(function(i,r){var a=null!=e[i[0]],o=null!=e[i[1]];a&&!o?t[r]="percent":!a&&o?t[r]="value":n?t[r]=n[r]:a&&(t[r]="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(getAxisMainType(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,i){each(n.indexList,(function(n){e.call(t,i,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(getAxisMainType(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;each([["start","startValue"],["end","endValue"]],(function(i){null==e[i[0]]&&null==e[i[1]]||(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;each(["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(),i=0;i<n.length;i++)for(var r=n[i],a=this._targetAxisInfoMap.get(r),o=0;o<a.indexList.length;o++){var s=this.getAxisProxy(r,a.indexList[o]);if(s.hostedBy(this))return s;t||(t=s)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={zlevel:0,z:4,filterMode:"filter",start:0,end:100},t}(ComponentModel);function retrieveRawOption(e){var t={};return each(["start","end","startValue","endValue","throttle"],(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}var DataZoomView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(ComponentView);ComponentView.registerClass(DataZoomView);var SelectDataZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.select",t}(DataZoomModel);ComponentModel.registerClass(SelectDataZoomModel);var SelectDataZoomView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.select",t}(DataZoomView);ComponentView.registerClass(SelectDataZoomView);var each$a=each,asc$1=asc,AxisProxy=function(){function e(e,t,n,i){this._dimName=e,this._axisIndex=t,this.ecModel=i,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(isCoordSupported(t)){var n=getAxisMainType(this._dimName),i=t.getReferringComponents(n,SINGLE_REFERRING).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}}),this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return clone(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],o=[],s=[];each$a(["start","end"],(function(l,u){var c=e[l],h=e[l+"Value"];"percent"===r[u]?(null==c&&(c=a[u]),h=i.parse(linearMap(c,a,n))):(t=!0,c=linearMap(h=null==h?n[u]:i.parse(h),n,a)),s[u]=h,o[u]=c})),asc$1(s),asc$1(o);var l=this._minMaxSpan;function u(e,t,n,r,a){var o=a?"Span":"ValueSpan";sliderMove(0,e,n,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=linearMap(e[s],n,r,!0),a&&(t[s]=i.parse(t[s]))}return t?u(s,o,n,a,!1):u(o,s,a,n,!0),{valueWindow:s,percentWindow:o}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=calculateDataExtent(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,i=this.getTargetSeriesModels(),r=e.get("filterMode"),a=this._valueWindow;"none"!==r&&each$a(i,(function(e){var t=e.getData(),i=t.mapDimensionsAll(n);i.length&&("weakFilter"===r?t.filterSelf((function(e){for(var n,r,o,s=0;s<i.length;s++){var l=t.get(i[s],e),u=!isNaN(l),c=l<a[0],h=l>a[1];if(u&&!c&&!h)return!0;u&&(o=!0),c&&(n=!0),h&&(r=!0)}return o&&n&&r})):each$a(i,(function(n){if("empty"===r)e.setData(t=t.map(n,(function(e){return function(e){return e>=a[0]&&e<=a[1]}(e)?e:NaN})));else{var i={};i[n]=a,t.selectRange(i)}})),each$a(i,(function(e){t.setApproximateExtent(a,e)})))}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;each$a(["min","max"],(function(i){var r=t.get(i+"Span"),a=t.get(i+"ValueSpan");null!=a&&(a=this.getAxisModel().axis.scale.parse(a)),null!=a?r=linearMap(n[0]+a,n,[0,100],!0):null!=r&&(a=linearMap(r,[0,100],n,!0)-n[0]),e[i+"Span"]=r,e[i+"ValueSpan"]=a}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=getPixelPrecision(n,[0,500]);i=Math.min(i,20);var r=e.axis.scale.rawExtentInfo;0!==t[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},e}();function calculateDataExtent(e,t,n){var i=[1/0,-1/0];each$a(n,(function(e){unionAxisExtentFromData(i,e.getData(),t)}));var r=e.getAxisModel(),a=ensureScaleRawExtentInfo(r.axis.scale,r,i).calculate();return[a.min,a.max]}registerProcessor(PRIORITY.PROCESSOR.FILTER,{getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var a=e.getComponent(getAxisMainType(i),r);t(i,r,a,n)}))}))}t((function(e,t,n,i){n.__dzAxisProxy=null}));var n=[];t((function(t,i,r,a){r.__dzAxisProxy||(r.__dzAxisProxy=new AxisProxy(t,i,a,e),n.push(r.__dzAxisProxy))}));var i=createHashMap();return each(n,(function(e){each(e.getTargetSeriesModels(),(function(e){i.set(e.uid,e)}))})),i},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){e.getAxisProxy(t,n).reset(e)})),e.eachTargetAxis((function(n,i){e.getAxisProxy(n,i).filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}}),registerAction("dataZoom",(function(e,t){each(findEffectedDataZooms(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var each$b=each,DATA_ZOOM_ID_BASE=makeInternalComponentId("toolbox-dataZoom_"),DataZoomFeature=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n,i){this.brushController||(this.brushController=new BrushController(n.getZr()),this.brushController.on("brush",bind(this._onBrush,this)).mount()),updateZoomBtnStatus(e,t,this,i,n),updateBackBtnStatus(e,t)},t.prototype.onclick=function(e,t,n){handlers$1[n].call(this)},t.prototype.remove=function(e,t){this.brushController.unmount()},t.prototype.dispose=function(e,t){this.brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},i=this.ecModel;this.brushController.updateCovers([]),new BrushTargetManager(makeAxisFinder(this.model),i,{include:["grid"]}).matchOutputRanges(t,i,(function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(r("x",n,t[0]),r("y",n,t[1])):r({lineX:"x",lineY:"y"}[i],n,t)}})),push(i,n),this._dispatchZoomAction(n)}function r(e,t,r){var a=t.getAxis(e),o=a.model,s=function(e,t,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(i=n)})),i}(e,o,i),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=sliderMove(0,r.slice(),a.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];each$b(e,(function(e,n){t.push(clone(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.getLocale(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(ToolboxFeature),handlers$1={zoom:function(){var e=!this.isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(pop(this.ecModel))}};function makeAxisFinder(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}function updateBackBtnStatus(e,t){e.setIconStatus("back",count(t)>1?"emphasis":"normal")}function updateZoomBtnStatus(e,t,n,i,r){var a=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(a="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n.isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new BrushTargetManager(makeAxisFinder(e),t,{include:["grid"]}).makePanelOpts(r,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n.brushController.setPanels(o).enableBrush(!(!a||!o.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}registerFeature("dataZoom",DataZoomFeature),registerInternalOptionCreator("dataZoom",(function(e){var t=e.getComponent("toolbox",0);if(t){var n=t.getModel(["feature","dataZoom"]),i=[],r=parseFinder(e,makeAxisFinder(n));return each$b(r.xAxisModels,(function(e){return a(e,"xAxis","xAxisIndex")})),each$b(r.yAxisModels,(function(e){return a(e,"yAxis","yAxisIndex")})),i}function a(e,t,r){var a=e.componentIndex,o={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:DATA_ZOOM_ID_BASE+t+a};o[r]=a,i.push(o)}}));var RestoreOption=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){clear$1(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.getLocale(["toolbox","restore","title"])}},t}(ToolboxFeature);registerFeature("restore",RestoreOption),registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")}));var TooltipModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={zlevel:0,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,borderColor:"#333",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}(ComponentModel);function shouldTooltipConfine(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}ComponentModel.registerClass(TooltipModel);var vendors=["-ms-","-moz-","-o-","-webkit-",""],gCssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;";function mirrorPos(e){return e="left"===e?"right":"right"===e?"left":"top"===e?"bottom":"top"}function assembleArrow(e,t,n){if(!isString(n)||"inside"===n)return"";t=convertToColorString(t);var i=mirrorPos(n),r="",a="";return indexOf(["left","right"],i)>-1?(r=i+":-6px;top:50%;",a="translateY(-50%) rotate("+("left"===i?-225:-45)+"deg)"):(r=i+":-6px;left:50%;",a="translateX(-50%) rotate("+("top"===i?225:45)+"deg)"),'<div style="'+["position:absolute;width:10px;height:10px;",""+r+(a=map(vendors,(function(e){return e+"transform:"+a})).join(";"))+";","border-bottom: "+t+" solid 1px;","border-right: "+t+" solid 1px;","background-color: "+e+";","box-shadow: 8px 8px 16px -3px #000;"].join("")+'"></div>'}function assembleTransition(e,t){var n="cubic-bezier(0.23, 1, 0.32, 1)",i="opacity "+e/2+"s "+n+",visibility "+e/2+"s "+n;return t||(i+=",left "+e+"s "+n+",top "+e+"s "+n),map(vendors,(function(e){return e+"transition:"+i})).join(";")}function assembleFont(e){var t=[],n=e.get("fontSize"),i=e.getTextColor();i&&t.push("color:"+i),t.push("font:"+e.getFont()),n&&t.push("line-height:"+Math.round(3*n/2)+"px");var r=e.get("textShadowColor"),a=e.get("textShadowBlur")||0,o=e.get("textShadowOffsetX")||0,s=e.get("textShadowOffsetY")||0;return r&&a&&t.push("text-shadow:"+o+"px "+s+"px "+a+"px "+r),each(["decoration","align"],(function(n){var i=e.get(n);i&&t.push("text-"+n+":"+i)})),t.join(";")}function assembleCssText(e,t,n){var i=[],r=e.get("transitionDuration"),a=e.get("backgroundColor"),o=e.get("shadowBlur"),s=e.get("shadowColor"),l=e.get("shadowOffsetX"),u=e.get("shadowOffsetY"),c=e.getModel("textStyle"),h=getPaddingFromTooltipModel(e,"html"),p=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+p),t&&r&&i.push(assembleTransition(r,n)),a&&(env.canvasSupported?i.push("background-Color:"+a):(i.push("background-Color:#"+toHex(a)),i.push("filter:alpha(opacity=70)"))),each(["width","color","radius"],(function(t){var n="border-"+t,r=toCamelCase(n),a=e.get(r);null!=a&&i.push(n+":"+a+("color"===t?"":"px"))})),i.push(assembleFont(c)),null!=h&&i.push("padding:"+normalizeCssArray$1(h).join("px ")+"px"),i.join(";")+";"}function makeStyleCoord(e,t,n,i,r){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&transformLocalCoord(e,o,document.body,i,r)}else{e[0]=i,e[1]=r;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var TooltipHTMLContent=function(){function e(e,t,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,env.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var r=this._zr=t.getZr(),a=this._appendToBody=n&&n.appendToBody;makeStyleCoord(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),a?document.body.appendChild(i):e.appendChild(i),this._container=e;var o=this;i.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},i.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=r.handler;normalizeEvent(r.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},i.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){var t=this._container,n=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==n.position&&(i.position="relative"),e.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=this._styleCoord,r=n.offsetHeight/2;t=convertToColorString(t),n.style.cssText=gCssText+assembleCssText(e,!this._firstShow,this._longHide)+";left:"+i[0]+"px;top:"+(i[1]-r)+"px;border-color: "+t+";"+(e.get("extraCssText")||""),n.style.display=n.innerHTML?"block":"none",n.style.pointerEvents=this._enterable?"auto":"none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,i,r){if(null!=e){var a=this.el;if(isString(r)&&"item"===n.get("trigger")&&!shouldTooltipConfine(n)&&(e+=assembleArrow(n.get("backgroundColor"),i,r)),isString(e))a.innerHTML=e;else if(e){a.innerHTML="",isArray(e)||(e=[e]);for(var o=0;o<e.length;o++)isDom(e[o])&&e[o].parentNode!==a&&a.appendChild(e[o])}}},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return[e.clientWidth,e.clientHeight]},e.prototype.moveTo=function(e,t){var n=this._styleCoord;if(makeStyleCoord(n,this._zr,this._appendToBody,e,t),null!=n[0]&&null!=n[1]){var i=this.el.style;i.left=n[0].toFixed(0)+"px",i.top=n[1].toFixed(0)+"px"}},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;this.el.style.visibility="hidden",this.el.style.opacity="0",this._show=!1,this._longHideTimeout=setTimeout((function(){return e._longHide=!0}),500)},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(bind(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},e.prototype.getOuterSize=function(){var e=this.el.clientWidth,t=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var n=document.defaultView.getComputedStyle(this.el);n&&(e+=parseInt(n.borderLeftWidth,10)+parseInt(n.borderRightWidth,10),t+=parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10))}return{width:e,height:t}},e}(),TooltipRichContent=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._zr=e.getZr(),makeStyleCoord$1(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){e.get("alwaysShowContent")&&this._moveIfResized()},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,i,r){isObject(e)&&throwError(""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new ZRText({style:{rich:t.richTextStyles,text:e,lineHeight:22,backgroundColor:n.get("backgroundColor"),borderRadius:n.get("borderRadius"),borderWidth:1,borderColor:i,shadowColor:n.get("shadowColor"),shadowBlur:n.get("shadowBlur"),shadowOffsetX:n.get("shadowOffsetX"),shadowOffsetY:n.get("shadowOffsetY"),textShadowColor:a.get("textShadowColor"),textShadowBlur:a.get("textShadowBlur")||0,textShadowOffsetX:a.get("textShadowOffsetX")||0,textShadowOffsetY:a.get("textShadowOffsetY")||0,fill:n.get(["textStyle","color"]),padding:getPaddingFromTooltipModel(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),this._zr.add(this.el);var o=this;this.el.on("mouseover",(function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0})),this.el.on("mouseout",(function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}))},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=calcShadowOuterSize(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 i=this._styleCoord;makeStyleCoord$1(i,this._zr,e,t),e=i[0],t=i[1];var r=n.style,a=mathMaxWith0(r.borderWidth||0),o=calcShadowOuterSize(r);n.x=e+a+o.left,n.y=t+a+o.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||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(bind(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.getOuterSize=function(){var e=this.getSize();return{width:e[0],height:e[1]}},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function mathMaxWith0(e){return Math.max(0,e)}function calcShadowOuterSize(e){var t=mathMaxWith0(e.shadowBlur||0),n=mathMaxWith0(e.shadowOffsetX||0),i=mathMaxWith0(e.shadowOffsetY||0);return{left:mathMaxWith0(t-n),right:mathMaxWith0(t+n),top:mathMaxWith0(t-i),bottom:mathMaxWith0(t+i)}}function makeStyleCoord$1(e,t,n,i){e[0]=n,e[1]=i,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var bind$2=bind,each$c=each,parsePercent$3=parsePercent$2,proxyRect=new Rect({shape:{x:-1,y:-1,width:2,height:2}}),TooltipView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){if(!env.node){var n=e.getComponent("tooltip"),i=n.get("renderMode");this._renderMode=getTooltipRenderMode(i),this._tooltipContent="richText"===this._renderMode?new TooltipRichContent(t):new TooltipHTMLContent(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)})}},t.prototype.render=function(e,t,n){if(!env.node){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n,this._alwaysShowContent=e.get("alwaysShowContent");var i=this._tooltipContent;i.update(e),i.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow()}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");register("itemTooltip",this._api,bind$2((function(t,n,i){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){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,i){if(i.from!==this.uid&&!env.node){var r=makeDispatchAction$1(i,n);this._ticket="";var a=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var o=proxyRect;o.x=i.x,o.y=i.y,o.update(),o.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:o},r)}else if(a)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:a,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var s=findPointFromSeries(i,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:i.position,target:s.el},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},t.prototype.manuallyHideTip=function(e,t,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(makeDispatchAction$1(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var r=i.seriesIndex,a=i.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=t.getSeriesByIndex(r);if(s)if("axis"===buildTooltipModel([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,e]).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i=e.dataByCoordSys;i&&i.length?this._showAxisTooltip(i,e):n&&findEventDispatcher(n,(function(e){return null!=getECData(e).dataIndex}))?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,n,t)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,n,t)):(this._lastDataByCoordSys=null,this._hide(t))}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=bind(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,r=[t.offsetX,t.offsetY],a=buildTooltipModel([t.tooltipOption,i]),o=this._renderMode,s=[],l=createTooltipMarkup("section",{blocks:[],noHeader:!0}),u=[],c=new TooltipMarkupStyleCreator;each$c(e,(function(e){each$c(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var r=getValueLabel(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),a=createTooltipMarkup("section",{header:r,noHeader:!trim(r),sortBlocks:!0,blocks:[]});l.blocks.push(a),each(e.seriesDataIndices,(function(l){var h=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,d=h.getDataParams(p);d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=getAxisRawValue(t.axis,{value:i}),d.axisValueLabel=r,d.marker=c.makeTooltipMarker("item",convertToColorString(d.color),o);var f=normalizeTooltipFormatResult(h.formatTooltip(p,!0,null));f.markupFragment&&a.blocks.push(f.markupFragment),f.markupText&&u.push(f.markupText),s.push(d)}))}}))})),l.blocks.reverse(),u.reverse();var h=t.position,p=a.get("order"),d=buildTooltipMarkup(l,c,o,p,n.get("useUTC"));d&&u.unshift(d);var f="richText"===o?"\n\n":"<br/>",g=u.join(f);this._showOrMove(a,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(a,h,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(a,g,s,Math.random()+"",r[0],r[1],h,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=findEventDispatcher(t,(function(e){return null!=getECData(e).dataIndex})),r=this._ecModel,a=getECData(i),o=a.seriesIndex,s=r.getSeriesByIndex(o),l=a.dataModel||s,u=a.dataIndex,c=a.dataType,h=l.getData(c),p=this._renderMode,d=buildTooltipModel([h.getItemModel(u),l,s&&(s.coordinateSystem||{}).model,this._tooltipModel]),f=d.get("trigger");if(null==f||"item"===f){var g=l.getDataParams(u,c),m=new TooltipMarkupStyleCreator;g.marker=m.makeTooltipMarker("item",convertToColorString(g.color),p);var y=normalizeTooltipFormatResult(l.formatTooltip(u,!1,c)),v=d.get("order"),_=y.markupFragment?buildTooltipMarkup(y.markupFragment,m,p,v,r.get("useUTC")):y.markupText,x="item_"+l.name+"_"+u;this._showOrMove(d,(function(){this._showTooltipContent(d,_,g,x,e.offsetX,e.offsetY,e.position,e.target,m)})),n({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=t.tooltip;if(isString(i)){i={content:i,formatter:i}}var r=new Model(i,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random()+"",s=new TooltipMarkupStyleCreator;this._showOrMove(r,(function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t,s)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,r,a,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,c=e.get("formatter");o=o||e.get("position");var h=t,p=this._getNearestPoint([r,a],n,e.get("trigger"));if(c&&isString(c)){var d=e.ecModel.get("useUTC"),f=isArray(n)?n[0]:n;h=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=format(f.axisValue,h,d)),h=formatTpl(h,n,!0)}else if(isFunction(c)){var g=bind$2((function(t,i){t===this._ticket&&(u.setContent(i,l,e,p.color,o),this._updatePosition(e,o,r,a,u,n,s))}),this);this._ticket=i,h=c(n,i,g)}u.setContent(h,l,e,p.color,o),u.show(e,p.color),this._updatePosition(e,o,r,a,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n){return"axis"===n||isArray(t)?{color:"html"===this._renderMode?"#fff":"none"}:isArray(t)?void 0:{color:t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),c=e.get("align"),h=e.get("verticalAlign"),p=o&&o.getBoundingRect().clone();if(o&&p.applyTransform(o.transform),isFunction(t)&&(t=t([n,i],a,r.el,p,{viewSize:[s,l],contentSize:u.slice()})),isArray(t))n=parsePercent$3(t[0],s),i=parsePercent$3(t[1],l);else if(isObject(t)){var d=t;d.width=u[0],d.height=u[1];var f=getLayoutRect(d,{width:s,height:l});n=f.x,i=f.y,c=null,h=null}else if(isString(t)&&o){n=(g=calcTooltipPosition(t,p,u))[0],i=g[1]}else{var g;n=(g=refixTooltipPosition(n,i,r,s,l,c?null:20,h?null:20))[0],i=g[1]}(c&&(n-=isCenterAlign(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=isCenterAlign(h)?u[1]/2:"bottom"===h?u[1]:0),shouldTooltipConfine(e))&&(n=(g=confineTooltipPosition(n,i,r,s,l))[0],i=g[1]);r.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e){var t=this._lastDataByCoordSys,n=!!t&&t.length===e.length;return n&&each$c(t,(function(t,i){var r=t.dataByAxis||[],a=(e[i]||{}).dataByAxis||[];(n=n&&r.length===a.length)&&each$c(r,(function(e,t){var i=a[t]||{},r=e.seriesDataIndices||[],o=i.seriesDataIndices||[];(n=n&&e.value===i.value&&e.axisType===i.axisType&&e.axisId===i.axisId&&r.length===o.length)&&each$c(r,(function(e,t){var i=o[t];n=n&&e.seriesIndex===i.seriesIndex&&e.dataIndex===i.dataIndex}))}))})),this._lastDataByCoordSys=e,!!n},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){env.node||(this._tooltipContent.dispose(),unregister("itemTooltip",t))},t.type="tooltip",t}(ComponentView);function buildTooltipModel(e){for(var t=e.pop();e.length;){var n=e.pop();n&&(n instanceof Model&&(n=n.get("tooltip",!0)),isString(n)&&(n={formatter:n}),t=new Model(n,t,t.ecModel))}return t}function makeDispatchAction$1(e,t){return e.dispatchAction||bind(t.dispatchAction,t)}function refixTooltipPosition(e,t,n,i,r,a,o){var s=n.getOuterSize(),l=s.width,u=s.height;return null!=a&&(e+l+a+2>i?e-=l+a:e+=a),null!=o&&(t+u+o>r?t-=u+o:t+=o),[e,t]}function confineTooltipPosition(e,t,n,i,r){var a=n.getOuterSize(),o=a.width,s=a.height;return e=Math.min(e+o,i)-o,t=Math.min(t+s,r)-s,[e=Math.max(e,0),t=Math.max(t,0)]}function calcTooltipPosition(e,t,n){var i=n[0],r=n[1],a=0,o=0,s=t.width,l=t.height;switch(e){case"inside":a=t.x+s/2-i/2,o=t.y+l/2-r/2;break;case"top":a=t.x+s/2-i/2,o=t.y-r-10;break;case"bottom":a=t.x+s/2-i/2,o=t.y+l+10;break;case"left":a=t.x-i-10-5,o=t.y+l/2-r/2;break;case"right":a=t.x+s+10+5,o=t.y+l/2-r/2}return[a,o]}function isCenterAlign(e){return"center"===e||"middle"===e}ComponentView.registerClass(TooltipView),registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var DEFAULT_TOOLBOX_BTNS=["rect","polygon","keep","clear"];function brushPreprocessor(e,t){var n=normalizeToArray(e?e.brush:[]);if(n.length){var i=[];each(n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(i=i.concat(t))}));var r=e&&e.toolbox;isArray(r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var a=r.feature||(r.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),removeDuplicate(s),t&&!s.length&&s.push.apply(s,DEFAULT_TOOLBOX_BTNS)}}function removeDuplicate(e){var t={};each(e,(function(e){t[e]=1})),e.length=0,each(t,(function(t,n){e.push(n)}))}var each$d=each;function hasKeys(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function createVisualMappings(e,t,n){var i={};return each$d(t,(function(t){var r,a=i[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);each$d(e[t],(function(e,i){if(VisualMapping.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),a[i]=new VisualMapping(r),"opacity"===i&&((r=clone(r)).type="colorAlpha",a.__hidden.__alphaForOpacity=new VisualMapping(r))}}))})),i}function replaceVisualOption(e,t,n){var i;each(n,(function(e){t.hasOwnProperty(e)&&hasKeys(t[e])&&(i=!0)})),i&&each(n,(function(n){t.hasOwnProperty(n)&&hasKeys(t[n])?e[n]=clone(t[n]):delete e[n]}))}function applyVisual(e,t,n,i,r,a){var o,s={};function l(e){return getItemVisualFromData(n,o,e)}function u(e,t){setItemVisualFromData(n,o,e,t)}function c(e,c){o=null==a?e:c;var h=n.getRawDataItem(o);if(!h||!1!==h.visualMap)for(var p=i.call(r,e),d=t[p],f=s[p],g=0,m=f.length;g<m;g++){var y=f[g];d[y]&&d[y].applyVisual(e,l,u)}}each(e,(function(e){var n=VisualMapping.prepareVisualTypes(t[e]);s[e]=n})),null==a?n.each(c):n.each([a],c)}function incrementalApplyVisual(e,t,n,i){var r={};return each(e,(function(e){var n=VisualMapping.prepareVisualTypes(t[e]);r[e]=n})),{progress:function(e,a){var o,s;function l(e){return getItemVisualFromData(a,s,e)}function u(e,t){setItemVisualFromData(a,s,e,t)}for(null!=i&&(o=a.getDimension(i));null!=(s=e.next());){var c=a.getRawDataItem(s);if(!c||!1!==c.visualMap)for(var h=null!=i?a.get(o,s):s,p=n(h),d=t[p],f=r[p],g=0,m=f.length;g<m;g++){var y=f[g];d[y]&&d[y].applyVisual(h,l,u)}}}}}function makeBrushCommonSelectorForSeries(e){var t=e.brushType,n={point:function(i){return selector[t].point(i,n,e)},rect:function(i){return selector[t].rect(i,n,e)}};return n}var selector={lineX:getLineSelectors(0),lineY:getLineSelectors(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])&&contain$2(n.range,e[0],e[1])},rect:function(e,t,n){var i=n.range;if(!e||i.length<=1)return!1;var r=e.x,a=e.y,o=e.width,s=e.height,l=i[0];return!!(contain$2(i,r,a)||contain$2(i,r+o,a)||contain$2(i,r,a+s)||contain$2(i,r+o,a+s)||BoundingRect.create(e).contain(l[0],l[1])||linePolygonIntersect(r,a,r+o,a,i)||linePolygonIntersect(r,a,r,a+s,i)||linePolygonIntersect(r+o,a,r+o,a+s,i)||linePolygonIntersect(r,a+s,r+o,a+s,i))||void 0}}};function getLineSelectors(e){var t=["x","y"],n=["width","height"];return{point:function(t,n,i){if(t){var r=i.range;return inLineRange(t[e],r)}},rect:function(i,r,a){if(i){var o=a.range,s=[i[t[e]],i[t[e]]+i[n[e]]];return s[1]<s[0]&&s.reverse(),inLineRange(s[0],o)||inLineRange(s[1],o)||inLineRange(o[0],s)||inLineRange(o[1],s)}}}}function inLineRange(e,t){return t[0]<=e&&e<=t[1]}var STATE_LIST=["inBrush","outOfBrush"],DISPATCH_METHOD="__ecBrushSelect",DISPATCH_FLAG="__ecInBrushSelectEvent",PRIORITY_BRUSH=PRIORITY.VISUAL.BRUSH;function layoutCovers(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new BrushTargetManager(t.option,e)).setInputRanges(t.areas,e)}))}function dispatchAction(e,t,n,i,r){if(r){var a=e.getZr();if(!a[DISPATCH_FLAG])a[DISPATCH_METHOD]||(a[DISPATCH_METHOD]=doDispatch),createOrUpdate(a,DISPATCH_METHOD,n,t)(e,i)}}function doDispatch(e,t){if(!e.isDisposed()){var n=e.getZr();n[DISPATCH_FLAG]=!0,e.dispatchAction({type:"brushSelect",batch:t}),n[DISPATCH_FLAG]=!1}}function checkInRange(e,t,n,i){for(var r=0,a=t.length;r<a;r++){var o=t[r];if(e.brushSelector(i,n,o.selectors,o))return!0}}function brushModelNotControll(e,t){var n=e.option.seriesIndex;return null!=n&&"all"!==n&&(isArray(n)?indexOf(n,t)<0:t!==n)}registerVisual(PRIORITY_BRUSH,(function(e,t,n){var i,r,a=[];e.eachComponent({mainType:"brush"},(function(e){n&&"takeGlobalCursor"===n.type&&e.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1})})),layoutCovers(e),e.eachComponent({mainType:"brush"},(function(t,n){var o={brushId:t.id,brushIndex:n,brushName:t.name,areas:clone(t.areas),selected:[]};a.push(o);var s=t.option,l=s.brushLink,u=[],c=[],h=[],p=!1;n||(i=s.throttleType,r=s.throttleDelay);var d=map(t.areas,(function(e){var t=boundingRectBuilders[e.brushType],n=defaults({boundingRect:t?t(e):void 0},e);return n.selectors=makeBrushCommonSelectorForSeries(n),n})),f=createVisualMappings(t.option,STATE_LIST,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||!!u[e]}function m(e){return!!e.length}isArray(l)&&each(l,(function(e){u[e]=1})),e.eachSeries((function(n,i){var r=h[i]=[];"parallel"===n.subType?function(e,t){var n=e.coordinateSystem;p=p||n.hasAxisBrushed(),g(t)&&n.eachActiveState(e.getData(),(function(e,t){"active"===e&&(c[t]=1)}))}(n,i):function(n,i,r){if(!n.brushSelector||brushModelNotControll(t,i))return;if(each(d,(function(i){t.brushTargetManager.controlSeries(i,n,e)&&r.push(i),p=p||m(r)})),g(i)&&m(r)){var a=n.getData();a.each((function(e){checkInRange(n,r,a,e)&&(c[e]=1)}))}}(n,i,r)})),e.eachSeries((function(e,t){var n={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};o.selected.push(n);var i=h[t],r=e.getData(),a=g(t)?function(e){return c[e]?(n.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(t){return checkInRange(e,i,r,t)?(n.dataIndex.push(r.getRawIndex(t)),"inBrush"):"outOfBrush"};(g(t)?p:m(i))&&applyVisual(STATE_LIST,f,r,a)}))})),dispatchAction(t,i,r,a,n)}));var boundingRectBuilders={rect:function(e){return getBoundingRectFromMinMax(e.range)},polygon:function(e){for(var t,n=e.range,i=0,r=n.length;i<r;i++){t=t||[[1/0,-1/0],[1/0,-1/0]];var a=n[i];a[0]<t[0][0]&&(t[0][0]=a[0]),a[0]>t[0][1]&&(t[0][1]=a[0]),a[1]<t[1][0]&&(t[1][0]=a[1]),a[1]>t[1][1]&&(t[1][1]=a[1])}return t&&getBoundingRectFromMinMax(t)}};function getBoundingRectFromMinMax(e){return new BoundingRect(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var DEFAULT_OUT_OF_BRUSH_COLOR="#ddd",BrushModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return __extends(t,e),t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&replaceVisualOption(n,e,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:DEFAULT_OUT_OF_BRUSH_COLOR},i.hasOwnProperty("liftZ")||(i.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=map(e,(function(e){return generateBrushOption(this.option,e)}),this))},t.prototype.setBrushOption=function(e){this.brushOption=generateBrushOption(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}(ComponentModel);function generateBrushOption(e,t){return merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Model(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}ComponentModel.registerClass(BrushModel);var BrushView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new BrushController(t.getZr())).on("brush",bind(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,i){this.model=e,this._updateController(e,t,n,i)},t.prototype.updateTransform=function(e,t,n,i){layoutCovers(t),this._updateController(e,t,n,i)},t.prototype.updateVisual=function(e,t,n,i){this.updateTransform(e,t,n,i)},t.prototype.updateView=function(e,t,n,i){this._updateController(e,t,n,i)},t.prototype._updateController=function(e,t,n,i){(!i||i.$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:clone(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:t,areas:clone(n),$from:t})},t.type="brush",t}(ComponentView);ComponentView.registerClass(BrushView),registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var ICON_TYPES=["rect","polygon","lineX","lineY","keep","clear"],BrushFeature=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n){var i,r,a;t.eachComponent({mainType:"brush"},(function(e){i=e.brushType,r=e.brushOption.brushMode||"single",a=a||!!e.areas.length})),this._brushType=i,this._brushMode=r,each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===r:"clear"===t?a:t===i)?"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 each(e.get("type",!0),(function(e){t[e]&&(n[e]=t[e])})),n},t.prototype.onclick=function(e,t,n){var i=this._brushType,r=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?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},t.getDefaultOption=function(e){return{show:!0,type:ICON_TYPES.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.getLocale(["toolbox","brush","title"])}},t}(ToolboxFeature);registerFeature("brush",BrushFeature),registerPreprocessor(brushPreprocessor);var TitleModel=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 __extends(t,e),t.type="title",t.defaultOption={zlevel:0,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}(ComponentModel);ComponentModel.registerClass(TitleModel);var TitleView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var i=this.group,r=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new ZRText({style:createTextStyle(r,{text:e.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new ZRText({style:createTextStyle(a,{text:c,fill:a.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=e.get("link"),d=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!p&&!f,h.silent=!d&&!f,p&&l.on("click",(function(){windowOpen(p,"_"+e.get("target"))})),d&&h.on("click",(function(){windowOpen(d,"_"+e.get("subtarget"))})),getECData(l).eventData=getECData(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,i.add(l),c&&i.add(h);var g=i.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=getLayoutRect(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?y.x+=y.width:"center"===o&&(y.x+=y.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:o,verticalAlign:s};l.setStyle(v),h.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var S=new Rect({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});i.add(S)}},t.type="title",t}(ComponentView);function timelinePreprocessor(e){var t=e&&e.timeline;isArray(t)||(t=t?[t]:[]),each(t,(function(e){e&&compatibleEC2(e)}))}function compatibleEC2(e){var t=e.type,n={number:"value",time:"time"};if(n[t]&&(e.axisType=n[t],delete e.type),transferItem(e),has(e,"controlPosition")){var i=e.controlStyle||(e.controlStyle={});has(i,"position")||(i.position=e.controlPosition),"none"!==i.position||has(i,"show")||(i.show=!1,delete i.position),delete e.controlPosition}each(e.data||[],(function(e){isObject(e)&&!isArray(e)&&(!has(e,"value")&&has(e,"name")&&(e.value=e.name),transferItem(e))}))}function transferItem(e){var t=e.itemStyle||(e.itemStyle={}),n=t.emphasis||(t.emphasis={}),i=e.label||e.label||{},r=i.normal||(i.normal={}),a={normal:1,emphasis:1};each(i,(function(e,t){a[t]||has(r,t)||(r[t]=e)})),n.label&&!has(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function has(e,t){return e.hasOwnProperty(t)}ComponentView.registerClass(TitleView),ComponentModel.registerSubTypeDefaulter("timeline",(function(){return"slider"})),registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var n=t.getComponent("timeline");return n&&null!=e.currentIndex&&(n.setCurrentIndex(e.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.setPlayState(!1)),t.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),defaults({currentIndex:n.option.currentIndex},e)})),registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var n=t.getComponent("timeline");n&&null!=e.playState&&n.setPlayState(e.playState)}));var TimelineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode="box",n}return __extends(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||[],i=t.axisType,r=this._names=[];"category"===i?(e=[],each(n,(function(t,n){var i,a=convertOptionIdName(getDataItemValue(t),"");isObject(t)?(i=clone(t)).value=n:i=n,e.push(i),r.push(a)}))):e=n;var a={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new List([{name:"value",type:a}],this)).initData(e,r)},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={zlevel:0,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}(ComponentModel);ComponentModel.registerClass(TimelineModel);var SliderTimelineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="timeline.slider",t.defaultOption=inheritDefaultOption(TimelineModel.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}(TimelineModel);mixin(SliderTimelineModel,DataFormatMixin.prototype),ComponentModel.registerClass(SliderTimelineModel);var TimelineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="timeline",t}(ComponentView),TimelineAxis=function(e){function t(t,n,i,r){var a=e.call(this,t,n,i)||this;return a.type=r||"value",a}return __extends(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(Axis),PI$9=Math.PI,labelDataIndexStore=makeInner(),SliderTimelineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(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 i=this._layout(e,n),r=this._createGroup("_mainGroup"),a=this._createGroup("_labelGroup"),o=this._axis=this._createAxis(i,e);e.formatTooltip=function(e){return createTooltipMarkup("nameValue",{noName:!0,value:o.scale.getLabel({value:e})})},each(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](i,r,o,e)}),this),this._renderAxisLabel(i,a,o,e),this._position(i,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,i,r,a,o=e.get(["label","position"]),s=e.get("orient"),l=getViewRect$5(e,t),u={horizontal:"center",vertical:(n=null==o||"auto"===o?"horizontal"===s?l.y+l.height/2<t.getHeight()/2?"-":"+":l.x+l.width/2<t.getWidth()/2?"+":"-":isString(o)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[s][o]:o)>=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:PI$9/2},p="vertical"===s?l.height:l.width,d=e.getModel("controlStyle"),f=d.get("show",!0),g=f?d.get("itemSize"):0,m=f?d.get("itemGap"):0,y=g+m,v=e.get(["label","rotate"])||0;v=v*PI$9/180;var _=d.get("position",!0),x=f&&d.get("showPlayBtn",!0),S=f&&d.get("showPrevBtn",!0),b=f&&d.get("showNextBtn",!0),T=0,M=p;"left"===_||"bottom"===_?(x&&(i=[0,0],T+=y),S&&(r=[T,0],T+=y),b&&(a=[M-g,0],M-=y)):(x&&(i=[M-g,0],M-=y),S&&(r=[0,0],T+=y),b&&(a=[M-g,0],M-=y));var A=[T,M];return e.get("inverse")&&A.reverse(),{viewRect:l,mainLength:p,orient:s,rotation:h[s],labelRotation:v,labelPosOpt:n,labelAlign:e.get(["label","align"])||u[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:i,prevBtnPosition:r,nextBtnPosition:a,axisExtent:A,controlSize:g,controlGap:m}},t.prototype._position=function(e,t){var n=this._mainGroup,i=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){var a=create$1(),o=r.x,s=r.y+r.height;translate(a,a,[-o,-s]),rotate(a,a,-PI$9/2),translate(a,a,[o,s]),(r=r.clone()).applyTransform(a)}var l=m(r),u=m(n.getBoundingRect()),c=m(i.getBoundingRect()),h=[n.x,n.y],p=[i.x,i.y];p[0]=h[0]=l[0][0];var d,f=e.labelPosOpt;null==f||isString(f)?(y(h,u,l,1,d="+"===f?0:1),y(p,c,l,1,1-d)):(y(h,u,l,1,d=f>=0?0:1),p[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 y(e,t,n,i,r){e[i]+=n[i][r]-t[i][r]}n.setPosition(h),i.setPosition(p),n.rotation=i.rotation=e.rotation,g(n),g(i)},t.prototype._createAxis=function(e,t){var n=t.getData(),i=t.get("axisType"),r=createScaleByModel$1(t,i);r.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var a=n.getDataExtent("value");r.setExtent(a[0],a[1]),r.niceTicks();var o=new TimelineAxis("value",r,e.axisExtent,i);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new Group;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var a=new Line({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:extend({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(a);var o=this._progressLine=new Line({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:defaults({lineCap:"round",lineWidth:a.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,i){var r=this,a=i.getData(),o=n.scale.getTicks();this._tickSymbols=[],each(o,(function(e){var o=n.dataToCoord(e.value),s=a.getItemModel(e.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:o,y:0,onclick:bind(r._changeTimeline,r,e.value)},p=giveSymbol(s,l,t,h);p.ensureState("emphasis").style=u.getItemStyle(),p.ensureState("progress").style=c.getItemStyle(),enableHoverEmphasis(p);var d=getECData(p);s.get("tooltip")?(d.dataIndex=e.value,d.dataModel=i):d.dataIndex=d.dataModel=null,r._tickSymbols.push(p)}))},t.prototype._renderAxisLabel=function(e,t,n,i){var r=this;if(n.getLabelModel().get("show")){var a=i.getData(),o=n.getViewLabels();this._tickLabels=[],each(o,(function(i){var o=i.tickValue,s=a.getItemModel(o),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(i.tickValue),p=new ZRText({x:h,y:0,rotation:e.labelRotation-e.rotation,onclick:bind(r._changeTimeline,r,o),silent:!1,style:createTextStyle(l,{text:i.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});p.ensureState("emphasis").style=createTextStyle(u),p.ensureState("progress").style=createTextStyle(c),t.add(p),enableHoverEmphasis(p),labelDataIndexStore(p).dataIndex=o,r._tickLabels.push(p)}))}},t.prototype._renderControl=function(e,t,n,i){var r=e.controlSize,a=e.rotation,o=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function c(e,n,l,u){if(e){var c=parsePercent(retrieve2(i.get(["controlStyle",n+"BtnSize"]),r),r),h=makeControlIcon(i,n+"Icon",[0,-c/2,c,c],{position:e,origin:[r/2,0],rotation:u?-a:0,rectHover:!0,style:o,onclick:l});h.ensureState("emphasis").style=s,t.add(h),enableHoverEmphasis(h)}}c(e.nextBtnPosition,"next",bind(this._changeTimeline,this,u?"-":"+")),c(e.prevBtnPosition,"prev",bind(this._changeTimeline,this,u?"+":"-")),c(e.playPosition,l?"stop":"play",bind(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,i){var r=i.getData(),a=i.getCurrentIndex(),o=r.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=bind(s._handlePointerDrag,s),e.ondragend=bind(s._handlePointerDragend,s),pointerMoveTo(e,s._progressLine,a,n,i,!0)},onUpdate:function(e){pointerMoveTo(e,s._progressLine,a,n,i)}};this._currentPointer=giveSymbol(o,o,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],i=asc(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n<i[0]&&(n=i[0]),this._currentPointer.x=n,this._currentPointer.markRedraw(),this._progressLine.shape.x2=n,this._progressLine.dirty();var r=this._findNearestTick(n),a=this.model;(t||r!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(r)},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 applyTransform$1(e,this._mainGroup.getLocalTransform(),!0)},t.prototype._findNearestTick=function(e){var t,n=this.model.getData(),i=1/0,r=this._axis;return n.each(["value"],(function(n,a){var o=r.dataToCoord(n),s=Math.abs(o-e);s<i&&(i=s,t=a)})),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 i=0;i<t.length;i++)t&&t[i]&&t[i].toggleState("progress",i<e);if(n)for(i=0;i<n.length;i++)n&&n[i]&&n[i].toggleState("progress",labelDataIndexStore(n[i]).dataIndex<=e)},t.type="timeline.slider",t}(TimelineView);function createScaleByModel$1(e,t){if(t=t||e.get("type"))switch(t){case"category":return new OrdinalScale({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case"time":return new TimeScale({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new IntervalScale}}function getViewRect$5(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}function makeControlIcon(e,t,n,i){var r=i.style,a=createIcon(e.get(["controlStyle",t]),i||{},new BoundingRect(n[0],n[1],n[2],n[3]));return r&&a.setStyle(r),a}function giveSymbol(e,t,n,i,r,a){var o=t.get("color");r?(r.setColor(o),n.add(r),a&&a.onUpdate(r)):((r=createSymbol(e.get("symbol"),-1,-1,2,2,o)).setStyle("strokeNoScale",!0),n.add(r),a&&a.onCreate(r));var s=t.getItemStyle(["color"]);r.setStyle(s),i=merge({rectHover:!0,z2:100},i,!0);var l=e.get("symbolSize");l=l instanceof Array?l.slice():[+l,+l],i.scaleX=l[0]/2,i.scaleY=l[1]/2;var u=e.get("symbolOffset");u&&(i.x=i.x||0,i.y=i.y||0,i.x+=parsePercent$2(u[0],l[0]),i.y+=parsePercent$2(u[1],l[1]));var c=e.get("symbolRotate");return i.rotation=(c||0)*Math.PI/180||0,r.attr(i),r.updateTransform(),r}function pointerMoveTo(e,t,n,i,r,a){if(!e.dragging){var o=r.getModel("checkpointStyle"),s=i.dataToCoord(r.getData().get("value",n));if(a||!o.get("animation",!0))e.attr({x:s,y:0}),t&&t.attr({shape:{x2:s}});else{var l={duration:o.get("animationDuration",!0),easing:o.get("animationEasing",!0)};e.stopAnimation(null,!0),e.animateTo({x:s,y:0},l),t&&t.animateTo({shape:{x2:s}},l)}}}function fillLabel(e){defaultEmphasis(e,"label",["show"])}ComponentView.registerClass(SliderTimelineView),registerPreprocessor(timelinePreprocessor);var inner$i=makeInner(),MarkerModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(env.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,i){var r=this.mainType;n||t.eachSeries((function(e){var n=e.get(this.mainType,!0),a=inner$i(e)[r];n&&n.data?(a?a._mergeOption(n,t,!0):(i&&fillLabel(n),each(n.data,(function(e){e instanceof Array?(fillLabel(e[0]),fillLabel(e[1])):fillLabel(e)})),extend(a=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),a.__hostSeries=e),inner$i(e)[r]=a):inner$i(e)[r]=null}),this)},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e),a=i.getName(e);return createTooltipMarkup("section",{header:this.name,blocks:[createTooltipMarkup("nameValue",{name:a,value:r,noName:!a,noValue:null==r})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return inner$i(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(ComponentModel);mixin(MarkerModel,DataFormatMixin.prototype);var MarkPointModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markPoint",t.defaultOption={zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(MarkerModel);function hasXOrY(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function hasXAndY(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}function markerTypeCalculatorWithExtent(e,t,n,i,r,a){var o=[],s=isDimensionStacked(t,i)?t.getCalculationInfo("stackResultDimension"):i,l=numCalculate(t,s,e),u=t.indicesOfNearest(s,l)[0];o[r]=t.get(n,u),o[a]=t.get(s,u);var c=t.get(i,u),h=getPrecision(t.get(i,u));return(h=Math.min(h,20))>=0&&(o[a]=+o[a].toFixed(h)),[o,c]}ComponentModel.registerClass(MarkPointModel);var markerTypeCalculator={min:curry(markerTypeCalculatorWithExtent,"min"),max:curry(markerTypeCalculatorWithExtent,"max"),average:curry(markerTypeCalculatorWithExtent,"average"),median:curry(markerTypeCalculatorWithExtent,"median")};function dataTransform(e,t){var n=e.getData(),i=e.coordinateSystem;if(t&&!hasXAndY(t)&&!isArray(t.coord)&&i){var r=i.dimensions,a=getAxisInfo$1(t,n,i,e);if((t=clone(t)).type&&markerTypeCalculator[t.type]&&a.baseAxis&&a.valueAxis){var o=indexOf(r,a.baseAxis.dim),s=indexOf(r,a.valueAxis.dim),l=markerTypeCalculator[t.type](n,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],c=0;c<2;c++)markerTypeCalculator[u[c]]&&(u[c]=numCalculate(n,n.mapDimension(r[c]),u[c]));t.coord=u}}return t}function getAxisInfo$1(e,t,n,i){var r={};return null!=e.valueIndex||null!=e.valueDim?(r.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,r.valueAxis=n.getAxis(dataDimToCoordDim(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim),r.valueDataDim=t.mapDimension(r.valueAxis.dim)),r}function dataDimToCoordDim(e,t){var n=e.getData(),i=n.dimensions;t=n.getDimension(t);for(var r=0;r<i.length;r++){var a=n.getDimensionInfo(i[r]);if(a.name===t)return a.coordDim}}function dataFilter$1(e,t){return!(e&&e.containData&&t.coord&&!hasXOrY(t))||e.containData(t.coord)}function dimValueGetter(e,t,n,i){return i<2?e.coord&&e.coord[i]:e.value}function numCalculate(e,t,n){if("average"===n){var i=0,r=0;return e.each(t,(function(e,t){isNaN(e)||(i+=e,r++)})),i/r}return"median"===n?e.getMedian(t):e.getDataExtent(t)["max"===n?1:0]}var inner$j=makeInner(),MarkerView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(){this.markerGroupMap=createHashMap()},t.prototype.render=function(e,t,n){var i=this,r=this.markerGroupMap;r.each((function(e){inner$j(e).keep=!1})),t.eachSeries((function(e){var r=MarkerModel.getMarkerModelFromSeries(e,i.type);r&&i.renderSeries(e,r,t,n)})),r.each((function(e){!inner$j(e).keep&&i.group.remove(e.group)}))},t.prototype.markKeep=function(e){inner$j(e).keep=!0},t.prototype.blurSeries=function(e){var t=this;each(e,(function(e){var n=MarkerModel.getMarkerModelFromSeries(e,t.type);n&&n.getData().eachItemGraphicEl((function(e){e&&enterBlur(e)}))}))},t.type="marker",t}(ComponentView);function updateMarkerLayout(e,t,n){var i=t.coordinateSystem;e.each((function(r){var a,o=e.getItemModel(r),s=parsePercent$2(o.get("x"),n.getWidth()),l=parsePercent$2(o.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)a=t.getMarkerPosition(e.getValues(e.dimensions,r));else if(i){var u=e.get(i.dimensions[0],r),c=e.get(i.dimensions[1],r);a=i.dataToPoint([u,c])}}else a=[s,l];isNaN(s)||(a[0]=s),isNaN(l)||(a[1]=l),e.setItemLayout(r,a)}))}var MarkPointView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markPoint");t&&(updateMarkerLayout(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new SymbolDraw),u=createList$1(r,e,t);t.setData(u),updateMarkerLayout(t.getData(),e,i),u.each((function(e){var n=u.getItemModel(e),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),a=n.getShallow("symbolRotate");if(isFunction(i)||isFunction(r)||isFunction(a)){var s=t.getRawValue(e),l=t.getDataParams(e);isFunction(i)&&(i=i(s,l)),isFunction(r)&&(r=r(s,l)),isFunction(a)&&(a=a(s,l))}var c=n.getModel("itemStyle").getItemStyle(),h=getVisualFromData(o,"color");c.fill||(c.fill=h),u.setItemVisual(e,{symbol:i,symbolSize:r,symbolRotate:a,style:c})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){getECData(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(MarkerView);function createList$1(e,t,n){var i;i=e?map(e&&e.dimensions,(function(e){return defaults({name:e},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{})})):[{name:"value",type:"float"}];var r=new List(i,n),a=map(n.get("data"),curry(dataTransform,t));return e&&(a=filter(a,curry(dataFilter$1,e))),r.initData(a,null,e?dimValueGetter:function(e){return e.value}),r}ComponentView.registerClass(MarkPointView),registerPreprocessor((function(e){e.markPoint=e.markPoint||{}}));var MarkLineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markLine",t.defaultOption={zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],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}(MarkerModel);ComponentModel.registerClass(MarkLineModel);var inner$k=makeInner(),markLineTransform=function(e,t,n,i){var r,a=e.getData();if(isArray(i))r=i;else{var o=i.type;if("min"===o||"max"===o||"average"===o||"median"===o||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=t.getAxis(null!=i.yAxis?"y":"x"),l=retrieve(i.yAxis,i.xAxis);else{var u=getAxisInfo$1(i,a,t,e);s=u.valueAxis,l=numCalculate(a,getStackedDimension(a,u.valueDataDim),o)}var c="x"===s.dim?0:1,h=1-c,p=clone(i),d={coord:[]};p.type=null,p.coord=[],p.coord[h]=-1/0,d.coord[h]=1/0;var f=n.get("precision");f>=0&&"number"==typeof l&&(l=+l.toFixed(Math.min(f,20))),p.coord[c]=d.coord[c]=l,r=[p,d,{type:o,valueIndex:i.valueIndex,value:l}]}else r=[]}var g=[dataTransform(e,r[0]),dataTransform(e,r[1]),extend({},r[2])];return g[2].type=g[2].type||null,merge(g[2],g[0]),merge(g[2],g[1]),g};function isInifinity(e){return!isNaN(e)&&!isFinite(e)}function ifMarkLineHasOnlyDim(e,t,n,i){var r=1-e,a=i.dimensions[e];return isInifinity(t[r])&&isInifinity(n[r])&&t[e]===n[e]&&i.getAxis(a).containData(t[e])}function markLineFilter(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(ifMarkLineHasOnlyDim(1,n,i,e)||ifMarkLineHasOnlyDim(0,n,i,e)))return!0}return dataFilter$1(e,t[0])&&dataFilter$1(e,t[1])}function updateSingleMarkerEndLayout(e,t,n,i,r){var a,o=i.coordinateSystem,s=e.getItemModel(t),l=parsePercent$2(s.get("x"),r.getWidth()),u=parsePercent$2(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)a=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=o.dimensions,h=e.get(c[0],t),p=e.get(c[1],t);a=o.dataToPoint([h,p])}if(isCoordinateSystemType(o,"cartesian2d")){var d=o.getAxis("x"),f=o.getAxis("y");c=o.dimensions;isInifinity(e.get(c[0],t))?a[0]=d.toGlobalCoord(d.getExtent()[n?0:1]):isInifinity(e.get(c[1],t))&&(a[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];e.setItemLayout(t,a)}var MarkLineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),r=inner$k(t).from,a=inner$k(t).to;r.each((function(t){updateSingleMarkerEndLayout(r,t,!0,e,n),updateSingleMarkerEndLayout(a,t,!1,e,n)})),i.each((function(e){i.setItemLayout(e,[r.getItemLayout(e),a.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new LineDraw);this.group.add(l.group);var u=createList$2(r,e,t),c=u.from,h=u.to,p=u.line;inner$k(t).from=c,inner$k(t).to=h,t.setData(p);var d=t.get("symbol"),f=t.get("symbolSize");function g(t,n,r){var a=t.getItemModel(n);updateSingleMarkerEndLayout(t,n,r,e,i);var s=a.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=getVisualFromData(o,"color")),t.setItemVisual(n,{symbolRotate:a.get("symbolRotate"),symbolSize:a.get("symbolSize")||f[r?0:1],symbol:a.get("symbol",!0)||d[r?0:1],style:s})}isArray(d)||(d=[d,d]),isArray(f)||(f=[f,f]),u.from.each((function(e){g(c,e,!0),g(h,e,!1)})),p.each((function(e){var t=p.getItemModel(e).getModel("lineStyle").getLineStyle();p.setItemLayout(e,[c.getItemLayout(e),h.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),p.setItemVisual(e,{fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolRotate:h.getItemVisual(e,"symbolRotate"),toSymbolSize:h.getItemVisual(e,"symbolSize"),toSymbol:h.getItemVisual(e,"symbol"),style:t})})),l.updateData(p),u.line.eachItemGraphicEl((function(e,n){e.traverse((function(e){getECData(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(MarkerView);function createList$2(e,t,n){var i;i=e?map(e&&e.dimensions,(function(e){return defaults({name:e},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{})})):[{name:"value",type:"float"}];var r=new List(i,n),a=new List(i,n),o=new List([],n),s=map(n.get("data"),curry(markLineTransform,t,e,n));e&&(s=filter(s,curry(markLineFilter,e)));var l=e?dimValueGetter:function(e){return e.value};return r.initData(map(s,(function(e){return e[0]})),null,l),a.initData(map(s,(function(e){return e[1]})),null,l),o.initData(map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:r,to:a,line:o}}ComponentView.registerClass(MarkLineView),registerPreprocessor((function(e){e.markLine=e.markLine||{}}));var MarkAreaModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(MarkerModel);ComponentModel.registerClass(MarkAreaModel);var inner$l=makeInner(),markAreaTransform=function(e,t,n,i){var r=dataTransform(e,i[0]),a=dataTransform(e,i[1]),o=r.coord,s=a.coord;o[0]=retrieve(o[0],-1/0),o[1]=retrieve(o[1],-1/0),s[0]=retrieve(s[0],1/0),s[1]=retrieve(s[1],1/0);var l=mergeAll([{},r,a]);return l.coord=[r.coord,a.coord],l.x0=r.x,l.y0=r.y,l.x1=a.x,l.y1=a.y,l};function isInifinity$1(e){return!isNaN(e)&&!isFinite(e)}function ifMarkAreaHasOnlyDim(e,t,n,i){var r=1-e;return isInifinity$1(t[r])&&isInifinity$1(n[r])}function markAreaFilter(e,t){var n=t.coord[0],i=t.coord[1];return!!(isCoordinateSystemType(e,"cartesian2d")&&n&&i&&(ifMarkAreaHasOnlyDim(1,n,i)||ifMarkAreaHasOnlyDim(0,n,i)))||(dataFilter$1(e,{coord:n,x:t.x0,y:t.y0})||dataFilter$1(e,{coord:i,x:t.x1,y:t.y1}))}function getSingleMarkerEndPoint(e,t,n,i,r){var a,o=i.coordinateSystem,s=e.getItemModel(t),l=parsePercent$2(s.get(n[0]),r.getWidth()),u=parsePercent$2(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)a=i.getMarkerPosition(e.getValues(n,t));else{var c=[d=e.get(n[0],t),f=e.get(n[1],t)];o.clampData&&o.clampData(c,c),a=o.dataToPoint(c,!0)}if(isCoordinateSystemType(o,"cartesian2d")){var h=o.getAxis("x"),p=o.getAxis("y"),d=e.get(n[0],t),f=e.get(n[1],t);isInifinity$1(d)?a[0]=h.toGlobalCoord(h.getExtent()["x0"===n[0]?0:1]):isInifinity$1(f)&&(a[1]=p.toGlobalCoord(p.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];return a}var dimPermutations=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],MarkAreaView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each((function(t){var r=map(dimPermutations,(function(r){return getSingleMarkerEndPoint(i,t,r,e,n)}));i.setItemLayout(t,r),i.getItemGraphicEl(t).setShape("points",r)}))}}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new Group});this.group.add(l.group),this.markKeep(l);var u=createList$3(r,e,t);t.setData(u),u.each((function(t){var n=map(dimPermutations,(function(n){return getSingleMarkerEndPoint(u,t,n,e,i)})),a=!0;each(dimPermutations,(function(e){if(a){var n=u.get(e[0],t),i=u.get(e[1],t);(isInifinity$1(n)||r.getAxis("x").containData(n))&&(isInifinity$1(i)||r.getAxis("y").containData(i))&&(a=!1)}})),u.setItemLayout(t,{points:n,allClipped:a});var s=u.getItemModel(t).getModel("itemStyle").getItemStyle(),l=getVisualFromData(o,"color");s.fill||(s.fill=l,"string"==typeof s.fill&&(s.fill=modifyAlpha(s.fill,.4))),s.stroke||(s.stroke=l),u.setItemVisual(t,"style",s)})),u.diff(inner$l(l).data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new Polygon({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}})).update((function(e,n){var i=inner$l(l).data.getItemGraphicEl(n),r=u.getItemLayout(e);r.allClipped?i&&l.group.remove(i):(i?updateProps(i,{shape:{points:r.points}},t,e):i=new Polygon({shape:{points:r.points}}),u.setItemGraphicEl(e,i),l.group.add(i))})).remove((function(e){var t=inner$l(l).data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,n){var i=u.getItemModel(n),r=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),setLabelStyle(e,getLabelStatesModels(i),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:"string"==typeof r.fill?modifyAlpha(r.fill,1):"#000"}),setStatesStylesFromModel(e,i),enableHoverEmphasis(e),getECData(e).dataModel=t})),inner$l(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(MarkerView);function createList$3(e,t,n){var i,r;e?(i=map(e&&e.dimensions,(function(e){var n=t.getData();return defaults({name:e},n.getDimensionInfo(n.mapDimension(e))||{})})),r=new List(map(["x0","y0","x1","y1"],(function(e,t){return{name:e,type:i[t%2].type}})),n)):r=new List(i=[{name:"value",type:"float"}],n);var a=map(n.get("data"),curry(markAreaTransform,t,e,n));e&&(a=filter(a,curry(markAreaFilter,e)));var o=e?function(e,t,n,i){return e.coord[Math.floor(i/2)][i%2]}:function(e){return e.value};return r.initData(a,null,o),r.hasItemOption=!0,r}ComponentView.registerClass(MarkAreaView),registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var getDefaultSelectorOptions=function(e,t){return"all"===t?{type:"all",title:e.getLocale(["legend","selector","all"])}:"inverse"===t?{type:"inverse",title:e.getLocale(["legend","selector","inverse"])}:void 0},LegendModel=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 __extends(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"]),isArray(t)&&each(t,(function(e,i){isString(e)&&(e={type:e}),t[i]=merge(e,getDefaultSelectorOptions(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 i=e[n].get("name");if(this.isSelected(i)){this.select(i),t=!0;break}}!t&&this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries((function(i){var r,a=i.name;if(n.push(a),i.legendVisualProvider){var o=i.legendVisualProvider.getAllNames();e.isSeriesFiltered(i)||(n=n.concat(o)),o.length?t=t.concat(o):r=!0}else r=!0;r&&isNameSpecified(i)&&t.push(i.name)})),this._availableNames=n;var i=map(this.get("data")||t,(function(e){return"string"!=typeof e&&"number"!=typeof e||(e={name:e}),new Model(e,this,this.ecModel)}),this);this._data=i},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;"single"===this.get("selectedMode")&&each(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;each(e,(function(e){t[e.get("name",!0)]=!0}))},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;each(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])&&indexOf(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={zlevel:0,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,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},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}(ComponentModel);function legendSelectActionHandler(e,t,n){var i,r={},a="toggleSelected"===e;return n.eachComponent("legend",(function(n){a&&null!=i?n[i?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),i=n.isSelected(t.name)),each(n.getData(),(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var i=n.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&i:r[t]=i}}))})),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}ComponentModel.registerClass(LegendModel),registerAction("legendToggleSelect","legendselectchanged",curry(legendSelectActionHandler,"toggleSelected")),registerAction("legendAllSelect","legendselectall",curry(legendSelectActionHandler,"allSelect")),registerAction("legendInverseSelect","legendinverseselect",curry(legendSelectActionHandler,"inverseSelect")),registerAction("legendSelect","legendselected",curry(legendSelectActionHandler,"select")),registerAction("legendUnSelect","legendunselected",curry(legendSelectActionHandler,"unSelect"));var curry$1=curry,each$e=each,Group$2=Group,LegendView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return __extends(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new Group$2),this.group.add(this._selectorGroup=new Group$2),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 i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,n,o,a,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=getLayoutRect(l,u,c),p=this.layoutInner(e,r,h,i,o,s),d=getLayoutRect(defaults({width:p.width,height:p.height},l),u,c);this.group.x=d.x-p.x,this.group.y=d.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(p,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,i,r,a,o){var s=this.getContentGroup(),l=createHashMap(),u=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),each$e(t.getData(),(function(r,a){var o=r.get("name");if(!this.newlineDisabled&&(""===o||"\n"===o)){var h=new Group$2;return h.newline=!0,void s.add(h)}var p=n.getSeriesByName(o)[0];if(!l.get(o)){if(p){var d=p.getData(),f=d.getVisual("style"),g=f[d.getVisual("drawType")]||f.fill,m=f.stroke,y=f.decal,v=d.getVisual("legendSymbol")||"roundRect",_=d.getVisual("symbol");this._createItem(o,a,r,t,v,_,e,g,m,y,u).on("click",curry$1(dispatchSelectAction,o,null,i,c)).on("mouseover",curry$1(dispatchHighlightAction,p.name,null,i,c)).on("mouseout",curry$1(dispatchDownplayAction,p.name,null,i,c)),l.set(o,!0)}else n.eachRawSeries((function(n){if(!l.get(o)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(o))return;var h=s.indexOfName(o),p=s.getItemVisual(h,"style"),d=p.stroke,f=p.decal,g=p.fill,m=parse(p.fill);m&&0===m[3]&&(m[3]=.2,g=stringify(m,"rgba"));this._createItem(o,a,r,t,"roundRect",null,e,g,d,f,u).on("click",curry$1(dispatchSelectAction,null,o,i,c)).on("mouseover",curry$1(dispatchHighlightAction,null,o,i,c)).on("mouseout",curry$1(dispatchDownplayAction,null,o,i,c)),l.set(o,!0)}}),this);0}}),this),r&&this._createSelector(r,t,i,a,o)},t.prototype._createSelector=function(e,t,n,i,r){var a=this.getSelectorGroup();each$e(e,(function(e){var i=e.type,r=new ZRText({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});a.add(r),setLabelStyle(r,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),enableHoverEmphasis(r)}))},t.prototype._createItem=function(e,t,n,i,r,a,o,s,l,u,c){var h=i.get("itemWidth"),p=i.get("itemHeight"),d=i.get("inactiveColor"),f=i.get("inactiveBorderColor"),g=i.get("symbolKeepAspect"),m=i.getModel("itemStyle"),y=i.isSelected(e),v=new Group$2,_=n.getModel("textStyle"),x=n.get("icon"),S=n.getModel("tooltip"),b=S.parentModel,T=createSymbol(r=x||r,0,0,h,p,y?s:d,null==g||g);if(v.add(setSymbolStyle(T,r,m,l,f,u,y)),!x&&a&&(a!==r||"none"===a)){var M=.8*p;"none"===a&&(a="circle");var A=createSymbol(a,(h-M)/2,(p-M)/2,M,M,y?s:d,null==g||g);v.add(setSymbolStyle(A,a,m,l,f,u,y))}var I="left"===o?h+5:-5,C=o,w=i.get("formatter"),P=e;"string"==typeof w&&w?P=w.replace("{name}",null!=e?e:""):"function"==typeof w&&(P=w(e)),v.add(new ZRText({style:createTextStyle(_,{text:P,x:I,y:p/2,fill:y?_.getTextColor():d,align:C,verticalAlign:"middle"})}));var L=new Rect({shape:v.getBoundingRect(),invisible:!0});if(S.get("show")){var E={componentType:"legend",legendIndex:i.componentIndex,name:e,$vars:["name"]};L.tooltip=extend({content:e,formatter:b.get("formatter",!0)||function(e){return e.name},formatterParams:E},S.option)}return v.add(L),v.eachChild((function(e){e.silent=!0})),L.silent=!c,this.getContentGroup().add(v),enableHoverEmphasis(v),v.__legendDataIndex=t,v},t.prototype.layoutInner=function(e,t,n,i,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();box(e.get("orient"),o,e.get("itemGap"),n.width,n.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),o.markRedraw(),r){box("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],p=e.get("selectorButtonGap",!0),d=e.getOrient().index,f=0===d?"width":"height",g=0===d?"height":"width",m=0===d?"y":"x";"end"===a?h[d]+=l[f]+p:u[d]+=c[f]+p,h[1-d]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],o.x=u[0],o.y=u[1];var y={x:0,y:0};return y[f]=l[f]+p+c[f],y[g]=Math.max(l[g],c[g]),y[m]=Math.min(0,c[m]+h[1-d]),y}return o.x=u[0],o.y=u[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(ComponentView);function setSymbolStyle(e,t,n,i,r,a,o){var s;return"line"!==t&&t.indexOf("empty")<0?(s=n.getItemStyle(),e.style.stroke=i,e.style.decal=a,o||(s.stroke=r)):s=n.getItemStyle(["borderWidth","borderColor"]),e.setStyle(s),e}function dispatchSelectAction(e,t,n,i){dispatchDownplayAction(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),dispatchHighlightAction(e,t,n,i)}function isUseHoverLayer(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,r=n.length;i<r&&!(t=n[i].states.emphasis);)i++;return t&&t.hoverLayer}function dispatchHighlightAction(e,t,n,i){isUseHoverLayer(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:i})}function dispatchDownplayAction(e,t,n,i){isUseHoverLayer(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:i})}function legendFilter(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}))}ComponentView.registerClass(LegendView),registerProcessor(PRIORITY.PROCESSOR.SERIES_FILTER,legendFilter),ComponentModel.registerSubTypeDefaulter("legend",(function(){return"plain"}));var ScrollableLegendModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,i){var r=getLayoutParams(t);e.prototype.init.call(this,t,n,i),mergeAndNormalizeLayoutParams$1(this,t,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),mergeAndNormalizeLayoutParams$1(this,this.option,t)},t.type="legend.scroll",t.defaultOption=inheritDefaultOption(LegendModel.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}(LegendModel);function mergeAndNormalizeLayoutParams$1(e,t,n){var i=[1,1];i[e.getOrient().index]=0,mergeLayoutParam(t,n,{type:"box",ignoreSize:!!i})}ComponentModel.registerClass(ScrollableLegendModel);var Group$3=Group,WH$1=["width","height"],XY$1=["x","y"],ScrollableLegendView=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 __extends(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new Group$3),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Group$3)},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,i,r,a,o,s){var l=this;e.prototype.renderInner.call(this,t,n,i,r,a,o,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=isArray(c)?c:[c,c];d("pagePrev",0);var p=n.getModel("pageTextStyle");function d(e,t){var i=e+"DataIndex",a=createIcon(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:bind(l._pageGo,l,i,n,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});a.name=e,u.add(a)}u.add(new ZRText({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1)},t.prototype.layoutInner=function(e,t,n,i,r,a){var o=this.getSelectorGroup(),s=e.getOrient().index,l=WH$1[s],u=XY$1[s],c=WH$1[1-s],h=XY$1[1-s];r&&box("horizontal",o,e.get("selectorItemGap",!0));var p=e.get("selectorButtonGap",!0),d=o.getBoundingRect(),f=[-d.x,-d.y],g=clone(n);r&&(g[l]=n[l]-d[l]-p);var m=this._layoutContentAndController(e,i,g,s,l,c,h,u);if(r){if("end"===a)f[s]+=m[l]+p;else{var y=d[l]+p;f[s]-=y,m[u]-=y}m[l]+=d[l]+p,f[1-s]+=m[h]+m[c]/2-d[c]/2,m[c]=Math.max(m[c],d[c]),m[h]=Math.min(m[h],d[h]+f[1-s]),o.x=f[0],o.y=f[1],o.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,i,r,a,o,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;box(e.get("orient"),l,e.get("itemGap"),i?n.width:null,i?null:n.height),box("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),p=c.getBoundingRect(),d=this._showController=h[r]>n[r],f=[-h.x,-h.y];t||(f[i]=l[s]);var g=[0,0],m=[-p.x,-p.y],y=retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?m[i]+=n[r]-p[r]:g[i]+=p[r]+y);m[1-i]+=h[a]/2-p[a]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var v={x:0,y:0};if(v[r]=d?n[r]:h[r],v[a]=Math.max(h[a],p[a]),v[o]=Math.min(0,p[o]+m[1-i]),u.__rectSize=n[r],d){var _={x:0,y:0};_[r]=Math.max(n[r]-p[r]-y,0),_[a]=v[a],u.setClipPath(new Rect({shape:_})),u.__rectSize=_[r]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&updateProps(l,{x:x.contentPosition[0],y:x.contentPosition[1]},d?e:null),this._updatePageInfoView(e,x),v},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;each(["pagePrev","pageNext"],(function(i){var r=null!=t[i+"DataIndex"],a=n.childOfName(i);a&&(a.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")}));var i=n.childOfName("pageText"),r=e.get("pageFormatter"),a=t.pageIndex,o=null!=a?a+1:0,s=t.pageCount;i&&r&&i.setStyle("text",isString(r)?r.replace("{current}",null==o?"":o+"").replace("{total}",null==s?"":s+""):r({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=e.getOrient().index,a=WH$1[r],o=XY$1[r],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=c?1:0,p={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return p;var d=v(u);p.contentPosition[r]=-d.s;for(var f=s+1,g=d,m=d,y=null;f<=c;++f)(!(y=v(l[f]))&&m.e>g.s+i||y&&!_(y,g.s))&&(g=m.i>g.i?m:y)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=g.i),++p.pageCount),m=y;for(f=s-1,g=d,m=d,y=null;f>=-1;--f)(y=v(l[f]))&&_(m,y.s)||!(g.i<m.i)||(m=g,null==p.pagePrevDataIndex&&(p.pagePrevDataIndex=g.i),++p.pageCount,++p.pageIndex),g=y;return p;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(i,r){var a=i.__legendDataIndex;null==n&&null!=a&&(n=r),a===e&&(t=r)})),null!=t?t:n):0;var t,n},t.type="legend.scroll",t}(LegendView);ComponentView.registerClass(ScrollableLegendView),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)}))}));var SliderZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=inheritDefaultOption(DataZoomModel.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:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(DataZoomModel);ComponentModel.registerClass(SliderZoomModel);var Rect$2=Rect,DEFAULT_LOCATION_EDGE_GAP=7,DEFAULT_FRAME_BORDER_WIDTH=1,DEFAULT_FILLER_SIZE=30,DEFAULT_MOVE_HANDLE_SIZE=7,HORIZONTAL="horizontal",VERTICAL="vertical",LABEL_GAP=5,SHOW_DATA_SHADOW_SERIES_TYPE=["line","bar","candlestick","scatter"],REALTIME_ANIMATION_CONFIG={easing:"cubicOut",duration:100},SliderZoomView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return __extends(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=bind(this._onBrush,this),this._onBrushEnd=bind(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,r){if(e.prototype.render.apply(this,arguments),createOrUpdate(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.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(){clear(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 Group;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")?DEFAULT_MOVE_HANDLE_SIZE:0,i=this._findCoordRect(),r={width:t.getWidth(),height:t.getHeight()},a=this._orient===HORIZONTAL?{right:r.width-i.x-i.width,top:r.height-DEFAULT_FILLER_SIZE-DEFAULT_LOCATION_EDGE_GAP-n,width:i.width,height:DEFAULT_FILLER_SIZE}:{right:DEFAULT_LOCATION_EDGE_GAP,top:i.y,width:DEFAULT_FILLER_SIZE,height:i.height},o=getLayoutParams(e.option);each(["right","top","width","height"],(function(e){"ph"===o[e]&&(o[e]=a[e])}));var s=getLayoutRect(o,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===VERTICAL&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n!==HORIZONTAL||r?n===HORIZONTAL&&r?{scaleY:o?1:-1,scaleX:-1}:n!==VERTICAL||r?{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?1:-1,scaleX:1});var s=e.getBoundingRect([a]);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,i=e.get("brushSelect");n.add(new Rect$2({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var r=new Rect$2({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:bind(this._onClickPanel,this)}),a=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",a.on("mousemove",this._onBrush),a.on("mouseup",this._onBrushEnd)):(a.off("mousemove",this._onBrush),a.off("mouseup",this._onBrushEnd)),n.add(r)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=e.series,i=n.getRawData(),r=n.getShadowDim?n.getShadowDim():e.otherDim;if(null!=r){var a=i.getDataExtent(r),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],c=[[t[0],0],[0,0]],h=[],p=u[1]/(i.count()-1),d=0,f=Math.round(i.count()/t[0]);i.each([r],(function(e,t){if(f>0&&t%f)d+=p;else{var n=null==e||isNaN(e)||""===e,i=n?0:linearMap(e,a,l,!0);n&&!s&&t?(c.push([c[c.length-1][0],0]),h.push([h[h.length-1][0],0])):!n&&s&&(c.push([d,0]),h.push([d,0])),c.push([d,i]),h.push([d,i]),d+=p,s=n}}));for(var g=this.dataZoomModel,m=0;m<3;m++){var y=v(1===m);this._displayables.sliderGroup.add(y),this._displayables.dataShadowSegs.push(y)}}}function v(e){var t=g.getModel(e?"selectedDataBackground":"dataBackground"),n=new Group,i=new Polygon({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Polyline({shape:{points:h},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,i=this.ecModel;return e.eachTargetAxis((function(r,a){each(e.getAxisProxy(r,a).getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&indexOf(SHOW_DATA_SHADOW_SERIES_TYPE,e.get("type"))<0)){var o,s=i.getComponent(getAxisMainType(r),a).axis,l=getOtherDim(r),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:r,otherDim:l,otherAxisInverse:o}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],r=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,l=o.get("borderRadius")||0,u=o.get("brushSelect"),c=t.filler=new Rect$2({silent:u,style:{fill:o.get("fillerColor")},textConfig:{position:"inside"}});r.add(c),r.add(new Rect$2({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:l},style:{stroke:o.get("dataBackgroundColor")||o.get("borderColor"),lineWidth:DEFAULT_FRAME_BORDER_WIDTH,fill:"rgba(0,0,0,0)"}})),each([0,1],(function(t){var a=o.get("handleIcon");!symbolBuildProxies[a]&&a.indexOf("path://")<0&&(a="path://"+a);var s=createSymbol(a,-1,0,2,2,null,!0);s.attr({cursor:getCursor(this._orient),draggable:!0,drift:bind(this._onDragMove,this,t),ondragend:bind(this._onDragEnd,this),onmouseover:bind(this._showDataInfo,this,!0),onmouseout:bind(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=o.get("handleSize");this._handleHeight=parsePercent$2(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(o.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=o.getModel(["emphasis","handleStyle"]).getItemStyle(),enableHoverEmphasis(s);var c=o.get("handleColor");null!=c&&(s.style.fill=c),r.add(n[t]=s);var h=o.getModel("textStyle");e.add(i[t]=new ZRText({silent:!0,invisible:!0,style:{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()},z2:10}))}),this);var h=c;if(u){var p=parsePercent$2(o.get("moveHandleSize"),a[1]),d=t.moveHandle=new Rect({style:o.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:p}}),f=.8*p,g=t.moveHandleIcon=createSymbol(o.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=a[1]+p/2-.5,d.ensureState("emphasis").style=o.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(a[1]/2,Math.max(p,10));(h=t.moveZone=new Rect({invisible:!0,shape:{y:a[1]-m,height:p+m}})).on("mouseover",(function(){s.enterEmphasis(d)})).on("mouseout",(function(){s.leaveEmphasis(d)})),r.add(d),r.add(g),r.add(h)}h.attr({draggable:!0,cursor:getCursor(this._orient),drift:bind(this._onDragMove,this,"all"),ondragstart:bind(this._showDataInfo,this,!0),ondragend:bind(this._onDragEnd,this),onmouseover:bind(this._showDataInfo,this,!0),onmouseout:bind(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[linearMap(e[0],[0,100],t,!0),linearMap(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];sliderMove(t,i,r,n.get("zoomLock")?"all":e,null!=a.minSpan?linearMap(a.minSpan,o,r,!0):null,null!=a.maxSpan?linearMap(a.maxSpan,o,r,!0):null);var s=this._range,l=this._range=asc([linearMap(i[0],r,o,!0),linearMap(i[1],r,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=asc(n.slice()),r=this._size;each([0,1],(function(e){var i=t.handles[e],a=this._handleHeight;i.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:r[1]/2-a/2})}),this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var a={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;l<o.length;l++){var u=o[l],c=u.getClipPath();c||(c=new Rect,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:r[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,i=n.handleLabels,r=this._orient,a=["",""];if(t.get("showDetail")){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,l=this._range,u=e?o.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=asc(this._handleEnds.slice());function h(e){var t=getTransform(n.handles[e].parent,this.group),o=transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+LABEL_GAP,l=applyTransform$1([c[e]+(0===e?-s:s),this._size[1]/2],t);i[e].setStyle({x:l[0],y:l[1],verticalAlign:r===HORIZONTAL?"middle":o,align:r===HORIZONTAL?o:"center",text:a[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,i=n.get("labelFormatter"),r=n.get("labelPrecision");null!=r&&"auto"!==r||(r=t.getPixelPrecision());var a=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(r,20));return isFunction(i)?i(e,a):isString(i)?i.replace("{value}",a):a},t.prototype._showDataInfo=function(e){e=this._dragging||e;var t=this._displayables,n=t.handleLabels;n[0].attr("invisible",!e),n[1].attr("invisible",!e),t.moveHandle&&this.api[e?"enterEmphasis":"leaveEmphasis"](t.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,i){this._dragging=!0,stop(i.event);var r=applyTransform$1([t,n],this._displayables.sliderGroup.getLocalTransform(),!0),a=this._updateInterval(e,r[0]),o=this.dataZoomModel.get("realtime");this._updateView(!o),a&&o&&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 i=this._handleEnds,r=(i[0]+i[1])/2,a=this._updateInterval("all",n[0]-r);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Point(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 i=this._getViewExtent(),r=[0,100];this._range=asc([linearMap(n.x,i,r,!0),linearMap(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(stop(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new Rect$2({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),l=o.transformCoordToLocal(a.x,a.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.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?REALTIME_ANIMATION_CONFIG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=collectReferCoordSysModelInfo(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),r=this.api.getHeight();e={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return e},t.type="dataZoom.slider",t}(DataZoomView);function getOtherDim(e){return{x:"y",y:"x",radius:"angle",angle:"radius"}[e]}function getCursor(e){return"vertical"===e?"ns-resize":"ew-resize"}ComponentView.registerClass(SliderZoomView);var InsideZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.inside",t.defaultOption=inheritDefaultOption(DataZoomModel.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(DataZoomModel);ComponentModel.registerClass(InsideZoomModel);var inner$m=makeInner();function setViewInfoToCoordSysRecord(e,t,n){inner$m(e).coordSysRecordMap.each((function(e){var i=e.dataZoomInfoMap.get(t.uid);i&&(i.getRange=n)}))}function disposeCoordSysRecordIfNeeded(e,t){for(var n=inner$m(e).coordSysRecordMap,i=n.keys(),r=0;r<i.length;r++){var a=i[r],o=n.get(a),s=o.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||disposeCoordSysRecord(n,o))}}}function disposeCoordSysRecord(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function createCoordSysRecord(e,t){var n={model:t,containsPoint:curry(containsPoint,t),dispatchAction:curry(dispatchAction$1,e),dataZoomInfoMap:null,controller:null},i=n.controller=new RoamController(e.getZr());return each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(t){var i=[];n.dataZoomInfoMap.each((function(r){if(t.isAvailableBehavior(r.model.option)){var a=(r.getRange||{})[e],o=a&&a(r.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!r.model.get("disabled",!0)&&o&&i.push({dataZoomId:r.model.id,start:o[0],end:o[1]})}})),i.length&&n.dispatchAction(i)}))})),n}function dispatchAction$1(e,t){e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function containsPoint(e,t,n,i){return e.coordinateSystem.containPoint([n,i])}function mergeControllerParams(e){var t,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0;return e.each((function(e){var a=e.model,o=!a.get("disabled",!0)&&(!a.get("zoomLock",!0)||"move");i[n+o]>i[n+t]&&(t=o),r=r&&a.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}registerProcessor(PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=inner$m(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=createHashMap());i.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){each(collectReferCoordSysModelInfo(e).infoList,(function(n){var r=n.model.uid,a=i.get(r)||i.set(r,createCoordSysRecord(t,n.model));(a.dataZoomInfoMap||(a.dataZoomInfoMap=createHashMap())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),i.each((function(e){var t,n=e.controller,r=e.dataZoomInfoMap;if(r){var a=r.keys()[0];null!=a&&(t=r.get(a))}if(t){var o=mergeControllerParams(r);n.enable(o.controlType,o.opt),n.setPointerChecker(e.containsPoint),createOrUpdate(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else disposeCoordSysRecord(i,e)}))}));var InsideZoomView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return __extends(t,e),t.prototype.render=function(t,n,i){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),setViewInfoToCoordSysRecord(i,t,{pan:bind(getRangeHandlers.pan,this),zoom:bind(getRangeHandlers.zoom,this),scrollMove:bind(getRangeHandlers.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){disposeCoordSysRecordIfNeeded(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(DataZoomView),getRangeHandlers={zoom:function(e,t,n,i){var r=this.range,a=r.slice(),o=e.axisModels[0];if(o){var s=getDirectionInfo[t](null,[i.originX,i.originY],o,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return sliderMove(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:makeMover((function(e,t,n,i,r,a){var o=getDirectionInfo[i]([a.oldX,a.oldY],[a.newX,a.newY],t,r,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:makeMover((function(e,t,n,i,r,a){return getDirectionInfo[i]([0,0],[a.scrollDelta,a.scrollDelta],t,r,n).signal*(e[1]-e[0])*a.scrollDelta}))};function makeMover(e){return function(t,n,i,r){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s)return sliderMove(e(o,s,t,n,i,r),o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}var getDirectionInfo={grid:function(e,t,n,i,r){var a=n.axis,o={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===a.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,i,r){var a=n.axis,o={},s=r.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?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,i,r){var a=n.axis,o=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===a.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};ComponentView.registerClass(InsideZoomView);var each$f=each;function visualMapPreprocessor(e){var t=e&&e.visualMap;isArray(t)||(t=t?[t]:[]),each$f(t,(function(e){if(e){has$1(e,"splitList")&&!has$1(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&isArray(t)&&each$f(t,(function(e){isObject(e)&&(has$1(e,"start")&&!has$1(e,"min")&&(e.min=e.start),has$1(e,"end")&&!has$1(e,"max")&&(e.max=e.end))}))}}))}function has$1(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}ComponentModel.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var VISUAL_PRIORITY=PRIORITY.VISUAL.COMPONENT;function getColorVisual(e,t,n,i){for(var r=t.targetVisuals[i],a=VisualMapping.prepareVisualTypes(r),o={color:getVisualFromData(e.getData(),"color")},s=0,l=a.length;s<l;s++){var u=a[s],c=r["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,p)}return o.color;function h(e){return o[e]}function p(e,t){o[e]=t}}registerVisual(VISUAL_PRIORITY,{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",(function(t){var i=e.pipelineContext;!t.isTargetSeries(e)||i&&i.large||n.push(incrementalApplyVisual(t.stateList,t.targetVisuals,bind(t.getValueState,t),t.getDataDimension(e.getData())))})),n}}),registerVisual(VISUAL_PRIORITY,{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),i=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var r=t.getVisualMeta(bind(getColorVisual,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimension(n),o=n.getDimensionInfo(a);null!=o&&(r.dimension=o.index,i.push(r))}})),e.getData().setVisual("visualMeta",i)}});var visualDefault={get:function(e,t,n){var i=clone((defaultOption$2[e]||{})[t]);return n&&isArray(i)?i[i.length-1]:i}},defaultOption$2={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]}},mapVisual$1=VisualMapping.mapVisual,eachVisual=VisualMapping.eachVisual,isArray$1=isArray,each$g=each,asc$2=asc,linearMap$1=linearMap,VisualMapModel=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 __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;env.canvasSupported||(n.realtime=!1),!t&&replaceVisualOption(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=bind(e,this),this.controllerVisuals=createVisualMappings(this.option.controller,t,e),this.targetVisuals=createVisualMappings(this.option.target,t,e)},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=normalizeToArray(e),t},t.prototype.eachTargetSeries=function(e,t){each(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&e.call(t,i)}),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 i,r=this.option,a=r.precision,o=this.dataBound,s=r.formatter;n=n||["<",">"],isArray(e)&&(e=e.slice(),i=!0);var l=t?e:i?[u(e[0]),u(e[1])]:u(e);return isString(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):isFunction(s)?i?s(e[0],e[1]):s(e):i?e[0]===o[0]?n[0]+" "+l[1]:e[1]===o[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(e){return e===o[0]?"min":e===o[1]?"max":(+e).toFixed(Math.min(a,20))}},t.prototype.resetExtent=function(){var e=this.option,t=asc$2([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimension=function(e){var t=this.option.dimension,n=e.dimensions;if(null!=t||n.length){if(null!=t)return e.getDimension(t);for(var i=e.dimensions,r=i.length-1;r>=0;r--){var a=i[r];if(!e.getDimensionInfo(a).isCalculationCoord)return a}}},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},i=t.target||(t.target={}),r=t.controller||(t.controller={});merge(i,n),merge(r,n);var a=this.isCategory();function o(n){isArray$1(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}o.call(this,i),o.call(this,r),function(e,t,n){var i=e[t],r=e[n];i&&!r&&(r=e[n]={},each$g(i,(function(e,t){if(VisualMapping.isValidType(t)){var n=visualDefault.get(t,"inactive",a);null!=n&&(r[t]=n,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor");each$g(this.stateList,(function(r){var o=this.itemSize,s=e[r];s||(s=e[r]={color:a?i:[i]}),null==s.symbol&&(s.symbol=t&&clone(t)||(a?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&clone(n)||(a?o[0]:[o[0],o[0]])),s.symbol=mapVisual$1(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;eachVisual(l,(function(e){e>u&&(u=e)})),s.symbolSize=mapVisual$1(l,(function(e){return linearMap$1(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,r)},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,zlevel: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}(ComponentModel),DEFAULT_BAR_BOUND=[20,140],ContinuousModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(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]=DEFAULT_BAR_BOUND[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=DEFAULT_BAR_BOUND[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):isArray(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),each(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=asc((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 i=[],r=n.getData();r.each(this.getDataDimension(r),(function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)}),this),t.push({seriesId:n.id,dataIndex:i})}),this),t},t.prototype.getVisualMeta=function(e){var t=getColorStopValues(this,"outOfRange",this.getExtent()),n=getColorStopValues(this,"inRange",this.option.range.slice()),i=[];function r(t,n){i.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,l=t.length;o<l&&(!n.length||t[o]<=n[0]);o++)t[o]<n[a]&&r(t[o],"outOfRange");for(var u=1;a<s;a++,u=0)u&&i.length&&r(n[a],"outOfRange"),r(n[a],"inRange");for(u=1;o<l;o++)(!n.length||n[n.length-1]<t[o])&&(u&&(i.length&&r(i[i.length-1].value,"outOfRange"),u=0),r(t[o],"outOfRange"));var c=i.length;return{stops:i,outerColors:[c?i[0].color:"transparent",c?i[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=inheritDefaultOption(VisualMapModel.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}(VisualMapModel);function getColorStopValues(e,t,n){if(n[0]===n[1])return n.slice();for(var i=(n[1]-n[0])/200,r=n[0],a=[],o=0;o<=200&&r<n[1];o++)a.push(r),r+=i;return a.push(n[1]),a}ComponentModel.registerClass(ContinuousModel);var VisualMapView=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 __extends(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,i){this.visualMapModel=e,!1!==e.get("show")?this.doRender(e,t,n,i):this.group.removeAll()},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=normalizeCssArray$1(t.get("padding")||0),i=e.getBoundingRect();e.add(new Rect({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.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 i=(n=n||{}).forceState,r=this.visualMapModel,a={};if("symbol"===t&&(a.symbol=r.get("itemSymbol")),"color"===t){var o=r.get("contentColor");a.color=o}function s(e){return a[e]}function l(e,t){a[e]=t}var u=r.controllerVisuals[i||r.getValueState(e)];return each(VisualMapping.prepareVisualTypes(u),(function(i){var r=u[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",r=u.__alphaForOpacity),VisualMapping.dependsOn(i,t)&&r&&r.applyVisual(e,s,l)})),a[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;positionElement(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,i){},t.type="visualMap",t}(ComponentView);ComponentView.registerClass(VisualMapView);var paramsSet=[["left","right","width"],["top","bottom","height"]];function getItemAlign(e,t,n){var i=e.option,r=i.align;if(null!=r&&"auto"!==r)return r;for(var a={width:t.getWidth(),height:t.getHeight()},o="horizontal"===i.orient?1:0,s=paramsSet[o],l=[0,null,10],u={},c=0;c<3;c++)u[paramsSet[1-o][c]]=l[c],u[s[c]]=2===c?n[0]:i[s[c]];var h=[["x","width",3],["y","height",0]][o],p=getLayoutRect(u,a,i.padding);return s[(p.margin[h[2]]||0)+p[h[0]]+.5*p[h[1]]<.5*a[h[1]]?0:1]}function makeHighDownBatch(e,t){return each(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}var linearMap$2=linearMap,each$h=each,mathMin$a=Math.min,mathMax$a=Math.max,HOVER_LINK_SIZE=12,HOVER_LINK_OUT=6,ContinuousView=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 __extends(t,e),t.prototype.doRender=function(e,t,n,i){this._api=n,i&&"selectDataRange"===i.type&&i.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 i=t[1-n];i=null!=i?i+"":"";var r=this.visualMapModel,a=r.get("textGap"),o=r.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([o[0]/2,0===n?-a:o[1]+a],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new ZRText({style:{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:i,font:h.getFont(),fill:h.getTextColor()}}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,i=t.itemSize,r=this._orient,a=this._useHandle,o=getItemAlign(t,this.api,i),s=n.mainGroup=this._createBarGroup(o),l=new Group;s.add(l),l.add(n.outOfRange=createPolygon()),l.add(n.inRange=createPolygon(null,a?getCursor$1(this._orient):null,bind(this._dragHandle,this,"all",!1),bind(this._dragHandle,this,"all",!0))),l.setClipPath(new Rect({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=mathMax$a(u.width,u.height);a&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,i,c,r),this._createHandle(t,s,1,i,c,r)),this._createIndicator(t,s,i,c,r),e.add(s)},t.prototype._createHandle=function(e,t,n,i,r,a){var o=bind(this._dragHandle,this,n,!1),s=bind(this._dragHandle,this,n,!0),l=parsePercent(e.get("handleSize"),i[0]),u=createSymbol(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=getCursor$1(this._orient);u.attr({cursor:c,draggable:!0,drift:o,ondragend:s,onmousemove:function(e){stop(e.event)}}),u.x=i[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(),setAsHighDownDispatcher(u,!0),t.add(u);var h=this.visualMapModel.textStyleModel,p=new ZRText({cursor:c,draggable:!0,drift:o,onmousemove:function(e){stop(e.event)},ondragend:s,style:{x:0,y:0,text:"",font:h.getFont(),fill:h.getTextColor()}});p.ensureState("blur").style={opacity:.1},p.stateTransition={duration:200},this.group.add(p);var d=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=d,f.handleLabels[n]=p},t.prototype._createIndicator=function(e,t,n,i,r){var a=parsePercent(e.get("indicatorSize"),n[0]),o=createSymbol(e.get("indicatorIcon"),-a/2,-a/2,a,a,null,!0);o.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(o instanceof ZRImage){var l=o.style;o.useStyle(extend({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else o.useStyle(s);t.add(o);var u=this.visualMapModel.textStyleModel,c=new ZRText({silent:!0,invisible:!0,style:{x:0,y:0,text:"",font:u.getFont(),fill:u.getTextColor()}});this.group.add(c);var h=[("horizontal"===r?i/2:HOVER_LINK_OUT)+n[0]/2,0],p=this._shapes;p.indicator=o,p.indicatorLabel=c,p.indicatorLabelPoint=h,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,i){if(this._useHandle){if(this._dragging=!t,!t){var r=this._applyTransform([n,i],this._shapes.mainGroup,!0);this._updateInterval(e,r[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():useHoverLinkOnHandle(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),i=[0,e.itemSize[1]];this._handleEnds=[linearMap$2(t[0],n,i,!0),linearMap$2(t[1],n,i,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,i=this._handleEnds,r=[0,n.itemSize[1]];sliderMove(t,i,r,e,0);var a=n.getExtent();this._dataInterval=[linearMap$2(i[0],r,a,!0),linearMap$2(i[1],r,a,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),i=this._shapes,r=[0,t.itemSize[1]],a=e?r:this._handleEnds,o=this._createBarVisual(this._dataInterval,n,a,"inRange"),s=this._createBarVisual(n,n,r,"outOfRange");i.inRange.setStyle({fill:o.barColor}).setShape("points",o.barPoints),i.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(a,o)},t.prototype._createBarVisual=function(e,t,n,i){var r={forceState:i,convertOpacityToAlpha:!0},a=this._makeColorGradient(e,r),o=[this.getControllerVisual(e[0],"symbolSize",r),this.getControllerVisual(e[1],"symbolSize",r)],s=this._createBarPoints(n,o);return{barColor:new LinearGradient(0,0,0,1,a),barPoints:s,handlesColor:[a[0].color,a[a.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],i=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var r=1;r<100;r++){var a=e[0]+i*r;if(a>e[1])break;n.push({color:this.getControllerVisual(a,"color",t),offset:r/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 Group("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,i=this.visualMapModel,r=n.handleThumbs,a=n.handleLabels,o=i.itemSize,s=i.getExtent();each$h([0,1],(function(l){var u=r[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=linearMap$2(e[l],[0,o[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/o[0],u.x=o[0]-h/2;var p=applyTransform$1(n.handleLabelPoints[l],getTransform(u,this.group));a[l].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,i){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,s=[0,o[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"),p=linearMap$2(e,a,s,!0),d=o[0]-h/2,f={x:u.x,y:u.y};u.y=p,u.x=d;var g=applyTransform$1(l.indicatorLabelPoint,getTransform(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;m.setStyle({text:(n||"")+r.formatValueText(t),verticalAlign:v?y:"middle",align:v?"center":y});var _={x:d,y:p,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var S={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,S),m.animateTo(x,S)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var T=0;T<b.length;T++)this._api.enterBlur(b[T])}},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,i=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);i[1]=mathMin$a(mathMax$a(0,i[1]),n[1]),e._doHoverLinkToSeries(i[1],0<=i[0]&&i[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,i=n.itemSize;if(n.option.hoverLink){var r=[0,i[1]],a=n.getExtent();e=mathMin$a(mathMax$a(r[0],e),r[1]);var o=getHalfHoverLinkSize(n,a,r),s=[e-o,e+o],l=linearMap$2(e,r,a,!0),u=[linearMap$2(s[0],r,a,!0),linearMap$2(s[1],r,a,!0)];s[0]<r[0]&&(u[0]=-1/0),s[1]>r[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var c=this._hoverLinkDataIndices,h=[];(t||useHoverLinkOnHandle(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var p=compressBatches(c,h);this._dispatchHighDown("downplay",makeHighDownBatch(p[0],n)),this._dispatchHighDown("highlight",makeHighDownBatch(p[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t=e.target,n=this.visualMapModel;if(t&&null!=getECData(t).dataIndex){var i=getECData(t),r=this.ecModel.getSeriesByIndex(i.seriesIndex);if(n.isTargetSeries(r)){var a=r.getData(i.dataType),o=a.get(n.getDataDimension(a),i.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",makeHighDownBatch(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,i){var r=getTransform(t,i?null:this.group);return isArray(e)?applyTransform$1(e,r,n):transformDirection(e,r,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.prototype.remove=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(VisualMapView);function createPolygon(e,t,n,i){return new Polygon({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){stop(e.event)},ondragend:i})}function getHalfHoverLinkSize(e,t,n){var i=HOVER_LINK_SIZE/2,r=e.get("hoverLinkDataSize");return r&&(i=linearMap$2(r,t,n,!0)/2),i}function useHoverLinkOnHandle(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function getCursor$1(e){return"vertical"===e?"ns-resize":"ew-resize"}ComponentView.registerClass(ContinuousView);var actionInfo$2={type:"selectDataRange",event:"dataRangeSelected",update:"update"};registerAction(actionInfo$2,(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),registerPreprocessor(visualMapPreprocessor);var PiecewiseModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return __extends(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],resetMethods[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var r=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=clone(r)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=map(this._pieceList,(function(e){return e=clone(e),"inRange"!==t&&(e.visual=null),e})))}))},t.prototype.completeVisualOption=function(){var t=this.option,n={},i=VisualMapping.listVisualTypes(),r=this.isCategory();function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}each(t.pieces,(function(e){each(i,(function(t){e.hasOwnProperty(t)&&(n[t]=1)}))})),each(n,(function(e,n){var i=!1;each(this.stateList,(function(e){i=i||a(t,e,n)||a(t.target,e,n)}),this),!i&&each(this.stateList,(function(e){(t[e]||(t[e]={}))[n]=visualDefault.get(n,"inRange"===e?"active":"inactive",r)}))}),this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,i=this._pieceList,r=(t?n:e).selected||{};if(n.selected=r,each(i,(function(e,t){var n=this.getSelectedMapKey(e);r.hasOwnProperty(n)||(r[n]=!0)}),this),"single"===n.selectedMode){var a=!1;each(i,(function(e,t){var n=this.getSelectedMapKey(e);r[n]&&(a?r[n]=!1:a=!0)}),this)}},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=clone(e)},t.prototype.getValueState=function(e){var t=VisualMapping.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(i){var r=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){VisualMapping.findPieceIndex(t,n)===e&&r.push(i)}),this),t.push({seriesId:i.id,dataIndex:r})}),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=["",""],i=this,r=this._pieceList.slice();if(r.length){var a=r[0].interval[0];a!==-1/0&&r.unshift({interval:[-1/0,a]}),(a=r[r.length-1].interval[1])!==1/0&&r.push({interval:[a,1/0]})}else r.push({interval:[-1/0,1/0]});var o=-1/0;return each(r,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:n}}function s(r,a){var o=i.getRepresentValue({interval:r});a||(a=i.getValueState(o));var s=e(o,a);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=inheritDefaultOption(VisualMapModel.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}(VisualMapModel),resetMethods={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),r=t.splitNumber;r=Math.max(parseInt(r,10),1),t.splitNumber=r;for(var a=(i[1]-i[0])/r;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o<r;s+=a,o++){var l=o===r-1?i[1]:s+a;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[i[1],1/0],close:[0,0]}),reformIntervals(e),each(e,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(e){var t=this.option;each(t.categories,(function(t){e.push({text:this.formatValueText(t,!0),value:t})}),this),normalizeReverse(t,e)},pieces:function(e){var t=this.option;each(t.pieces,(function(t,n){isObject(t)||(t={value:t});var i={text:"",index:n};if(null!=t.label&&(i.text=t.label),t.hasOwnProperty("value")){var r=i.value=t.value;i.interval=[r,r],i.close=[1,1]}else{for(var a=i.interval=[],o=i.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],p=0;p<3&&null==a[c];p++)a[c]=t[h[p]],o[c]=s[p],u[c]=2===p;null==a[c]&&(a[c]=l[c])}u[0]&&a[1]===1/0&&(o[0]=0),u[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(i.value=a[0])}i.visual=VisualMapping.retrieveVisuals(t),e.push(i)}),this),normalizeReverse(t,e),reformIntervals(e),each(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 normalizeReverse(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}ComponentModel.registerClass(PiecewiseModel);var PiecewiseVisualMapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,r=i.getFont(),a=i.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,o),each(l.viewPieceList,(function(i){var l=i.piece,u=new Group;u.onclick=bind(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var p=this.visualMapModel.getValueState(h);u.add(new ZRText({style:{x:"right"===o?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:o,font:r,fill:a,opacity:"outOfRange"===p?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,c,o),box(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 i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:makeHighDownBatch(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return getItemAlign(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,r){if(t){var a=new Group,o=this.visualMapModel.textStyleModel;a.add(new ZRText({style:{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:t,font:o.getFont(),fill:o.getTextColor()}})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),i=e.get("orient"),r=e.get("inverse");return("horizontal"===i?r:!r)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(createSymbol(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=clone(n.selected),r=t.getSelectedMapKey(e);"single"===n.selectedMode?(i[r]=!0,each(i,(function(e,t){i[t]=t===r}))):i[r]=!i[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})},t.type="visualMap.piecewise",t}(VisualMapView);ComponentView.registerClass(PiecewiseVisualMapView),registerPreprocessor(visualMapPreprocessor);var DEFAULT_OPTION={label:{enabled:!0},decal:{show:!1}},inner$n=makeInner(),decalPaletteScope={};function ariaVisual(e,t){var n=e.getModel("aria");if(n.get("enabled")){var i=clone(DEFAULT_OPTION);merge(i.label,e.getLocaleModel().get("aria"),!1),merge(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var t=createHashMap();e.eachSeries((function(e){if(e.useColorPaletteOnData){var n=t.get(e.type);n||(n={},t.set(e.type,n)),inner$n(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if("function"!=typeof t.enableAriaDecal){var n=t.getData();if(t.useColorPaletteOnData){var i=t.getRawData(),r={},a=inner$n(t).scope;n.each((function(e){var t=n.getRawIndex(e);r[t]=e}));var o=i.count();i.each((function(e){var s=r[e],l=i.getName(e)||e+"",c=getDecalFromPalette(t.ecModel,l,a,o),h=n.getItemVisual(s,"decal");n.setItemVisual(s,"decal",u(h,c))}))}else{var s=getDecalFromPalette(t.ecModel,t.name,decalPaletteScope,e.getSeriesCount()),l=n.getVisual("decal");n.setVisual("decal",u(l,s))}}else t.enableAriaDecal();function u(e,t){var n=e?extend(extend({},t),e):t;return n.dirty=!0,n}}))}}(),function(){var i=e.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=defaults(a.option,i),!a.get("enabled"))return;var o=t.getZr().dom;if(a.get("description"))return void o.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 p=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();if(p){var d=a.get(["general","withTitle"]);s=r(d,{title:p})}else s=a.get(["general","withoutTitle"]);var f=[],g=l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]);s+=r(g,{seriesCount:l}),e.eachSeries((function(t,n){if(n<h){var i=void 0,o=t.get("name")?"withName":"withoutName";i=r(i=l>1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(_=t.subType,e.getLocaleModel().get(["series","typeNames"])[_]||"自定义图")});var s=t.getData();if(s.count()>u)i+=r(a.get(["data","partialData"]),{displayCnt:u});else i+=a.get(["data","allData"]);for(var c=[],p=0;p<s.count();p++)if(p<u){var d=s.getName(p),g=retrieveRawValue(s,p),m=a.get(["data",d?"withName":"withoutName"]);c.push(r(m,{name:d,value:g}))}var y=a.get(["data","separator","middle"]),v=a.get(["data","separator","end"]);i+=c.join(y)+v,f.push(i)}var _}));var m=a.getModel(["series","multiple","separator"]),y=m.get("middle"),v=m.get("end");s+=f.join(y)+v,o.setAttribute("aria-label",s)}()}function r(e,t){if("string"!=typeof e)return e;var n=e;return each(t,(function(e,t){n=n.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),n}}function ariaPreprocessor(e){if(e&&e.aria){var t=e.aria;null!=t.show&&(t.enabled=t.show),t.label=t.label||{},each(["description","general","series","data"],(function(e){null!=t[e]&&(t.label[e]=t[e])}))}}var PRIORITY_VISUAL_ARIA$1=PRIORITY.VISUAL.ARIA;function createElement(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}registerPreprocessor(ariaPreprocessor),registerVisual(PRIORITY_VISUAL_ARIA$1,ariaVisual);var NONE="none",mathRound=Math.round,mathSin$4=Math.sin,mathCos$4=Math.cos,PI$a=Math.PI,PI2$a=2*Math.PI,degree=180/PI$a,EPSILON$4=1e-4;function round3(e){return mathRound(1e3*e)/1e3}function round4(e){return mathRound(1e4*e)/1e4}function isAroundZero$1(e){return e<EPSILON$4&&e>-EPSILON$4}function pathHasFill(e){var t=e.fill;return null!=t&&t!==NONE}function pathHasStroke(e){var t=e.stroke;return null!=t&&t!==NONE}function setTransform(e,t){t&&attr(e,"transform","matrix("+round3(t[0])+","+round3(t[1])+","+round3(t[2])+","+round3(t[3])+","+round4(t[4])+","+round4(t[5])+")")}function attr(e,t,n){(!n||"linear"!==n.type&&"radial"!==n.type)&&e.setAttribute(t,n)}function attrXLink(e,t,n){e.setAttributeNS("http://www.w3.org/1999/xlink",t,n)}function attrXML(e,t,n){e.setAttributeNS("http://www.w3.org/XML/1998/namespace",t,n)}function bindStyle(e,t,n){var i=null==t.opacity?1:t.opacity;if(pathHasFill(t)){var r=t.fill;attr(e,"fill",r="transparent"===r?NONE:r),attr(e,"fill-opacity",(null!=t.fillOpacity?t.fillOpacity*i:i)+"")}else attr(e,"fill",NONE);if(pathHasStroke(t)){var a=t.stroke;attr(e,"stroke",a="transparent"===a?NONE:a);var o=t.lineWidth,s=t.strokeNoScale?n.getLineScale():1;attr(e,"stroke-width",(s?o/s:0)+""),attr(e,"paint-order",t.strokeFirst?"stroke":"fill"),attr(e,"stroke-opacity",(null!=t.strokeOpacity?t.strokeOpacity*i:i)+"");var l=t.lineDash&&o>0&&normalizeLineDash(t.lineDash,o);if(l){var u=t.lineDashOffset;s&&1!==s&&(l=map(l,(function(e){return e/s})),u&&(u=mathRound(u/=s))),attr(e,"stroke-dasharray",l.join(",")),attr(e,"stroke-dashoffset",(u||0)+"")}else attr(e,"stroke-dasharray","");t.lineCap&&attr(e,"stroke-linecap",t.lineCap),t.lineJoin&&attr(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&attr(e,"stroke-miterlimit",t.miterLimit+"")}else attr(e,"stroke",NONE)}var SVGPathRebuilder=function(){function e(){}return e.prototype.reset=function(){this._d=[],this._str=""},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,i,r,a){this._add("C",e,t,n,i,r,a)},e.prototype.quadraticCurveTo=function(e,t,n,i){this._add("Q",e,t,n,i)},e.prototype.arc=function(e,t,n,i,r,a){this.ellipse(e,t,n,n,0,i,r,a)},e.prototype.ellipse=function(e,t,n,i,r,a,o,s){var l=0===this._d.length,u=o-a,c=!s,h=Math.abs(u),p=isAroundZero$1(h-PI2$a)||(c?u>=PI2$a:-u>=PI2$a),d=u>0?u%PI2$a:u%PI2$a+PI2$a,f=!1;f=!!p||!isAroundZero$1(h)&&d>=PI$a==!!c;var g=round4(e+n*mathCos$4(a)),m=round4(t+i*mathSin$4(a));p&&(u=c?PI2$a-1e-4:1e-4-PI2$a,f=!0,l&&this._d.push("M",g,m));var y=round4(e+n*mathCos$4(a+u)),v=round4(t+i*mathSin$4(a+u));if(isNaN(g)||isNaN(m)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(degree)||isNaN(y)||isNaN(v))return"";this._d.push("A",round4(n),round4(i),mathRound(r*degree),+f,+c,y,v)},e.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("L",e+n,t),this._add("L",e+n,t+i),this._add("L",e,t+i),this._add("L",e,t)},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,i,r,a,o,s,l){this._d.push(e);for(var u=1;u<arguments.length;u++){var c=arguments[u];if(isNaN(c))return void(this._invalid=!0);this._d.push(round4(c))}},e.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(" "),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),svgPath={brush:function(e){var t=e.style,n=e.__svgEl;n||(n=createElement("path"),e.__svgEl=n),e.path||e.createPathProxy();var i=e.path;e.shapeChanged()&&(i.beginPath(),e.buildPath(i,e.shape),e.pathUpdated());var r=i.getVersion(),a=e,o=a.__svgPathBuilder;(a.__svgPathVersion!==r||!o||e.style.strokePercent<1)&&(o||(o=a.__svgPathBuilder=new SVGPathRebuilder),o.reset(),i.rebuildPath(o,e.style.strokePercent),o.generateStr(),a.__svgPathVersion=r),attr(n,"d",o.getStr()),bindStyle(n,t,e),setTransform(n,e.transform)}},svgImage={brush:function(e){var t=e.style,n=t.image;n instanceof HTMLImageElement&&(n=n.src);if(n){var i=t.x||0,r=t.y||0,a=t.width,o=t.height,s=e.__svgEl;s||(s=createElement("image"),e.__svgEl=s),n!==e.__imageSrc&&(attrXLink(s,"href",n),e.__imageSrc=n),attr(s,"width",a+""),attr(s,"height",o+""),attr(s,"x",i+""),attr(s,"y",r+""),setTransform(s,e.transform)}}},TEXT_ALIGN_TO_ANCHOR={left:"start",right:"end",center:"middle",middle:"middle"};function adjustTextY$1(e,t,n){return"top"===n?e+=t/2:"bottom"===n&&(e-=t/2),e}var svgText={brush:function(e){var t=e.style,n=t.text;if(null!=n&&(n+=""),n&&!isNaN(t.x)&&!isNaN(t.y)){var i=e.__svgEl;i||(attrXML(i=createElement("text"),"xml:space","preserve"),e.__svgEl=i);var r=t.font||DEFAULT_FONT;i.style.font=r,i.textContent=n,bindStyle(i,t,e),setTransform(i,e.transform);var a=t.x||0,o=adjustTextY$1(t.y||0,getLineHeight(r),t.textBaseline),s=TEXT_ALIGN_TO_ANCHOR[t.textAlign]||t.textAlign;attr(i,"dominant-baseline","central"),attr(i,"text-anchor",s),attr(i,"x",a+""),attr(i,"y",o+"")}}};function diff(e,t,n){n||(n=function(e,t){return e===t}),e=e.slice();var i=(t=t.slice()).length,r=e.length,a=1,o=i+r,s=[{newPos:-1,components:[]}],l=extractCommon(s[0],t,e,0,n);if(s[0].newPos+1>=i&&l+1>=r){for(var u=[],c=0;c<t.length;c++)u.push(c);return[{indices:u,count:t.length,added:!1,removed:!1}]}function h(){for(var o=-1*a;o<=a;o+=2){var l,u=s[o-1],c=s[o+1],h=(c?c.newPos:0)-o;u&&(s[o-1]=void 0);var p=u&&u.newPos+1<i,d=c&&0<=h&&h<r;if(p||d){if(!p||d&&u.newPos<c.newPos?pushComponent((l=clonePath(c)).components,!1,!0):((l=u).newPos++,pushComponent(l.components,!0,!1)),h=extractCommon(l,t,e,o,n),l.newPos+1>=i&&h+1>=r)return buildValues(l.components);s[o]=l}else s[o]=void 0}a++}for(;a<=o;){var p=h();if(p)return p}}function extractCommon(e,t,n,i,r){for(var a=t.length,o=n.length,s=e.newPos,l=s-i,u=0;s+1<a&&l+1<o&&r(t[s+1],n[l+1]);)s++,l++,u++;return u&&e.components.push({count:u,added:!1,removed:!1,indices:[]}),e.newPos=s,l}function pushComponent(e,t,n){var i=e[e.length-1];i&&i.added===t&&i.removed===n?e[e.length-1]={count:i.count+1,added:t,removed:n,indices:[]}:e.push({count:1,added:t,removed:n,indices:[]})}function buildValues(e){for(var t=0,n=e.length,i=0,r=0;t<n;t++){var a=e[t];if(a.removed){for(s=r;s<r+a.count;s++)a.indices.push(s);r+=a.count}else{for(var o=[],s=i;s<i+a.count;s++)o.push(s);a.indices=o,i+=a.count,a.added||(r+=a.count)}}return e}function clonePath(e){return{newPos:e.newPos,components:e.components.slice(0)}}function arrayDiff(e,t,n){return diff(e,t,n)}var MARK_UNUSED="0",MARK_USED="1",Definable=function(){function e(e,t,n,i,r){this.nextId=0,this._domName="_dom",this.createElement=createElement,this._zrId=e,this._svgRoot=t,this._tagNames="string"==typeof n?[n]:n,this._markLabel=i,r&&(this._domName=r)}return e.prototype.getDefs=function(e){var t=this._svgRoot,n=this._svgRoot.getElementsByTagName("defs");if(0===n.length){if(e){var i=t.insertBefore(this.createElement("defs"),t.firstChild);return i.contains||(i.contains=function(e){var t=i.children;if(!t)return!1;for(var n=t.length-1;n>=0;--n)if(t[n]===e)return!0;return!1}),i}return null}return n[0]},e.prototype.doUpdate=function(e,t){if(e){var n=this.getDefs(!1);if(e[this._domName]&&n.contains(e[this._domName]))"function"==typeof t&&t(e);else{var i=this.add(e);i&&(e[this._domName]=i)}}},e.prototype.add=function(e){return null},e.prototype.addDom=function(e){var t=this.getDefs(!0);e.parentNode!==t&&t.appendChild(e)},e.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},e.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return each(this._tagNames,(function(n){for(var i=e.getElementsByTagName(n),r=0;r<i.length;r++)t.push(i[r])})),t},e.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;each(e,(function(e){e[t._markLabel]=MARK_UNUSED}))},e.prototype.markDomUsed=function(e){e&&(e[this._markLabel]=MARK_USED)},e.prototype.markDomUnused=function(e){e&&(e[this._markLabel]=MARK_UNUSED)},e.prototype.isDomUnused=function(e){return e&&e[this._markLabel]!==MARK_USED},e.prototype.removeUnused=function(){var e=this,t=this.getDefs(!1);t&&each(this.getDoms(),(function(n){e.isDomUnused(n)&&t.removeChild(n)}))},e.prototype.getSvgProxy=function(e){return e instanceof Path?svgPath:e instanceof ZRImage?svgImage:e instanceof TSpan?svgText:svgPath},e.prototype.getSvgElement=function(e){return e.__svgEl},e}();function isLinearGradient(e){return"linear"===e.type}function isRadialGradient(e){return"radial"===e.type}function isGradient(e){return e&&("linear"===e.type||"radial"===e.type)}var GradientManager=function(e){function t(t,n){return e.call(this,t,n,["linearGradient","radialGradient"],"__gradient_in_use__")||this}return __extends(t,e),t.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var n=this;each(["fill","stroke"],(function(i){var r=t.style[i];if(isGradient(r)){var a=r,o=n.getDefs(!0),s=void 0;a.__dom?(s=a.__dom,o.contains(a.__dom)||n.addDom(s)):s=n.add(a),n.markUsed(t);var l=s.getAttribute("id");e.setAttribute(i,"url(#"+l+")")}}))}},t.prototype.add=function(e){var t;if(isLinearGradient(e))t=this.createElement("linearGradient");else{if(!isRadialGradient(e))return logError("Illegal gradient type."),null;t=this.createElement("radialGradient")}return e.id=e.id||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-gradient-"+e.id),this.updateDom(e,t),this.addDom(t),t},t.prototype.update=function(e){if(isGradient(e)){var t=this;this.doUpdate(e,(function(){var n=e.__dom;if(n){var i=n.tagName,r=e.type;"linear"===r&&"linearGradient"===i||"radial"===r&&"radialGradient"===i?t.updateDom(e,e.__dom):(t.removeDom(e),t.add(e))}}))}},t.prototype.updateDom=function(e,t){if(isLinearGradient(e))t.setAttribute("x1",e.x+""),t.setAttribute("y1",e.y+""),t.setAttribute("x2",e.x2+""),t.setAttribute("y2",e.y2+"");else{if(!isRadialGradient(e))return void logError("Illegal gradient type.");t.setAttribute("cx",e.x+""),t.setAttribute("cy",e.y+""),t.setAttribute("r",e.r+"")}e.global?t.setAttribute("gradientUnits","userSpaceOnUse"):t.setAttribute("gradientUnits","objectBoundingBox"),t.innerHTML="";for(var n=e.colorStops,i=0,r=n.length;i<r;++i){var a=this.createElement("stop");a.setAttribute("offset",100*n[i].offset+"%");var o=n[i].color;if(o.indexOf("rgba")>-1){var s=parse(o)[3],l=toHex(o);a.setAttribute("stop-color","#"+l),a.setAttribute("stop-opacity",s+"")}else a.setAttribute("stop-color",n[i].color);t.appendChild(a)}e.__dom=t},t.prototype.markUsed=function(t){if(t.style){var n=t.style.fill;n&&n.__dom&&e.prototype.markDomUsed.call(this,n.__dom),(n=t.style.stroke)&&n.__dom&&e.prototype.markDomUsed.call(this,n.__dom)}},t}(Definable);function isPattern(e){return e&&(!!e.image||!!e.svgElement)}var patternDomMap=new WeakMap,PatternManager=function(e){function t(t,n){return e.call(this,t,n,["pattern"],"__pattern_in_use__")||this}return __extends(t,e),t.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var n=this;each(["fill","stroke"],(function(i){var r=t.style[i];if(isPattern(r)){var a=n.getDefs(!0),o=patternDomMap.get(r);o?a.contains(o)||n.addDom(o):o=n.add(r),n.markUsed(t);var s=o.getAttribute("id");e.setAttribute(i,"url(#"+s+")")}}))}},t.prototype.add=function(e){if(isPattern(e)){var t=this.createElement("pattern");return e.id=null==e.id?this.nextId++:e.id,t.setAttribute("id","zr"+this._zrId+"-pattern-"+e.id),t.setAttribute("x","0"),t.setAttribute("y","0"),t.setAttribute("patternUnits","userSpaceOnUse"),this.updateDom(e,t),this.addDom(t),t}},t.prototype.update=function(e){if(isPattern(e)){var t=this;this.doUpdate(e,(function(){var n=patternDomMap.get(e);t.updateDom(e,n)}))}},t.prototype.updateDom=function(e,t){var n=e.svgElement;if(n instanceof SVGElement)n.parentNode!==t&&(t.innerHTML="",t.appendChild(n),t.setAttribute("width",e.svgWidth+""),t.setAttribute("height",e.svgHeight+""));else{var i=void 0,r=t.getElementsByTagName("image");if(r.length){if(!e.image)return void t.removeChild(r[0]);i=r[0]}else e.image&&(i=this.createElement("image"));if(i){var a=void 0;if("string"==typeof e.image?a=e.image:e.image instanceof HTMLImageElement?a=e.image.src:e.image instanceof HTMLCanvasElement&&(a=e.image.toDataURL()),a){i.setAttribute("href",a),i.setAttribute("x","0"),i.setAttribute("y","0");var o=createOrUpdateImage(a,i,{dirty:function(){}},(function(e){t.setAttribute("width",e.width+""),t.setAttribute("height",e.height+"")}));o&&o.width&&o.height&&(t.setAttribute("width",o.width+""),t.setAttribute("height",o.height+"")),t.appendChild(i)}}}var s="translate("+(e.x||0)+", "+(e.y||0)+") rotate("+(e.rotation||0)/Math.PI*180+") scale("+(e.scaleX||1)+", "+(e.scaleY||1)+")";t.setAttribute("patternTransform",s),patternDomMap.set(e,t)},t.prototype.markUsed=function(t){t.style&&(isPattern(t.style.fill)&&e.prototype.markDomUsed.call(this,patternDomMap.get(t.style.fill)),isPattern(t.style.stroke)&&e.prototype.markDomUsed.call(this,patternDomMap.get(t.style.stroke)))},t}(Definable);function generateClipPathsKey(e){var t=[];if(e)for(var n=0;n<e.length;n++){var i=e[n];t.push(i.id)}return t.join(",")}function hasClipPath(e){var t=e.__clipPaths;return t&&t.length>0}var ClippathManager=function(e){function t(t,n){var i=e.call(this,t,n,"clipPath","__clippath_in_use__")||this;return i._refGroups={},i._keyDuplicateCount={},i}return __extends(t,e),t.prototype.markAllUnused=function(){for(var t in e.prototype.markAllUnused.call(this),this._refGroups)this.markDomUnused(this._refGroups[t]);this._keyDuplicateCount={}},t.prototype._getClipPathGroup=function(e,t){if(hasClipPath(e)){var n=e.__clipPaths,i=this._keyDuplicateCount,r=generateClipPathsKey(n);return isClipPathChanged(n,t&&t.__clipPaths)&&(i[r]=i[r]||0,i[r]&&(r+="-"+i[r]),i[r]++),this._refGroups[r]||(this._refGroups[r]=this.createElement("g"))}},t.prototype.update=function(e,t){var n=this._getClipPathGroup(e,t);return n&&(this.markDomUsed(n),this.updateDom(n,e.__clipPaths)),n},t.prototype.updateDom=function(e,t){if(t&&t.length>0){var n=this.getDefs(!0),i=t[0],r=void 0,a=void 0;i._dom?(a=i._dom.getAttribute("id"),r=i._dom,n.contains(r)||n.appendChild(r)):(a="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(r=this.createElement("clipPath")).setAttribute("id",a),n.appendChild(r),i._dom=r),this.getSvgProxy(i).brush(i);var o=this.getSvgElement(i);r.innerHTML="",r.appendChild(o),e.setAttribute("clip-path","url(#"+a+")"),t.length>1&&this.updateDom(r,t.slice(1))}else e&&e.setAttribute("clip-path","none")},t.prototype.markUsed=function(t){var n=this;t.__clipPaths&&each(t.__clipPaths,(function(t){t._dom&&e.prototype.markDomUsed.call(n,t._dom)}))},t.prototype.removeUnused=function(){e.prototype.removeUnused.call(this);var t={};for(var n in this._refGroups){var i=this._refGroups[n];this.isDomUnused(i)?i.parentNode&&i.parentNode.removeChild(i):t[n]=i}this._refGroups=t},t}(Definable),ShadowManager=function(e){function t(t,n){var i=e.call(this,t,n,["filter"],"__filter_in_use__","_shadowDom")||this;return i._shadowDomMap={},i._shadowDomPool=[],i}return __extends(t,e),t.prototype._getFromPool=function(){var e=this._shadowDomPool.pop();if(!e){(e=this.createElement("filter")).setAttribute("id","zr"+this._zrId+"-shadow-"+this.nextId++);var t=this.createElement("feDropShadow");e.appendChild(t),this.addDom(e)}return e},t.prototype.update=function(e,t){if(hasShadow(t.style)){var n=getShadowKey(t),i=t._shadowDom=this._shadowDomMap[n];i||(i=this._getFromPool(),this._shadowDomMap[n]=i),this.updateDom(e,t,i)}else this.remove(e,t)},t.prototype.remove=function(e,t){null!=t._shadowDom&&(t._shadowDom=null,e.style.filter="")},t.prototype.updateDom=function(e,t,n){var i=n.children[0],r=t.style,a=t.getGlobalScale(),o=a[0],s=a[1];if(o&&s){var l=r.shadowOffsetX||0,u=r.shadowOffsetY||0,c=r.shadowBlur,h=r.shadowColor;i.setAttribute("dx",l/o+""),i.setAttribute("dy",u/s+""),i.setAttribute("flood-color",h);var p=c/2/o+" "+c/2/s;i.setAttribute("stdDeviation",p),n.setAttribute("x","-100%"),n.setAttribute("y","-100%"),n.setAttribute("width","300%"),n.setAttribute("height","300%"),t._shadowDom=n;var d=n.getAttribute("id");e.style.filter="url(#"+d+")"}},t.prototype.removeUnused=function(){if(this.getDefs(!1)){var e=this._shadowDomPool;for(var t in this._shadowDomMap){var n=this._shadowDomMap[t];e.push(n)}this._shadowDomMap={}}},t}(Definable);function hasShadow(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function getShadowKey(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(",")}function parseInt10$1(e){return parseInt(e,10)}function getSvgProxy(e){return e instanceof Path?svgPath:e instanceof ZRImage?svgImage:e instanceof TSpan?svgText:svgPath}function checkParentAvailable(e,t){return t&&e&&t.parentNode!==e}function insertAfter(e,t,n){if(checkParentAvailable(e,t)&&n){var i=n.nextSibling;i?e.insertBefore(t,i):e.appendChild(t)}}function prepend(e,t){if(checkParentAvailable(e,t)){var n=e.firstChild;n?e.insertBefore(t,n):e.appendChild(t)}}function remove(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function removeFromMyParent(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function getSvgElement(e){return e.__svgEl}var SVGPainter=function(){function e(e,t,n,i){this.type="svg",this.refreshHover=createMethodNotSupport("refreshHover"),this.pathToImage=createMethodNotSupport("pathToImage"),this.configLayer=createMethodNotSupport("configLayer"),this.root=e,this.storage=t,this._opts=n=extend({},n||{});var r=createElement("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;";var a=createElement("g");r.appendChild(a);var o=createElement("g");r.appendChild(o),this._gradientManager=new GradientManager(i,o),this._patternManager=new PatternManager(i,o),this._clipPathManager=new ClippathManager(i,o),this._shadowManager=new ShadowManager(i,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=r,this._svgRoot=o,this._backgroundRoot=a,this._viewport=s,e.appendChild(s),s.appendChild(r),this.resize(n.width,n.height),this._visibleList=[]}return e.prototype.getType=function(){return"svg"},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.getSvgRoot=function(){return this._svgRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},e.prototype.setBackgroundColor=function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=createElement("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},e.prototype.createSVGElement=function(e){return createElement(e)},e.prototype.paintOne=function(e){var t=getSvgProxy(e);return t&&t.brush(e),getSvgElement(e)},e.prototype._paintList=function(e){var t=this._gradientManager,n=this._patternManager,i=this._clipPathManager,r=this._shadowManager;t.markAllUnused(),n.markAllUnused(),i.markAllUnused(),r.markAllUnused();for(var a=this._svgRoot,o=this._visibleList,s=e.length,l=[],u=0;u<s;u++){var c=getSvgProxy(_=e[u]),h=getSvgElement(_);_.invisible||(!_.__dirty&&h||(c&&c.brush(_),(h=getSvgElement(_))&&_.style&&(t.update(_.style.fill),t.update(_.style.stroke),n.update(_.style.fill),n.update(_.style.stroke),r.update(h,_)),_.__dirty=0),h&&l.push(_))}var p,d,f,g,m=arrayDiff(o,l);for(u=0;u<m.length;u++){if((v=m[u]).removed)for(var y=0;y<v.count;y++){h=getSvgElement(_=o[v.indices[y]]);hasClipPath(_)?removeFromMyParent(h):remove(a,h)}}for(u=0;u<m.length;u++){var v;(v=m[u]).added;if(!v.removed)for(y=0;y<v.count;y++){var _=l[v.indices[y]],x=i.update(_,f);x!==g&&(p=d,x&&(p?insertAfter(a,x,p):prepend(a,x),d=x,p=null),g=x);h=getSvgElement(_);p?insertAfter(g||a,h,p):prepend(g||a,h),p=h||p,g||(d=p),t.markUsed(_),t.addWithoutUpdate(h,_),n.markUsed(_),n.addWithoutUpdate(h,_),i.markUsed(_),f=_}}t.removeUnused(),n.removeUnused(),i.removeUnused(),r.removeUnused(),this._visibleList=l},e.prototype._getDefs=function(e){var t=this._svgDom,n=t.getElementsByTagName("defs");if(0===n.length){if(e){var i=t.insertBefore(createElement("defs"),t.firstChild);return i.contains||(i.contains=function(e){var t=i.children;if(!t)return!1;for(var n=t.length-1;n>=0;--n)if(t[n]===e)return!0;return!1}),i}return null}return n[0]},e.prototype.resize=function(e,t){var n=this._viewport;n.style.display="none";var i=this._opts;if(null!=e&&(i.width=e),null!=t&&(i.height=t),e=this._getSize(0),t=this._getSize(1),n.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var r=n.style;r.width=e+"px",r.height=t+"px";var a=this._svgDom;a.setAttribute("width",e+""),a.setAttribute("height",t+"")}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype._getSize=function(e){var t=this._opts,n=["width","height"][e],i=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[n]&&"auto"!==t[n])return parseFloat(t[n]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[i]||parseInt10$1(s[n])||parseInt10$1(o.style[n]))-(parseInt10$1(s[r])||0)-(parseInt10$1(s[a])||0)|0},e.prototype.dispose=function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},e.prototype.clear=function(){var e=this._viewport;e&&e.parentNode&&e.parentNode.removeChild(e)},e.prototype.toDataURL=function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/></g,">\n\r<"))},e}();function createMethodNotSupport(e){return function(){logError('In SVG mode painter not support method "'+e+'"')}}registerPainter("svg",SVGPainter);export{Axis,List,Model,PRIORITY,color,connect,dataTool,dependencies,disConnect,disconnect,dispose$1 as dispose,env,extendChartView,extendComponentModel,extendComponentView,extendSeriesModel,format$1 as format,getCoordinateSystemDimensions,getInstanceByDom,getInstanceById,getMap,graphic$1 as graphic,helper,init$1 as init,brushSingle as innerDrawElementOnCanvas,matrix,number,parseGeoJSON,parseGeoJson,registerAction,registerCoordinateSystem,registerLayout,registerLoading,registerLocale,registerMap,registerPostInit,registerPostUpdate,registerPreprocessor,registerProcessor,registerTheme,registerTransform,registerVisual,setCanvasCreator,throttle,time,ecUtil as util,vector,version$1 as version,zrender};

Anon7 - 2022
AnonSec Team