define(["gpui-style-inject","react","mobx"],(function(e,t,i){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var r=n(e),o=n(t),s=a(t);
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
function l(e,t,i,n){var a,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}function u(e,t,i,n){return new(i||(i=Promise))((function(a,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}r.default("html, body, #root {\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  overflow: hidden; }\n\n.g__index {\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  height: 100%; }\n");var h="index-module_main__WSFNB",c="index-module_chart__RJBRM",d="index-module_name__7vlXo";r.default(".index-module_main__WSFNB {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  width: 100%;\n  height: 100%; }\n  .index-module_main__WSFNB .index-module_chart__RJBRM {\n    width: 60vw;\n    height: 60vw;\n    overflow: hidden; }\n  .index-module_main__WSFNB .index-module_name__7vlXo {\n    margin-top: 7vh;\n    line-height: 7vh;\n    font-size: 7vh;\n    color: #cde0ff; }\n");var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e){var t={exports:{}};return e(t,t.exports),t.exports}var m=g((function(e,t){var i;i=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}return i.m=e,i.c=t,i.p="",i(0)}([function(e,t,i){e.exports=i(1)},function(e,t,i){var n=i(2),a=i(3),r=i(4),o=i(22);function s(e){var t=new r(e),i=a(r.prototype.request,t);return n.extend(i,r.prototype,t),n.extend(i,t),i}var l=s(i(10));l.Axios=r,l.create=function(e){return s(o(l.defaults,e))},l.Cancel=i(23),l.CancelToken=i(24),l.isCancel=i(9),l.all=function(e){return Promise.all(e)},l.spread=i(25),e.exports=l,e.exports.default=l},function(e,t,i){var n=i(3),a=Object.prototype.toString;function r(e){return"[object Array]"===a.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function l(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),r(e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}e.exports={isArray:r,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:o,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]=i}for(var n=0,a=arguments.length;n<a;n++)u(arguments[n],i);return t},deepMerge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]="object"==typeof i?e({},i):i}for(var n=0,a=arguments.length;n<a;n++)u(arguments[n],i);return t},extend:function(e,t,i){return u(t,(function(t,a){e[a]=i&&"function"==typeof t?n(t,i):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t){e.exports=function(e,t){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(t,i)}}},function(e,t,i){var n=i(2),a=i(5),r=i(6),o=i(7),s=i(22);function l(e){this.defaults=e,this.interceptors={request:new r,response:new r}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[o,void 0],i=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)i=i.then(t.shift(),t.shift());return i},l.prototype.getUri=function(e){return e=s(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,i){return this.request(n.merge(i||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,i,a){return this.request(n.merge(a||{},{method:e,url:t,data:i}))}})),e.exports=l},function(e,t,i){var n=i(2);function a(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var r;if(i)r=i(t);else if(n.isURLSearchParams(t))r=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(a(t)+"="+a(e))})))})),r=o.join("&")}if(r){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}},function(e,t,i){var n=i(2);function a(){this.handlers=[]}a.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},function(e,t,i){var n=i(2),a=i(8),r=i(9),o=i(10);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=a(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return s(e),t.data=a(t.data,t.headers,e.transformResponse),t}),(function(t){return r(t)||(s(e),t&&t.response&&(t.response.data=a(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,i){var n=i(2);e.exports=function(e,t,i){return n.forEach(i,(function(i){e=i(e,t)})),e}},function(e,t){e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){var n=i(2),a=i(11),r={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,l={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(s=i(12)),s),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(r)})),e.exports=l},function(e,t,i){var n=i(2);e.exports=function(e,t){n.forEach(e,(function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])}))}},function(e,t,i){var n=i(2),a=i(13),r=i(5),o=i(16),s=i(19),l=i(20),u=i(14);e.exports=function(e){return new Promise((function(t,h){var c=e.data,d=e.headers;n.isFormData(c)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",g=e.auth.password||"";d.Authorization="Basic "+btoa(f+":"+g)}var m=o(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),r(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var i="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:i,config:e,request:p};a(t,h,n),p=null}},p.onabort=function(){p&&(h(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){h(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),h(u(t,e,"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var v=i(21),y=(e.withCredentials||l(m))&&e.xsrfCookieName?v.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&n.forEach(d,(function(e,t){void 0===c&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),h(e),p=null)})),void 0===c&&(c=null),p.send(c)}))}},function(e,t,i){var n=i(14);e.exports=function(e,t,i){var a=i.config.validateStatus;!a||a(i.status)?e(i):t(n("Request failed with status code "+i.status,i.config,null,i.request,i))}},function(e,t,i){var n=i(15);e.exports=function(e,t,i,a,r){var o=new Error(e);return n(o,t,i,a,r)}},function(e,t){e.exports=function(e,t,i,n,a){return e.config=t,i&&(e.code=i),e.request=n,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,i){var n=i(17),a=i(18);e.exports=function(e,t){return e&&!n(t)?a(e,t):t}},function(e,t){e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){var n=i(2),a=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,r,o={};return e?(n.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=n.trim(e.substr(0,r)).toLowerCase(),i=n.trim(e.substr(r+1)),t){if(o[t]&&a.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([i]):o[t]?o[t]+", "+i:i}})),o):o}},function(e,t,i){var n=i(2);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function a(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=a(window.location.href),function(t){var i=n.isString(t)?a(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0}},function(e,t,i){var n=i(2);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,i,a,r,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),n.isString(a)&&s.push("path="+a),n.isString(r)&&s.push("domain="+r),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,i){var n=i(2);e.exports=function(e,t){t=t||{};var i={},a=["url","method","params","data"],r=["headers","auth","proxy"],o=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];n.forEach(a,(function(e){void 0!==t[e]&&(i[e]=t[e])})),n.forEach(r,(function(a){n.isObject(t[a])?i[a]=n.deepMerge(e[a],t[a]):void 0!==t[a]?i[a]=t[a]:n.isObject(e[a])?i[a]=n.deepMerge(e[a]):void 0!==e[a]&&(i[a]=e[a])})),n.forEach(o,(function(n){void 0!==t[n]?i[n]=t[n]:void 0!==e[n]&&(i[n]=e[n])}));var s=a.concat(r).concat(o),l=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return n.forEach(l,(function(n){void 0!==t[n]?i[n]=t[n]:void 0!==e[n]&&(i[n]=e[n])})),i}},function(e,t){function i(e){this.message=e}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,e.exports=i},function(e,t,i){var n=i(23);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var i=this;e((function(e){i.reason||(i.reason=new n(e),t(i.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},function(e,t){e.exports=function(e){return function(t){return e.apply(null,t)}}}])},e.exports=i()}));class v{constructor({baseURL:e="",timeout:t=6e4,headers:i={}}){this.passenger=m.create({baseURL:e,timeout:t,headers:Object.assign({"Content-Type":"application/x-www-form-urlencoded; chartset=UTF-8"},i)}),this.passenger.interceptors.response.use((e=>e),(e=>Promise.reject(e)))}call({method:e,params:t={}}){var i,n;return u(this,void 0,void 0,(function*(){const a=yield this.passenger.post("",{jsonrpc:"2.0",method:e,id:1,params:t instanceof Array?t:[t]});return(null===(i=a.data)||void 0===i?void 0:i.result)?a.data.result:null===(n=a.data)||void 0===n?void 0:n.error}))}sendObject({method:e,params:t={}}){var i,n;return u(this,void 0,void 0,(function*(){const a=yield this.passenger.post("",{jsonrpc:"2.0",method:e,id:1,params:t});return(null===(i=a.data)||void 0===i?void 0:i.result)?a.data.result:null===(n=a.data)||void 0===n?void 0:n.error}))}get({method:e,params:t={},path:i={}}){return u(this,void 0,void 0,(function*(){let n=e;if(Object.keys(i).length&&e)for(const e in i)n=n.replace(`:${e}`,i[e]);const a=yield this.passenger.get(n,{params:t});return a.data?a.data:a.data.error}))}}if(!t.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!i.spy)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},y.apply(this,arguments)}function x(){var e=t.useState(0)[1];return t.useCallback((function(){e((function(e){return e+1}))}),[])}function _(e){return i.getDependencyTree(e)}var b,w=1e4,S=new Set;function M(){void 0===b&&(b=setTimeout(I,1e4))}function I(){b=void 0;var e=Date.now();S.forEach((function(t){var i=t.current;i&&e>=i.cleanAt&&(i.reaction.dispose(),t.current=null,S.delete(t))})),S.size>0&&M()}var A={};function T(e){return"observer"+e}function C(e,t,n){void 0===t&&(t="observed"),void 0===n&&(n=A);var a,r=(n.useForceUpdate||x)(),s=o.default.useRef(null);if(!s.current){var l=new i.Reaction(T(t),(function(){u.mounted?r():(l.dispose(),s.current=null)})),u=function(e){return{cleanAt:Date.now()+w,reaction:e}}(l);s.current=u,a=s,S.add(a),M()}var h,c,d=s.current.reaction;if(o.default.useDebugValue(d,_),o.default.useEffect((function(){var e;return e=s,S.delete(e),s.current?s.current.mounted=!0:(s.current={reaction:new i.Reaction(T(t),(function(){r()})),cleanAt:1/0},r()),function(){s.current.reaction.dispose(),s.current=null}}),[]),d.track((function(){try{h=e()}catch(e){c=e}})),c)throw c;return h}function D(e,i){var n,a=y({forwardRef:!1},i),r=e.displayName||e.name,o=function(t,i){return C((function(){return e(t,i)}),r)};return o.displayName=r,n=a.forwardRef?t.memo(t.forwardRef(o)):t.memo(o),function(e,t){Object.keys(e).forEach((function(i){L[i]||Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}(e,n),n.displayName=r,n}var L={$$typeof:!0,render:!0,compare:!0,type:!0};function P(e){var t=e.children,i=e.render,n=t||i;return"function"!=typeof n?null:C(n)}function k(e,t,i,n,a){var r="children"===t?"render":"children",o="function"==typeof e[t],s="function"==typeof e[r];return o&&s?new Error("MobX Observer: Do not use children and render in the same time in`"+i):o||s?null:new Error("Invalid prop `"+a+"` of type `"+typeof e[t]+"` supplied to `"+i+"`, expected `function`.")}P.propTypes={children:k,render:k},P.displayName="Observer";var O=0;var R={};function E(e){return R[e]||(R[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+O+")";return O++,t}(e)),R[e]}function N(e,t){if(z(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(var a=0;a<i.length;a++)if(!Object.hasOwnProperty.call(t,i[a])||!z(e[i[a]],t[i[a]]))return!1;return!0}function z(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function B(e,t,i){Object.hasOwnProperty.call(e,t)?e[t]=i:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:i})}var V=E("patchMixins"),G=E("patchedDefinition");function F(e,t){for(var i=this,n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];t.locks++;try{var o;return null!=e&&(o=e.apply(this,a)),o}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(i,a)}))}}function H(e,t){return function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];F.call.apply(F,[this,e,t].concat(n))}}function W(e,t,i){var n=function(e,t){var i=e[V]=e[V]||{},n=i[t]=i[t]||{};return n.locks=n.locks||0,n.methods=n.methods||[],n}(e,t);n.methods.indexOf(i)<0&&n.methods.push(i);var a=Object.getOwnPropertyDescriptor(e,t);if(!a||!a[G]){var r=e[t],o=U(e,t,a?a.enumerable:void 0,n,r);Object.defineProperty(e,t,o)}}function U(e,t,i,n,a){var r,o=H(a,n);return(r={})[G]=!0,r.get=function(){return o},r.set=function(a){if(this===e)o=H(a,n);else{var r=U(this,t,i,n,a);Object.defineProperty(this,t,r)}},r.configurable=!0,r.enumerable=i,r}var j=i.$mobx||"$mobx",Z=E("isUnmounted"),Y=E("skipRender"),X=E("isForcingUpdate");function q(e){var i=e.prototype;if(i.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==t.PureComponent)if(i.shouldComponentUpdate){if(i.shouldComponentUpdate!==K)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else i.shouldComponentUpdate=K;J(i,"props"),J(i,"state");var n=i.render;return i.render=function(){return $.call(this,n)},W(i,"componentWillUnmount",(function(){this.render[j]&&this.render[j].dispose(),this[Z]=!0})),e}function $(e){var n=this;B(this,Y,!1),B(this,X,!1);var a,r=(a=this).displayName||a.name||a.constructor&&(a.constructor.displayName||a.constructor.name)||"<component>",o=e.bind(this),s=!1,l=new i.Reaction(r+".render()",(function(){if(!s&&(s=!0,!0!==n[Z])){var e=!0;try{B(n,X,!0),n[Y]||t.Component.prototype.forceUpdate.call(n),e=!1}finally{B(n,X,!1),e&&l.dispose()}}}));function u(){s=!1;var e=void 0,t=void 0;if(l.track((function(){try{t=i._allowStateChanges(!1,o)}catch(t){e=t}})),e)throw e;return t}return l.reactComponent=this,u[j]=l,this.render=u,u.call(this)}function K(e,t){return this.state!==t||!N(this.props,e)}function J(e,t){var n=E("reactProp_"+t+"_valueHolder"),a=E("reactProp_"+t+"_atomHolder");function r(){return this[a]||B(this,a,i.createAtom("reactive "+t)),this[a]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return i._allowStateReadsStart&&i._allowStateReadsEnd&&(e=i._allowStateReadsStart(!0)),r.call(this).reportObserved(),i._allowStateReadsStart&&i._allowStateReadsEnd&&i._allowStateReadsEnd(e),this[n]},set:function(e){this[X]||N(this[n],e)?B(this,n,e):(B(this,n,e),B(this,Y,!0),r.call(this).reportChanged(),B(this,Y,!1))}})}var Q="function"==typeof Symbol&&Symbol.for,ee=Q?Symbol.for("react.forward_ref"):"function"==typeof t.forwardRef&&t.forwardRef((function(e){return null})).$$typeof,te=Q?Symbol.for("react.memo"):"function"==typeof t.memo&&t.memo((function(e){return null})).$$typeof;if(!t.Component)throw new Error("mobx-react requires React to be available");if(!i.observable)throw new Error("mobx-react requires mobx to be available");"undefined"!=typeof window||void 0!==p&&p.__DEV__;var ie=2311;var ne=function(){return ie++};var ae="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(e){var t={},i={},n=e.match(/Firefox\/([\d.]+)/),a=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),r=e.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(i.firefox=!0,i.version=n[1]);a&&(i.ie=!0,i.version=a[1]);r&&(i.edge=!0,i.version=r[1]);o&&(i.weChat=!0);return{browser:i,os:t,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!i.ie&&!i.edge,pointerEventsSupported:"onpointerdown"in window&&(i.edge||i.ie&&i.version>=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent),re={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},oe={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},se=Object.prototype.toString,le=Array.prototype,ue=le.forEach,he=le.filter,ce=le.slice,de=le.map,pe=le.reduce,fe={};function ge(e){if(null==e||"object"!=typeof e)return e;var t=e,i=se.call(e);if("[object Array]"===i){if(!Te(e)){t=[];for(var n=0,a=e.length;n<a;n++)t[n]=ge(e[n])}}else if(oe[i]){if(!Te(e)){var r=e.constructor;if(e.constructor.from)t=r.from(e);else{t=new r(e.length);for(n=0,a=e.length;n<a;n++)t[n]=ge(e[n])}}}else if(!re[i]&&!Te(e)&&!Ie(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=ge(e[o]));return t}function me(e,t,i){if(!Se(t)||!Se(e))return i?ge(t):e;for(var n in t)if(t.hasOwnProperty(n)){var a=e[n],r=t[n];!Se(r)||!Se(a)||we(r)||we(a)||Ie(r)||Ie(a)||Me(r)||Me(a)||Te(r)||Te(a)?!i&&n in e||(e[n]=ge(t[n])):me(a,r,i)}return e}function ve(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(i?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}var ye,xe=function(){return fe.createCanvas()};function _e(e,t,i){if(e&&t)if(e.forEach&&e.forEach===ue)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n,e);else for(var r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function be(e,t){var i=ce.call(arguments,2);return function(){return e.apply(t,i.concat(ce.call(arguments)))}}function we(e){return"[object Array]"===se.call(e)}function Se(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function Me(e){return!!re[se.call(e)]}function Ie(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}fe.createCanvas=function(){return document.createElement("canvas")};var Ae="__ec_primitive__";function Te(e){return e[Ae]}function Ce(e){var t=we(e);this.data={};var i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof Ce?e.each(n):e&&_e(e,n)}Ce.prototype={constructor:Ce,get:function(e){return this.data.hasOwnProperty(e)?this.data[e]:null},set:function(e,t){return this.data[e]=t},each:function(e,t){for(var i in void 0!==t&&(e=be(e,t)),this.data)this.data.hasOwnProperty(i)&&e(this.data[i],i)},removeKey:function(e){delete this.data[e]}};var De=function(e,t){for(var i=e[0],n=1,a=e.length;n<a;n++)i=me(i,e[n],t);return i},Le=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i}return-1},Pe=function(e,t){var i=e.prototype;function n(){}for(var a in n.prototype=t.prototype,e.prototype=new n,i)i.hasOwnProperty(a)&&(e.prototype[a]=i[a]);e.prototype.constructor=e,e.superClass=t},ke=function(e,t,i){if(e&&t){if(e.map&&e.map===de)return e.map(t,i);for(var n=[],a=0,r=e.length;a<r;a++)n.push(t.call(i,e[a],a,e));return n}},Oe=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===pe)return e.reduce(t,i,n);for(var a=0,r=e.length;a<r;a++)i=t.call(n,i,e[a],a,e);return i}},Re=function(e,t,i){if(e&&t){if(e.filter&&e.filter===he)return e.filter(t,i);for(var n=[],a=0,r=e.length;a<r;a++)t.call(i,e[a],a,e)&&n.push(e[a]);return n}},Ee=function(e,t,i){if(e&&t)for(var n=0,a=e.length;n<a;n++)if(t.call(i,e[n],n,e))return e[n]},Ne=function(e){var t=ce.call(arguments,1);return function(){return e.apply(this,t.concat(ce.call(arguments)))}},ze=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},Be=function(){return Function.call.apply(ce,arguments)},Ve=function(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},Ge=function(e,t){for(var i=new e.constructor(e.length+t.length),n=0;n<e.length;n++)i[n]=e[n];var a=e.length;for(n=0;n<t.length;n++)i[n+a]=t[n];return i},Fe={$override:function(e,t){"createCanvas"===e&&(ye=null),fe[e]=t},clone:ge,merge:me,mergeAll:De,extend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},defaults:ve,createCanvas:xe,getContext:function(){return ye||(ye=xe().getContext("2d")),ye},indexOf:Le,inherits:Pe,mixin:function(e,t,i){ve(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,i)},isArrayLike:function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},each:_e,map:ke,reduce:Oe,filter:Re,find:Ee,bind:be,curry:Ne,isArray:we,isFunction:function(e){return"function"==typeof e},isString:function(e){return"[object String]"===se.call(e)},isObject:Se,isBuiltInObject:Me,isTypedArray:function(e){return!!oe[se.call(e)]},isDom:Ie,eqNaN:function(e){return e!=e},retrieve:ze,retrieve2:function(e,t){return null!=e?e:t},retrieve3:function(e,t,i){return null!=e?e:null!=t?t:i},slice:Be,normalizeCssArray:Ve,assert:function(e,t){if(!e)throw new Error(t)},trim:function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},setAsPrimitive:function(e){e[Ae]=!0},isPrimitive:Te,createHashMap:function(e){return new Ce(e)},concatArray:Ge,noop:function(){}},He="undefined"==typeof Float32Array?Array:Float32Array;function We(e){return Math.sqrt(Ue(e))}function Ue(e){return e[0]*e[0]+e[1]*e[1]}function je(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function Ze(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Ye=function(e,t){var i=new He(2);return null==e&&(e=0),null==t&&(t=0),i[0]=e,i[1]=t,i},Xe=function(e,t){return e[0]=t[0],e[1]=t[1],e},qe=function(e){var t=new He(2);return t[0]=e[0],t[1]=e[1],t},$e=function(e,t,i){return e[0]=t,e[1]=i,e},Ke=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},Je=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},Qe=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},et=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},tt=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},it=function(e,t){return e[0]*t[0]+e[1]*t[1]},nt=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},at=function(e,t){var i=We(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},rt=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ot=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},st=function(e,t,i){var n=t[0],a=t[1];return e[0]=i[0]*n+i[2]*a+i[4],e[1]=i[1]*n+i[3]*a+i[5],e},lt=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},ut=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},ht={create:Ye,copy:Xe,clone:qe,set:$e,add:Ke,scaleAndAdd:Je,sub:Qe,len:We,length:We,lenSquare:Ue,lengthSquare:Ue,mul:et,div:tt,dot:it,scale:nt,normalize:at,distance:je,dist:je,distanceSquare:Ze,distSquare:Ze,negate:rt,lerp:ot,applyTransform:st,min:lt,max:ut};function ct(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function dt(e,t){return{target:e,topTarget:t&&t.topTarget}}ct.prototype={constructor:ct,_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.dispatchToElement(dt(t,e),"dragstart",e.event))},_drag:function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,n=e.offsetY,a=i-this._x,r=n-this._y;this._x=i,this._y=n,t.drift(a,r,e),this.dispatchToElement(dt(t,e),"drag",e.event);var o=this.findHover(i,n,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.dispatchToElement(dt(s,e),"dragleave",e.event),o&&o!==s&&this.dispatchToElement(dt(o,e),"dragenter",e.event))}},_dragEnd:function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.dispatchToElement(dt(t,e),"dragend",e.event),this._dropTarget&&this.dispatchToElement(dt(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null}};var pt=ct,ft=Array.prototype.slice,gt=function(e){this._$handlers={},this._$eventProcessor=e};function mt(e,t,i,n,a,r){var o=e._$handlers;if("function"==typeof i&&(a=n,n=i,i=null),!n||!t)return e;i=function(e,t){var i=e._$eventProcessor;return null!=t&&i&&i.normalizeQuery&&(t=i.normalizeQuery(t)),t}(e,i),o[t]||(o[t]=[]);for(var s=0;s<o[t].length;s++)if(o[t][s].h===n)return e;var l={h:n,one:r,query:i,ctx:a||e,callAtLast:n.zrEventfulCallAtLast},u=o[t].length-1,h=o[t][u];return h&&h.callAtLast?o[t].splice(u,0,l):o[t].push(l),e}gt.prototype={constructor:gt,one:function(e,t,i,n){return mt(this,e,t,i,n,!0)},on:function(e,t,i,n){return mt(this,e,t,i,n,!1)},isSilent:function(e){var t=this._$handlers;return!t[e]||!t[e].length},off:function(e,t){var i=this._$handlers;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var n=[],a=0,r=i[e].length;a<r;a++)i[e][a].h!==t&&n.push(i[e][a]);i[e]=n}i[e]&&0===i[e].length&&delete i[e]}else delete i[e];return this},trigger:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,a=n.length;a>3&&(n=ft.call(n,1));for(var r=t.length,o=0;o<r;){var s=t[o];if(i&&i.filter&&null!=s.query&&!i.filter(e,s.query))o++;else{switch(a){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,n[1]);break;case 3:s.h.call(s.ctx,n[1],n[2]);break;default:s.h.apply(s.ctx,n)}s.one?(t.splice(o,1),r--):o++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this},triggerWithContext:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,a=n.length;a>4&&(n=ft.call(n,1,n.length-1));for(var r=n[n.length-1],o=t.length,s=0;s<o;){var l=t[s];if(i&&i.filter&&null!=l.query&&!i.filter(e,l.query))s++;else{switch(a){case 1:l.h.call(r);break;case 2:l.h.call(r,n[1]);break;case 3:l.h.call(r,n[1],n[2]);break;default:l.h.apply(r,n)}l.one?(t.splice(s,1),o--):s++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this}};var vt=gt,yt=Math.log(2);function xt(e,t,i,n,a,r){var o=n+"-"+a,s=e.length;if(r.hasOwnProperty(o))return r[o];if(1===t){var l=Math.round(Math.log((1<<s)-1&~a)/yt);return e[i][l]}for(var u=n|1<<i,h=i+1;n&1<<h;)h++;for(var c=0,d=0,p=0;d<s;d++){var f=1<<d;f&a||(c+=(p%2?-1:1)*e[i][d]*xt(e,t-1,h,u,a|f,r),p++)}return r[o]=c,c}var _t=function(e,t){var i=[[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]]],n={},a=xt(i,8,0,0,0,n);if(0!==a){for(var r=[],o=0;o<8;o++)for(var s=0;s<8;s++)null==r[s]&&(r[s]=0),r[s]+=((o+s)%2?-1:1)*xt(i,7,0===o?1:0,1<<o,1<<s,n)/a*t[o];return function(e,t,i){var n=t*r[6]+i*r[7]+1;e[0]=(t*r[0]+i*r[1]+r[2])/n,e[1]=(t*r[3]+i*r[4]+r[5])/n}}},bt={buildTransformer:_t}.buildTransformer,wt="___zrEVENTSAVED",St=[];function Mt(e,t,i,n,a){if(t.getBoundingClientRect&&ae.domSupported&&!It(t)){var r=t[wt]||(t[wt]={}),o=function(e,t){var i=t.markers;if(i)return i;i=t.markers=[];for(var n=["left","right"],a=["top","bottom"],r=0;r<4;r++){var o=document.createElement("div"),s=r%2,l=(r>>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[s]+":0",a[l]+":0",n[1-s]+":auto",a[1-l]+":auto",""].join("!important;"),e.appendChild(o),i.push(o)}return i}(t,r),s=function(e,t,i){for(var n=i?"invTrans":"trans",a=t[n],r=t.srcCoords,o=!0,s=[],l=[],u=0;u<4;u++){var h=e[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;s.push(d,p),o=o&&r&&d===r[c]&&p===r[c+1],l.push(e[u].offsetLeft,e[u].offsetTop)}return o&&a?a:(t.srcCoords=s,t[n]=i?bt(l,s):bt(s,l))}(o,r,a);if(s)return s(e,i,n),!0}return!1}function It(e){return"CANVAS"===e.nodeName.toUpperCase()}var At=function(e,t,i,n,a){return Mt(St,t,n,a,!0)&&Mt(e,i,St[0],St[1])},Tt={transformLocalCoord:At,transformCoordWithViewport:Mt,isCanvasEl:It},Ct=vt,Dt=Tt.isCanvasEl,Lt=Tt.transformCoordWithViewport,Pt="undefined"!=typeof window&&!!window.addEventListener,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ot=[];function Rt(e,t,i,n){return i=i||{},n||!ae.canvasSupported?Et(e,t,i):ae.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(i.zrX=t.layerX,i.zrY=t.layerY):null!=t.offsetX?(i.zrX=t.offsetX,i.zrY=t.offsetY):Et(e,t,i),i}function Et(e,t,i){if(ae.domSupported&&e.getBoundingClientRect){var n=t.clientX,a=t.clientY;if(Dt(e)){var r=e.getBoundingClientRect();return i.zrX=n-r.left,void(i.zrY=a-r.top)}if(Lt(Ot,e,n,a))return i.zrX=Ot[0],void(i.zrY=Ot[1])}i.zrX=i.zrY=0}function Nt(e){return e||window.event}var zt={Dispatcher:Ct,clientToLocal:Rt,getNativeEvent:Nt,normalizeEvent:function(e,t,i){if(null!=(t=Nt(t)).zrX)return t;var n=t.type;if(n&&n.indexOf("touch")>=0){var a="touchend"!==n?t.targetTouches[0]:t.changedTouches[0];a&&Rt(e,a,t,i)}else Rt(e,t,t,i),t.zrDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3;var r=t.button;return null==t.which&&void 0!==r&&kt.test(t.type)&&(t.which=1&r?1:2&r?3:4&r?2:0),t},addEventListener:function(e,t,i,n){Pt?e.addEventListener(t,i,n):e.attachEvent("on"+t,i)},removeEventListener:function(e,t,i,n){Pt?e.removeEventListener(t,i,n):e.detachEvent("on"+t,i)},stop:Pt?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0},isMiddleOrRightButtonOnMouseUpDown:function(e){return 2===e.which||3===e.which},notLeftMouse:function(e){return e.which>1}},Bt=function(){this._track=[]};function Vt(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}Bt.prototype={constructor:Bt,recognize:function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},clear:function(){return this._track.length=0,this},_doTrack:function(e,t,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:t,event:e},r=0,o=n.length;r<o;r++){var s=n[r],l=zt.clientToLocal(i,s,{});a.points.push([l.zrX,l.zrY]),a.touches.push(s)}this._track.push(a)}},_recognize:function(e){for(var t in Gt)if(Gt.hasOwnProperty(t)){var i=Gt[t](this._track,e);if(i)return i}}};var Gt={pinch:function(e,t){var i=e.length;if(i){var n,a=(e[i-1]||{}).points,r=(e[i-2]||{}).points||a;if(r&&r.length>1&&a&&a.length>1){var o=Vt(a)/Vt(r);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((n=a)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}},Ft=Bt,Ht="silent";function Wt(){zt.stop(this.event)}function Ut(){}Ut.prototype.dispose=function(){};var jt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Zt=function(e,t,i,n){vt.call(this),this.storage=e,this.painter=t,this.painterRoot=n,i=i||new Ut,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,pt.call(this),this.setHandlerProxy(i)};function Yt(e,t,i){if(e[e.rectHover?"rectContain":"contain"](t,i)){for(var n,a=e;a;){if(a.clipPath&&!a.clipPath.contain(t,i))return!1;a.silent&&(n=!0),a=a.parent}return!n||Ht}return!1}function Xt(e,t,i){var n=e.painter;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}Zt.prototype={constructor:Zt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(Fe.each(jt,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},mousemove:function(e){var t=e.zrX,i=e.zrY,n=Xt(this,t,i),a=this._hovered,r=a.target;r&&!r.__zr&&(r=(a=this.findHover(a.x,a.y)).target);var o=this._hovered=n?{x:t,y:i}:this.findHover(t,i),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(a,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==r&&this.dispatchToElement(o,"mouseover",e)},mouseout:function(e){var t=e.zrEventControl,i=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!i&&this.trigger("globalout",{type:"globalout",event:e})},resize:function(e){this._hovered={}},dispatch:function(e,t){var i=this[e];i&&i.call(this,t)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},dispatchToElement:function(e,t,i){var n=(e=e||{}).target;if(!n||!n.silent){for(var a="on"+t,r=function(e,t,i){return{type:e,event:i,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:Wt}}(t,e,i);n&&(n[a]&&(r.cancelBubble=n[a].call(n,r)),n.trigger(t,r),n=n.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(t,r),this.painter&&this.painter.eachOtherLayer((function(e){"function"==typeof e[a]&&e[a].call(e,r),e.trigger&&e.trigger(t,r)})))}},findHover:function(e,t,i){for(var n=this.storage.getDisplayList(),a={x:e,y:t},r=n.length-1;r>=0;r--){var o;if(n[r]!==i&&!n[r].ignore&&(o=Yt(n[r],e,t))&&(!a.topTarget&&(a.topTarget=n[r]),o!==Ht)){a.target=n[r];break}}return a},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Ft);var i=this._gestureMgr;"start"===t&&i.clear();var n=i.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&i.clear(),n){var a=n.type;e.gestureEvent=a,this.dispatchToElement({target:n.target},a,n.event)}}},Fe.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Zt.prototype[e]=function(t){var i,n,a=t.zrX,r=t.zrY,o=Xt(this,a,r);if("mouseup"===e&&o||(n=(i=this.findHover(a,r)).target),"mousedown"===e)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===e)this._upEl=n;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||ht.dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}})),Fe.mixin(Zt,vt),Fe.mixin(Zt,pt);var qt=Zt,$t="undefined"==typeof Float32Array?Array:Float32Array;function Kt(){var e=new $t(6);return Jt(e),e}function Jt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Qt(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}var ei=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],a=t[1]*i[0]+t[3]*i[1],r=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=a,e[2]=r,e[3]=o,e[4]=s,e[5]=l,e},ti=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},ii=function(e,t,i){var n=t[0],a=t[2],r=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=a*h+s*u,e[3]=-a*u+h*s,e[4]=h*r+u*l,e[5]=h*l-u*r,e},ni=function(e,t,i){var n=i[0],a=i[1];return e[0]=t[0]*n,e[1]=t[1]*a,e[2]=t[2]*n,e[3]=t[3]*a,e[4]=t[4]*n,e[5]=t[5]*a,e},ai=function(e,t){var i=t[0],n=t[2],a=t[4],r=t[1],o=t[3],s=t[5],l=i*o-r*n;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*a)*l,e[5]=(r*a-i*s)*l,e):null},ri={create:Kt,identity:Jt,copy:Qt,mul:ei,translate:ti,rotate:ii,scale:ni,invert:ai,clone:function(e){var t=Kt();return Qt(t,e),t}},oi=ri.identity,si=5e-5;function li(e){return e>si||e<-5e-5}var ui=function(e){(e=e||{}).position||(this.position=[0,0]),null==e.rotation&&(this.rotation=0),e.scale||(this.scale=[1,1]),this.origin=this.origin||null},hi=ui.prototype;hi.transform=null,hi.needLocalTransform=function(){return li(this.rotation)||li(this.position[0])||li(this.position[1])||li(this.scale[0]-1)||li(this.scale[1]-1)};var ci=[];hi.updateTransform=function(){var e=this.parent,t=e&&e.transform,i=this.needLocalTransform(),n=this.transform;if(i||t){n=n||ri.create(),i?this.getLocalTransform(n):oi(n),t&&(i?ri.mul(n,e.transform,n):ri.copy(n,e.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(ci);var r=ci[0]<0?-1:1,o=ci[1]<0?-1:1,s=((ci[0]-r)*a+r)/ci[0]||0,l=((ci[1]-o)*a+o)/ci[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||ri.create(),ri.invert(this.invTransform,n)}else n&&oi(n)},hi.getLocalTransform=function(e){return ui.getLocalTransform(this,e)},hi.setTransform=function(e){var t=this.transform,i=e.dpr||1;t?e.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):e.setTransform(i,0,0,i,0,0)},hi.restoreTransform=function(e){var t=e.dpr||1;e.setTransform(t,0,0,t,0,0)};var di=[],pi=ri.create();hi.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=this.position,a=this.scale;li(t-1)&&(t=Math.sqrt(t)),li(i-1)&&(i=Math.sqrt(i)),e[0]<0&&(t=-t),e[3]<0&&(i=-i),n[0]=e[4],n[1]=e[5],a[0]=t,a[1]=i,this.rotation=Math.atan2(-e[1]/i,e[0]/t)}},hi.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(ri.mul(di,e.invTransform,t),t=di);var i=this.origin;i&&(i[0]||i[1])&&(pi[4]=i[0],pi[5]=i[1],ri.mul(di,t,pi),di[4]-=i[0],di[5]-=i[1],t=di),this.setLocalTransform(t)}},hi.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)},hi.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&ht.applyTransform(i,i,n),i},hi.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&ht.applyTransform(i,i,n),i},ui.getLocalTransform=function(e,t){oi(t=t||[]);var i=e.origin,n=e.scale||[1,1],a=e.rotation||0,r=e.position||[0,0];return i&&(t[4]-=i[0],t[5]-=i[1]),ri.scale(t,t,n),a&&ri.rotate(t,t,a),i&&(t[4]+=i[0],t[5]+=i[1]),t[4]+=r[0],t[5]+=r[1],t};var fi=ui,gi={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,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.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-gi.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*gi.bounceIn(2*e):.5*gi.bounceOut(2*e-1)+.5}},mi=gi;function vi(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,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,this._pausedTime=0,this._paused=!1}vi.prototype={constructor:vi,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,a="string"==typeof n?mi[n]:n,r="function"==typeof a?a(i):i;return this.fire("frame",r),1===i?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var yi=vi,xi=function(){this.head=null,this.tail=null,this._len=0},_i=xi.prototype;_i.insert=function(e){var t=new bi(e);return this.insertEntry(t),t},_i.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++},_i.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},_i.len=function(){return this._len},_i.clear=function(){this.head=this.tail=null,this._len=0};var bi=function(e){this.value=e,this.next,this.prev},wi=function(e){this._list=new xi,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},Si=wi.prototype;Si.put=function(e,t){var i=this._list,n=this._map,a=null;if(null==n[e]){var r=i.len(),o=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=i.head;i.remove(s),delete n[s.key],a=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new bi(t),o.key=e,i.insertEntry(o),n[e]=o}return a},Si.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},Si.clear=function(){this._list.clear(),this._map={}};var Mi=wi,Ii={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 Ai(e){return(e=Math.round(e))<0?0:e>255?255:e}function Ti(e){return e<0?0:e>1?1:e}function Ci(e){return e.length&&"%"===e.charAt(e.length-1)?Ai(parseFloat(e)/100*255):Ai(parseInt(e,10))}function Di(e){return e.length&&"%"===e.charAt(e.length-1)?Ti(parseFloat(e)/100):Ti(parseFloat(e))}function Li(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function Pi(e,t,i){return e+(t-e)*i}function ki(e,t,i,n,a){return e[0]=t,e[1]=i,e[2]=n,e[3]=a,e}function Oi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Ri=new Mi(20),Ei=null;function Ni(e,t){Ei&&Oi(Ei,t),Ei=Ri.put(e,Ei||t.slice())}function zi(e,t){if(e){t=t||[];var i=Ri.get(e);if(i)return Oi(t,i);var n,a=(e+="").replace(/ /g,"").toLowerCase();if(a in Ii)return Oi(t,Ii[a]),Ni(e,t),t;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(ki(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),Ni(e,t),t):void ki(t,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(ki(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),Ni(e,t),t):void ki(t,0,0,0,1):void 0;var r=a.indexOf("("),o=a.indexOf(")");if(-1!==r&&o+1===a.length){var s=a.substr(0,r),l=a.substr(r+1,o-(r+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void ki(t,0,0,0,1);u=Di(l.pop());case"rgb":return 3!==l.length?void ki(t,0,0,0,1):(ki(t,Ci(l[0]),Ci(l[1]),Ci(l[2]),u),Ni(e,t),t);case"hsla":return 4!==l.length?void ki(t,0,0,0,1):(l[3]=Di(l[3]),Bi(l,t),Ni(e,t),t);case"hsl":return 3!==l.length?void ki(t,0,0,0,1):(Bi(l,t),Ni(e,t),t);default:return}}ki(t,0,0,0,1)}}function Bi(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=Di(e[1]),a=Di(e[2]),r=a<=.5?a*(n+1):a+n-a*n,o=2*a-r;return ki(t=t||[],Ai(255*Li(o,r,i+1/3)),Ai(255*Li(o,r,i)),Ai(255*Li(o,r,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Vi(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),a=Math.floor(n),r=Math.ceil(n),o=t[a],s=t[r],l=n-a;return i[0]=Ai(Pi(o[0],s[0],l)),i[1]=Ai(Pi(o[1],s[1],l)),i[2]=Ai(Pi(o[2],s[2],l)),i[3]=Ti(Pi(o[3],s[3],l)),i}}function Gi(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),a=Math.floor(n),r=Math.ceil(n),o=zi(t[a]),s=zi(t[r]),l=n-a,u=Fi([Ai(Pi(o[0],s[0],l)),Ai(Pi(o[1],s[1],l)),Ai(Pi(o[2],s[2],l)),Ti(Pi(o[3],s[3],l))],"rgba");return i?{color:u,leftIndex:a,rightIndex:r,value:n}:u}}function Fi(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}var Hi=function(e,t){var i=zi(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return Fi(i,4===i.length?"rgba":"rgb")}},Wi=function(e){var t=zi(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},Ui=function(e,t,i,n){if(e=zi(e))return e=function(e){if(e){var t,i,n=e[0]/255,a=e[1]/255,r=e[2]/255,o=Math.min(n,a,r),s=Math.max(n,a,r),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-a)/6+l/2)/l,d=((s-r)/6+l/2)/l;n===s?t=d-c:a===s?t=1/3+h-d:r===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,i,u];return null!=e[3]&&p.push(e[3]),p}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=Di(i)),null!=n&&(e[2]=Di(n)),Fi(Bi(e),"rgba")},ji=function(e,t){if((e=zi(e))&&null!=t)return e[3]=Ti(t),Fi(e,"rgba")},Zi={parse:zi,lift:Hi,toHex:Wi,fastLerp:Vi,fastMapToColor:Vi,lerp:Gi,mapToColor:Gi,modifyHSL:Ui,modifyAlpha:ji,stringify:Fi},Yi=Fe.isArrayLike,Xi=Array.prototype.slice;function qi(e,t){return e[t]}function $i(e,t,i){e[t]=i}function Ki(e,t,i){return(t-e)*i+e}function Ji(e,t,i){return i>.5?t:e}function Qi(e,t,i,n,a){var r=e.length;if(1===a)for(var o=0;o<r;o++)n[o]=Ki(e[o],t[o],i);else{var s=r&&e[0].length;for(o=0;o<r;o++)for(var l=0;l<s;l++)n[o][l]=Ki(e[o][l],t[o][l],i)}}function en(e,t,i){var n=e.length,a=t.length;if(n!==a)if(n>a)e.length=a;else for(var r=n;r<a;r++)e.push(1===i?t[r]:Xi.call(t[r]));var o=e[0]&&e[0].length;for(r=0;r<e.length;r++)if(1===i)isNaN(e[r])&&(e[r]=t[r]);else for(var s=0;s<o;s++)isNaN(e[r][s])&&(e[r][s]=t[r][s])}function tn(e,t,i){if(e===t)return!0;var n=e.length;if(n!==t.length)return!1;if(1===i){for(var a=0;a<n;a++)if(e[a]!==t[a])return!1}else{var r=e[0].length;for(a=0;a<n;a++)for(var o=0;o<r;o++)if(e[a][o]!==t[a][o])return!1}return!0}function nn(e,t,i,n,a,r,o,s,l){var u=e.length;if(1===l)for(var h=0;h<u;h++)s[h]=an(e[h],t[h],i[h],n[h],a,r,o);else{var c=e[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=an(e[h][d],t[h][d],i[h][d],n[h][d],a,r,o)}}function an(e,t,i,n,a,r,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*r+s*a+t}function rn(e){if(Yi(e)){var t=e.length;if(Yi(e[0])){for(var i=[],n=0;n<t;n++)i.push(Xi.call(e[n]));return i}return Xi.call(e)}return e}function on(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function sn(e,t,i,n,a,r){var o=e._getter,s=e._setter,l="spline"===t,u=n.length;if(u){var h,c=n[0].value,d=Yi(c),p=!1,f=!1,g=d?function(e){var t=e[e.length-1].value;return Yi(t&&t[0])?2:1}(n):0;n.sort((function(e,t){return e.time-t.time})),h=n[u-1].time;for(var m=[],v=[],y=n[0].value,x=!0,_=0;_<u;_++){m.push(n[_].time/h);var b=n[_].value;if(d&&tn(b,y,g)||!d&&b===y||(x=!1),y=b,"string"==typeof b){var w=Zi.parse(b);w?(b=w,p=!0):f=!0}v.push(b)}if(r||!x){var S=v[u-1];for(_=0;_<u-1;_++)d?en(v[_],S,g):!isNaN(v[_])||isNaN(S)||f||p||(v[_]=S);d&&en(o(e._target,a),S,g);var M,I,A,T,C,D=0,L=0;if(p)var P=[0,0,0,0];var k=new yi({target:e._target,life:h,loop:e._loop,delay:e._delay,onframe:function(e,t){var i;if(t<0)i=0;else if(t<L){for(i=Math.min(D+1,u-1);i>=0&&!(m[i]<=t);i--);i=Math.min(i,u-2)}else{for(i=D;i<u&&!(m[i]>t);i++);i=Math.min(i-1,u-2)}D=i,L=t;var n=m[i+1]-m[i];if(0!==n)if(M=(t-m[i])/n,l)if(A=v[i],I=v[0===i?i:i-1],T=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)nn(I,A,T,C,M,M*M,M*M*M,o(e,a),g);else{if(p)r=nn(I,A,T,C,M,M*M,M*M*M,P,1),r=on(P);else{if(f)return Ji(A,T,M);r=an(I,A,T,C,M,M*M,M*M*M)}s(e,a,r)}else if(d)Qi(v[i],v[i+1],M,o(e,a),g);else{var r;if(p)Qi(v[i],v[i+1],M,P,1),r=on(P);else{if(f)return Ji(v[i],v[i+1],M);r=Ki(v[i],v[i+1],M)}s(e,a,r)}},ondestroy:i});return t&&"spline"!==t&&(k.easing=t),k}}}var ln=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||qi,this._setter=n||$i,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};ln.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var a=this._getter(this._target,n);if(null==a)continue;0!==e&&i[n].push({time:0,value:rn(a)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,i=0;i<t;i++)e[i].call(this)},start:function(e,t){var i,n=this,a=0,r=function(){--a||n._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=sn(this,e,r,this._tracks[o],o,t);s&&(this._clipList.push(s),a++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(e,t){l(e,t);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](e,t)}}return a||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,i=this.animation,n=0;n<t.length;n++){var a=t[n];e&&a.onframe(this._target,1),i&&i.removeClip(a)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var un=ln,hn=1;"undefined"!=typeof window&&(hn=Math.max(window.devicePixelRatio||1,1));var cn={debugMode:0,devicePixelRatio:hn},dn=function(){},pn=Fe.isString,fn=Fe.isFunction,gn=Fe.isObject,mn=Fe.isArrayLike,vn=Fe.indexOf,yn=function(){this.animators=[]};function xn(e,t,i,n,a,r,o,s){pn(n)?(r=a,a=n,n=0):fn(a)?(r=a,a="linear",n=0):fn(n)?(r=n,n=0):fn(i)?(r=i,i=500):i||(i=500),e.stopAnimation(),_n(e,"",e,t,i,n,s);var l=e.animators.slice(),u=l.length;function h(){--u||r&&r()}u||r&&r();for(var c=0;c<l.length;c++)l[c].done(h).start(a,o)}function _n(e,t,i,n,a,r,o){var s={},l=0;for(var u in n)n.hasOwnProperty(u)&&(null!=i[u]?gn(n[u])&&!mn(n[u])?_n(e,t?t+"."+u:u,i[u],n[u],a,r,o):(o?(s[u]=i[u],bn(e,t,u,n[u])):s[u]=n[u],l++):null==n[u]||o||bn(e,t,u,n[u]));l>0&&e.animate(t,!1).when(null==a?500:a,s).delay(r||0)}function bn(e,t,i,n){if(t){var a={};a[t]={},a[t][i]=n,e.attr(a)}else e.attr(i,n)}yn.prototype={constructor:yn,animate:function(e,t){var i,n=!1,a=this,r=this.__zr;if(e){var o=e.split("."),s=a;n="shape"===o[0];for(var l=0,u=o.length;l<u;l++)s&&(s=s[o[l]]);s&&(i=s)}else i=a;if(i){var h=a.animators,c=new un(i,t);return c.during((function(e){a.dirty(n)})).done((function(){h.splice(vn(h,c),1)})),h.push(c),r&&r.animation.addAnimator(c),c}dn('Property "'+e+'" is not existed in element '+a.id)},stopAnimation:function(e){for(var t=this.animators,i=t.length,n=0;n<i;n++)t[n].stop(e);return t.length=0,this},animateTo:function(e,t,i,n,a,r){xn(this,e,t,i,n,a,r)},animateFrom:function(e,t,i,n,a,r){xn(this,e,t,i,n,a,r,!0)}};var wn=yn,Sn=function(e){fi.call(this,e),vt.call(this,e),wn.call(this,e),this.id=e.id||ne()};Sn.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(e,t){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.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(e,t){},attrKV:function(e,t){if("position"===e||"scale"===e||"origin"===e){if(t){var i=this[e];i||(i=this[e]=[]),i[0]=t[0],i[1]=t[1]}}else this[e]=t},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(Fe.isObject(e))for(var i in e)e.hasOwnProperty(i)&&this.attrKV(i,e[i]);return this.dirty(!1),this},setClipPath:function(e){var t=this.__zr;t&&e.addSelfToZr(t),this.clipPath&&this.clipPath!==e&&this.removeClipPath(),this.clipPath=e,e.__zr=t,e.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var e=this.clipPath;e&&(e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this.clipPath&&this.clipPath.addSelfToZr(e)},removeSelfFromZr:function(e){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this.clipPath&&this.clipPath.removeSelfFromZr(e)}},Fe.mixin(Sn,wn),Fe.mixin(Sn,fi),Fe.mixin(Sn,vt);var Mn,In,An,Tn,Cn=Sn,Dn=ht.applyTransform,Ln=Math.min,Pn=Math.max;function kn(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}kn.prototype={constructor:kn,union:function(e){var t=Ln(e.x,this.x),i=Ln(e.y,this.y);this.width=Pn(e.x+e.width,this.x+this.width)-t,this.height=Pn(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:(Mn=[],In=[],An=[],Tn=[],function(e){if(e){Mn[0]=An[0]=this.x,Mn[1]=Tn[1]=this.y,In[0]=Tn[0]=this.x+this.width,In[1]=An[1]=this.y+this.height,Dn(Mn,Mn,e),Dn(In,In,e),Dn(An,An,e),Dn(Tn,Tn,e),this.x=Ln(Mn[0],In[0],An[0],Tn[0]),this.y=Ln(Mn[1],In[1],An[1],Tn[1]);var t=Pn(Mn[0],In[0],An[0],Tn[0]),i=Pn(Mn[1],In[1],An[1],Tn[1]);this.width=t-this.x,this.height=i-this.y}}),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=ri.create();return ri.translate(a,a,[-t.x,-t.y]),ri.scale(a,a,[i,n]),ri.translate(a,a,[e.x,e.y]),a},intersect:function(e){if(!e)return!1;e instanceof kn||(e=kn.create(e));var t=this,i=t.x,n=t.x+t.width,a=t.y,r=t.y+t.height,o=e.x,s=e.x+e.width,l=e.y,u=e.y+e.height;return!(n<o||s<i||r<l||u<a)},contain:function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new kn(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},kn.create=function(e){return new kn(e.x,e.y,e.width,e.height)};var On=kn,Rn=function(e){for(var t in e=e||{},Cn.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};Rn.prototype={constructor:Rn,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},childOfName:function(e){for(var t=this._children,i=0;i<t.length;i++)if(t[i].name===e)return t[i]},childCount:function(){return this._children.length},add:function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},addBefore:function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var i=this._children,n=i.indexOf(t);n>=0&&(i.splice(n,0,e),this._doAdd(e))}return this},_doAdd:function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__storage,i=this.__zr;t&&t!==e.__storage&&(t.addToStorage(e),e instanceof Rn&&e.addChildrenToStorage(t)),i&&i.refresh()},remove:function(e){var t=this.__zr,i=this.__storage,n=this._children,a=Fe.indexOf(n,e);return a<0||(n.splice(a,1),e.parent=null,i&&(i.delFromStorage(e),e instanceof Rn&&e.delChildrenFromStorage(i)),t&&t.refresh()),this},removeAll:function(){var e,t,i=this._children,n=this.__storage;for(t=0;t<i.length;t++)e=i[t],n&&(n.delFromStorage(e),e instanceof Rn&&e.delChildrenFromStorage(n)),e.parent=null;return i.length=0,this},eachChild:function(e,t){for(var i=this._children,n=0;n<i.length;n++){var a=i[n];e.call(t,a,n)}return this},traverse:function(e,t){for(var i=0;i<this._children.length;i++){var n=this._children[i];e.call(t,n),"group"===n.type&&n.traverse(e,t)}return this},addChildrenToStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.addToStorage(i),i instanceof Rn&&i.addChildrenToStorage(e)}},delChildrenFromStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.delFromStorage(i),i instanceof Rn&&i.delChildrenFromStorage(e)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(e){for(var t=null,i=new On(0,0,0,0),n=e||this._children,a=[],r=0;r<n.length;r++){var o=n[r];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(a);l?(i.copy(s),i.applyTransform(l),(t=t||i.clone()).union(i)):(t=t||s.clone()).union(s)}}return t||i}},Fe.inherits(Rn,Cn);var En=Rn;function Nn(e,t,i,n){var a=t+1;if(a===i)return 1;if(n(e[a++],e[t])<0){for(;a<i&&n(e[a],e[a-1])<0;)a++;!function(e,t,i){i--;for(;t<i;){var n=e[t];e[t++]=e[i],e[i--]=n}}(e,t,a)}else for(;a<i&&n(e[a],e[a-1])>=0;)a++;return a-t}function zn(e,t,i,n,a){for(n===t&&n++;n<i;n++){for(var r,o=e[n],s=t,l=n;s<l;)a(o,e[r=s+l>>>1])<0?l=r:s=r+1;var u=n-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 Bn(e,t,i,n,a,r){var o=0,s=0,l=1;if(r(e,t[i+a])>0){for(s=n-a;l<s&&r(e,t[i+a+l])>0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;l<s&&r(e,t[i+a-l])<=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=a-l,l=a-u}for(o++;o<l;){var h=o+(l-o>>>1);r(e,t[i+h])>0?o=h+1:l=h}return l}function Vn(e,t,i,n,a,r){var o=0,s=0,l=1;if(r(e,t[i+a])<0){for(s=a+1;l<s&&r(e,t[i+a-l])<0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=a-l,l=a-u}else{for(s=n-a;l<s&&r(e,t[i+a+l])>=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o<l;){var h=o+(l-o>>>1);r(e,t[i+h])<0?l=h:o=h+1}return l}function Gn(e,t){var i,n,a=7,r=0;e.length;var o=[];function s(s){var l=i[s],u=n[s],h=i[s+1],c=n[s+1];n[s]=u+c,s===r-3&&(i[s+1]=i[s+2],n[s+1]=n[s+2]),r--;var d=Vn(e[h],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(c=Bn(e[l+u-1],e,h,c,c-1,t))&&(u<=c?function(i,n,r,s){var l=0;for(l=0;l<n;l++)o[l]=e[i+l];var u=0,h=r,c=i;if(e[c++]=e[h++],0==--s){for(l=0;l<n;l++)e[c+l]=o[u+l];return}if(1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];return void(e[c+s]=o[u])}var d,p,f,g=a;for(;;){d=0,p=0,f=!1;do{if(t(e[h],o[u])<0){if(e[c++]=e[h++],p++,d=0,0==--s){f=!0;break}}else if(e[c++]=o[u++],d++,p=0,1==--n){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=Vn(e[h],o,u,n,0,t))){for(l=0;l<d;l++)e[c+l]=o[u+l];if(c+=d,u+=d,(n-=d)<=1){f=!0;break}}if(e[c++]=e[h++],0==--s){f=!0;break}if(0!==(p=Bn(o[u],e,h,s,0,t))){for(l=0;l<p;l++)e[c+l]=e[h+l];if(c+=p,h+=p,0===(s-=p)){f=!0;break}}if(e[c++]=o[u++],1==--n){f=!0;break}g--}while(d>=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((a=g)<1&&(a=1),1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];e[c+s]=o[u]}else{if(0===n)throw new Error;for(l=0;l<n;l++)e[c+l]=o[u+l]}}(l,u,h,c):function(i,n,r,s){var l=0;for(l=0;l<s;l++)o[l]=e[r+l];var u=i+n-1,h=s-1,c=r+s-1,d=0,p=0;if(e[c--]=e[u--],0==--n){for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l];return}if(1===s){for(p=(c-=n)+1,d=(u-=n)+1,l=n-1;l>=0;l--)e[p+l]=e[d+l];return void(e[c]=o[h])}var f=a;for(;;){var g=0,m=0,v=!1;do{if(t(o[h],e[u])<0){if(e[c--]=e[u--],g++,m=0,0==--n){v=!0;break}}else if(e[c--]=o[h--],m++,g=0,1==--s){v=!0;break}}while((g|m)<f);if(v)break;do{if(0!==(g=n-Vn(o[h],e,i,n,n-1,t))){for(n-=g,p=(c-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)e[p+l]=e[d+l];if(0===n){v=!0;break}}if(e[c--]=o[h--],1==--s){v=!0;break}if(0!==(m=s-Bn(e[u],o,0,s,s-1,t))){for(s-=m,p=(c-=m)+1,d=(h-=m)+1,l=0;l<m;l++)e[p+l]=o[d+l];if(s<=1){v=!0;break}}if(e[c--]=e[u--],0==--n){v=!0;break}f--}while(g>=7||m>=7);if(v)break;f<0&&(f=0),f+=2}(a=f)<1&&(a=1);if(1===s){for(p=(c-=n)+1,d=(u-=n)+1,l=n-1;l>=0;l--)e[p+l]=e[d+l];e[c]=o[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l]}}(l,u,h,c))}i=[],n=[],this.mergeRuns=function(){for(;r>1;){var e=r-2;if(e>=1&&n[e-1]<=n[e]+n[e+1]||e>=2&&n[e-2]<=n[e]+n[e-1])n[e-1]<n[e+1]&&e--;else if(n[e]>n[e+1])break;s(e)}},this.forceMergeRuns=function(){for(;r>1;){var e=r-2;e>0&&n[e-1]<n[e+1]&&e--,s(e)}},this.pushRun=function(e,t){i[r]=e,n[r]=t,r+=1}}var Fn=function(e,t,i,n){i||(i=0),n||(n=e.length);var a=n-i;if(!(a<2)){var r=0;if(a<32)zn(e,i,n,i+(r=Nn(e,i,n,t)),t);else{var o=new Gn(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(a);do{if((r=Nn(e,i,n,t))<s){var l=a;l>s&&(l=s),zn(e,i,i+l,i+r,t),r=l}o.pushRun(i,r),o.mergeRuns(),a-=r,i+=r}while(0!==a);o.forceMergeRuns()}}};function Hn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Wn=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Wn.prototype={constructor:Wn,traverse:function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},getDisplayList:function(e,t){return t=t||!1,e&&this.updateDisplayList(t),this._displayList},updateDisplayList:function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,n=0,a=t.length;n<a;n++)this._updateAndAddDisplayable(t[n],null,e);i.length=this._displayListLen,ae.canvasSupported&&Fn(i,Hn)},_updateAndAddDisplayable:function(e,t,i){if(!e.ignore||i){e.beforeUpdate(),e.__dirty&&e.update(),e.afterUpdate();var n=e.clipPath;if(n){t=t?t.slice():[];for(var a=n,r=e;a;)a.parent=r,a.updateTransform(),t.push(a),r=a,a=a.clipPath}if(e.isGroup){for(var o=e._children,s=0;s<o.length;s++){var l=o[s];e.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,t,i)}e.__dirty=!1}else e.__clipPaths=t,this._displayList[this._displayListLen++]=e}},addRoot:function(e){e.__storage!==this&&(e instanceof En&&e.addChildrenToStorage(this),this.addToStorage(e),this._roots.push(e))},delRoot:function(e){if(null==e){for(var t=0;t<this._roots.length;t++){var i=this._roots[t];i instanceof En&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(e instanceof Array){t=0;for(var n=e.length;t<n;t++)this.delRoot(e[t])}else{var a=Fe.indexOf(this._roots,e);a>=0&&(this.delFromStorage(e),this._roots.splice(a,1),e instanceof En&&e.delChildrenFromStorage(this))}},addToStorage:function(e){return e&&(e.__storage=this,e.dirty(!1)),this},delFromStorage:function(e){return e&&(e.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:Hn};var Un=Wn,jn={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};var Zn=function(e,t,i){return jn.hasOwnProperty(t)?i*e.dpr:i},Yn={ContextCachedBy:{NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},WILL_BE_RESTORED:9},Xn=Yn.ContextCachedBy,qn=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],$n=function(e){this.extendFrom(e,!1)};function Kn(e,t,i){var n=null==t.x?0:t.x,a=null==t.x2?1:t.x2,r=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(n=n*i.width+i.x,a=a*i.width+i.x,r=r*i.height+i.y,o=o*i.height+i.y),n=isNaN(n)?0:n,a=isNaN(a)?1:a,r=isNaN(r)?0:r,o=isNaN(o)?0:o,e.createLinearGradient(n,r,a,o)}function Jn(e,t,i){var n=i.width,a=i.height,r=Math.min(n,a),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*n+i.x,s=s*a+i.y,l*=r),e.createRadialGradient(o,s,0,o,s,l)}$n.prototype={constructor:$n,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(e,t,i){var n=this,a=i&&i.style,r=!a||e.__attrCachedBy!==Xn.STYLE_BIND;e.__attrCachedBy=Xn.STYLE_BIND;for(var o=0;o<qn.length;o++){var s=qn[o],l=s[0];(r||n[l]!==a[l])&&(e[l]=Zn(e,l,n[l]||s[1]))}if((r||n.fill!==a.fill)&&(e.fillStyle=n.fill),(r||n.stroke!==a.stroke)&&(e.strokeStyle=n.stroke),(r||n.opacity!==a.opacity)&&(e.globalAlpha=null==n.opacity?1:n.opacity),(r||n.blend!==a.blend)&&(e.globalCompositeOperation=n.blend||"source-over"),this.hasStroke()){var u=n.lineWidth;e.lineWidth=u/(this.strokeNoScale&&t&&t.getLineScale?t.getLineScale():1)}},hasFill:function(){var e=this.fill;return null!=e&&"none"!==e},hasStroke:function(){var e=this.stroke;return null!=e&&"none"!==e&&this.lineWidth>0},extendFrom:function(e,t){if(e)for(var i in e)!e.hasOwnProperty(i)||!0!==t&&(!1===t?this.hasOwnProperty(i):null==e[i])||(this[i]=e[i])},set:function(e,t){"string"==typeof e?this[e]=t:this.extendFrom(e,!0)},clone:function(){var e=new this.constructor;return e.extendFrom(this,!0),e},getGradient:function(e,t,i){for(var n=("radial"===t.type?Jn:Kn)(e,t,i),a=t.colorStops,r=0;r<a.length;r++)n.addColorStop(a[r].offset,a[r].color);return n}};for(var Qn=$n.prototype,ea=0;ea<qn.length;ea++){var ta=qn[ea];ta[0]in Qn||(Qn[ta[0]]=ta[1])}$n.getGradient=Qn.getGradient;var ia=$n,na=function(e,t){this.image=e,this.repeat=t,this.type="pattern"};na.prototype.getCanvasPattern=function(e){return e.createPattern(this.image,this.repeat||"repeat")};var aa=na,ra=cn.devicePixelRatio;function oa(){return!1}function sa(e,t,i){var n=Fe.createCanvas(),a=t.getWidth(),r=t.getHeight(),o=n.style;return o&&(o.position="absolute",o.left=0,o.top=0,o.width=a+"px",o.height=r+"px",n.setAttribute("data-zr-dom-id",e)),n.width=a*i,n.height=r*i,n}var la=function(e,t,i){var n;i=i||ra,"string"==typeof e?n=sa(e,t,i):Fe.isObject(e)&&(e=(n=e).id),this.id=e,this.dom=n;var a=n.style;a&&(n.onselectstart=oa,a["-webkit-user-select"]="none",a["user-select"]="none",a["-webkit-touch-callout"]="none",a["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",a.padding=0,a.margin=0,a["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=t,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i};la.prototype={constructor:la,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var e=this.dpr;this.domBack=sa("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},resize:function(e,t){var i=this.dpr,n=this.dom,a=n.style,r=this.domBack;a&&(a.width=e+"px",a.height=t+"px"),n.width=e*i,n.height=t*i,r&&(r.width=e*i,r.height=t*i,1!==i&&this.ctxBack.scale(i,i))},clear:function(e,t){var i,n=this.dom,a=this.ctx,r=n.width,o=n.height,s=(t=t||this.clearColor,this.motionBlur&&!e),l=this.lastFrameAlpha,u=this.dpr;(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(n,0,0,r/u,o/u)),a.clearRect(0,0,r,o),t&&"transparent"!==t)&&(t.colorStops?(i=t.__canvasGradient||ia.getGradient(a,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=i):t.image&&(i=aa.prototype.getCanvasPattern.call(t,a)),a.save(),a.fillStyle=i||t,a.fillRect(0,0,r,o),a.restore());if(s){var h=this.domBack;a.save(),a.globalAlpha=l,a.drawImage(h,0,0,r,o),a.restore()}}};var ua=la,ha="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)},ca=new Mi(50);function da(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var i=e.pending[t],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}e.pending.length=0}function pa(e){return e&&e.width&&e.height}var fa=function(e,t,i,n,a){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var r=ca.get(e),o={hostEl:i,cb:n,cbPayload:a};return r?!pa(t=r.image)&&r.pending.push(o):((t=new Image).onload=t.onerror=da,ca.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return e}return t},ga={findExistImage:function(e){if("string"==typeof e){var t=ca.get(e);return t&&t.image}return e},createOrUpdateImage:fa,isImageReady:pa},ma=Fe.getContext,va=Fe.extend,ya=Fe.retrieve2,xa=Fe.retrieve3,_a=Fe.trim,ba={},wa=0,Sa=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,Ma="12px sans-serif",Ia={};function Aa(e,t){var i=e+":"+(t=t||Ma);if(ba[i])return ba[i];for(var n=(e+"").split("\n"),a=0,r=0,o=n.length;r<o;r++)a=Math.max(Ea(n[r],t).width,a);return wa>5e3&&(wa=0,ba={}),wa++,ba[i]=a,a}function Ta(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function Ca(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function Da(e,t,i){var n=t.textPosition,a=t.textDistance,r=i.x,o=i.y;a=a||0;var s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":r-=a,o+=u,h="right",c="middle";break;case"right":r+=a+l,o+=u,c="middle";break;case"top":r+=l/2,o-=a,h="center",c="bottom";break;case"bottom":r+=l/2,o+=s+a,h="center";break;case"inside":r+=l/2,o+=u,h="center",c="middle";break;case"insideLeft":r+=a,o+=u,c="middle";break;case"insideRight":r+=l-a,o+=u,h="right",c="middle";break;case"insideTop":r+=l/2,o+=a,h="center";break;case"insideBottom":r+=l/2,o+=s-a,h="center",c="bottom";break;case"insideTopLeft":r+=a,o+=a;break;case"insideTopRight":r+=l-a,o+=a,h="right";break;case"insideBottomLeft":r+=a,o+=s-a,c="bottom";break;case"insideBottomRight":r+=l-a,o+=s-a,h="right",c="bottom"}return(e=e||{}).x=r,e.y=o,e.textAlign=h,e.textVerticalAlign=c,e}function La(e,t,i,n,a){if(!t)return"";var r=(e+"").split("\n");a=Pa(t,i,n,a);for(var o=0,s=r.length;o<s;o++)r[o]=ka(r[o],a);return r.join("\n")}function Pa(e,t,i,n){(n=va({},n)).font=t;i=ya(i,"...");n.maxIterations=ya(n.maxIterations,2);var a=n.minChar=ya(n.minChar,0);n.cnCharWidth=Aa("国",t);var r=n.ascCharWidth=Aa("a",t);n.placeholder=ya(n.placeholder,"");for(var o=e=Math.max(0,e-1),s=0;s<a&&o>=r;s++)o-=r;var l=Aa(i,t);return l>o&&(i="",l=0),o=e-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=o,n.containerWidth=e,n}function ka(e,t){var i=t.containerWidth,n=t.font,a=t.contentWidth;if(!i)return"";var r=Aa(e,n);if(r<=i)return e;for(var o=0;;o++){if(r<=a||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?Oa(e,a,t.ascCharWidth,t.cnCharWidth):r>0?Math.floor(e.length*a/r):0;r=Aa(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function Oa(e,t,i,n){for(var a=0,r=0,o=e.length;r<o&&a<t;r++){var s=e.charCodeAt(r);a+=0<=s&&s<=127?i:n}return r}function Ra(e){return Aa("国",e)}function Ea(e,t){return Ia.measureText(e,t)}function Na(e,t,i,n,a){null!=e&&(e+="");var r=ya(n,Ra(t)),o=e?e.split("\n"):[],s=o.length*r,l=s,u=!0;if(i&&(l+=i[0]+i[2]),e&&a){u=!1;var h=a.outerHeight,c=a.outerWidth;if(null!=h&&l>h)e="",o=[];else if(null!=c)for(var d=Pa(c-(i?i[1]+i[3]:0),t,a.ellipsis,{minChar:a.minChar,placeholder:a.placeholder}),p=0,f=o.length;p<f;p++)o[p]=ka(o[p],d)}return{lines:o,height:s,outerHeight:l,lineHeight:r,canCacheByTextString:u}}function za(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,a=Sa.lastIndex=0;null!=(n=Sa.exec(e));){var r=n.index;r>a&&Ba(i,e.substring(a,r)),Ba(i,n[2],n[1]),a=Sa.lastIndex}a<e.length&&Ba(i,e.substring(a,e.length));var o=i.lines,s=0,l=0,u=[],h=t.textPadding,c=t.truncate,d=c&&c.outerWidth,p=c&&c.outerHeight;h&&(null!=d&&(d-=h[1]+h[3]),null!=p&&(p-=h[0]+h[2]));for(var f=0;f<o.length;f++){for(var g=o[f],m=0,v=0,y=0;y<g.tokens.length;y++){var x=(D=g.tokens[y]).styleName&&t.rich[D.styleName]||{},_=D.textPadding=x.textPadding,b=D.font=x.font||t.font,w=D.textHeight=ya(x.textHeight,Ra(b));if(_&&(w+=_[0]+_[2]),D.height=w,D.lineHeight=xa(x.textLineHeight,t.textLineHeight,w),D.textAlign=x&&x.textAlign||t.textAlign,D.textVerticalAlign=x&&x.textVerticalAlign||"middle",null!=p&&s+D.lineHeight>p)return{lines:[],width:0,height:0};D.textWidth=Aa(D.text,b);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))D.percentWidth=S,u.push(D),S=0;else{if(M){S=D.textWidth;var I=x.textBackgroundColor,A=I&&I.image;A&&(A=ga.findExistImage(A),ga.isImageReady(A)&&(S=Math.max(S,A.width*w/A.height)))}var T=_?_[1]+_[3]:0;S+=T;var C=null!=d?d-v:null;null!=C&&C<S&&(!M||C<T?(D.text="",D.textWidth=S=0):(D.text=La(D.text,C-T,b,c.ellipsis,{minChar:c.minChar}),D.textWidth=Aa(D.text,b),S=D.textWidth+T))}v+=D.width=S,x&&(m=Math.max(m,D.lineHeight))}g.width=v,g.lineHeight=m,s+=m,l=Math.max(l,v)}i.outerWidth=i.width=ya(t.textWidth,l),i.outerHeight=i.height=ya(t.textHeight,s),h&&(i.outerWidth+=h[1]+h[3],i.outerHeight+=h[0]+h[2]);for(f=0;f<u.length;f++){var D,L=(D=u[f]).percentWidth;D.width=parseInt(L,10)/100*l}return i}function Ba(e,t,i){for(var n=""===t,a=t.split("\n"),r=e.lines,o=0;o<a.length;o++){var s=a[o],l={styleName:i,text:s,isLineHolder:!s&&!n};if(o)r.push({tokens:[l]});else{var u=(r[r.length-1]||(r[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:(s||!h||n)&&u.push(l)}}}Ia.measureText=function(e,t){var i=ma();return i.font=t||Ma,i.measureText(e)};var Va=function(e,t,i,n,a,r,o,s){return o?function(e,t,i,n,a,r,o,s){var l=za(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:a,textLineHeight:r}),u=l.outerWidth,h=l.outerHeight,c=Ta(0,u,i),d=Ca(0,h,n);return new On(c,d,u,h)}(e,t,i,n,a,r,o,s):function(e,t,i,n,a,r,o){var s=Na(e,t,a,r,o),l=Aa(e,t);a&&(l+=a[1]+a[3]);var u=s.outerHeight,h=Ta(0,l,i),c=Ca(0,u,n),d=new On(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,n,a,r,s)},Ga=function(e,t,i){return Da({},{textPosition:e,textDistance:i},t)},Fa=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&_a(t)||e.textFont||e.font},Ha={DEFAULT_FONT:Ma,$override:function(e,t){Ia[e]=t},getWidth:Aa,getBoundingRect:Va,adjustTextX:Ta,adjustTextY:Ca,calculateTextPosition:Da,adjustTextPositionOnRect:Ga,truncateText:La,getLineHeight:Ra,measureText:Ea,parsePlainText:Na,parseRichText:za,makeFont:Fa};var Wa={buildPath:function(e,t){var i,n,a,r,o,s=t.x,l=t.y,u=t.width,h=t.height,c=t.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?i=n=a=r=c:c instanceof Array?1===c.length?i=n=a=r=c[0]:2===c.length?(i=a=c[0],n=r=c[1]):3===c.length?(i=c[0],n=r=c[1],a=c[2]):(i=c[0],n=c[1],a=c[2],r=c[3]):i=n=a=r=0,i+n>u&&(i*=u/(o=i+n),n*=u/o),a+r>u&&(a*=u/(o=a+r),r*=u/o),n+a>h&&(n*=h/(o=n+a),a*=h/o),i+r>h&&(i*=h/(o=i+r),r*=h/o),e.moveTo(s+i,l),e.lineTo(s+u-n,l),0!==n&&e.arc(s+u-n,l+n,n,-Math.PI/2,0),e.lineTo(s+u,l+h-a),0!==a&&e.arc(s+u-a,l+h-a,a,0,Math.PI/2),e.lineTo(s+r,l+h),0!==r&&e.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),e.lineTo(s,l+i),0!==i&&e.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)}},Ua=Fe.retrieve2,ja=Fe.retrieve3,Za=Fe.each,Ya=Fe.normalizeCssArray,Xa=Fe.isString,qa=Fe.isObject,$a=Yn.ContextCachedBy,Ka=Yn.WILL_BE_RESTORED,Ja=Ha.DEFAULT_FONT,Qa={left:1,right:1,center:1},er={top:1,bottom:1,middle:1},tr=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],ir={},nr={};function ar(e){if(e){e.font=Ha.makeFont(e);var t=e.textAlign;"middle"===t&&(t="center"),e.textAlign=null==t||Qa[t]?t:"left";var i=e.textVerticalAlign||e.textBaseline;"center"===i&&(i="middle"),e.textVerticalAlign=null==i||er[i]?i:"top",e.textPadding&&(e.textPadding=Ya(e.textPadding))}}function rr(e,t,i,n,a){if(i&&t.textRotation){var r=t.textOrigin;"center"===r?(n=i.width/2+i.x,a=i.height/2+i.y):r&&(n=r[0]+i.x,a=r[1]+i.y),e.translate(n,a),e.rotate(-t.textRotation),e.translate(-n,-a)}}function or(e,t,i,n,a,r,o,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=r+a/2;"top"===u?h=r+i.height/2:"bottom"===u&&(h=r+a-i.height/2),!i.isLineHolder&&sr(l)&&lr(e,t,l,"right"===s?o-i.width:"center"===s?o-i.width/2:o,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(o=gr(o,s,c),h-=i.height/2-c[2]-i.textHeight/2),cr(t,"shadowBlur",ja(l.textShadowBlur,n.textShadowBlur,0)),cr(t,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),cr(t,"shadowOffsetX",ja(l.textShadowOffsetX,n.textShadowOffsetX,0)),cr(t,"shadowOffsetY",ja(l.textShadowOffsetY,n.textShadowOffsetY,0)),cr(t,"textAlign",s),cr(t,"textBaseline","middle"),cr(t,"font",i.font||Ja);var d=dr(l.textStroke||n.textStroke,f),p=pr(l.textFill||n.textFill),f=Ua(l.textStrokeWidth,n.textStrokeWidth);d&&(cr(t,"lineWidth",f),cr(t,"strokeStyle",d),t.strokeText(i.text,o,h)),p&&(cr(t,"fillStyle",p),t.fillText(i.text,o,h))}function sr(e){return!!(e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor)}function lr(e,t,i,n,a,r,o){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=Xa(s);if(cr(t,"shadowBlur",i.textBoxShadowBlur||0),cr(t,"shadowColor",i.textBoxShadowColor||"transparent"),cr(t,"shadowOffsetX",i.textBoxShadowOffsetX||0),cr(t,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){t.beginPath();var c=i.textBorderRadius;c?Wa.buildPath(t,{x:n,y:a,width:r,height:o,r:c}):t.rect(n,a,r,o),t.closePath()}if(h)if(cr(t,"fillStyle",s),null!=i.fillOpacity){var d=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,t.fill(),t.globalAlpha=d}else t.fill();else if(qa(s)){var p=s.image;(p=ga.createOrUpdateImage(p,null,e,ur,s))&&ga.isImageReady(p)&&t.drawImage(p,n,a,r,o)}if(l&&u)if(cr(t,"lineWidth",l),cr(t,"strokeStyle",u),null!=i.strokeOpacity){d=t.globalAlpha;t.globalAlpha=i.strokeOpacity*i.opacity,t.stroke(),t.globalAlpha=d}else t.stroke()}function ur(e,t){t.image=e}function hr(e,t,i,n){var a=i.x||0,r=i.y||0,o=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)a=n.x+fr(l[0],n.width),r=n.y+fr(l[1],n.height);else{var u=t&&t.calculateTextPosition?t.calculateTextPosition(ir,i,n):Ha.calculateTextPosition(ir,i,n);a=u.x,r=u.y,o=o||u.textAlign,s=s||u.textVerticalAlign}var h=i.textOffset;h&&(a+=h[0],r+=h[1])}return(e=e||{}).baseX=a,e.baseY=r,e.textAlign=o,e.textVerticalAlign=s,e}function cr(e,t,i){return e[t]=Zn(e,t,i),e[t]}function dr(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function pr(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function fr(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function gr(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}var mr=function(e){return ar(e),Za(e.rich,ar),e},vr=function(e,t,i,n,a,r){n.rich?function(e,t,i,n,a,r){r!==Ka&&(t.__attrCachedBy=$a.NONE);var o=e.__textCotentBlock;o&&!e.__dirtyText||(o=e.__textCotentBlock=Ha.parseRichText(i,n));!function(e,t,i,n,a){var r=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=hr(nr,e,n,a),h=u.baseX,c=u.baseY,d=u.textAlign,p=u.textVerticalAlign;rr(t,n,a,h,c);var f=Ha.adjustTextX(h,o,d),g=Ha.adjustTextY(c,s,p),m=f,v=g;l&&(m+=l[3],v+=l[0]);var y=m+r;sr(n)&&lr(e,t,n,f,g,o,s);for(var x=0;x<i.lines.length;x++){for(var _,b=i.lines[x],w=b.tokens,S=w.length,M=b.lineHeight,I=b.width,A=0,T=m,C=y,D=S-1;A<S&&(!(_=w[A]).textAlign||"left"===_.textAlign);)or(e,t,_,n,M,v,T,"left"),I-=_.width,T+=_.width,A++;for(;D>=0&&"right"===(_=w[D]).textAlign;)or(e,t,_,n,M,v,C,"right"),I-=_.width,C-=_.width,D--;for(T+=(r-(T-m)-(y-C)-I)/2;A<=D;)or(e,t,_=w[A],n,M,v,T+_.width/2,"center"),T+=_.width,A++;v+=M}}(e,t,o,n,a)}(e,t,i,n,a,r):function(e,t,i,n,a,r){var o,s=sr(n),l=!1,u=t.__attrCachedBy===$a.PLAIN_TEXT;r!==Ka?(r&&(o=r.style,l=!s&&u&&o),t.__attrCachedBy=s?$a.NONE:$a.PLAIN_TEXT):u&&(t.__attrCachedBy=$a.NONE);var h=n.font||Ja;l&&h===(o.font||Ja)||(t.font=h);var c=e.__computedFont;e.__styleFont!==h&&(e.__styleFont=h,c=e.__computedFont=t.font);var d=n.textPadding,p=n.textLineHeight,f=e.__textCotentBlock;f&&!e.__dirtyText||(f=e.__textCotentBlock=Ha.parsePlainText(i,c,d,p,n.truncate));var g=f.outerHeight,m=f.lines,v=f.lineHeight,y=hr(nr,e,n,a),x=y.baseX,_=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;rr(t,n,a,x,_);var S=Ha.adjustTextY(_,g,w),M=x,I=S;if(s||d){var A=Ha.getWidth(i,c);d&&(A+=d[1]+d[3]);var T=Ha.adjustTextX(x,A,b);s&&lr(e,t,n,T,S,A,g),d&&(M=gr(x,b,d),I+=d[0])}t.textAlign=b,t.textBaseline="middle",t.globalAlpha=n.opacity||1;for(var C=0;C<tr.length;C++){var D=tr[C],L=D[0],P=D[1],k=n[L];l&&k===o[L]||(t[P]=Zn(t,P,k||D[2]))}I+=v/2;var O=n.textStrokeWidth,R=l?o.textStrokeWidth:null,E=!l||O!==R,N=!l||E||n.textStroke!==o.textStroke,z=dr(n.textStroke,O),B=pr(n.textFill);z&&(E&&(t.lineWidth=O),N&&(t.strokeStyle=z));B&&(l&&n.textFill===o.textFill||(t.fillStyle=B));if(1===m.length)z&&t.strokeText(m[0],M,I),B&&t.fillText(m[0],M,I);else for(C=0;C<m.length;C++)z&&t.strokeText(m[C],M,I),B&&t.fillText(m[C],M,I),I+=v}(e,t,i,n,a,r)},yr=function(e,t){return null!=e&&(e||t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor||t.textPadding)},xr={normalizeTextStyle:mr,renderText:vr,getBoxPosition:hr,getStroke:dr,getFill:pr,parsePercent:fr,needDrawText:yr},_r=Yn.WILL_BE_RESTORED,br=new On,wr=function(){};wr.prototype={constructor:wr,drawRectText:function(e,t){var i=this.style;t=i.textRect||t,this.__dirty&&xr.normalizeTextStyle(i,!0);var n=i.text;if(null!=n&&(n+=""),xr.needDrawText(n,i)){e.save();var a=this.transform;i.transformText?this.setTransform(e):a&&(br.copy(t),br.applyTransform(a),t=br),xr.renderText(this,e,n,i,t,_r),e.restore()}}};var Sr=wr;function Mr(e){for(var t in e=e||{},Cn.call(this,e),e)e.hasOwnProperty(t)&&"style"!==t&&(this[t]=e[t]);this.style=new ia(e.style),this._rect=null,this.__clipPaths=null}Mr.prototype={constructor:Mr,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(e){},afterBrush:function(e){},brush:function(e,t){},getBoundingRect:function(){},contain:function(e,t){return this.rectContain(e,t)},traverse:function(e,t){e.call(t,this)},rectContain:function(e,t){var i=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(e){return this.animate("style",e)},attrKV:function(e,t){"style"!==e?Cn.prototype.attrKV.call(this,e,t):this.style.set(t)},setStyle:function(e,t){return this.style.set(e,t),this.dirty(!1),this},useStyle:function(e){return this.style=new ia(e),this.dirty(!1),this},calculateTextPosition:null},Fe.inherits(Mr,Cn),Fe.mixin(Mr,Sr);var Ir=Mr;function Ar(e){Ir.call(this,e)}Ar.prototype={constructor:Ar,type:"image",brush:function(e,t){var i=this.style,n=i.image;i.bind(e,this,t);var a=this._image=ga.createOrUpdateImage(n,this._image,this,this.onload);if(a&&ga.isImageReady(a)){var r=i.x||0,o=i.y||0,s=i.width,l=i.height,u=a.width/a.height;if(null==s&&null!=l?s=l*u:null==l&&null!=s?l=s/u:null==s&&null==l&&(s=a.width,l=a.height),this.setTransform(e),i.sWidth&&i.sHeight){var h=i.sx||0,c=i.sy||0;e.drawImage(a,h,c,i.sWidth,i.sHeight,r,o,s,l)}else if(i.sx&&i.sy){var d=s-(h=i.sx),p=l-(c=i.sy);e.drawImage(a,h,c,d,p,r,o,s,l)}else e.drawImage(a,r,o,s,l);null!=i.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))}},getBoundingRect:function(){var e=this.style;return this._rect||(this._rect=new On(e.x||0,e.y||0,e.width||0,e.height||0)),this._rect}},Fe.inherits(Ar,Ir);var Tr=Ar,Cr=cn.devicePixelRatio,Dr=1e5,Lr=314159,Pr=.01;function kr(e){return parseInt(e,10)}var Or=new On(0,0,0,0),Rr=new On(0,0,0,0);var Er=function(e,t,i){this.type="canvas";var n=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=i=Fe.extend({},i||{}),this.dpr=i.devicePixelRatio||Cr,this._singleCanvas=n,this.root=e;var a=e.style;a&&(a["-webkit-tap-highlight-color"]="transparent",a["-webkit-user-select"]=a["user-select"]=a["-webkit-touch-callout"]="none",e.innerHTML=""),this.storage=t;var r=this._zlevelList=[],o=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,n){var s=e.width,l=e.height;null!=i.width&&(s=i.width),null!=i.height&&(l=i.height),this.dpr=i.devicePixelRatio||1,e.width=s*this.dpr,e.height=l*this.dpr,this._width=s,this._height=l;var u=new ua(e,this,this.dpr);u.__builtin__=!0,u.initContext(),o[314159]=u,u.zlevel=Lr,r.push(Lr),this._domRoot=e}else{this._width=this._getSize(0),this._height=this._getSize(1);var h=this._domRoot=function(e,t){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);e.appendChild(h)}this._hoverlayer=null,this._hoverElements=[]};Er.prototype={constructor:Er,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(e){var t=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,e,this._redrawId);for(var n=0;n<i.length;n++){var a=i[n],r=this._layers[a];if(!r.__builtin__&&r.refresh){var o=0===n?this._backgroundColor:null;r.refresh(o)}}return this.refreshHover(),this},addHover:function(e,t){if(!e.__hoverMir){var i=new e.constructor({style:e.style,shape:e.shape,z:e.z,z2:e.z2,silent:e.silent});return i.__from=e,e.__hoverMir=i,t&&i.setStyle(t),this._hoverElements.push(i),i}},removeHover:function(e){var t=e.__hoverMir,i=this._hoverElements,n=Fe.indexOf(i,t);n>=0&&i.splice(n,1),e.__hoverMir=null},clearHover:function(e){for(var t=this._hoverElements,i=0;i<t.length;i++){var n=t[i].__from;n&&(n.__hoverMir=null)}t.length=0},refreshHover:function(){var e=this._hoverElements,t=e.length,i=this._hoverlayer;if(i&&i.clear(),t){Fn(e,this.storage.displayableSortFunc),i||(i=this._hoverlayer=this.getLayer(Dr));var n={};i.ctx.save();for(var a=0;a<t;){var r=e[a],o=r.__from;o&&o.__zr?(a++,o.invisible||(r.transform=o.transform,r.invTransform=o.invTransform,r.__clipPaths=o.__clipPaths,this._doPaintEl(r,i,!0,n))):(e.splice(a,1),o.__hoverMir=null,t--)}i.ctx.restore()}},getHoverLayer:function(){return this.getLayer(Dr)},_paintList:function(e,t,i){if(this._redrawId===i){t=t||!1,this._updateLayerStatus(e);var n=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),!n){var a=this;ha((function(){a._paintList(e,t,i)}))}}},_compositeManually:function(){var e=this.getLayer(Lr).ctx,t=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,t,i),this.eachBuiltinLayer((function(n){n.virtual&&e.drawImage(n.dom,0,0,t,i)}))},_doPaintList:function(e,t){for(var i=[],n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];(s=this._layers[a]).__builtin__&&s!==this._hoverlayer&&(s.__dirty||t)&&i.push(s)}for(var r=!0,o=0;o<i.length;o++){var s,l=(s=i[o]).ctx,u={};l.save();var h=t?s.__startIndex:s.__drawIndex,c=!t&&s.incremental&&Date.now,d=c&&Date.now(),p=s.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,p);else if(h===s.__startIndex){var f=e[h];f.incremental&&f.notClear&&!t||s.clear(!1,p)}-1===h&&(console.error("For some unknown reason. drawIndex is -1"),h=s.__startIndex);for(var g=h;g<s.__endIndex;g++){var m=e[g];if(this._doPaintEl(m,s,t,u),m.__dirty=m.__dirtyText=!1,c)if(Date.now()-d>15)break}s.__drawIndex=g,s.__drawIndex<s.__endIndex&&(r=!1),u.prevElClipPaths&&l.restore(),l.restore()}return ae.wxa&&Fe.each(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),r},_doPaintEl:function(e,t,i,n){var a=t.ctx,r=e.transform;if((t.__dirty||i)&&!e.invisible&&0!==e.style.opacity&&(!r||r[0]||r[3])&&(!e.culling||!function(e,t,i){return Or.copy(e.getBoundingRect()),e.transform&&Or.applyTransform(e.transform),Rr.width=t,Rr.height=i,!Or.intersect(Rr)}(e,this._width,this._height))){var o=e.__clipPaths,s=n.prevElClipPaths;s&&!function(e,t){if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!0;return!1}(o,s)||(s&&(a.restore(),n.prevElClipPaths=null,n.prevEl=null),o&&(a.save(),function(e,t){for(var i=0;i<e.length;i++){var n=e[i];n.setTransform(t),t.beginPath(),n.buildPath(t,n.shape),t.clip(),n.restoreTransform(t)}}(o,a),n.prevElClipPaths=o)),e.beforeBrush&&e.beforeBrush(a),e.brush(a,n.prevEl||null),n.prevEl=e,e.afterBrush&&e.afterBrush(a)}},getLayer:function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Lr);var i=this._layers[e];return i||((i=new ua("zr_"+e,this,this.dpr)).zlevel=e,i.__builtin__=!0,this._layerConfig[e]?Fe.merge(i,this._layerConfig[e],!0):this._layerConfig[e-Pr]&&Fe.merge(i,this._layerConfig[e-Pr],!0),t&&(i.virtual=t),this.insertLayer(e,i),i.initContext()),i},insertLayer:function(e,t){var i=this._layers,n=this._zlevelList,a=n.length,r=null,o=-1,s=this._domRoot;if(!i[e]&&function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(a>0&&e>n[0]){for(o=0;o<a-1&&!(n[o]<e&&n[o+1]>e);o++);r=i[n[o]]}if(n.splice(o+1,0,e),i[e]=t,!t.virtual)if(r){var l=r.dom;l.nextSibling?s.insertBefore(t.dom,l.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom)}},eachLayer:function(e,t){var i,n,a=this._zlevelList;for(n=0;n<a.length;n++)i=a[n],e.call(t,this._layers[i],i)},eachBuiltinLayer:function(e,t){var i,n,a,r=this._zlevelList;for(a=0;a<r.length;a++)n=r[a],(i=this._layers[n]).__builtin__&&e.call(t,i,n)},eachOtherLayer:function(e,t){var i,n,a,r=this._zlevelList;for(a=0;a<r.length;a++)n=r[a],(i=this._layers[n]).__builtin__||e.call(t,i,n)},getLayers:function(){return this._layers},_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 i=1;i<e.length;i++){if((o=e[i]).zlevel!==e[i-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var n,a=null,r=0;for(i=0;i<e.length;i++){var o,s,l=(o=e[i]).zlevel;n!==l&&(n=l,r=0),o.incremental?((s=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,r=1):s=this.getLayer(l+(r>0?Pr:0),this._needsManuallyCompositing),s.__builtin__||dn("ZLevel "+l+" has been used by unkown layer "+s.id),s!==a&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,t(i),a=s),o.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(e){e.clear()},setBackgroundColor:function(e){this._backgroundColor=e},configLayer:function(e,t){if(t){var i=this._layerConfig;i[e]?Fe.merge(i[e],t,!0):i[e]=t;for(var n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];if(a===e||a===e+Pr){var r=this._layers[a];Fe.merge(r,i[e],!0)}}}},delLayer:function(e){var t=this._layers,i=this._zlevelList,n=t[e];n&&(n.dom.parentNode.removeChild(n.dom),delete t[e],i.splice(Fe.indexOf(i,e),1))},resize:function(e,t){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||t!==this._height){for(var a in i.style.width=e+"px",i.style.height=t+"px",this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,t);Fe.each(this._progressiveLayers,(function(i){i.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(Lr).resize(e,t)}return this},clearLayer:function(e){var t=this._layers[e];t&&t.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new ua("image",this,e.pixelRatio||this.dpr);if(t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor),e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,n=t.dom.height,a=t.ctx;this.eachLayer((function(e){e.__builtin__?a.drawImage(e.dom,0,0,i,n):e.renderToCanvas&&(t.ctx.save(),e.renderToCanvas(t.ctx),t.ctx.restore())}))}else for(var r={},o=this.storage.getDisplayList(!0),s=0;s<o.length;s++){var l=o[s];this._doPaintEl(l,t,!0,r)}return t.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],r=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||kr(s[i])||kr(o.style[i]))-(kr(s[a])||0)-(kr(s[r])||0)|0},pathToImage:function(e,t){t=t||this.dpr;var i=document.createElement("canvas"),n=i.getContext("2d"),a=e.getBoundingRect(),r=e.style,o=r.shadowBlur*t,s=r.shadowOffsetX*t,l=r.shadowOffsetY*t,u=r.hasStroke()?r.lineWidth:0,h=Math.max(u/2,-s+o),c=Math.max(u/2,s+o),d=Math.max(u/2,-l+o),p=Math.max(u/2,l+o),f=a.width+h+c,g=a.height+d+p;i.width=f*t,i.height=g*t,n.scale(t,t),n.clearRect(0,0,f,g),n.dpr=t;var m={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[h-a.x,d-a.y],e.rotation=0,e.scale=[1,1],e.updateTransform(),e&&e.brush(n);var v=new Tr({style:{x:0,y:0,image:i}});return null!=m.position&&(v.position=e.position=m.position),null!=m.rotation&&(v.rotation=e.rotation=m.rotation),null!=m.scale&&(v.scale=e.scale=m.scale),v}};var Nr=Er,zr=zt.Dispatcher,Br=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,zr.call(this)};Br.prototype={constructor:Br,addClip:function(e){this._clips.push(e)},addAnimator:function(e){e.animation=this;for(var t=e.getClips(),i=0;i<t.length;i++)this.addClip(t[i])},removeClip:function(e){var t=Fe.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},removeAnimator:function(e){for(var t=e.getClips(),i=0;i<t.length;i++)this.removeClip(t[i]);e.animation=null},_update:function(){for(var e=(new Date).getTime()-this._pausedTime,t=e-this._time,i=this._clips,n=i.length,a=[],r=[],o=0;o<n;o++){var s=i[o],l=s.step(e,t);l&&(a.push(l),r.push(s))}for(o=0;o<n;)i[o]._needsRemove?(i[o]=i[n-1],i.pop(),n--):o++;n=a.length;for(o=0;o<n;o++)r[o].fire(a[o]);this._time=e,this.onframe(t),this.trigger("frame",t),this.stage.update&&this.stage.update()},_startLoop:function(){var e=this;this._running=!0,ha((function t(){e._running&&(ha(t),!e._paused&&e._update())}))},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(e,t){var i=new un(e,(t=t||{}).loop,t.getter,t.setter);return this.addAnimator(i),i}},Fe.mixin(Br,zr);var Vr,Gr,Fr=Br,Hr=zt.addEventListener,Wr=zt.removeEventListener,Ur=zt.normalizeEvent,jr=zt.getNativeEvent,Zr=ae.domSupported,Yr=(Gr={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Vr=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:Fe.map(Vr,(function(e){var t=e.replace("mouse","pointer");return Gr.hasOwnProperty(t)?t:e}))}),Xr=["mousemove","mouseup"],qr=["pointermove","pointerup"];function $r(e){return"mousewheel"===e&&ae.browser.firefox?"DOMMouseScroll":e}function Kr(e){var t=e.pointerType;return"pen"===t||"touch"===t}function Jr(e){e&&(e.zrByTouch=!0)}function Qr(e,t){for(var i=t,n=!1;i&&9!==i.nodeType&&!(n=i.domBelongToZr||i!==t&&i===e.painterRoot);)i=i.parentNode;return n}function eo(e,t){this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}var to=eo.prototype;to.stopPropagation=to.stopImmediatePropagation=to.preventDefault=Fe.noop;var io={mousedown:function(e){e=Ur(this.dom,e),this._mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Ur(this.dom,e);var t=this._mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||lo(this,!0),this.trigger("mousemove",e)},mouseup:function(e){e=Ur(this.dom,e),lo(this,!1),this.trigger("mouseup",e)},mouseout:function(e){e=Ur(this.dom,e),this._pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=Qr(this,t),this.trigger("mouseout",e)},touchstart:function(e){Jr(e=Ur(this.dom,e)),this._lastTouchMoment=new Date,this.handler.processGesture(e,"start"),io.mousemove.call(this,e),io.mousedown.call(this,e)},touchmove:function(e){Jr(e=Ur(this.dom,e)),this.handler.processGesture(e,"change"),io.mousemove.call(this,e)},touchend:function(e){Jr(e=Ur(this.dom,e)),this.handler.processGesture(e,"end"),io.mouseup.call(this,e),+new Date-this._lastTouchMoment<300&&io.click.call(this,e)},pointerdown:function(e){io.mousedown.call(this,e)},pointermove:function(e){Kr(e)||io.mousemove.call(this,e)},pointerup:function(e){io.mouseup.call(this,e)},pointerout:function(e){Kr(e)||io.mouseout.call(this,e)}};Fe.each(["click","mousewheel","dblclick","contextmenu"],(function(e){io[e]=function(t){t=Ur(this.dom,t),this.trigger(e,t)}}));var no={pointermove:function(e){Kr(e)||no.mousemove.call(this,e)},pointerup:function(e){no.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this._pointerCapturing;lo(this,!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function ao(e,t){var i=t.domHandlers;ae.pointerEventsSupported?Fe.each(Yr.pointer,(function(n){oo(t,n,(function(t){i[n].call(e,t)}))})):(ae.touchEventsSupported&&Fe.each(Yr.touch,(function(n){oo(t,n,(function(a){i[n].call(e,a),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),Fe.each(Yr.mouse,(function(n){oo(t,n,(function(a){a=jr(a),t.touching||i[n].call(e,a)}))})))}function ro(e,t){function i(i){oo(t,i,(function(n){n=jr(n),Qr(e,n.target)||(n=function(e,t){return Ur(e.dom,new eo(e,t),!0)}(e,n),t.domHandlers[i].call(e,n))}),{capture:!0})}ae.pointerEventsSupported?Fe.each(qr,i):ae.touchEventsSupported||Fe.each(Xr,i)}function oo(e,t,i,n){e.mounted[t]=i,e.listenerOpts[t]=n,Hr(e.domTarget,$r(t),i,n)}function so(e){var t=e.mounted;for(var i in t)t.hasOwnProperty(i)&&Wr(e.domTarget,$r(i),t[i],e.listenerOpts[i]);e.mounted={}}function lo(e,t){if(e._mayPointerCapture=null,Zr&&e._pointerCapturing^t){e._pointerCapturing=t;var i=e._globalHandlerScope;t?ro(e,i):so(i)}}function uo(e,t){this.domTarget=e,this.domHandlers=t,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function ho(e,t){vt.call(this),this.dom=e,this.painterRoot=t,this._localHandlerScope=new uo(e,io),Zr&&(this._globalHandlerScope=new uo(document,no)),this._pointerCapturing=!1,this._mayPointerCapture=null,ao(this,this._localHandlerScope)}var co=ho.prototype;co.dispose=function(){so(this._localHandlerScope),Zr&&so(this._globalHandlerScope)},co.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},Fe.mixin(ho,vt);var po=ho,fo=!ae.canvasSupported,go={canvas:Nr},mo={};var vo=function(e,t,i){i=i||{},this.dom=t,this.id=e;var n=this,a=new Un,r=i.renderer;if(fo){if(!go.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");r="vml"}else r&&go[r]||(r="canvas");var o=new go[r](t,a,i,e);this.storage=a,this.painter=o;var s=ae.node||ae.worker?null:new po(o.getViewportRoot(),o.root);this.handler=new qt(a,o,s,o.root),this.animation=new Fr({stage:{update:Fe.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=a.delFromStorage,u=a.addToStorage;a.delFromStorage=function(e){l.call(a,e),e&&e.removeSelfFromZr(n)},a.addToStorage=function(e){u.call(a,e),e.addSelfToZr(n)}};vo.prototype={constructor:vo,getId:function(){return this.id},add:function(e){this.storage.addRoot(e),this._needsRefresh=!0},remove:function(e){this.storage.delRoot(e),this._needsRefresh=!0},configLayer:function(e,t){this.painter.configLayer&&this.painter.configLayer(e,t),this._needsRefresh=!0},setBackgroundColor:function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var e;this._needsRefresh&&(e=!0,this.refreshImmediately()),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately()),e&&this.trigger("rendered")},addHover:function(e,t){if(this.painter.addHover){var i=this.painter.addHover(e,t);return this.refreshHover(),i}},removeHover:function(e){this.painter.removeHover&&(this.painter.removeHover(e),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(e,t){return this.painter.pathToImage(e,t)},setCursorStyle:function(e){this.handler.setCursorStyle(e)},findHover:function(e,t){return this.handler.findHover(e,t)},on:function(e,t,i){this.handler.on(e,t,i)},off:function(e,t){this.handler.off(e,t)},trigger:function(e,t){this.handler.trigger(e,t)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){var e;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,e=this.id,delete mo[e]}};var yo=function(e,t){var i=new vo(ne(),e,t);return mo[i.id]=i,i},xo={version:"4.3.1",init:yo,dispose:function(e){if(e)e.dispose();else{for(var t in mo)mo.hasOwnProperty(t)&&mo[t].dispose();mo={}}return this},getInstance:function(e){return mo[e]},registerPainter:function(e,t){go[e]=t}},_o=Fe.each,bo=Fe.isObject,wo=Fe.isArray,So="series\0";function Mo(e){return e instanceof Array?e:null==e?[]:[e]}function Io(e){return bo(e)&&e.id&&0===(e.id+"").indexOf("\0_ec_\0")}var Ao=0;function To(e,t){return e&&e.hasOwnProperty(t)}var Co=function(e,t,i){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var n=0,a=i.length;n<a;n++){var r=i[n];!e.emphasis[t].hasOwnProperty(r)&&e[t].hasOwnProperty(r)&&(e.emphasis[t][r]=e[t][r])}}},Do=function(e,t){t=(t||[]).slice();var i=Fe.map(e||[],(function(e,t){return{exist:e}}));return _o(t,(function(e,n){if(bo(e)){for(var a=0;a<i.length;a++)if(!i[a].option&&null!=e.id&&i[a].exist.id===e.id+"")return i[a].option=e,void(t[n]=null);for(a=0;a<i.length;a++){var r=i[a].exist;if(!(i[a].option||null!=r.id&&null!=e.id||null==e.name||Io(e)||Io(r)||r.name!==e.name+""))return i[a].option=e,void(t[n]=null)}}})),_o(t,(function(e,t){if(bo(e)){for(var n=0;n<i.length;n++){var a=i[n].exist;if(!i[n].option&&!Io(a)&&null==e.id){i[n].option=e;break}}n>=i.length&&i.push({option:e})}})),i},Lo=function(e,t){var i={},n={};return a(e||[],i),a(t||[],n,i),[r(i),r(n)];function a(e,t,i){for(var n=0,a=e.length;n<a;n++)for(var r=e[n].seriesId,o=Mo(e[n].dataIndex),s=i&&i[r],l=0,u=o.length;l<u;l++){var h=o[l];s&&s[h]?s[h]=null:(t[r]||(t[r]={}))[h]=1}}function r(e,t){var i=[];for(var n in e)if(e.hasOwnProperty(n)&&null!=e[n])if(t)i.push(+n);else{var a=r(e[n],!0);a.length&&i.push({seriesId:n,dataIndex:a})}return i}},Po=function(e,t,i){e.setAttribute?e.setAttribute(t,i):e[t]=i},ko=function(e,t){return e.getAttribute?e.getAttribute(t):e[t]},Oo=function(e,t){var i=Fe.createHashMap(),n=[];return Fe.each(e,(function(e){var a=t(e);(i.get(a)||(n.push(a),i.set(a,[]))).push(e)})),{keys:n,buckets:i}},Ro={normalizeToArray:Mo,defaultEmphasis:Co,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"],getDataItemValue:function(e){return!bo(e)||wo(e)||e instanceof Date?e:e.value},isDataItemOption:function(e){return bo(e)&&!(e instanceof Array)},mappingToExists:Do,makeIdAndName:function(e){var t=Fe.createHashMap();_o(e,(function(e,i){var n=e.exist;n&&t.set(n.id,e)})),_o(e,(function(e,i){var n=e.option;Fe.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={})})),_o(e,(function(e,i){var n=e.exist,a=e.option,r=e.keyInfo;if(bo(a)){if(r.name=null!=a.name?a.name+"":n?n.name:So+i,n)r.id=n.id;else if(null!=a.id)r.id=a.id+"";else{var o=0;do{r.id="\0"+r.name+"\0"+o++}while(t.get(r.id))}t.set(r.id,e)}}))},isNameSpecified:function(e){var t=e.name;return!(!t||!t.indexOf(So))},isIdInner:Io,compressBatches:Lo,queryDataIndex:function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?Fe.isArray(t.dataIndex)?Fe.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?Fe.isArray(t.name)?Fe.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},makeInner:function(){var e="__\0ec_inner_"+Ao+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}},parseFinder:function(e,t,i){if(Fe.isString(t)){var n={};n[t+"Index"]=0,t=n}var a=i&&i.defaultMainType;!a||To(t,a+"Index")||To(t,a+"Id")||To(t,a+"Name")||(t[a+"Index"]=0);var r={};return _o(t,(function(n,a){n=t[a];if("dataIndex"!==a&&"dataIndexInside"!==a){var o=a.match(/^(\w+)(Index|Id|Name)$/)||[],s=o[1],l=(o[2]||"").toLowerCase();if(!(!s||!l||null==n||"index"===l&&"none"===n||i&&i.includeMainTypes&&Fe.indexOf(i.includeMainTypes,s)<0)){var u={mainType:s};"index"===l&&"all"===n||(u[l]=n);var h=e.queryComponents(u);r[s+"Models"]=h,r[s+"Model"]=h[0]}}else r[a]=n})),r},setAttribute:Po,getAttribute:ko,getTooltipRenderMode:function(e){return"auto"===e?ae.domSupported?"html":"richText":e||"html"},groupData:Oo},Eo="___EC__COMPONENT__CONTAINER___";function No(e){var t={main:"",sub:""};return e&&(e=e.split("."),t.main=e[0]||"",t.sub=e[1]||""),t}var zo=0;function Bo(e,t){var i=Fe.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function Vo(e,t,i){return this.superClass.prototype[t].apply(e,i)}var Go=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return Fe.extend(i.prototype,e),i.extend=this.extend,i.superCall=Bo,i.superApply=Vo,Fe.inherits(i,this),i.superClass=t,i}},Fo=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){Fe.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=No(t)).sub){if(t.sub!==Eo){var n=function(e){var t=i[e.main];t&&t[Eo]||((t=i[e.main]={})[Eo]=!0);return t}(t);n[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var a=i[e];if(a&&a[Eo]&&(a=t?a[t]:null),n&&!a)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return a},e.getClassesByMainType=function(e){e=No(e);var t=[],n=i[e.main];return n&&n[Eo]?Fe.each(n,(function(e,i){i!==Eo&&t.push(e)})):t.push(n),t},e.hasClass=function(e){return e=No(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return Fe.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=No(e);var t=i[e.main];return t&&t[Eo]},e.parseClassType=No,t.registerWhenExtend){var n=e.extend;n&&(e.extend=function(t){var i=n.call(this,t);return e.registerClass(i,t.type)})}return e},Ho={parseClassType:No,enableClassExtend:Go,enableClassCheck:function(e){var t=["__\0is_clz",zo++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},enableClassManagement:Fo,setReadOnly:function(e,t){}};var Wo=function(e){for(var t=0;t<e.length;t++)e[t][1]||(e[t][1]=e[t][0]);return function(t,i,n){for(var a={},r=0;r<e.length;r++){var o=e[r][1];if(!(i&&Fe.indexOf(i,o)>=0||n&&Fe.indexOf(n,o)<0)){var s=t.getShallow(o);null!=s&&(a[e[r][0]]=s)}}return a}},Uo=Wo([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),jo={getLineStyle:function(e){var t=Uo(this,e);return t.lineDash=this.getLineDash(t.lineWidth),t},getLineDash:function(e){null==e&&(e=1);var t=this.get("type"),i=Math.max(e,2),n=4*e;return"solid"!==t&&null!=t&&("dashed"===t?[n,n]:[i,i])}},Zo=jo,Yo=Wo([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Xo={getAreaStyle:function(e,t){return Yo(this,e,t)}},qo=ht.create,$o=ht.distSquare,Ko=Math.pow,Jo=Math.sqrt,Qo=1e-8,es=1e-4,ts=Jo(3),is=1/3,ns=qo(),as=qo(),rs=qo();function os(e){return e>-1e-8&&e<Qo}function ss(e){return e>Qo||e<-1e-8}function ls(e,t,i,n,a){var r=1-a;return r*r*(r*e+3*a*t)+a*a*(a*n+3*r*i)}function us(e,t,i,n){var a=1-n;return a*(a*e+2*n*t)+n*n*i}var hs=function(e,t,i,n,a,r){var o=n+3*(t-i)-e,s=3*(i-2*t+e),l=3*(t-e),u=e-a,h=s*s-3*o*l,c=s*l-9*o*u,d=l*l-3*s*u,p=0;if(os(h)&&os(c)){if(os(s))r[0]=0;else(M=-l/s)>=0&&M<=1&&(r[p++]=M)}else{var f=c*c-4*h*d;if(os(f)){var g=c/h,m=-g/2;(M=-s/o+g)>=0&&M<=1&&(r[p++]=M),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var v=Jo(f),y=h*s+1.5*o*(-c+v),x=h*s+1.5*o*(-c-v);(M=(-s-((y=y<0?-Ko(-y,is):Ko(y,is))+(x=x<0?-Ko(-x,is):Ko(x,is))))/(3*o))>=0&&M<=1&&(r[p++]=M)}else{var _=(2*h*s-3*o*c)/(2*Jo(h*h*h)),b=Math.acos(_)/3,w=Jo(h),S=Math.cos(b),M=(-s-2*w*S)/(3*o),I=(m=(-s+w*(S+ts*Math.sin(b)))/(3*o),(-s+w*(S-ts*Math.sin(b)))/(3*o));M>=0&&M<=1&&(r[p++]=M),m>=0&&m<=1&&(r[p++]=m),I>=0&&I<=1&&(r[p++]=I)}}return p},cs=function(e,t,i,n,a){var r=6*i-12*t+6*e,o=9*t+3*n-3*e-9*i,s=3*t-3*e,l=0;if(os(o)){if(ss(r))(h=-s/r)>=0&&h<=1&&(a[l++]=h)}else{var u=r*r-4*o*s;if(os(u))a[0]=-r/(2*o);else if(u>0){var h,c=Jo(u),d=(-r-c)/(2*o);(h=(-r+c)/(2*o))>=0&&h<=1&&(a[l++]=h),d>=0&&d<=1&&(a[l++]=d)}}return l},ds=function(e,t,i,n,a,r){var o=(t-e)*a+e,s=(i-t)*a+t,l=(n-i)*a+i,u=(s-o)*a+o,h=(l-s)*a+s,c=(h-u)*a+u;r[0]=e,r[1]=o,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=n},ps=function(e,t,i,n,a,r,o,s,l,u,h){var c,d,p,f,g,m=.005,v=1/0;ns[0]=l,ns[1]=u;for(var y=0;y<1;y+=.05)as[0]=ls(e,i,a,o,y),as[1]=ls(t,n,r,s,y),(f=$o(ns,as))<v&&(c=y,v=f);v=1/0;for(var x=0;x<32&&!(m<es);x++)d=c-m,p=c+m,as[0]=ls(e,i,a,o,d),as[1]=ls(t,n,r,s,d),f=$o(as,ns),d>=0&&f<v?(c=d,v=f):(rs[0]=ls(e,i,a,o,p),rs[1]=ls(t,n,r,s,p),g=$o(rs,ns),p<=1&&g<v?(c=p,v=g):m*=.5);return h&&(h[0]=ls(e,i,a,o,c),h[1]=ls(t,n,r,s,c)),Jo(v)},fs=function(e,t,i,n,a){var r=e-2*t+i,o=2*(t-e),s=e-n,l=0;if(os(r)){if(ss(o))(h=-s/o)>=0&&h<=1&&(a[l++]=h)}else{var u=o*o-4*r*s;if(os(u))(h=-o/(2*r))>=0&&h<=1&&(a[l++]=h);else if(u>0){var h,c=Jo(u),d=(-o-c)/(2*r);(h=(-o+c)/(2*r))>=0&&h<=1&&(a[l++]=h),d>=0&&d<=1&&(a[l++]=d)}}return l},gs=function(e,t,i,n,a){var r=(t-e)*n+e,o=(i-t)*n+t,s=(o-r)*n+r;a[0]=e,a[1]=r,a[2]=s,a[3]=s,a[4]=o,a[5]=i},ms=function(e,t,i,n,a,r,o,s,l){var u,h=.005,c=1/0;ns[0]=o,ns[1]=s;for(var d=0;d<1;d+=.05){as[0]=us(e,i,a,d),as[1]=us(t,n,r,d),(m=$o(ns,as))<c&&(u=d,c=m)}c=1/0;for(var p=0;p<32&&!(h<es);p++){var f=u-h,g=u+h;as[0]=us(e,i,a,f),as[1]=us(t,n,r,f);var m=$o(as,ns);if(f>=0&&m<c)u=f,c=m;else{rs[0]=us(e,i,a,g),rs[1]=us(t,n,r,g);var v=$o(rs,ns);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=us(e,i,a,u),l[1]=us(t,n,r,u)),Jo(c)},vs={cubicAt:ls,cubicDerivativeAt:function(e,t,i,n,a){var r=1-a;return 3*(((t-e)*r+2*(i-t)*a)*r+(n-i)*a*a)},cubicRootAt:hs,cubicExtrema:cs,cubicSubdivide:ds,cubicProjectPoint:ps,quadraticAt:us,quadraticDerivativeAt:function(e,t,i,n){return 2*((1-n)*(t-e)+n*(i-t))},quadraticRootAt:fs,quadraticExtremum:function(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n},quadraticSubdivide:gs,quadraticProjectPoint:ms},ys=Math.min,xs=Math.max,_s=Math.sin,bs=Math.cos,ws=2*Math.PI,Ss=ht.create(),Ms=ht.create(),Is=ht.create();var As=[],Ts=[];var Cs=function(e,t,i){if(0!==e.length){var n,a=e[0],r=a[0],o=a[0],s=a[1],l=a[1];for(n=1;n<e.length;n++)a=e[n],r=ys(r,a[0]),o=xs(o,a[0]),s=ys(s,a[1]),l=xs(l,a[1]);t[0]=r,t[1]=s,i[0]=o,i[1]=l}},Ds=function(e,t,i,n,a,r){a[0]=ys(e,i),a[1]=ys(t,n),r[0]=xs(e,i),r[1]=xs(t,n)},Ls=function(e,t,i,n,a,r,o,s,l,u){var h,c=vs.cubicExtrema,d=vs.cubicAt,p=c(e,i,a,o,As);for(l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0,h=0;h<p;h++){var f=d(e,i,a,o,As[h]);l[0]=ys(f,l[0]),u[0]=xs(f,u[0])}for(p=c(t,n,r,s,Ts),h=0;h<p;h++){var g=d(t,n,r,s,Ts[h]);l[1]=ys(g,l[1]),u[1]=xs(g,u[1])}l[0]=ys(e,l[0]),u[0]=xs(e,u[0]),l[0]=ys(o,l[0]),u[0]=xs(o,u[0]),l[1]=ys(t,l[1]),u[1]=xs(t,u[1]),l[1]=ys(s,l[1]),u[1]=xs(s,u[1])},Ps=function(e,t,i,n,a,r,o,s){var l=vs.quadraticExtremum,u=vs.quadraticAt,h=xs(ys(l(e,i,a),1),0),c=xs(ys(l(t,n,r),1),0),d=u(e,i,a,h),p=u(t,n,r,c);o[0]=ys(e,a,d),o[1]=ys(t,r,p),s[0]=xs(e,a,d),s[1]=xs(t,r,p)},ks=function(e,t,i,n,a,r,o,s,l){var u=ht.min,h=ht.max,c=Math.abs(a-r);if(c%ws<1e-4&&c>1e-4)return s[0]=e-i,s[1]=t-n,l[0]=e+i,void(l[1]=t+n);if(Ss[0]=bs(a)*i+e,Ss[1]=_s(a)*n+t,Ms[0]=bs(r)*i+e,Ms[1]=_s(r)*n+t,u(s,Ss,Ms),h(l,Ss,Ms),(a%=ws)<0&&(a+=ws),(r%=ws)<0&&(r+=ws),a>r&&!o?r+=ws:a<r&&o&&(a+=ws),o){var d=r;r=a,a=d}for(var p=0;p<r;p+=Math.PI/2)p>a&&(Is[0]=bs(p)*i+e,Is[1]=_s(p)*n+t,u(s,Is,s),h(l,Is,l))},Os={fromPoints:Cs,fromLine:Ds,fromCubic:Ls,fromQuadratic:Ps,fromArc:ks},Rs=cn.devicePixelRatio,Es={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Ns=[],zs=[],Bs=[],Vs=[],Gs=Math.min,Fs=Math.max,Hs=Math.cos,Ws=Math.sin,Us=Math.sqrt,js=Math.abs,Zs="undefined"!=typeof Float32Array,Ys=function(e){this._saveData=!e,this._saveData&&(this.data=[]),this._ctx=null};Ys.prototype={constructor:Ys,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(e,t,i){i=i||0,this._ux=js(i/Rs/e)||0,this._uy=js(i/Rs/t)||0},getContext:function(){return this._ctx},beginPath:function(e){return this._ctx=e,e&&e.beginPath(),e&&(this.dpr=e.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(e,t){return this.addData(Es.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},lineTo:function(e,t){var i=js(e-this._xi)>this._ux||js(t-this._yi)>this._uy||this._len<5;return this.addData(Es.L,e,t),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),i&&(this._xi=e,this._yi=t),this},bezierCurveTo:function(e,t,i,n,a,r){return this.addData(Es.C,e,t,i,n,a,r),this._ctx&&(this._needsDash()?this._dashedBezierTo(e,t,i,n,a,r):this._ctx.bezierCurveTo(e,t,i,n,a,r)),this._xi=a,this._yi=r,this},quadraticCurveTo:function(e,t,i,n){return this.addData(Es.Q,e,t,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(e,t,i,n):this._ctx.quadraticCurveTo(e,t,i,n)),this._xi=i,this._yi=n,this},arc:function(e,t,i,n,a,r){return this.addData(Es.A,e,t,i,i,n,a-n,0,r?0:1),this._ctx&&this._ctx.arc(e,t,i,n,a,r),this._xi=Hs(a)*i+e,this._yi=Ws(a)*i+t,this},arcTo:function(e,t,i,n,a){return this._ctx&&this._ctx.arcTo(e,t,i,n,a),this},rect:function(e,t,i,n){return this._ctx&&this._ctx.rect(e,t,i,n),this.addData(Es.R,e,t,i,n),this},closePath:function(){this.addData(Es.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&(this._needsDash()&&this._dashedLineTo(t,i),e.closePath()),this._xi=t,this._yi=i,this},fill:function(e){e&&e.fill(),this.toStatic()},stroke:function(e){e&&e.stroke(),this.toStatic()},setLineDash:function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,i=0;i<e.length;i++)t+=e[i];this._dashSum=t}return this},setLineDashOffset:function(e){return this._dashOffset=e,this},len:function(){return this._len},setData:function(e){var t=e.length;this.data&&this.data.length===t||!Zs||(this.data=new Float32Array(t));for(var i=0;i<t;i++)this.data[i]=e[i];this._len=t},appendPath:function(e){e instanceof Array||(e=[e]);for(var t=e.length,i=0,n=this._len,a=0;a<t;a++)i+=e[a].len();Zs&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(a=0;a<t;a++)for(var r=e[a].data,o=0;o<r.length;o++)this.data[n++]=r[o];this._len=n},addData:function(e){if(this._saveData){var t=this.data;this._len+arguments.length>t.length&&(this._expandData(),t=this.data);for(var i=0;i<arguments.length;i++)t[this._len++]=arguments[i];this._prevCmd=e}},_expandData:function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(e,t){var i,n,a=this._dashSum,r=this._dashOffset,o=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,h=e-l,c=t-u,d=Us(h*h+c*c),p=l,f=u,g=o.length;for(r<0&&(r=a+r),p-=(r%=a)*(h/=d),f-=r*(c/=d);h>0&&p<=e||h<0&&p>=e||0===h&&(c>0&&f<=t||c<0&&f>=t);)p+=h*(i=o[n=this._dashIdx]),f+=c*i,this._dashIdx=(n+1)%g,h>0&&p<l||h<0&&p>l||c>0&&f<u||c<0&&f>u||s[n%2?"moveTo":"lineTo"](h>=0?Gs(p,e):Fs(p,e),c>=0?Gs(f,t):Fs(f,t));h=p-e,c=f-t,this._dashOffset=-Us(h*h+c*c)},_dashedBezierTo:function(e,t,i,n,a,r){var o,s,l,u,h,c=this._dashSum,d=this._dashOffset,p=this._lineDash,f=this._ctx,g=this._xi,m=this._yi,v=vs.cubicAt,y=0,x=this._dashIdx,_=p.length,b=0;for(d<0&&(d=c+d),d%=c,o=0;o<1;o+=.1)s=v(g,e,i,a,o+.1)-v(g,e,i,a,o),l=v(m,t,n,r,o+.1)-v(m,t,n,r,o),y+=Us(s*s+l*l);for(;x<_&&!((b+=p[x])>d);x++);for(o=(b-d)/y;o<=1;)u=v(g,e,i,a,o),h=v(m,t,n,r,o),x%2?f.moveTo(u,h):f.lineTo(u,h),o+=p[x]/y,x=(x+1)%_;x%2!=0&&f.lineTo(a,r),s=a-u,l=r-h,this._dashOffset=-Us(s*s+l*l)},_dashedQuadraticTo:function(e,t,i,n){var a=i,r=n;i=(i+2*e)/3,n=(n+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,i,n,a,r)},toStatic:function(){var e=this.data;e instanceof Array&&(e.length=this._len,Zs&&(this.data=new Float32Array(e)))},getBoundingRect:function(){Ns[0]=Ns[1]=Bs[0]=Bs[1]=Number.MAX_VALUE,zs[0]=zs[1]=Vs[0]=Vs[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,i=0,n=0,a=0,r=0;r<e.length;){var o=e[r++];switch(1===r&&(n=t=e[r],a=i=e[r+1]),o){case Es.M:t=n=e[r++],i=a=e[r++],Bs[0]=n,Bs[1]=a,Vs[0]=n,Vs[1]=a;break;case Es.L:Os.fromLine(t,i,e[r],e[r+1],Bs,Vs),t=e[r++],i=e[r++];break;case Es.C:Os.fromCubic(t,i,e[r++],e[r++],e[r++],e[r++],e[r],e[r+1],Bs,Vs),t=e[r++],i=e[r++];break;case Es.Q:Os.fromQuadratic(t,i,e[r++],e[r++],e[r],e[r+1],Bs,Vs),t=e[r++],i=e[r++];break;case Es.A:var s=e[r++],l=e[r++],u=e[r++],h=e[r++],c=e[r++],d=e[r++]+c;r+=1;var p=1-e[r++];1===r&&(n=Hs(c)*u+s,a=Ws(c)*h+l),Os.fromArc(s,l,u,h,c,d,p,Bs,Vs),t=Hs(d)*u+s,i=Ws(d)*h+l;break;case Es.R:n=t=e[r++],a=i=e[r++];var f=e[r++],g=e[r++];Os.fromLine(n,a,n+f,a+g,Bs,Vs);break;case Es.Z:t=n,i=a}ht.min(Ns,Ns,Bs),ht.max(zs,zs,Vs)}return 0===r&&(Ns[0]=Ns[1]=zs[0]=zs[1]=0),new On(Ns[0],Ns[1],zs[0]-Ns[0],zs[1]-Ns[1])},rebuildPath:function(e){for(var t,i,n,a,r,o,s=this.data,l=this._ux,u=this._uy,h=this._len,c=0;c<h;){var d=s[c++];switch(1===c&&(t=n=s[c],i=a=s[c+1]),d){case Es.M:t=n=s[c++],i=a=s[c++],e.moveTo(n,a);break;case Es.L:r=s[c++],o=s[c++],(js(r-n)>l||js(o-a)>u||c===h-1)&&(e.lineTo(r,o),n=r,a=o);break;case Es.C:e.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case Es.Q:e.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case Es.A:var p=s[c++],f=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],b=g>m?g:m,w=g>m?1:g/m,S=g>m?m/g:1,M=v+y;Math.abs(g-m)>.001?(e.translate(p,f),e.rotate(x),e.scale(w,S),e.arc(0,0,b,v,M,1-_),e.scale(1/w,1/S),e.rotate(-x),e.translate(-p,-f)):e.arc(p,f,b,v,M,1-_),1===c&&(t=Hs(v)*g+p,i=Ws(v)*m+f),n=Hs(M)*g+p,a=Ws(M)*m+f;break;case Es.R:t=n=s[c],i=a=s[c+1],e.rect(s[c++],s[c++],s[c++],s[c++]);break;case Es.Z:e.closePath(),n=t,a=i}}}},Ys.CMD=Es;var Xs=Ys;var qs={containStroke:function(e,t,i,n,a,r,o){if(0===a)return!1;var s=a,l=0;if(o>t+s&&o>n+s||o<t-s&&o<n-s||r>e+s&&r>i+s||r<e-s&&r<i-s)return!1;if(e===i)return Math.abs(r-e)<=s/2;var u=(l=(t-n)/(e-i))*r-o+(e*n-i*t)/(e-i);return u*u/(l*l+1)<=s/2*s/2}};var $s={containStroke:function(e,t,i,n,a,r,o,s,l,u,h){if(0===l)return!1;var c=l;return!(h>t+c&&h>n+c&&h>r+c&&h>s+c||h<t-c&&h<n-c&&h<r-c&&h<s-c||u>e+c&&u>i+c&&u>a+c&&u>o+c||u<e-c&&u<i-c&&u<a-c&&u<o-c)&&vs.cubicProjectPoint(e,t,i,n,a,r,o,s,u,h,null)<=c/2}},Ks=vs.quadraticProjectPoint;var Js={containStroke:function(e,t,i,n,a,r,o,s,l){if(0===o)return!1;var u=o;return!(l>t+u&&l>n+u&&l>r+u||l<t-u&&l<n-u&&l<r-u||s>e+u&&s>i+u&&s>a+u||s<e-u&&s<i-u&&s<a-u)&&Ks(e,t,i,n,a,r,s,l,null)<=u/2}},Qs=2*Math.PI;var el={normalizeRadian:function(e){return(e%=Qs)<0&&(e+=Qs),e}},tl=el.normalizeRadian,il=2*Math.PI;var nl={containStroke:function(e,t,i,n,a,r,o,s,l){if(0===o)return!1;var u=o;s-=e,l-=t;var h=Math.sqrt(s*s+l*l);if(h-u>i||h+u<i)return!1;if(Math.abs(n-a)%il<1e-4)return!0;if(r){var c=n;n=tl(a),a=tl(c)}else n=tl(n),a=tl(a);n>a&&(a+=il);var d=Math.atan2(l,s);return d<0&&(d+=il),d>=n&&d<=a||d+il>=n&&d+il<=a}};var al=function(e,t,i,n,a,r){if(r>t&&r>n||r<t&&r<n)return 0;if(n===t)return 0;var o=n<t?1:-1,s=(r-t)/(n-t);1!==s&&0!==s||(o=n<t?.5:-.5);var l=s*(i-e)+e;return l===a?1/0:l>a?o:0},rl=el.normalizeRadian,ol=Xs.CMD,sl=2*Math.PI;var ll=[-1,-1,-1],ul=[-1,-1];function hl(e,t,i,n,a,r,o,s,l,u){if(u>t&&u>n&&u>r&&u>s||u<t&&u<n&&u<r&&u<s)return 0;var h,c=vs.cubicRootAt(t,n,r,s,u,ll);if(0===c)return 0;for(var d,p,f=0,g=-1,m=0;m<c;m++){var v=ll[m],y=0===v||1===v?.5:1;vs.cubicAt(e,i,a,o,v)<l||(g<0&&(g=vs.cubicExtrema(t,n,r,s,ul),ul[1]<ul[0]&&g>1&&(h=void 0,h=ul[0],ul[0]=ul[1],ul[1]=h),d=vs.cubicAt(t,n,r,s,ul[0]),g>1&&(p=vs.cubicAt(t,n,r,s,ul[1]))),2===g?v<ul[0]?f+=d<t?y:-y:v<ul[1]?f+=p<d?y:-y:f+=s<p?y:-y:v<ul[0]?f+=d<t?y:-y:f+=s<d?y:-y)}return f}function cl(e,t,i,n,a,r,o,s){if(s>t&&s>n&&s>r||s<t&&s<n&&s<r)return 0;var l=vs.quadraticRootAt(t,n,r,s,ll);if(0===l)return 0;var u=vs.quadraticExtremum(t,n,r);if(u>=0&&u<=1){for(var h=0,c=vs.quadraticAt(t,n,r,u),d=0;d<l;d++){var p=0===ll[d]||1===ll[d]?.5:1;vs.quadraticAt(e,i,a,ll[d])<o||(ll[d]<u?h+=c<t?p:-p:h+=r<c?p:-p)}return h}p=0===ll[0]||1===ll[0]?.5:1;return vs.quadraticAt(e,i,a,ll[0])<o?0:r<t?p:-p}function dl(e,t,i,n,a,r,o,s){if((s-=t)>i||s<-i)return 0;var l=Math.sqrt(i*i-s*s);ll[0]=-l,ll[1]=l;var u=Math.abs(n-a);if(u<1e-4)return 0;if(u%sl<1e-4){n=0,a=sl;var h=r?1:-1;return o>=ll[0]+e&&o<=ll[1]+e?h:0}if(r){l=n;n=rl(a),a=rl(l)}else n=rl(n),a=rl(a);n>a&&(a+=sl);for(var c=0,d=0;d<2;d++){var p=ll[d];if(p+e>o){var f=Math.atan2(s,p);h=r?1:-1;f<0&&(f=sl+f),(f>=n&&f<=a||f+sl>=n&&f+sl<=a)&&(f>Math.PI/2&&f<1.5*Math.PI&&(h=-h),c+=h)}}return c}function pl(e,t,i,n,a){for(var r,o,s=0,l=0,u=0,h=0,c=0,d=0;d<e.length;){var p=e[d++];switch(p===ol.M&&d>1&&(i||(s+=al(l,u,h,c,n,a))),1===d&&(h=l=e[d],c=u=e[d+1]),p){case ol.M:l=h=e[d++],u=c=e[d++];break;case ol.L:if(i){if(qs.containStroke(l,u,e[d],e[d+1],t,n,a))return!0}else s+=al(l,u,e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case ol.C:if(i){if($s.containStroke(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],t,n,a))return!0}else s+=hl(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case ol.Q:if(i){if(Js.containStroke(l,u,e[d++],e[d++],e[d],e[d+1],t,n,a))return!0}else s+=cl(l,u,e[d++],e[d++],e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case ol.A:var f=e[d++],g=e[d++],m=e[d++],v=e[d++],y=e[d++],x=e[d++];d+=1;var _=1-e[d++],b=Math.cos(y)*m+f,w=Math.sin(y)*v+g;d>1?s+=al(l,u,b,w,n,a):(h=b,c=w);var S=(n-f)*v/m+f;if(i){if(nl.containStroke(f,g,v,y,y+x,_,t,S,a))return!0}else s+=dl(f,g,v,y,y+x,_,S,a);l=Math.cos(y+x)*m+f,u=Math.sin(y+x)*v+g;break;case ol.R:h=l=e[d++],c=u=e[d++];b=h+e[d++],w=c+e[d++];if(i){if(qs.containStroke(h,c,b,c,t,n,a)||qs.containStroke(b,c,b,w,t,n,a)||qs.containStroke(b,w,h,w,t,n,a)||qs.containStroke(h,w,h,c,t,n,a))return!0}else s+=al(b,c,b,w,n,a),s+=al(h,w,h,c,n,a);break;case ol.Z:if(i){if(qs.containStroke(l,u,h,c,t,n,a))return!0}else s+=al(l,u,h,c,n,a);l=h,u=c}}return i||(r=u,o=c,Math.abs(r-o)<1e-4)||(s+=al(l,u,h,c,n,a)||0),0!==s}var fl={contain:function(e,t,i){return pl(e,0,!1,t,i)},containStroke:function(e,t,i,n){return pl(e,t,!0,i,n)}},gl=aa.prototype.getCanvasPattern,ml=Math.abs,vl=new Xs(!0);function yl(e){Ir.call(this,e),this.path=null}yl.prototype={constructor:yl,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(e,t){var i,n=this.style,a=this.path||vl,r=n.hasStroke(),o=n.hasFill(),s=n.fill,l=n.stroke,u=o&&!!s.colorStops,h=r&&!!l.colorStops,c=o&&!!s.image,d=r&&!!l.image;(n.bind(e,this,t),this.setTransform(e),this.__dirty)&&(u&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(e,s,i)),h&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(e,l,i)));u?e.fillStyle=this._fillGradient:c&&(e.fillStyle=gl.call(s,e)),h?e.strokeStyle=this._strokeGradient:d&&(e.strokeStyle=gl.call(l,e));var p=n.lineDash,f=n.lineDashOffset,g=!!e.setLineDash,m=this.getGlobalScale();if(a.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||p&&!g&&r?(a.beginPath(e),p&&!g&&(a.setLineDash(p),a.setLineDashOffset(f)),this.buildPath(a,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(e.beginPath(),this.path.rebuildPath(e)),o)if(null!=n.fillOpacity){var v=e.globalAlpha;e.globalAlpha=n.fillOpacity*n.opacity,a.fill(e),e.globalAlpha=v}else a.fill(e);if(p&&g&&(e.setLineDash(p),e.lineDashOffset=f),r)if(null!=n.strokeOpacity){v=e.globalAlpha;e.globalAlpha=n.strokeOpacity*n.opacity,a.stroke(e),e.globalAlpha=v}else a.stroke(e);p&&g&&e.setLineDash([]),null!=n.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))},buildPath:function(e,t,i){},createPathProxy:function(){this.path=new Xs},getBoundingRect:function(){var e=this._rect,t=this.style,i=!e;if(i){var n=this.path;n||(n=this.path=new Xs),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),e=n.getBoundingRect()}if(this._rect=e,t.hasStroke()){var a=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){a.copy(e);var r=t.lineWidth,o=t.strokeNoScale?this.getLineScale():1;t.hasFill()||(r=Math.max(r,this.strokeContainThreshold||4)),o>1e-10&&(a.width+=r/o,a.height+=r/o,a.x-=r/o/2,a.y-=r/o/2)}return a}return e},contain:function(e,t){var i=this.transformCoordToLocal(e,t),n=this.getBoundingRect(),a=this.style;if(e=i[0],t=i[1],n.contain(e,t)){var r=this.path.data;if(a.hasStroke()){var o=a.lineWidth,s=a.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(a.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),fl.containStroke(r,o/s,e,t)))return!0}if(a.hasFill())return fl.contain(r,e,t)}return!1},dirty:function(e){null==e&&(e=!0),e&&(this.__dirtyPath=e,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(e){return this.animate("shape",e)},attrKV:function(e,t){"shape"===e?(this.setShape(t),this.__dirtyPath=!0,this._rect=null):Ir.prototype.attrKV.call(this,e,t)},setShape:function(e,t){var i=this.shape;if(i){if(Fe.isObject(e))for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);else i[e]=t;this.dirty(!0)}return this},getLineScale:function(){var e=this.transform;return e&&ml(e[0]-1)>1e-10&&ml(e[3]-1)>1e-10?Math.sqrt(ml(e[0]*e[3]-e[2]*e[1])):1}},yl.extend=function(e){var t=function(t){yl.call(this,t),e.style&&this.style.extendFrom(e.style,!1);var i=e.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var a in i)!n.hasOwnProperty(a)&&i.hasOwnProperty(a)&&(n[a]=i[a])}e.init&&e.init.call(this,t)};for(var i in Fe.inherits(t,yl),e)"style"!==i&&"shape"!==i&&(t.prototype[i]=e[i]);return t},Fe.inherits(yl,Ir);var xl=yl,_l=ht.applyTransform,bl=Xs.CMD,wl=[[],[],[]],Sl=Math.sqrt,Ml=Math.atan2;var Il=function(e,t){var i,n,a,r,o,s=e.data,l=bl.M,u=bl.C,h=bl.L,c=bl.R,d=bl.A,p=bl.Q;for(a=0,r=0;a<s.length;){switch(i=s[a++],r=a,n=0,i){case l:case h:n=1;break;case u:n=3;break;case p:n=2;break;case d:var f=t[4],g=t[5],m=Sl(t[0]*t[0]+t[1]*t[1]),v=Sl(t[2]*t[2]+t[3]*t[3]),y=Ml(-t[1]/v,t[0]/m);s[a]*=m,s[a++]+=f,s[a]*=v,s[a++]+=g,s[a++]*=m,s[a++]*=v,s[a++]+=y,s[a++]+=y,r=a+=2;break;case c:x[0]=s[a++],x[1]=s[a++],_l(x,x,t),s[r++]=x[0],s[r++]=x[1],x[0]+=s[a++],x[1]+=s[a++],_l(x,x,t),s[r++]=x[0],s[r++]=x[1]}for(o=0;o<n;o++){var x;(x=wl[o])[0]=s[a++],x[1]=s[a++],_l(x,x,t),s[r++]=x[0],s[r++]=x[1]}}},Al=Math.sqrt,Tl=Math.sin,Cl=Math.cos,Dl=Math.PI,Ll=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},Pl=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(Ll(e)*Ll(t))},kl=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Pl(e,t))};function Ol(e,t,i,n,a,r,o,s,l,u,h){var c=l*(Dl/180),d=Cl(c)*(e-i)/2+Tl(c)*(t-n)/2,p=-1*Tl(c)*(e-i)/2+Cl(c)*(t-n)/2,f=d*d/(o*o)+p*p/(s*s);f>1&&(o*=Al(f),s*=Al(f));var g=(a===r?-1:1)*Al((o*o*(s*s)-o*o*(p*p)-s*s*(d*d))/(o*o*(p*p)+s*s*(d*d)))||0,m=g*o*p/s,v=g*-s*d/o,y=(e+i)/2+Cl(c)*m-Tl(c)*v,x=(t+n)/2+Tl(c)*m+Cl(c)*v,_=kl([1,0],[(d-m)/o,(p-v)/s]),b=[(d-m)/o,(p-v)/s],w=[(-1*d-m)/o,(-1*p-v)/s],S=kl(b,w);Pl(b,w)<=-1&&(S=Dl),Pl(b,w)>=1&&(S=0),0===r&&S>0&&(S-=2*Dl),1===r&&S<0&&(S+=2*Dl),h.addData(u,y,x,o,s,_,S,c,r)}var Rl=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,El=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Nl(e,t){var i=function(e){if(!e)return new Xs;for(var t,i=0,n=0,a=i,r=n,o=new Xs,s=Xs.CMD,l=e.match(Rl),u=0;u<l.length;u++){for(var h,c=l[u],d=c.charAt(0),p=c.match(El)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v,y,x,_,b,w,S,M=i,I=n;switch(d){case"l":i+=p[m++],n+=p[m++],h=s.L,o.addData(h,i,n);break;case"L":i=p[m++],n=p[m++],h=s.L,o.addData(h,i,n);break;case"m":i+=p[m++],n+=p[m++],h=s.M,o.addData(h,i,n),a=i,r=n,d="l";break;case"M":i=p[m++],n=p[m++],h=s.M,o.addData(h,i,n),a=i,r=n,d="L";break;case"h":i+=p[m++],h=s.L,o.addData(h,i,n);break;case"H":i=p[m++],h=s.L,o.addData(h,i,n);break;case"v":n+=p[m++],h=s.L,o.addData(h,i,n);break;case"V":n=p[m++],h=s.L,o.addData(h,i,n);break;case"C":h=s.C,o.addData(h,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),i=p[m-2],n=p[m-1];break;case"c":h=s.C,o.addData(h,p[m++]+i,p[m++]+n,p[m++]+i,p[m++]+n,p[m++]+i,p[m++]+n),i+=p[m-2],n+=p[m-1];break;case"S":v=i,y=n;var A=o.len(),T=o.data;t===s.C&&(v+=i-T[A-4],y+=n-T[A-3]),h=s.C,M=p[m++],I=p[m++],i=p[m++],n=p[m++],o.addData(h,v,y,M,I,i,n);break;case"s":v=i,y=n,A=o.len(),T=o.data,t===s.C&&(v+=i-T[A-4],y+=n-T[A-3]),h=s.C,M=i+p[m++],I=n+p[m++],i+=p[m++],n+=p[m++],o.addData(h,v,y,M,I,i,n);break;case"Q":M=p[m++],I=p[m++],i=p[m++],n=p[m++],h=s.Q,o.addData(h,M,I,i,n);break;case"q":M=p[m++]+i,I=p[m++]+n,i+=p[m++],n+=p[m++],h=s.Q,o.addData(h,M,I,i,n);break;case"T":v=i,y=n,A=o.len(),T=o.data,t===s.Q&&(v+=i-T[A-4],y+=n-T[A-3]),i=p[m++],n=p[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"t":v=i,y=n,A=o.len(),T=o.data,t===s.Q&&(v+=i-T[A-4],y+=n-T[A-3]),i+=p[m++],n+=p[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"A":x=p[m++],_=p[m++],b=p[m++],w=p[m++],S=p[m++],Ol(M=i,I=n,i=p[m++],n=p[m++],w,S,x,_,b,h=s.A,o);break;case"a":x=p[m++],_=p[m++],b=p[m++],w=p[m++],S=p[m++],Ol(M=i,I=n,i+=p[m++],n+=p[m++],w,S,x,_,b,h=s.A,o)}}"z"!==d&&"Z"!==d||(h=s.Z,o.addData(h),i=a,n=r),t=h}return o.toStatic(),o}(e);return(t=t||{}).buildPath=function(e){if(e.setData){e.setData(i.data),(t=e.getContext())&&e.rebuildPath(t)}else{var t=e;i.rebuildPath(t)}},t.applyTransform=function(e){Il(i,e),this.dirty(!0)},t}var zl=function(e,t){for(var i=[],n=e.length,a=0;a<n;a++){var r=e[a];r.path||r.createPathProxy(),r.__dirtyPath&&r.buildPath(r.path,r.shape,!0),i.push(r.path)}var o=new xl(t);return o.createPathProxy(),o.buildPath=function(e){e.appendPath(i);var t=e.getContext();t&&e.rebuildPath(t)},o},Bl={createFromString:function(e,t){return new xl(Nl(e,t))},extendFromString:function(e,t){return xl.extend(Nl(e,t))},mergePath:zl},Vl=Yn.ContextCachedBy,Gl=function(e){Ir.call(this,e)};Gl.prototype={constructor:Gl,type:"text",brush:function(e,t){var i=this.style;this.__dirty&&xr.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),xr.needDrawText(n,i)?(this.setTransform(e),xr.renderText(this,e,n,i,null,t),this.restoreTransform(e)):e.__attrCachedBy=Vl.NONE},getBoundingRect:function(){var e=this.style;if(this.__dirty&&xr.normalizeTextStyle(e,!0),!this._rect){e.text;var t=Ha.getBoundingRect(e.text+"",e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich);if(t.x+=e.x||0,t.y+=e.y||0,xr.getStroke(e.textStroke,e.textStrokeWidth)){var i=e.textStrokeWidth;t.x-=i/2,t.y-=i/2,t.width+=i,t.height+=i}this._rect=t}return this._rect}},Fe.inherits(Gl,Ir);var Fl=Gl,Hl=xl.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(e,t,i){i&&e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI,!0)}}),Wl=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];var Ul=function(e){return ae.browser.ie&&ae.browser.version>=11?function(){var t,i=this.__clipPaths,n=this.style;if(i)for(var a=0;a<i.length;a++){var r=i[a],o=r&&r.shape,s=r&&r.type;if(o&&("sector"===s&&o.startAngle===o.endAngle||"rect"===s&&(!o.width||!o.height))){for(var l=0;l<Wl.length;l++)Wl[l][2]=n[Wl[l][0]],n[Wl[l][0]]=Wl[l][1];t=!0;break}}if(e.apply(this,arguments),t)for(l=0;l<Wl.length;l++)n[Wl[l][0]]=Wl[l][2]}:e},jl=xl.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:Ul(xl.prototype.brush),buildPath:function(e,t){var i=t.cx,n=t.cy,a=Math.max(t.r0||0,0),r=Math.max(t.r,0),o=t.startAngle,s=t.endAngle,l=t.clockwise,u=Math.cos(o),h=Math.sin(o);e.moveTo(u*a+i,h*a+n),e.lineTo(u*r+i,h*r+n),e.arc(i,n,r,o,s,!l),e.lineTo(Math.cos(s)*a+i,Math.sin(s)*a+n),0!==a&&e.arc(i,n,a,s,o,l),e.closePath()}}),Zl=xl.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=2*Math.PI;e.moveTo(i+t.r,n),e.arc(i,n,t.r,0,a,!1),e.moveTo(i+t.r0,n),e.arc(i,n,t.r0,0,a,!0)}}),Yl=Zl,Xl=ht.distance;function ql(e,t,i,n,a,r,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*r+s*a+t}var $l=function(e,t){for(var i=e.length,n=[],a=0,r=1;r<i;r++)a+=Xl(e[r-1],e[r]);var o=a/2;for(o=o<i?i:o,r=0;r<o;r++){var s,l,u,h=r/(o-1)*(t?i:i-1),c=Math.floor(h),d=h-c,p=e[c%i];t?(s=e[(c-1+i)%i],l=e[(c+1)%i],u=e[(c+2)%i]):(s=e[0===c?c:c-1],l=e[c>i-2?i-1:c+1],u=e[c>i-3?i-1:c+2]);var f=d*d,g=d*f;n.push([ql(s[0],p[0],l[0],u[0],d,f,g),ql(s[1],p[1],l[1],u[1],d,f,g)])}return n},Kl=ht.min,Jl=ht.max,Ql=ht.scale,eu=ht.distance,tu=ht.add,iu=ht.clone,nu=ht.sub;var au=function(e,t,i,n){var a,r,o,s,l=[],u=[],h=[],c=[];if(n){o=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=e.length;d<p;d++)Kl(o,o,e[d]),Jl(s,s,e[d]);Kl(o,o,n[0]),Jl(s,s,n[1])}for(d=0,p=e.length;d<p;d++){var f=e[d];if(i)a=e[d?d-1:p-1],r=e[(d+1)%p];else{if(0===d||d===p-1){l.push(iu(e[d]));continue}a=e[d-1],r=e[d+1]}nu(u,r,a),Ql(u,u,t);var g=eu(f,a),m=eu(f,r),v=g+m;0!==v&&(g/=v,m/=v),Ql(h,u,-g),Ql(c,u,m);var y=tu([],f,h),x=tu([],f,c);n&&(Jl(y,y,o),Kl(y,y,s),Jl(x,x,o),Kl(x,x,s)),l.push(y),l.push(x)}return i&&l.push(l.shift()),l};var ru=function(e,t,i){var n=t.points,a=t.smooth;if(n&&n.length>=2){if(a&&"spline"!==a){var r=au(n,a,i,t.smoothConstraint);e.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(i?o:o-1);s++){var l=r[2*s],u=r[2*s+1],h=n[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===a&&(n=$l(n,i)),e.moveTo(n[0][0],n[0][1]);s=1;for(var c=n.length;s<c;s++)e.lineTo(n[s][0],n[s][1])}i&&e.closePath()}},ou={buildPath:ru},su=xl.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(e,t){ou.buildPath(e,t,!0)}}),lu=xl.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(e,t){ou.buildPath(e,t,!1)}}),uu=Math.round;function hu(e,t,i){if(!t)return e;var n=uu(2*e);return(n+uu(t))%2==0?n/2:(n+(i?1:-1))/2}var cu=function(e,t,i){if(t){var n=t.x1,a=t.x2,r=t.y1,o=t.y2;e.x1=n,e.x2=a,e.y1=r,e.y2=o;var s=i&&i.lineWidth;s&&(uu(2*n)===uu(2*a)&&(e.x1=e.x2=hu(n,s,!0)),uu(2*r)===uu(2*o)&&(e.y1=e.y2=hu(r,s,!0)))}},du=function(e,t,i){if(t){var n=t.x,a=t.y,r=t.width,o=t.height;e.x=n,e.y=a,e.width=r,e.height=o;var s=i&&i.lineWidth;s&&(e.x=hu(n,s,!0),e.y=hu(a,s,!0),e.width=Math.max(hu(n+r,s,!1)-e.x,0===r?0:1),e.height=Math.max(hu(a+o,s,!1)-e.y,0===o?0:1))}},pu={subPixelOptimizeLine:cu,subPixelOptimizeRect:du,subPixelOptimize:hu},fu=pu.subPixelOptimizeRect,gu={},mu=xl.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(e,t){var i,n,a,r;this.subPixelOptimize?(fu(gu,t,this.style),i=gu.x,n=gu.y,a=gu.width,r=gu.height,gu.r=t.r,t=gu):(i=t.x,n=t.y,a=t.width,r=t.height),t.r?Wa.buildPath(e,t):e.rect(i,n,a,r),e.closePath()}}),vu=pu.subPixelOptimizeLine,yu={},xu=xl.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i,n,a,r;this.subPixelOptimize?(vu(yu,t,this.style),i=yu.x1,n=yu.y1,a=yu.x2,r=yu.y2):(i=t.x1,n=t.y1,a=t.x2,r=t.y2);var o=t.percent;0!==o&&(e.moveTo(i,n),o<1&&(a=i*(1-o)+a*o,r=n*(1-o)+r*o),e.lineTo(a,r))},pointAt:function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]}}),_u=vs.quadraticSubdivide,bu=vs.cubicSubdivide,wu=vs.quadraticAt,Su=vs.cubicAt,Mu=vs.quadraticDerivativeAt,Iu=vs.cubicDerivativeAt,Au=[];function Tu(e,t,i){var n=e.cpx2,a=e.cpy2;return null===n||null===a?[(i?Iu:Su)(e.x1,e.cpx1,e.cpx2,e.x2,t),(i?Iu:Su)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(i?Mu:wu)(e.x1,e.cpx1,e.x2,t),(i?Mu:wu)(e.y1,e.cpy1,e.y2,t)]}var Cu=xl.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.x1,n=t.y1,a=t.x2,r=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,h=t.percent;0!==h&&(e.moveTo(i,n),null==l||null==u?(h<1&&(_u(i,o,a,h,Au),o=Au[1],a=Au[2],_u(n,s,r,h,Au),s=Au[1],r=Au[2]),e.quadraticCurveTo(o,s,a,r)):(h<1&&(bu(i,o,l,a,h,Au),o=Au[1],l=Au[2],a=Au[3],bu(n,s,u,r,h,Au),s=Au[1],u=Au[2],r=Au[3]),e.bezierCurveTo(o,s,l,u,a,r)))},pointAt:function(e){return Tu(this.shape,e,!1)},tangentAt:function(e){var t=Tu(this.shape,e,!0);return ht.normalize(t,t)}}),Du=xl.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.cx,n=t.cy,a=Math.max(t.r,0),r=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(r),u=Math.sin(r);e.moveTo(l*a+i,u*a+n),e.arc(i,n,a,r,o,!s)}}),Lu=xl.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var e=this.__dirtyPath,t=this.shape.paths,i=0;i<t.length;i++)e=e||t[i].__dirtyPath;this.__dirtyPath=e,this.__dirty=this.__dirty||e},beforeBrush:function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),i=0;i<e.length;i++)e[i].path||e[i].createPathProxy(),e[i].path.setScale(t[0],t[1],e[i].segmentIgnoreThreshold)},buildPath:function(e,t){for(var i=t.paths||[],n=0;n<i.length;n++)i[n].buildPath(e,i[n].shape,!0)},afterBrush:function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),xl.prototype.getBoundingRect.call(this)}}),Pu=Lu,ku=function(e){this.colorStops=e||[]};ku.prototype={constructor:ku,addColorStop:function(e,t){this.colorStops.push({offset:e,color:t})}};var Ou=ku,Ru=function(e,t,i,n,a,r){this.x=null==e?0:e,this.y=null==t?0:t,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=r||!1,Ou.call(this,a)};Ru.prototype={constructor:Ru},Fe.inherits(Ru,Ou);var Eu=Ru,Nu=function(e,t,i,n,a){this.x=null==e?.5:e,this.y=null==t?.5:t,this.r=null==i?.5:i,this.type="radial",this.global=a||!1,Ou.call(this,n)};Nu.prototype={constructor:Nu},Fe.inherits(Nu,Ou);var zu=Nu,Bu=Fe.inherits;function Vu(e){Ir.call(this,e),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}Vu.prototype.incremental=!0,Vu.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},Vu.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.dirty()},Vu.prototype.addDisplayables=function(e,t){t=t||!1;for(var i=0;i<e.length;i++)this.addDisplayable(e[i],t)},Vu.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])},Vu.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}},Vu.prototype.brush=function(e,t){for(var i=this._cursor;i<this._displayables.length;i++){(n=this._displayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,i===this._cursor?null:this._displayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._cursor=i;for(i=0;i<this._temporaryDisplayables.length;i++){var n;(n=this._temporaryDisplayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,0===i?null:this._temporaryDisplayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._temporaryDisplayables=[],this.notClear=!0};var Gu=[];Vu.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new On(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var i=this._displayables[t],n=i.getBoundingRect().clone();i.needLocalTransform()&&n.applyTransform(i.getLocalTransform(Gu)),e.union(n)}this._rect=e}return this._rect},Vu.prototype.contain=function(e,t){var i=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(i[0],i[1]))for(var n=0;n<this._displayables.length;n++){if(this._displayables[n].contain(e,t))return!0}return!1},Bu(Vu,Ir);var Fu=Vu,Hu=Tr,Wu=En,Uu=Fl,ju=Hl,Zu=jl,Yu=Yl,Xu=su,qu=lu,$u=mu,Ku=xu,Ju=Cu,Qu=Du,eh=Pu,th=Eu,ih=zu,nh=On,ah=Fu,rh=Math.max,oh=Math.min,sh={},lh="emphasis",uh="normal",hh=1,ch={},dh={};function ph(e,t){dh[e]=t}function fh(e,t,i,n){var a=Bl.createFromString(e,t);return i&&("center"===n&&(i=gh(i,a.getBoundingRect())),vh(a,i)),a}function gh(e,t){var i,n=t.width/t.height,a=e.height*n;return i=a<=e.width?e.height:(a=e.width)/n,{x:e.x+e.width/2-a/2,y:e.y+e.height/2-i/2,width:a,height:i}}var mh=Bl.mergePath;function vh(e,t){if(e.applyTransform){var i=e.getBoundingRect().calculateTransform(t);e.applyTransform(i)}}var yh=pu.subPixelOptimize;function xh(e){return null!=e&&"none"!==e}var _h=Fe.createHashMap(),bh=0;function wh(e){var t=e.__hoverStl;if(t&&!e.__highlighted){var i=e.__zr,n=e.useHoverLayer&&i&&"canvas"===i.painter.type;if(e.__highlighted=n?"layer":"plain",!(e.isGroup||!i&&e.useHoverLayer)){var a=e,r=e.style;n&&(r=(a=i.addHover(e)).style),Bh(r),n||function(e){if(e.__hoverStlDirty){e.__hoverStlDirty=!1;var t=e.__hoverStl;if(t){var i=e.__cachedNormalStl={};e.__cachedNormalZ2=e.z2;var n=e.style;for(var a in t)null!=t[a]&&(i[a]=n[a]);i.fill=n.fill,i.stroke=n.stroke}else e.__cachedNormalStl=e.__cachedNormalZ2=null}}(a),r.extendFrom(t),Sh(r,t,"fill"),Sh(r,t,"stroke"),zh(r),n||(e.dirty(!1),e.z2+=1)}}}function Sh(e,t,i){!xh(t[i])&&xh(e[i])&&(e[i]=function(e){if("string"!=typeof e)return e;var t=_h.get(e);return t||(t=Zi.lift(e,-.1),bh<1e4&&(_h.set(e,t),bh++)),t}(e[i]))}function Mh(e){var t=e.__highlighted;if(t&&(e.__highlighted=!1,!e.isGroup))if("layer"===t)e.__zr&&e.__zr.removeHover(e);else{var i=e.style,n=e.__cachedNormalStl;n&&(Bh(i),e.setStyle(n),zh(i));var a=e.__cachedNormalZ2;null!=a&&e.z2-a==1&&(e.z2=a)}}function Ih(e,t,i){var n,a=uh,r=uh;e.__highlighted&&(a=lh,n=!0),t(e,i),e.__highlighted&&(r=lh,n=!0),e.isGroup&&e.traverse((function(e){!e.isGroup&&t(e,i)})),n&&e.__highDownOnUpdate&&e.__highDownOnUpdate(a,r)}function Ah(e,t){t=e.__hoverStl=!1!==t&&(e.hoverStyle||t||{}),e.__hoverStlDirty=!0,e.__highlighted&&(e.__cachedNormalStl=null,Mh(e),wh(e))}function Th(e){!Ph(this,e)&&!this.__highByOuter&&Ih(this,wh)}function Ch(e){!Ph(this,e)&&!this.__highByOuter&&Ih(this,Mh)}function Dh(e){this.__highByOuter|=1<<(e||0),Ih(this,wh)}function Lh(e){!(this.__highByOuter&=~(1<<(e||0)))&&Ih(this,Mh)}function Ph(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function kh(e,t){var i=!1===t;if(e.__highDownSilentOnTouch=e.highDownSilentOnTouch,e.__highDownOnUpdate=e.highDownOnUpdate,!i||e.__highDownDispatcher){var n=i?"off":"on";e[n]("mouseover",Th)[n]("mouseout",Ch),e[n]("emphasis",Dh)[n]("normal",Lh),e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!i}}function Oh(e,t,i,n,a){return Rh(e,t,n,a),i&&Fe.extend(e,i),e}function Rh(e,t,i,n){if((i=i||sh).isRectText){var a;i.getTextPosition?a=i.getTextPosition(t,n):"outside"===(a=t.getShallow("position")||(n?null:"inside"))&&(a="top"),e.textPosition=a,e.textOffset=t.getShallow("offset");var r=t.getShallow("rotate");null!=r&&(r*=Math.PI/180),e.textRotation=r,e.textDistance=Fe.retrieve2(t.getShallow("distance"),n?null:5)}var o,s=t.ecModel,l=s&&s.option.textStyle,u=function(e){var t;for(;e&&e!==e.ecModel;){var i=(e.option||sh).rich;if(i)for(var n in t=t||{},i)i.hasOwnProperty(n)&&(t[n]=1);e=e.parentModel}return t}(t);if(u)for(var h in o={},u)if(u.hasOwnProperty(h)){var c=t.getModel(["rich",h]);Eh(o[h]={},c,l,i,n)}return e.rich=o,Eh(e,t,l,i,n,!0),i.forceRich&&!i.textStyle&&(i.textStyle={}),e}function Eh(e,t,i,n,a,r){i=!a&&i||sh,e.textFill=Nh(t.getShallow("color"),n)||i.color,e.textStroke=Nh(t.getShallow("textBorderColor"),n)||i.textBorderColor,e.textStrokeWidth=Fe.retrieve2(t.getShallow("textBorderWidth"),i.textBorderWidth),a||(r&&(e.insideRollbackOpt=n,zh(e)),null==e.textFill&&(e.textFill=n.autoColor)),e.fontStyle=t.getShallow("fontStyle")||i.fontStyle,e.fontWeight=t.getShallow("fontWeight")||i.fontWeight,e.fontSize=t.getShallow("fontSize")||i.fontSize,e.fontFamily=t.getShallow("fontFamily")||i.fontFamily,e.textAlign=t.getShallow("align"),e.textVerticalAlign=t.getShallow("verticalAlign")||t.getShallow("baseline"),e.textLineHeight=t.getShallow("lineHeight"),e.textWidth=t.getShallow("width"),e.textHeight=t.getShallow("height"),e.textTag=t.getShallow("tag"),r&&n.disableBox||(e.textBackgroundColor=Nh(t.getShallow("backgroundColor"),n),e.textPadding=t.getShallow("padding"),e.textBorderColor=Nh(t.getShallow("borderColor"),n),e.textBorderWidth=t.getShallow("borderWidth"),e.textBorderRadius=t.getShallow("borderRadius"),e.textBoxShadowColor=t.getShallow("shadowColor"),e.textBoxShadowBlur=t.getShallow("shadowBlur"),e.textBoxShadowOffsetX=t.getShallow("shadowOffsetX"),e.textBoxShadowOffsetY=t.getShallow("shadowOffsetY")),e.textShadowColor=t.getShallow("textShadowColor")||i.textShadowColor,e.textShadowBlur=t.getShallow("textShadowBlur")||i.textShadowBlur,e.textShadowOffsetX=t.getShallow("textShadowOffsetX")||i.textShadowOffsetX,e.textShadowOffsetY=t.getShallow("textShadowOffsetY")||i.textShadowOffsetY}function Nh(e,t){return"auto"!==e?e:t&&t.autoColor?t.autoColor:null}function zh(e){var t,i=e.textPosition,n=e.insideRollbackOpt;if(n&&null==e.textFill){var a=n.autoColor,r=n.isRectText,o=n.useInsideStyle,s=!1!==o&&(!0===o||r&&i&&"string"==typeof i&&i.indexOf("inside")>=0),l=!s&&null!=a;(s||l)&&(t={textFill:e.textFill,textStroke:e.textStroke,textStrokeWidth:e.textStrokeWidth}),s&&(e.textFill="#fff",null==e.textStroke&&(e.textStroke=a,null==e.textStrokeWidth&&(e.textStrokeWidth=2))),l&&(e.textFill=a)}e.insideRollback=t}function Bh(e){var t=e.insideRollback;t&&(e.textFill=t.textFill,e.textStroke=t.textStroke,e.textStrokeWidth=t.textStrokeWidth,e.insideRollback=null)}function Vh(e,t,i,n,a,r){if("function"==typeof a&&(r=a,a=null),n&&n.isAnimationEnabled()){var o=e?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),u=n.getShallow("animationDelay"+o);"function"==typeof u&&(u=u(a,n.getAnimationDelayParams?n.getAnimationDelayParams(t,a):null)),"function"==typeof s&&(s=s(a)),s>0?t.animateTo(i,s,u||0,l,r,!!r):(t.stopAnimation(),t.attr(i),r&&r())}else t.stopAnimation(),t.attr(i),r&&r()}function Gh(e,t,i,n,a){Vh(!0,e,t,i,n,a)}function Fh(e,t,i){return t&&!Fe.isArrayLike(t)&&(t=fi.getLocalTransform(t)),i&&(t=ri.invert([],t)),ht.applyTransform([],e,t)}function Hh(e,t,i,n,a,r,o,s){var l,u=i-e,h=n-t,c=o-a,d=s-r,p=Wh(c,d,u,h);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-a,g=t-r,m=Wh(f,g,u,h)/p;if(m<0||m>1)return!1;var v=Wh(f,g,c,d)/p;return!(v<0||v>1)}function Wh(e,t,i,n){return e*n-i*t}ph("circle",Hl),ph("sector",jl),ph("ring",Yl),ph("polygon",su),ph("polyline",lu),ph("rect",mu),ph("line",xu),ph("bezierCurve",Cu),ph("arc",Du);var Uh=function(e,t,i){var n=new Tr({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===i){var a={width:e.width,height:e.height};n.setStyle(gh(t,a))}}});return n},jh=function(e){return pu.subPixelOptimizeLine(e.shape,e.shape,e.style),e},Zh=function(e){return pu.subPixelOptimizeRect(e.shape,e.shape,e.style),e},Yh=function(e,t,i){var n,a={isRectText:!0};!1===i?n=!0:a.autoColor=i,Rh(e,t,a,n)},Xh=function(e,t,i){var n=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),a=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),r=["left"===e?-n:"right"===e?n:0,"top"===e?-a:"bottom"===e?a:0];return r=Fh(r,t,i),Math.abs(r[0])>Math.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"},qh=function(e,t){return Fe.map(e,(function(e){var i=e[0];i=rh(i,t.x),i=oh(i,t.x+t.width);var n=e[1];return n=rh(n,t.y),[i,n=oh(n,t.y+t.height)]}))},$h=function(e,t,i){var n=(t=Fe.extend({rectHover:!0},t)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(n.image=e.slice(8),Fe.defaults(n,i),new Tr(t)):fh(e.replace("path://",""),t,i,"center")},Kh=function(e,t,i,n,a){for(var r=0,o=a[a.length-1];r<a.length;r++){var s=a[r];if(Hh(e,t,i,n,s[0],s[1],o[0],o[1]))return!0;o=s}},Jh={Image:Hu,Group:Wu,Text:Uu,Circle:ju,Sector:Zu,Ring:Yu,Polygon:Xu,Polyline:qu,Rect:$u,Line:Ku,BezierCurve:Ju,Arc:Qu,CompoundPath:eh,LinearGradient:th,RadialGradient:ih,BoundingRect:nh,IncrementalDisplayable:ah,Z2_EMPHASIS_LIFT:1,CACHED_LABEL_STYLE_PROPERTIES:{color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},extendShape:function(e){return xl.extend(e)},extendPath:function(e,t){return Bl.extendFromString(e,t)},registerShape:ph,getShapeClass:function(e){if(dh.hasOwnProperty(e))return dh[e]},makePath:fh,makeImage:Uh,mergePath:mh,resizePath:vh,subPixelOptimizeLine:jh,subPixelOptimizeRect:Zh,subPixelOptimize:yh,setElementHoverStyle:Ah,setHoverStyle:function(e,t){kh(e,!0),Ih(e,Ah,t)},setAsHighDownDispatcher:kh,isHighDownDispatcher:function(e){return!(!e||!e.__highDownDispatcher)},getHighlightDigit:function(e){var t=ch[e];return null==t&&hh<=32&&(t=ch[e]=hh++),t},setLabelStyle:function(e,t,i,n,a,r,o){var s,l=(a=a||sh).labelFetcher,u=a.labelDataIndex,h=a.labelDimIndex,c=a.labelProp,d=i.getShallow("show"),p=n.getShallow("show");(d||p)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h,c)),null==s&&(s=Fe.isFunction(a.defaultText)?a.defaultText(u,a):a.defaultText));var f=d?s:null,g=p?Fe.retrieve2(l?l.getFormattedLabel(u,"emphasis",null,h,c):null,s):null;null==f&&null==g||(Oh(e,i,r,a),Oh(t,n,o,a,!0)),e.text=f,t.text=g},modifyLabelStyle:function(e,t,i){var n=e.style;t&&(Bh(n),e.setStyle(t),zh(n)),n=e.__hoverStl,i&&n&&(Bh(n),Fe.extend(n,i),zh(n))},setTextStyle:Oh,setText:Yh,getFont:function(e,t){var i=t&&t.getModel("textStyle");return Fe.trim([e.fontStyle||i&&i.getShallow("fontStyle")||"",e.fontWeight||i&&i.getShallow("fontWeight")||"",(e.fontSize||i&&i.getShallow("fontSize")||12)+"px",e.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))},updateProps:Gh,initProps:function(e,t,i,n,a){Vh(!1,e,t,i,n,a)},getTransform:function(e,t){for(var i=ri.identity([]);e&&e!==t;)ri.mul(i,e.getLocalTransform(),i),e=e.parent;return i},applyTransform:Fh,transformDirection:Xh,groupTransition:function(e,t,i,n){if(e&&t){var a,r=(a={},e.traverse((function(e){!e.isGroup&&e.anid&&(a[e.anid]=e)})),a);t.traverse((function(e){if(!e.isGroup&&e.anid){var t=r[e.anid];if(t){var n=o(e);e.attr(o(t)),Gh(e,n,i,e.dataIndex)}}}))}function o(e){var t={position:ht.clone(e.position),rotation:e.rotation};return e.shape&&(t.shape=Fe.extend({},e.shape)),t}},clipPointsByRect:qh,clipRectByRect:function(e,t){var i=rh(e.x,t.x),n=oh(e.x+e.width,t.x+t.width),a=rh(e.y,t.y),r=oh(e.y+e.height,t.y+t.height);if(n>=i&&r>=a)return{x:i,y:a,width:n-i,height:r-a}},createIcon:$h,linePolygonIntersect:Kh,lineLineIntersect:Hh},Qh=["textStyle","color"],ec={getTextColor:function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(Qh):null)},getFont:function(){return Jh.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(e){return Ha.getBoundingRect(e,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},tc=ec,ic=Wo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),nc={getItemStyle:function(e,t){var i=ic(this,e,t),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var e=this.get("borderType");return"solid"===e||null==e?null:"dashed"===e?[5,5]:[1,1]}},ac=nc,rc=Ro.makeInner,oc=Ho.enableClassExtend,sc=Ho.enableClassCheck,lc=Fe.mixin,uc=rc();function hc(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}function cc(e,t,i){for(var n=0;n<t.length&&(!t[n]||null!=(e=e&&"object"==typeof e?e[t[n]]:null));n++);return null==e&&i&&(e=i.get(t)),e}function dc(e,t){var i=uc(e).getParent;return i?i.call(e,t):e.parentModel}hc.prototype={constructor:hc,init:null,mergeOption:function(e){Fe.merge(this.option,e,!0)},get:function(e,t){return null==e?this.option:cc(this.option,this.parsePath(e),!t&&dc(this,e))},getShallow:function(e,t){var i=this.option,n=null==i?i:i[e],a=!t&&dc(this,e);return null==n&&a&&(n=a.getShallow(e)),n},getModel:function(e,t){var i;return new hc(null==e?this.option:cc(this.option,e=this.parsePath(e)),t=t||(i=dc(this,e))&&i.getModel(e),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(Fe.clone(this.option))},setReadOnly:function(e){},parsePath:function(e){return"string"==typeof e&&(e=e.split(".")),e},customizeGetParent:function(e){uc(this).getParent=e},isAnimationEnabled:function(){if(!ae.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},oc(hc),sc(hc),lc(hc,Zo),lc(hc,Xo),lc(hc,tc),lc(hc,ac);var pc=hc,fc=Ho.parseClassType,gc=0;var mc={getUID:function(e){return[e||"",gc++,Math.random().toFixed(5)].join("_")},enableSubTypeDefaulter:function(e){var t={};return e.registerSubTypeDefaulter=function(e,i){e=fc(e),t[e.main]=i},e.determineSubType=function(i,n){var a=n.type;if(!a){var r=fc(i).main;e.hasSubTypes(i)&&t[r]&&(a=t[r](n))}return a},e},enableTopologicalTravel:function(e,t){function i(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,n,a,r){if(e.length){var o=function(e){var n={},a=[];return Fe.each(e,(function(r){var o=i(n,r),s=function(e,t){var i=[];return Fe.each(e,(function(e){Fe.indexOf(t,e)>=0&&i.push(e)})),i}(o.originalDeps=t(r),e);o.entryCount=s.length,0===o.entryCount&&a.push(r),Fe.each(s,(function(e){Fe.indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=i(n,e);Fe.indexOf(t.successor,e)<0&&t.successor.push(r)}))})),{graph:n,noEntryList:a}}(n),s=o.graph,l=o.noEntryList,u={};for(Fe.each(e,(function(e){u[e]=!0}));l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(a.call(r,h,c.originalDeps.slice()),delete u[h]),Fe.each(c.successor,d?f:p)}Fe.each(u,(function(){throw new Error("Circle dependency may exists")}))}function p(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,p(e)}}}},vc=1e-4;var yc=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function xc(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}var _c=function(e,t,i,n){var a=t[1]-t[0],r=i[1]-i[0];if(0===a)return 0===r?i[0]:(i[0]+i[1])/2;if(n)if(a>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/a*r+i[0]},bc=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},wc=function(e,t){var i=Math.log,n=Math.LN10,a=Math.floor(i(e[1]-e[0])/n),r=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-a+r,0),20);return isFinite(o)?o:20},Sc=function(e,t,i){if(!e[t])return 0;var n=Fe.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return 0;for(var a=Math.pow(10,i),r=Fe.map(e,(function(e){return(isNaN(e)?0:e)/n*a*100})),o=100*a,s=Fe.map(r,(function(e){return Math.floor(e)})),l=Fe.reduce(s,(function(e,t){return e+t}),0),u=Fe.map(r,(function(e,t){return e-s[t]}));l<o;){for(var h=Number.NEGATIVE_INFINITY,c=null,d=0,p=u.length;d<p;++d)u[d]>h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[t]/a},Mc=function(e,t){var i=xc(e),n=Math.pow(10,i),a=e/n;return e=(t?a<1.5?1:a<2.5?2:a<4?3:a<7?5:10:a<1?1:a<2?2:a<3?3:a<5?5:10)*n,i>=-20?+e.toFixed(i<0?-i:0):e},Ic=function(e,t){var i=(e.length-1)*t+1,n=Math.floor(i),a=+e[n-1],r=i-n;return r?a+r*(e[n]-a):a},Ac=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n<e.length;){for(var a=e[n].interval,r=e[n].close,o=0;o<2;o++)a[o]<=t&&(a[o]=t,r[o]=o?1:1-i),t=a[o],i=r[o];a[0]===a[1]&&r[0]*r[1]!=1?e.splice(n,1):n++}return e;function s(e,t,i){return e.interval[i]<t.interval[i]||e.interval[i]===t.interval[i]&&(e.close[i]-t.close[i]==(i?-1:1)||!i&&s(e,t,1))}},Tc=function(e){return e-parseFloat(e)>=0},Cc={linearMap:_c,parsePercent:function(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?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},round:function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},asc:function(e){return e.sort((function(e,t){return e-t})),e},getPrecision:bc,getPrecisionSafe:function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var a=t.indexOf(".");return a<0?0:t.length-1-a},getPixelPrecision:wc,getPercentWithPrecision:Sc,MAX_SAFE_INTEGER:9007199254740991,remRadian:function(e){var t=2*Math.PI;return(e%t+t)%t},isRadianAroundZero:function(e){return e>-1e-4&&e<vc},parseDate:function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=yc.exec(e);if(!t)return new Date(NaN);if(t[8]){var i=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(i-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,i,+(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))},quantity:function(e){return Math.pow(10,xc(e))},quantityExponent:xc,nice:Mc,quantile:Ic,reformIntervals:Ac,isNumeric:Tc};var Dc=Fe.normalizeCssArray,Lc=/([&<>"'])/g,Pc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function kc(e){return null==e?"":(e+"").replace(Lc,(function(e,t){return Pc[t]}))}var Oc=["a","b","c","d","e","f","g"],Rc=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Ec(e,t){return"0000".substr(0,t-(e+="").length)+e}var Nc=function(e,t,i){Fe.isArray(t)||(t=[t]);var n=t.length;if(!n)return"";for(var a=t[0].$vars||[],r=0;r<a.length;r++){var o=Oc[r];e=e.replace(Rc(o),Rc(o,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var u=t[s][a[l]];e=e.replace(Rc(Oc[l],s),i?kc(u):u)}return e},zc=function(e,t,i){return Fe.each(t,(function(t,n){e=e.replace("{"+n+"}",i?kc(t):t)})),e},Bc=function(e,t){var i=(e=Fe.isString(e)?{color:e,extraCssText:t}:e||{}).color,n=e.type,a=(t=e.extraCssText,e.renderMode||"html"),r=e.markerId||"X";return i?"html"===a?"subItem"===n?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+kc(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+kc(i)+";"+(t||"")+'"></span>':{renderMode:a,content:"{marker"+r+"|}  ",style:{color:i}}:""},Vc=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=Cc.parseDate(t),a=i?"UTC":"",r=n["get"+a+"FullYear"](),o=n["get"+a+"Month"]()+1,s=n["get"+a+"Date"](),l=n["get"+a+"Hours"](),u=n["get"+a+"Minutes"](),h=n["get"+a+"Seconds"](),c=n["get"+a+"Milliseconds"]();return e=e.replace("MM",Ec(o,2)).replace("M",o).replace("yyyy",r).replace("yy",r%100).replace("dd",Ec(s,2)).replace("d",s).replace("hh",Ec(l,2)).replace("h",l).replace("mm",Ec(u,2)).replace("m",u).replace("ss",Ec(h,2)).replace("s",h).replace("SSS",Ec(c,3))},Gc=function(e,t,i,n,a,r,o,s){return Ha.getBoundingRect(e,t,i,n,a,s,r,o)},Fc={addCommas:function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},toCamelCase:function(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},normalizeCssArray:Dc,encodeHTML:kc,formatTpl:Nc,formatTplSimple:zc,getTooltipMarker:Bc,formatTime:Vc,capitalFirst:function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},truncateText:Ha.truncateText,getTextBoundingRect:function(e){return Ha.getBoundingRect(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},getTextRect:Gc,windowOpen:function(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)}},Hc=Cc.parsePercent,Wc=Fe.each,Uc=["left","right","top","bottom","width","height"],jc=[["width","left","right"],["height","top","bottom"]];function Zc(e,t,i,n,a){var r=0,o=0;null==n&&(n=1/0),null==a&&(a=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,p=l.getBoundingRect(),f=t.childAt(u+1),g=f&&f.getBoundingRect();if("horizontal"===e){var m=p.width+(g?-g.x+p.x:0);(h=r+m)>n||l.newline?(r=0,h=m,o+=s+i,s=p.height):s=Math.max(s,p.height)}else{var v=p.height+(g?-g.y+p.y:0);(c=o+v)>a||l.newline?(r+=s+i,o=0,c=v,s=p.width):s=Math.max(s,p.width)}l.newline||(d[0]=r,d[1]=o,"horizontal"===e?r=h+i:o=c+i)}))}var Yc=Zc,Xc=Fe.curry(Zc,"vertical"),qc=Fe.curry(Zc,"horizontal");function $c(e,t,i){i=Fc.normalizeCssArray(i||0);var n=t.width,a=t.height,r=Hc(e.left,n),o=Hc(e.top,a),s=Hc(e.right,n),l=Hc(e.bottom,a),u=Hc(e.width,n),h=Hc(e.height,a),c=i[2]+i[0],d=i[1]+i[3],p=e.aspect;switch(isNaN(u)&&(u=n-s-d-r),isNaN(h)&&(h=a-l-c-o),null!=p&&(isNaN(u)&&isNaN(h)&&(p>n/a?u=.8*n:h=.8*a),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=n-s-u-d),isNaN(o)&&(o=a-l-h-c),e.left||e.right){case"center":r=n/2-u/2-i[3];break;case"right":r=n-u-d}switch(e.top||e.bottom){case"middle":case"center":o=a/2-h/2-i[0];break;case"bottom":o=a-h-c}r=r||0,o=o||0,isNaN(u)&&(u=n-d-r-(s||0)),isNaN(h)&&(h=a-c-o-(l||0));var f=new On(r+i[3],o+i[0],u,h);return f.margin=i,f}function Kc(e,t){return t&&e&&Wc(Uc,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}var Jc=function(e,t,i,n,a){var r=!a||!a.hv||a.hv[0],o=!a||!a.hv||a.hv[1],s=a&&a.boundingMode||"all";if(r||o){var l;if("raw"===s)l="group"===e.type?new On(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)}t=$c(Fe.defaults({width:l.width,height:l.height},t),i,n);var h=e.position,c=r?t.x-l.x:0,d=o?t.y-l.y:0;e.attr("position","raw"===s?[c,d]:[h[0]+c,h[1]+d])}},Qc=function(e,t,i){!Fe.isObject(i)&&(i={});var n=i.ignoreSize;!Fe.isArray(n)&&(n=[n,n]);var a=o(jc[0],0),r=o(jc[1],1);function o(i,a){var r={},o=0,u={},h=0;if(Wc(i,(function(t){u[t]=e[t]})),Wc(i,(function(e){s(t,e)&&(r[e]=u[e]=t[e]),l(r,e)&&o++,l(u,e)&&h++})),n[a])return l(t,i[1])?u[i[2]]=null:l(t,i[2])&&(u[i[1]]=null),u;if(2!==h&&o){if(o>=2)return r;for(var c=0;c<i.length;c++){var d=i[c];if(!s(r,d)&&s(e,d)){r[d]=e[d];break}}return r}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,i){Wc(e,(function(e){t[e]=i[e]}))}u(jc[0],e,a),u(jc[1],e,r)},ed={LOCATION_PARAMS:Uc,HV_NAMES:jc,box:Yc,vbox:Xc,hbox:qc,getAvailableSize:function(e,t,i){var n=t.width,a=t.height,r=Hc(e.x,n),o=Hc(e.y,a),s=Hc(e.x2,n),l=Hc(e.y2,a);return(isNaN(r)||isNaN(parseFloat(e.x)))&&(r=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=n),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.y2)))&&(l=a),i=Fc.normalizeCssArray(i||0),{width:Math.max(s-r-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}},getLayoutRect:$c,positionElement:Jc,sizeCalculable:function(e,t){return null!=e[jc[t][0]]||null!=e[jc[t][1]]&&null!=e[jc[t][2]]},mergeLayoutParam:Qc,getLayoutParams:function(e){return Kc({},e)},copyLayoutParams:Kc},td={getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}},id=Ho.enableClassManagement,nd=Ho.parseClassType,ad=(0,Ro.makeInner)(),rd=pc.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(e,t,i,n){pc.call(this,e,t,i,n),this.uid=mc.getUID("ec_cpt_model")},init:function(e,t,i,n){this.mergeDefaultAndTheme(e,i)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?ed.getLayoutParams(e):{},a=t.getTheme();Fe.merge(e,a.get(this.mainType)),Fe.merge(e,this.getDefaultOption()),i&&ed.mergeLayoutParam(e,n,i)},mergeOption:function(e,t){Fe.merge(this.option,e,!0);var i=this.layoutMode;i&&ed.mergeLayoutParam(this.option,e,i)},optionUpdated:function(e,t){},getDefaultOption:function(){var e=ad(this);if(!e.defaultOption){for(var t=[],i=this.constructor;i;){var n=i.prototype.defaultOption;n&&t.push(n),i=i.superClass}for(var a={},r=t.length-1;r>=0;r--)a=Fe.merge(a,t[r],!0);e.defaultOption=a}return e.defaultOption},getReferringComponents:function(e){return this.ecModel.queryComponents({mainType:e,index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)})}});id(rd,{registerWhenExtend:!0}),mc.enableSubTypeDefaulter(rd),mc.enableTopologicalTravel(rd,(function(e){var t=[];Fe.each(rd.getClassesByMainType(e),(function(e){t=t.concat(e.prototype.dependencies||[])})),t=Fe.map(t,(function(e){return nd(e).main})),"dataset"!==e&&Fe.indexOf(t,"dataset")<=0&&t.unshift("dataset");return t})),Fe.mixin(rd,td);var od=rd,sd="";"undefined"!=typeof navigator&&(sd=navigator.platform||"");var ld={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:sd.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},ud=Ro.makeInner,hd=Ro.normalizeToArray,cd=ud();var dd={clearColorPalette:function(){cd(this).colorIdx=0,cd(this).colorNameMap={}},getColorFromPalette:function(e,t,i){var n=cd(t=t||this),a=n.colorIdx||0,r=n.colorNameMap=n.colorNameMap||{};if(r.hasOwnProperty(e))return r[e];var o=hd(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?function(e,t){for(var i=e.length,n=0;n<i;n++)if(e[n].length>t)return e[n];return e[i-1]}(s,i):o;if((l=l||o)&&l.length){var u=l[a];return e&&(r[e]=u),n.colorIdx=(a+1)%l.length,u}}},pd=dd,fd={SOURCE_FORMAT_ORIGINAL:"original",SOURCE_FORMAT_ARRAY_ROWS:"arrayRows",SOURCE_FORMAT_OBJECT_ROWS:"objectRows",SOURCE_FORMAT_KEYED_COLUMNS:"keyedColumns",SOURCE_FORMAT_UNKNOWN:"unknown",SOURCE_FORMAT_TYPED_ARRAY:"typedArray",SERIES_LAYOUT_BY_COLUMN:"column",SERIES_LAYOUT_BY_ROW:"row"},gd=Fe.createHashMap,md=Fe.isTypedArray,vd=Ho.enableClassCheck,yd=fd.SOURCE_FORMAT_ORIGINAL,xd=fd.SERIES_LAYOUT_BY_COLUMN,_d=fd.SOURCE_FORMAT_UNKNOWN,bd=fd.SOURCE_FORMAT_TYPED_ARRAY,wd=fd.SOURCE_FORMAT_KEYED_COLUMNS;function Sd(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===wd?{}:[]),this.sourceFormat=e.sourceFormat||_d,this.seriesLayoutBy=e.seriesLayoutBy||xd,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&gd(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Sd.seriesDataToSource=function(e){return new Sd({data:e,sourceFormat:md(e)?bd:yd,fromDataset:!1})},vd(Sd);var Md=Sd,Id=Ro.makeInner,Ad=Ro.getDataItemValue,Td=Fe.createHashMap,Cd=Fe.each,Dd=Fe.map,Ld=Fe.isArray,Pd=Fe.isString,kd=Fe.isObject,Od=Fe.isTypedArray,Rd=Fe.isArrayLike,Ed=Fe.extend,Nd=fd.SOURCE_FORMAT_ORIGINAL,zd=fd.SOURCE_FORMAT_ARRAY_ROWS,Bd=fd.SOURCE_FORMAT_OBJECT_ROWS,Vd=fd.SOURCE_FORMAT_KEYED_COLUMNS,Gd=fd.SOURCE_FORMAT_UNKNOWN,Fd=fd.SOURCE_FORMAT_TYPED_ARRAY,Hd=fd.SERIES_LAYOUT_BY_ROW,Wd={Must:1,Might:2,Not:3},Ud=Id();function jd(e){if(e){var t=Td();return Dd(e,(function(e,i){if(null==(e=Ed({},kd(e)?e:{name:e})).name)return e;e.name+="",null==e.displayName&&(e.displayName=e.name);var n=t.get(e.name);return n?e.name+="-"+n.count++:t.set(e.name,{count:1}),e}))}}function Zd(e,t,i,n){if(null==n&&(n=1/0),t===Hd)for(var a=0;a<i.length&&a<n;a++)e(i[a]?i[a][0]:null,a);else{var r=i[0]||[];for(a=0;a<r.length&&a<n;a++)e(r[a],a)}}function Yd(e){var t=e.option;if(!t.data)return e.ecModel.getComponent("dataset",t.datasetIndex||0)}function Xd(e,t,i,n,a,r){var o,s,l;if(Od(e))return Wd.Not;if(n){var u=n[r];kd(u)?(s=u.name,l=u.type):Pd(u)&&(s=u)}if(null!=l)return"ordinal"===l?Wd.Must:Wd.Not;if(t===zd)if(i===Hd){for(var h=e[r],c=0;c<(h||[]).length&&c<5;c++)if(null!=(o=g(h[a+c])))return o}else for(c=0;c<e.length&&c<5;c++){var d=e[a+c];if(d&&null!=(o=g(d[r])))return o}else if(t===Bd){if(!s)return Wd.Not;for(c=0;c<e.length&&c<5;c++){if((p=e[c])&&null!=(o=g(p[s])))return o}}else if(t===Vd){if(!s)return Wd.Not;if(!(h=e[s])||Od(h))return Wd.Not;for(c=0;c<h.length&&c<5;c++)if(null!=(o=g(h[c])))return o}else if(t===Nd)for(c=0;c<e.length&&c<5;c++){var p=e[c],f=Ad(p);if(!Ld(f))return Wd.Not;if(null!=(o=g(f[r])))return o}function g(e){var t=Pd(e);return null!=e&&isFinite(e)&&""!==e?t?Wd.Might:Wd.Not:t&&"-"!==e?Wd.Must:void 0}return Wd.Not}var qd=function(e){var t=e.option.source,i=Gd;if(Od(t))i=Fd;else if(Ld(t)){0===t.length&&(i=zd);for(var n=0,a=t.length;n<a;n++){var r=t[n];if(null!=r){if(Ld(r)){i=zd;break}if(kd(r)){i=Bd;break}}}}else if(kd(t)){for(var o in t)if(t.hasOwnProperty(o)&&Rd(t[o])){i=Vd;break}}else if(null!=t)throw new Error("Invalid data");Ud(e).sourceFormat=i},$d=function(e,t,i){var n={},a=Yd(t);if(!a||!e)return n;var r,o,s=[],l=[],u=t.ecModel,h=Ud(u).datasetMap,c=a.uid+"_"+i.seriesLayoutBy;e=e.slice(),Cd(e,(function(t,i){!kd(t)&&(e[i]={name:t}),"ordinal"===t.type&&null==r&&(r=i,o=f(e[i])),n[t.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:o,valueWayDim:0});function p(e,t,i){for(var n=0;n<i;n++)e.push(t+n)}function f(e){var t=e.dimsDef;return t?t.length:1}return Cd(e,(function(e,t){var i=e.name,a=f(e);if(null==r){var o=d.valueWayDim;p(n[i],o,a),p(l,o,a),d.valueWayDim+=a}else if(r===t)p(n[i],0,a),p(s,0,a);else{o=d.categoryWayDim;p(n[i],o,a),p(l,o,a),d.categoryWayDim+=a}})),s.length&&(n.itemName=s),l.length&&(n.seriesName=l),n},Kd=function(e,t,i){var n={};if(!Yd(e))return n;var a,r=t.sourceFormat,o=t.dimensionsDefine;r!==Bd&&r!==Vd||Cd(o,(function(e,t){"name"===(kd(e)?e.name:e)&&(a=t)}));var s=function(){for(var e={},n={},s=[],l=0,u=Math.min(5,i);l<u;l++){var h=Xd(t.data,r,t.seriesLayoutBy,o,t.startIndex,l);s.push(h);var c=h===Wd.Not;if(c&&null==e.v&&l!==a&&(e.v=l),(null==e.n||e.n===e.v||!c&&s[e.n]===Wd.Not)&&(e.n=l),d(e)&&s[e.n]!==Wd.Not)return e;c||(h===Wd.Might&&null==n.v&&l!==a&&(n.v=l),null!=n.n&&n.n!==n.v||(n.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(n)?n:null}();if(s){n.value=s.v;var l=null!=a?a:s.n;n.itemName=[l],n.seriesName=[l]}return n},Jd={BE_ORDINAL:Wd,detectSourceFormat:qd,getSource:function(e){return Ud(e).source},resetSourceDefaulter:function(e){Ud(e).datasetMap=Td()},prepareSource:function(e){var t=e.option,i=t.data,n=Od(i)?Fd:Nd,a=!1,r=t.seriesLayoutBy,o=t.sourceHeader,s=t.dimensions,l=Yd(e);if(l){var u=l.option;i=u.source,n=Ud(l).sourceFormat,a=!0,r=r||u.seriesLayoutBy,null==o&&(o=u.sourceHeader),s=s||u.dimensions}var h=function(e,t,i,n,a){if(!e)return{dimensionsDefine:jd(a)};var r,o;if(t===zd)"auto"===n||null==n?Zd((function(e){null!=e&&"-"!==e&&(Pd(e)?null==o&&(o=1):o=0)}),i,e,10):o=n?1:0,a||1!==o||(a=[],Zd((function(e,t){a[t]=null!=e?e:""}),i,e)),r=a?a.length:i===Hd?e.length:e[0]?e[0].length:null;else if(t===Bd)a||(a=function(e){var t,i=0;for(;i<e.length&&!(t=e[i++]););if(t){var n=[];return Cd(t,(function(e,t){n.push(t)})),n}}(e));else if(t===Vd)a||(a=[],Cd(e,(function(e,t){a.push(t)})));else if(t===Nd){var s=Ad(e[0]);r=Ld(s)&&s.length||1}return{startIndex:o,dimensionsDefine:jd(a),dimensionsDetectCount:r}}(i,n,r,o,s);Ud(e).source=new Md({data:i,fromDataset:a,seriesLayoutBy:r,sourceFormat:n,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:t.encode})},makeSeriesEncodeForAxisCoordSys:$d,makeSeriesEncodeForNameBased:Kd,guessOrdinal:function(e,t){return Xd(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}},Qd=Fe.each,ep=Fe.filter,tp=Fe.map,ip=Fe.isArray,np=Fe.indexOf,ap=Fe.isObject,rp=Fe.isString,op=Fe.createHashMap,sp=Fe.assert,lp=Fe.clone,up=Fe.merge,hp=Fe.extend,cp=Fe.mixin,dp=Jd.resetSourceDefaulter,pp="\0_ec_inner",fp=pc.extend({init:function(e,t,i,n){i=i||{},this.option=null,this._theme=new pc(i),this._optionManager=n},setOption:function(e,t){sp(!(pp in e),"please use chart.getOption()"),this._optionManager.setOption(e,t),this.resetOption(null)},resetOption:function(e){var t=!1,i=this._optionManager;if(!e||"recreate"===e){var n=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this.mergeOption(n)):gp.call(this,n),t=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var a=i.getTimelineOption(this);a&&(this.mergeOption(a),t=!0)}if(!e||"recreate"===e||"media"===e){var r=i.getMediaOption(this,this._api);r.length&&Qd(r,(function(e){this.mergeOption(e,t=!0)}),this)}return t},mergeOption:function(e){var t=this.option,i=this._componentsMap,n=[];dp(this),Qd(e,(function(e,i){null!=e&&(od.hasClass(i)?i&&n.push(i):t[i]=null==t[i]?lp(e):up(t[i],e,!0))})),od.topologicalTravel(n,od.getAllClassMainTypes(),(function(n,a){var r=Ro.normalizeToArray(e[n]),o=Ro.mappingToExists(i.get(n),r);Ro.makeIdAndName(o),Qd(o,(function(e,t){var i=e.option;ap(i)&&(e.keyInfo.mainType=n,e.keyInfo.subType=function(e,t,i){var n=t.type?t.type:i?i.subType:od.determineSubType(e,t);return n}(n,i,e.exist))}));var s=function(e,t){ip(t)||(t=t?[t]:[]);var i={};return Qd(t,(function(t){i[t]=(e.get(t)||[]).slice()})),i}(i,a);t[n]=[],i.set(n,[]),Qd(o,(function(e,a){var r=e.exist,o=e.option;if(sp(ap(o)||r,"Empty component definition"),o){var l=od.getClass(n,e.keyInfo.subType,!0);if(r&&r.constructor===l)r.name=e.keyInfo.name,r.mergeOption(o,this),r.optionUpdated(o,!1);else{var u=hp({dependentModels:s,componentIndex:a},e.keyInfo);r=new l(o,this,this,u),hp(r,u),r.init(o,this,this,u),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);i.get(n)[a]=r,t[n][a]=r.option}),this),"series"===n&&mp(this,i.get("series"))}),this),this._seriesIndicesMap=op(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var e=lp(this.option);return Qd(e,(function(t,i){if(od.hasClass(i)){for(var n=(t=Ro.normalizeToArray(t)).length-1;n>=0;n--)Ro.isIdInner(t[n])&&t.splice(n,1);e[i]=t}})),delete e[pp],e},getTheme:function(){return this._theme},getComponent:function(e,t){var i=this._componentsMap.get(e);if(i)return i[t||0]},queryComponents:function(e){var t=e.mainType;if(!t)return[];var i,n=e.index,a=e.id,r=e.name,o=this._componentsMap.get(t);if(!o||!o.length)return[];if(null!=n)ip(n)||(n=[n]),i=ep(tp(n,(function(e){return o[e]})),(function(e){return!!e}));else if(null!=a){var s=ip(a);i=ep(o,(function(e){return s&&np(a,e.id)>=0||!s&&e.id===a}))}else if(null!=r){var l=ip(r);i=ep(o,(function(e){return l&&np(r,e.name)>=0||!l&&e.name===r}))}else i=o.slice();return vp(i,e)},findComponents:function(e){var t,i,n,a,r,o=e.query,s=e.mainType,l=(i=s+"Index",n=s+"Id",a=s+"Name",!(t=o)||null==t[i]&&null==t[n]&&null==t[a]?null:{mainType:s,index:t[i],id:t[n],name:t[a]}),u=l?this.queryComponents(l):this._componentsMap.get(s);return r=vp(u,e),e.filter?ep(r,e.filter):r},eachComponent:function(e,t,i){var n=this._componentsMap;if("function"==typeof e)i=t,t=e,n.each((function(e,n){Qd(e,(function(e,a){t.call(i,n,e,a)}))}));else if(rp(e))Qd(n.get(e),t,i);else if(ap(e)){var a=this.findComponents(e);Qd(a,t,i)}},getSeriesByName:function(e){var t=this._componentsMap.get("series");return ep(t,(function(t){return t.name===e}))},getSeriesByIndex:function(e){return this._componentsMap.get("series")[e]},getSeriesByType:function(e){var t=this._componentsMap.get("series");return ep(t,(function(t){return t.subType===e}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(e,t){Qd(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];e.call(t,n,i)}),this)},eachRawSeries:function(e,t){Qd(this._componentsMap.get("series"),e,t)},eachSeriesByType:function(e,t,i){Qd(this._seriesIndices,(function(n){var a=this._componentsMap.get("series")[n];a.subType===e&&t.call(i,a,n)}),this)},eachRawSeriesByType:function(e,t,i){return Qd(this.getSeriesByType(e),t,i)},isSeriesFiltered:function(e){return null==this._seriesIndicesMap.get(e.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(e,t){mp(this,ep(this._componentsMap.get("series"),e,t))},restoreData:function(e){var t=this._componentsMap;mp(this,t.get("series"));var i=[];t.each((function(e,t){i.push(t)})),od.topologicalTravel(i,od.getAllClassMainTypes(),(function(i,n){Qd(t.get(i),(function(t){("series"!==i||!function(e,t){if(t){var i=t.seiresIndex,n=t.seriesId,a=t.seriesName;return null!=i&&e.componentIndex!==i||null!=n&&e.id!==n||null!=a&&e.name!==a}}(t,e))&&t.restoreData()}))}))}});function gp(e){this.option={},this.option[pp]=1,this._componentsMap=op({series:[]}),this._seriesIndices,this._seriesIndicesMap,function(e,t){var i=e.color&&!e.colorLayer;Qd(t,(function(t,n){"colorLayer"===n&&i||od.hasClass(n)||("object"==typeof t?e[n]=e[n]?up(e[n],t,!1):lp(t):null==e[n]&&(e[n]=t))}))}(e,this._theme.option),up(e,ld,!1),this.mergeOption(e)}function mp(e,t){e._seriesIndicesMap=op(e._seriesIndices=tp(t,(function(e){return e.componentIndex}))||[])}function vp(e,t){return t.hasOwnProperty("subType")?ep(e,(function(e){return e.subType===t.subType})):e}cp(fp,pd);var yp=fp,xp=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];var _p=function(e){Fe.each(xp,(function(t){this[t]=Fe.bind(e[t],e)}),this)},bp={};function wp(){this._coordinateSystems=[]}wp.prototype={constructor:wp,create:function(e,t){var i=[];Fe.each(bp,(function(n,a){var r=n.create(e,t);i=i.concat(r||[])})),this._coordinateSystems=i},update:function(e,t){Fe.each(this._coordinateSystems,(function(i){i.update&&i.update(e,t)}))},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},wp.register=function(e,t){bp[e]=t},wp.get=function(e){return bp[e]};var Sp=wp,Mp=Fe.each,Ip=Fe.clone,Ap=Fe.map,Tp=Fe.merge,Cp=/^(min|max)?(.+)$/;function Dp(e){this._api=e,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function Lp(e,t,i){var n,a,r=[],o=[],s=e.timeline;if(e.baseOption&&(a=e.baseOption),(s||e.options)&&(a=a||{},r=(e.options||[]).slice()),e.media){a=a||{};var l=e.media;Mp(l,(function(e){e&&e.option&&(e.query?o.push(e):n||(n=e))}))}return a||(a=e),a.timeline||(a.timeline=s),Mp([a].concat(r).concat(Fe.map(o,(function(e){return e.option}))),(function(e){Mp(t,(function(t){t(e,i)}))})),{baseOption:a,timelineOptions:r,mediaDefault:n,mediaList:o}}function Pp(e,t,i){var n={width:t,height:i,aspectratio:t/i},a=!0;return Fe.each(e,(function(e,t){var i=t.match(Cp);if(i&&i[1]&&i[2]){var r=i[1],o=i[2].toLowerCase();(function(e,t,i){return"min"===i?e>=t:"max"===i?e<=t:e===t})(n[o],e,r)||(a=!1)}})),a}Dp.prototype={constructor:Dp,setOption:function(e,t){e&&Fe.each(Ro.normalizeToArray(e.series),(function(e){e&&e.data&&Fe.isTypedArray(e.data)&&Fe.setAsPrimitive(e.data)})),e=Ip(e);var i,n,a=this._optionBackup,r=Lp.call(this,e,t,!a);this._newBaseOption=r.baseOption,a?(i=a.baseOption,n=r.baseOption,Mp(n=n||{},(function(e,t){if(null!=e){var n=i[t];if(od.hasClass(t)){e=Ro.normalizeToArray(e),n=Ro.normalizeToArray(n);var a=Ro.mappingToExists(n,e);i[t]=Ap(a,(function(e){return e.option&&e.exist?Tp(e.exist,e.option,!0):e.exist||e.option}))}else i[t]=Tp(n,e,!0)}})),r.timelineOptions.length&&(a.timelineOptions=r.timelineOptions),r.mediaList.length&&(a.mediaList=r.mediaList),r.mediaDefault&&(a.mediaDefault=r.mediaDefault)):this._optionBackup=r},mountOption:function(e){var t=this._optionBackup;return this._timelineOptions=Ap(t.timelineOptions,Ip),this._mediaList=Ap(t.mediaList,Ip),this._mediaDefault=Ip(t.mediaDefault),this._currentMediaIndices=[],Ip(e?t.baseOption:this._newBaseOption)},getTimelineOption:function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=Ip(i[n.getCurrentIndex()],!0))}return t},getMediaOption:function(e){var t,i,n=this._api.getWidth(),a=this._api.getHeight(),r=this._mediaList,o=this._mediaDefault,s=[],l=[];if(!r.length&&!o)return l;for(var u=0,h=r.length;u<h;u++)Pp(r[u].query,n,a)&&s.push(u);return!s.length&&o&&(s=[-1]),s.length&&(t=s,i=this._currentMediaIndices,t.join(",")!==i.join(","))&&(l=Ap(s,(function(e){return Ip(-1===e?o.option:r[e].option)}))),this._currentMediaIndices=s,l}};var kp=Dp,Op=Fe.each,Rp=Fe.isObject,Ep=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Np(e){var t=e&&e.itemStyle;if(t)for(var i=0,n=Ep.length;i<n;i++){var a=Ep[i],r=t.normal,o=t.emphasis;r&&r[a]&&(e[a]=e[a]||{},e[a].normal?Fe.merge(e[a].normal,r[a]):e[a].normal=r[a],r[a]=null),o&&o[a]&&(e[a]=e[a]||{},e[a].emphasis?Fe.merge(e[a].emphasis,o[a]):e[a].emphasis=o[a],o[a]=null)}}function zp(e,t,i){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,a=e[t].emphasis;n&&(i?(e[t].normal=e[t].emphasis=null,Fe.defaults(e[t],n)):e[t]=n),a&&(e.emphasis=e.emphasis||{},e.emphasis[t]=a)}}function Bp(e){zp(e,"itemStyle"),zp(e,"lineStyle"),zp(e,"areaStyle"),zp(e,"label"),zp(e,"labelLine"),zp(e,"upperLabel"),zp(e,"edgeLabel")}function Vp(e,t){var i=Rp(e)&&e[t],n=Rp(i)&&i.textStyle;if(n)for(var a=0,r=Ro.TEXT_STYLE_OPTIONS.length;a<r;a++){t=Ro.TEXT_STYLE_OPTIONS[a];n.hasOwnProperty(t)&&(i[t]=n[t])}}function Gp(e){e&&(Bp(e),Vp(e,"label"),e.emphasis&&Vp(e.emphasis,"label"))}function Fp(e){return Fe.isArray(e)?e:e?[e]:[]}function Hp(e){return(Fe.isArray(e)?e[0]:e)||{}}var Wp=function(e,t){Op(Fp(e.series),(function(e){Rp(e)&&function(e){if(Rp(e)){Np(e),Bp(e),Vp(e,"label"),Vp(e,"upperLabel"),Vp(e,"edgeLabel"),e.emphasis&&(Vp(e.emphasis,"label"),Vp(e.emphasis,"upperLabel"),Vp(e.emphasis,"edgeLabel")),(i=e.markPoint)&&(Np(i),Gp(i)),(n=e.markLine)&&(Np(n),Gp(n));var t=e.markArea;t&&Gp(t);var i,n,a=e.data;if("graph"===e.type){a=a||e.nodes;var r=e.links||e.edges;if(r&&!Fe.isTypedArray(r))for(var o=0;o<r.length;o++)Gp(r[o]);Fe.each(e.categories,(function(e){Bp(e)}))}if(a&&!Fe.isTypedArray(a))for(o=0;o<a.length;o++)Gp(a[o]);if((i=e.markPoint)&&i.data){var s=i.data;for(o=0;o<s.length;o++)Gp(s[o])}if((n=e.markLine)&&n.data){var l=n.data;for(o=0;o<l.length;o++)Fe.isArray(l[o])?(Gp(l[o][0]),Gp(l[o][1])):Gp(l[o])}"gauge"===e.type?(Vp(e,"axisLabel"),Vp(e,"title"),Vp(e,"detail")):"treemap"===e.type?(zp(e.breadcrumb,"itemStyle"),Fe.each(e.levels,(function(e){Bp(e)}))):"tree"===e.type&&Bp(e.leaves)}}(e)}));var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),Op(i,(function(t){Op(Fp(e[t]),(function(e){e&&(Vp(e,"axisLabel"),Vp(e.axisPointer,"label"))}))})),Op(Fp(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;Vp(t,"axisLabel"),Vp(t&&t.axisPointer,"label")})),Op(Fp(e.calendar),(function(e){zp(e,"itemStyle"),Vp(e,"dayLabel"),Vp(e,"monthLabel"),Vp(e,"yearLabel")})),Op(Fp(e.radar),(function(e){Vp(e,"name")})),Op(Fp(e.geo),(function(e){Rp(e)&&(Gp(e),Op(Fp(e.regions),(function(e){Gp(e)})))})),Op(Fp(e.timeline),(function(e){Gp(e),zp(e,"label"),zp(e,"itemStyle"),zp(e,"controlStyle",!0);var t=e.data;Fe.isArray(t)&&Fe.each(t,(function(e){Fe.isObject(e)&&(zp(e,"label"),zp(e,"itemStyle"))}))})),Op(Fp(e.toolbox),(function(e){zp(e,"iconStyle"),Op(e.feature,(function(e){zp(e,"iconStyle")}))})),Vp(Hp(e.axisPointer),"label"),Vp(Hp(e.tooltip).axisPointer,"label")},Up=Fe.each,jp=Fe.isArray,Zp=Fe.isObject,Yp=Ro.normalizeToArray;function Xp(e){Up(qp,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var qp=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],$p=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"];var Kp=function(e,t){Wp(e,t),e.series=Yp(e.series),Up(e.series,(function(e){if(Zp(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t)null!=e.clockWise&&(e.clockwise=e.clockWise);else if("gauge"===t){var i=function(e,t){t=t.split(",");for(var i=e,n=0;n<t.length&&null!=(i=i&&i[t[n]]);n++);return i}(e,"pointer.color");null!=i&&function(e,t,i,n){t=t.split(",");for(var a,r=e,o=0;o<t.length-1;o++)null==r[a=t[o]]&&(r[a]={}),r=r[a];(n||null==r[t[o]])&&(r[t[o]]=i)}(e,"itemStyle.color",i)}Xp(e)}})),e.dataRange&&(e.visualMap=e.dataRange),Up($p,(function(t){var i=e[t];i&&(jp(i)||(i=[i]),Up(i,(function(e){Xp(e)})))}))},Jp=Fe.createHashMap,Qp=Fe.each;function ef(e){Qp(e,(function(t,i){var n=[],a=[NaN,NaN],r=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=o.map(r,(function(r,l,u){var h,c,d=o.get(t.stackedDimension,u);if(isNaN(d))return a;s?c=o.getRawIndex(u):h=o.get(t.stackedByDimension,u);for(var p=NaN,f=i-1;f>=0;f--){var g=e[f];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var m=g.data.getByRawIndex(g.stackResultDimension,c);if(d>=0&&m>0||d<=0&&m<0){d+=m,p=m;break}}}return n[0]=d,n[1]=p,n}));o.hostModel.setData(l),t.data=l}))}var tf=function(e){var t=Jp();e.eachSeries((function(e){var i=e.get("stack");if(i){var n=t.get(i)||t.set(i,[]),a=e.getData(),r={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:e};if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;n.length&&a.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(r)}})),t.each(ef)},nf=Fe.extend,af=Fe.each,rf=Fe.isObject,of=Ro.getDataItemValue,sf=Ro.isDataItemOption,lf=Cc.parseDate,uf=fd.SOURCE_FORMAT_TYPED_ARRAY,hf=fd.SOURCE_FORMAT_ARRAY_ROWS,cf=fd.SOURCE_FORMAT_ORIGINAL,df=fd.SOURCE_FORMAT_OBJECT_ROWS;function pf(e,t){Md.isInstance(e)||(e=Md.seriesDataToSource(e)),this._source=e;var i=this._data=e.data,n=e.sourceFormat;n===uf&&(this._offset=0,this._dimSize=t,this._data=i);var a=gf[n===hf?n+"_"+e.seriesLayoutBy:n];nf(this,a)}var ff=pf.prototype;ff.pure=!1,ff.persistent=!0,ff.getSource=function(){return this._source};var gf={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(e){return this._data[e+this._source.startIndex]},appendData:yf},arrayRows_row:{pure:!0,count:function(){var e=this._data[0];return e?Math.max(0,e.length-this._source.startIndex):0},getItem:function(e){e+=this._source.startIndex;for(var t=[],i=this._data,n=0;n<i.length;n++){var a=i[n];t.push(a?a[e]:null)}return t},appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},objectRows:{pure:!0,count:mf,getItem:vf,appendData:yf},keyedColumns:{pure:!0,count:function(){var e=this._source.dimensionsDefine[0].name,t=this._data[e];return t?t.length:0},getItem:function(e){for(var t=[],i=this._source.dimensionsDefine,n=0;n<i.length;n++){var a=this._data[i[n].name];t.push(a?a[e]:null)}return t},appendData:function(e){var t=this._data;af(e,(function(e,i){for(var n=t[i]||(t[i]=[]),a=0;a<(e||[]).length;a++)n.push(e[a])}))}},original:{count:mf,getItem:vf,appendData:yf},typedArray:{persistent:!1,pure:!0,count:function(){return this._data?this._data.length/this._dimSize:0},getItem:function(e,t){e-=this._offset,t=t||[];for(var i=this._dimSize*e,n=0;n<this._dimSize;n++)t[n]=this._data[i+n];return t},appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}}};function mf(){return this._data.length}function vf(e){return this._data[e]}function yf(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}var xf={arrayRows:_f,objectRows:function(e,t,i,n){return null!=i?e[n]:e},keyedColumns:_f,original:function(e,t,i,n){var a=of(e);return null!=i&&a instanceof Array?a[i]:a},typedArray:_f};function _f(e,t,i,n){return null!=i?e[i]:e}function bf(e,t,i,n){return wf(e[n],this._dimensionInfos[t])}function wf(e,t){var i=t&&t.type;if("ordinal"===i){var n=t&&t.ordinalMeta;return n?n.parseAndCollect(e):e}return"time"===i&&"number"!=typeof e&&null!=e&&"-"!==e&&(e=+lf(e)),null==e||""===e?NaN:+e}var Sf=function(e,t,i){if(e){var n=e.getProvider().getSource().sourceFormat;if(n===cf||n===df){var a=e.getRawDataItem(t);return n!==cf||rf(a)||(a=null),a?a[i]:void 0}}},Mf={DefaultDataProvider:pf,defaultDimValueGetters:{arrayRows:bf,objectRows:function(e,t,i,n){return wf(e[t],this._dimensionInfos[t])},keyedColumns:bf,original:function(e,t,i,n){var a=e&&(null==e.value?e:e.value);return!this._rawData.pure&&sf(e)&&(this.hasItemOption=!0),wf(a instanceof Array?a[n]:a,this._dimensionInfos[t])},typedArray:function(e,t,i,n){return e[n]}},retrieveRawValue:function(e,t,i){if(e){var n=e.getRawDataItem(t);if(null!=n){var a,r,o=e.getProvider().getSource().sourceFormat,s=e.getDimensionInfo(i);return s&&(a=s.name,r=s.index),xf[o](n,t,r,a)}}},retrieveRawAttr:Sf},If=Mf.retrieveRawValue,Af=Fc.getTooltipMarker,Tf=Fc.formatTpl,Cf=Ro.getTooltipRenderMode,Df=/\{@(.+?)\}/g,Lf={getDataParams:function(e,t){var i=this.getData(t),n=this.getRawValue(e,t),a=i.getRawIndex(e),r=i.getName(e),o=i.getRawDataItem(e),s=i.getItemVisual(e,"color"),l=i.getItemVisual(e,"borderColor"),u=this.ecModel.getComponent("tooltip"),h=u&&u.get("renderMode"),c=Cf(h),d=this.mainType,p="series"===d,f=i.userOutput;return{componentType:d,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:p?this.subType:null,seriesIndex:this.seriesIndex,seriesId:p?this.id:null,seriesName:p?this.name:null,name:r,dataIndex:a,data:o,dataType:t,value:n,color:s,borderColor:l,dimensionNames:f?f.dimensionNames:null,encode:f?f.encode:null,marker:Af({color:s,renderMode:c}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(e,t,i,n,a){t=t||"normal";var r=this.getData(i),o=r.getItemModel(e),s=this.getDataParams(e,i);null!=n&&s.value instanceof Array&&(s.value=s.value[n]);var l=o.get("normal"===t?[a||"label","formatter"]:[t,a||"label","formatter"]);return"function"==typeof l?(s.status=t,s.dimensionIndex=n,l(s)):"string"==typeof l?Tf(l,s).replace(Df,(function(t,i){var n=i.length;return"["===i.charAt(0)&&"]"===i.charAt(n-1)&&(i=+i.slice(1,n-1)),If(r,e,i)})):void 0},getRawValue:function(e,t){return If(this.getData(t),e)},formatTooltip:function(){}},Pf=Lf,kf=Fe.isArray;function Of(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0,this.context}var Rf=Of.prototype;Rf.perform=function(e){var t,i=this._upstream,n=e&&e.skip;if(this._dirty&&i){var a=this.context;a.data=a.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(t=this._plan(this.context));var r,o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;function h(e){return!(e>=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,r=function(e,t){var i,n;e._dueIndex=e._outputDueEnd=e._dueEnd=0,e._settedOutputEnd=null,!t&&e._reset&&((i=e._reset(e.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),kf(i)&&!i.length&&(i=null));e._progress=i,e._modBy=e._modDataCount=null;var a=e._downstream;return a&&a.dirty(),n}(this,n)),this._modBy=l,this._modDataCount=u;var c=e&&e.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(r||d<p)){var f=this._progress;if(kf(f))for(var g=0;g<f.length;g++)Nf(this,f[g],d,p,l,u);else Nf(this,f,d,p,l,u)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var Ef=function(){var e,t,i,n,a,r={reset:function(l,u,h,c){t=l,e=u,i=h,n=c,a=Math.ceil(n/i),r.next=i>1&&n>0?s:o}};return r;function o(){return t<e?t++:null}function s(){var r=t%a*i+Math.ceil(t/a),o=t>=e?null:r<n?r:t;return t++,o}}();function Nf(e,t,i,n,a,r){Ef.reset(i,n,a,r),e._callingProgress=t,e._callingProgress({start:i,end:n,count:n-i,next:Ef.next},e.context)}Rf.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},Rf.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},Rf.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},Rf.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},Rf.getUpstream=function(){return this._upstream},Rf.getDownstream=function(){return this._downstream},Rf.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e};var zf={createTask:function(e){return new Of(e)}},Bf=Fc.formatTime,Vf=Fc.encodeHTML,Gf=Fc.addCommas,Ff=Fc.getTooltipMarker,Hf=ed.getLayoutParams,Wf=ed.mergeLayoutParam,Uf=zf.createTask,jf=Jd.prepareSource,Zf=Jd.getSource,Yf=Mf.retrieveRawValue,Xf=Ro.makeInner(),qf=od.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(e,t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Uf({count:Kf,reset:Jf}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,i),jf(this);var a=this.getInitialData(e,i);eg(a,this),this.dataTask.context.data=a,Xf(this).dataBeforeProcessed=a,$f(this)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?Hf(e):{},a=this.subType;od.hasClass(a)&&(a+="Series"),Fe.merge(e,t.getTheme().get(this.subType)),Fe.merge(e,this.getDefaultOption()),Ro.defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),i&&Wf(e,n,i)},mergeOption:function(e,t){e=Fe.merge(this.option,e,!0),this.fillDataTextStyle(e.data);var i=this.layoutMode;i&&Wf(this.option,e,i),jf(this);var n=this.getInitialData(e,t);eg(n,this),this.dataTask.dirty(),this.dataTask.context.data=n,Xf(this).dataBeforeProcessed=n,$f(this)},fillDataTextStyle:function(e){if(e&&!Fe.isTypedArray(e))for(var t=["show"],i=0;i<e.length;i++)e[i]&&e[i].label&&Ro.defaultEmphasis(e[i],"label",t)},getInitialData:function(){},appendData:function(e){this.getRawData().appendData(e.data)},getData:function(e){var t=ig(this);if(t){var i=t.context.data;return null==e?i:i.getLinkedData(e)}return Xf(this).data},setData:function(e){var t=ig(this);if(t){var i=t.context;i.data!==e&&t.modifyOutputEnd&&t.setOutputEnd(e.count()),i.outputData=e,t!==this.dataTask&&(i.data=e)}Xf(this).data=e},getSource:function(){return Zf(this)},getRawData:function(){return Xf(this).dataBeforeProcessed},getBaseAxis:function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},formatTooltip:function(e,t,i,n){var a=this,r="html"===(n=n||"html")?"<br/>":"\n",o="richText"===n,s={},l=0;function u(e){return{renderMode:n,content:Vf(Gf(e)),style:s}}var h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),d=c.length,p=this.getRawValue(e),f=Fe.isArray(p),g=h.getItemVisual(e,"color");Fe.isObject(g)&&g.colorStops&&(g=(g.colorStops[0]||{}).color),g=g||"transparent";var m=d>1||f&&!d?function(i){var r=Fe.reduce(i,(function(e,t,i){var n=h.getDimensionInfo(i);return e|(n&&!1!==n.tooltip&&null!=n.displayName)}),0),u=[];function d(e,i){var c=h.getDimensionInfo(i);if(c&&!1!==c.otherDims.tooltip){var d=c.type,p="sub"+a.seriesIndex+"at"+l,f=Ff({color:g,type:"subItem",renderMode:n,markerId:p}),m="string"==typeof f?f:f.content,v=(r?m+Vf(c.displayName||"-")+": ":"")+Vf("ordinal"===d?e+"":"time"===d?t?"":Bf("yyyy/MM/dd hh:mm:ss",e):Gf(e));v&&u.push(v),o&&(s[p]=g,++l)}}c.length?Fe.each(c,(function(t){d(Yf(h,e,t),t)})):Fe.each(i,d);var p=r?o?"\n":"<br/>":"",f=p+u.join(p||", ");return{renderMode:n,content:f,style:s}}(p):u(d?Yf(h,e,c[0]):f?p[0]:p),v=m.content,y=a.seriesIndex+"at"+l,x=Ff({color:g,type:"item",renderMode:n,markerId:y});s[y]=g,++l;var _=h.getName(e),b=this.name;Ro.isNameSpecified(this)||(b=""),b=b?Vf(b)+(t?": ":r):"";var w="string"==typeof x?x:x.content;return{html:t?w+b+v:b+w+(_?Vf(_)+": "+v:v),markers:s}},isAnimationEnabled:function(){if(ae.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),e},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(e,t,i){var n=this.ecModel,a=pd.getColorFromPalette.call(this,e,t,i);return a||(a=n.getColorFromPalette(e,t,i)),a},coordDimToDataDim:function(e){return this.getRawData().mapDimension(e,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function $f(e){var t=e.name;Ro.isNameSpecified(e)||(e.name=function(e){var t=e.getRawData(),i=t.mapDimension("seriesName",!0),n=[];return Fe.each(i,(function(e){var i=t.getDimensionInfo(e);i.displayName&&n.push(i.displayName)})),n.join(" ")}(e)||t)}function Kf(e){return e.model.getRawData().count()}function Jf(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Qf}function Qf(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function eg(e,t){Fe.each(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,Fe.curry(tg,t))}))}function tg(e){var t=ig(e);t&&t.setOutputEnd(this.count())}function ig(e){var t=(e.ecModel||{}).scheduler,i=t&&t.getPipeline(e.uid);if(i){var n=i.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(e.uid))}return n}}Fe.mixin(qf,Pf),Fe.mixin(qf,pd);var ng=qf,ag=function(){this.group=new En,this.uid=mc.getUID("viewComponent")},rg=ag.prototype={constructor:ag,init:function(e,t){},render:function(e,t,i,n){},dispose:function(){},filterForExposedEvent:null};rg.updateView=rg.updateLayout=rg.updateVisual=function(e,t,i,n){},Ho.enableClassExtend(ag),Ho.enableClassManagement(ag,{registerWhenExtend:!0});var og=ag,sg=Ro.makeInner;var lg=function(){var e=sg();return function(t){var i=e(t),n=t.pipelineContext,a=i.large,r=i.progressiveRender,o=i.large=n&&n.large,s=i.progressiveRender=n&&n.progressiveRender;return!!(a^o||r^s)&&"reset"}},ug=Fe.each,hg=zf.createTask,cg=Ro.makeInner(),dg=lg();function pg(){this.group=new En,this.uid=mc.getUID("viewChart"),this.renderTask=hg({plan:vg,reset:yg}),this.renderTask.context={view:this}}pg.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,n){},highlight:function(e,t,i,n){mg(e.getData(),n,"emphasis")},downplay:function(e,t,i,n){mg(e.getData(),n,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var fg=pg.prototype;function gg(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!Jh.isHighDownDispatcher(e)))for(var n=0,a=e.childCount();n<a;n++)gg(e.childAt(n),t,i)}function mg(e,t,i){var n=Ro.queryDataIndex(e,t),a=t&&null!=t.highlightKey?Jh.getHighlightDigit(t.highlightKey):null;null!=n?ug(Ro.normalizeToArray(n),(function(t){gg(e.getItemGraphicEl(t),i,a)})):e.eachItemGraphicEl((function(e){gg(e,i,a)}))}function vg(e){return dg(e.model)}function yg(e){var t=e.model,i=e.ecModel,n=e.api,a=e.payload,r=t.pipelineContext.progressiveRender,o=e.view,s=a&&cg(a).updateMethod,l=r?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,i,n,a),xg[l]}fg.updateView=fg.updateLayout=fg.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},Ho.enableClassExtend(pg,["dispose"]),Ho.enableClassManagement(pg,{registerWhenExtend:!0}),pg.markUpdateMethod=function(e,t){cg(e).updateMethod=t};var xg={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)}}},_g=pg,bg="\0__throttleOriginMethod",wg="\0__throttleRate",Sg="\0__throttleType";function Mg(e,t,i){var n,a,r,o,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,e.apply(r,o||[])}t=t||0;var d=function(){n=(new Date).getTime(),r=this,o=arguments;var e=s||t,d=s||i;s=null,a=n-(d?l:u)-e,clearTimeout(h),d?h=setTimeout(c,e):a>=0?c():h=setTimeout(c,-a),l=n};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(e){s=e},d}var Ig={throttle:Mg,createOrUpdate:function(e,t,i,n){var a=e[t];if(a){var r=a[bg]||a,o=a[Sg];if(a[wg]!==i||o!==n){if(null==i||!n)return e[t]=r;(a=e[t]=Mg(r,i,"debounce"===n))[bg]=r,a[Sg]=n,a[wg]=i}return a}},clear:function(e,t){var i=e[t];i&&i[bg]&&(e[t]=i[bg])}},Ag=Fe.isFunction,Tg={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),n=(e.visualColorAccessPath||"itemStyle.color").split("."),a=e.get(n),r=!Ag(a)||a instanceof Ou?null:a;a&&!r||(a=e.getColorFromPalette(e.name,null,t.getSeriesCount())),i.setVisual("color",a);var o=(e.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=e.get(o);if(i.setVisual("borderColor",s),!t.isSeriesFiltered(e)){r&&i.each((function(t){i.setItemVisual(t,"color",r(e.getDataParams(t)))}));return{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t),a=i.get(n,!0),r=i.get(o,!0);null!=a&&e.setItemVisual(t,"color",a),null!=r&&e.setItemVisual(t,"borderColor",r)}:null}}}},Cg=Tg,Dg={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:""}}}},Lg=Mf.retrieveRawValue;var Pg=function(e,t){var i=t.getModel("aria");if(i.get("show"))if(i.get("description"))e.setAttribute("aria-label",i.get("description"));else{var n=0;t.eachSeries((function(e,t){++n}),this);var a,r=i.get("data.maxCount")||10,o=i.get("series.maxCount")||10,s=Math.min(n,o);if(!(n<1)){var l=function(){var e=t.getModel("title").option;e&&e.length&&(e=e[0]);return e&&e.text}();a=l?h(c("general.withTitle"),{title:l}):c("general.withoutTitle");var u=[];a+=h(c(n>1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:n}),t.eachSeries((function(e,t){if(t<s){var i,a=e.get("name"),o="series."+(n>1?"multiple":"single")+".";i=h(i=c(a?o+"withName":o+"withoutName"),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(m=e.subType,Dg.series.typeNames[m]||"自定义图")});var l=e.getData();window.data=l,l.count()>r?i+=h(c("data.partialData"),{displayCnt:r}):i+=c("data.allData");for(var d=[],p=0;p<l.count();p++)if(p<r){var f=l.getName(p),g=Lg(l,p);d.push(h(c(f?"data.withName":"data.withoutName"),{name:f,value:g}))}i+=d.join(c("data.separator.middle"))+c("data.separator.end"),u.push(i)}var m})),a+=u.join(c("series.multiple.separator.middle"))+c("series.multiple.separator.end"),e.setAttribute("aria-label",a)}}function h(e,t){if("string"!=typeof e)return e;var i=e;return Fe.each(t,(function(e,t){i=i.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),i}function c(e){var t=i.get(e);if(null==t){for(var n=e.split("."),a=Dg.aria,r=0;r<n.length;++r)a=a[n[r]];return a}return t}},kg=Math.PI;var Og=function(e,t){t=t||{},Fe.defaults(t,{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#c23531",spinnerRadius:10,lineWidth:5,zlevel:0});var i=new Jh.Group,n=new Jh.Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(n);var a=t.fontSize+" sans-serif",r=new Jh.Rect({style:{fill:"none",text:t.text,font:a,textPosition:"right",textDistance:10,textFill:t.textColor},zlevel:t.zlevel,z:10001});if(i.add(r),t.showSpinner){var o=new Jh.Arc({shape:{startAngle:-kg/2,endAngle:-kg/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001});o.animateShape(!0).when(1e3,{endAngle:3*kg/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*kg/2}).delay(300).start("circularInOut"),i.add(o)}return i.resize=function(){var i=Ha.getWidth(t.text,a),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&i?10:0)-i)/2-(t.showSpinner?0:i/2),u=e.getHeight()/2;t.showSpinner&&o.setShape({cx:l,cy:u}),r.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},i.resize(),i},Rg=Fe.each,Eg=Fe.map,Ng=Fe.isFunction,zg=Fe.createHashMap,Bg=Fe.noop,Vg=zf.createTask,Gg=mc.getUID,Fg=Ro.normalizeToArray;function Hg(e,t,i,n){this.ecInstance=e,this.api=t,this.unfinished;i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=zg()}var Wg=Hg.prototype;function Ug(e,t,i,n,a){var r;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}a=a||{},Rg(t,(function(t,s){if(!a.visualType||a.visualType===t.visualType){var l=e._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(e){o(a,e)&&(e.dirty(),c=!0)})),c&&h.dirty(),jg(h,n);var p=e.getPerformArgs(h,a.block);d.each((function(e){e.perform(p)})),r|=h.perform(p)}else u&&u.each((function(s,l){o(a,s)&&s.dirty();var u=e.getPerformArgs(s,a.block);u.skip=!t.performRawSeries&&i.isSeriesFiltered(s.context.model),jg(s,n),r|=s.perform(u)}))}})),e.unfinished|=r}Wg.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},Wg.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex?i.step:null,r=n&&n.modDataCount;return{step:a,modBy:null!=r?Math.ceil(r/a):null,modDataCount:r}}},Wg.getPipeline=function(e){return this._pipelineMap.get(e)},Wg.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData().count(),a=i.progressiveEnabled&&t.incrementalPrepareRender&&n>=i.threshold,r=e.get("large")&&n>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?n:null;e.pipelineContext=i.context={progressiveRender:a,modDataCount:o,large:r}},Wg.restorePipelines=function(e){var t=this,i=t._pipelineMap=zg();e.eachSeries((function(e){var n=e.getProgressive(),a=e.uid;i.set(a,{id:a,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:n&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),tm(t,e,e.dataTask)}))},Wg.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.ecInstance.getModel(),i=this.api;Rg(this._allHandlers,(function(n){var a=e.get(n.uid)||e.set(n.uid,[]);n.reset&&function(e,t,i,n,a){var r=i.seriesTaskMap||(i.seriesTaskMap=zg()),o=t.seriesType,s=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(l):o?n.eachRawSeriesByType(o,l):s&&s(n,a).each(l);function l(i){var o=i.uid,s=r.get(o)||r.set(o,Vg({plan:$g,reset:Kg,count:em}));s.context={model:i,ecModel:n,api:a,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:e},tm(e,i,s)}var u=e._pipelineMap;r.each((function(e,t){u.get(t)||(e.dispose(),r.removeKey(t))}))}(this,n,a,t,i),n.overallReset&&function(e,t,i,n,a){var r=i.overallTask=i.overallTask||Vg({reset:Zg});r.context={ecModel:n,api:a,overallReset:t.overallReset,scheduler:e};var o=r.agentStubMap=r.agentStubMap||zg(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?n.eachRawSeriesByType(s,c):l?l(n,a).each(c):(u=!1,Rg(n.getSeries(),c));function c(t){var i=t.uid,n=o.get(i);n||(n=o.set(i,Vg({reset:Yg,onDirty:qg})),r.dirty()),n.context={model:t,overallProgress:u,modifyOutputEnd:h},n.agent=r,n.__block=u,tm(e,t,n)}var d=e._pipelineMap;o.each((function(e,t){d.get(t)||(e.dispose(),r.dirty(),o.removeKey(t))}))}(this,n,a,t,i)}),this)},Wg.prepareView=function(e,t,i,n){var a=e.renderTask,r=a.context;r.model=t,r.ecModel=i,r.api=n,a.__block=!e.incrementalPrepareRender,tm(this,t,a)},Wg.performDataProcessorTasks=function(e,t){Ug(this,this._dataProcessorHandlers,e,t,{block:!0})},Wg.performVisualTasks=function(e,t,i){Ug(this,this._visualHandlers,e,t,i)},Wg.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t|=e.dataTask.perform()})),this.unfinished|=t},Wg.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)}))};var jg=Wg.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function Zg(e){e.overallReset(e.ecModel,e.api,e.payload)}function Yg(e,t){return e.overallProgress&&Xg}function Xg(){this.agent.dirty(),this.getDownstream().dirty()}function qg(){this.agent&&this.agent.dirty()}function $g(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function Kg(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Fg(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Eg(t,(function(e,t){return Qg(t)})):Jg}var Jg=Qg(0);function Qg(e){return function(t,i){var n=i.data,a=i.resetDefines[e];if(a&&a.dataEach)for(var r=t.start;r<t.end;r++)a.dataEach(n,r);else a&&a.progress&&a.progress(t,n)}}function em(e){return e.data.count()}function tm(e,t,i){var n=t.uid,a=e._pipelineMap.get(n);!a.head&&(a.head=i),a.tail&&a.tail.pipe(i),a.tail=i,i.__idxInPipeline=a.count++,i.__pipeline=a}function im(e){nm=null;try{e(am,rm)}catch(e){}return nm}Hg.wrapStageHandler=function(e,t){return Ng(e)&&(e={overallReset:e,seriesType:im(e)}),e.uid=Gg("stageHandler"),t&&(e.visualType=t),e};var nm,am={},rm={};function om(e,t){for(var i in t.prototype)e[i]=Bg}om(am,yp),om(rm,_p),am.eachSeriesByType=am.eachRawSeriesByType=function(e){nm=e},am.eachComponent=function(e){"series"===e.mainType&&e.subType&&(nm=e.subType)};var sm=Hg,lm=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],um={color:lm,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],lm]},hm="#eee",cm=function(){return{axisLine:{lineStyle:{color:hm}},axisTick:{lineStyle:{color:hm}},axisLabel:{textStyle:{color:hm}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:hm}}}},dm=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],pm={color:dm,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:hm},crossStyle:{color:hm},label:{color:"#000"}}},legend:{textStyle:{color:hm}},textStyle:{color:hm},title:{textStyle:{color:hm}},toolbox:{iconStyle:{normal:{borderColor:hm}}},dataZoom:{textStyle:{color:hm}},visualMap:{textStyle:{color:hm}},timeline:{lineStyle:{color:hm},itemStyle:{normal:{color:dm[1]}},label:{normal:{textStyle:{color:hm}}},controlStyle:{normal:{color:hm,borderColor:hm}}},timeAxis:cm(),logAxis:cm(),valueAxis:cm(),categoryAxis:cm(),line:{symbol:"circle"},graph:{color:dm},gauge:{title:{textStyle:{color:hm}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};pm.categoryAxis.splitLine.show=!1;var fm=pm,gm=Jd.detectSourceFormat,mm=fd.SERIES_LAYOUT_BY_COLUMN;od.extend({type:"dataset",defaultOption:{seriesLayoutBy:mm,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){gm(this)}}),og.extend({type:"dataset"});var vm=xl.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(e,t){var i=.5522848,n=t.cx,a=t.cy,r=t.rx,o=t.ry,s=r*i,l=o*i;e.moveTo(n-r,a),e.bezierCurveTo(n-r,a-l,n-s,a-o,n,a-o),e.bezierCurveTo(n+s,a-o,n+r,a-l,n+r,a),e.bezierCurveTo(n+r,a+l,n+s,a+o,n,a+o),e.bezierCurveTo(n-s,a+o,n-r,a+l,n-r,a),e.closePath()}}),ym=vm,xm=Bl.createFromString,_m=Fe.isString,bm=Fe.extend,wm=Fe.defaults,Sm=Fe.trim,Mm=Fe.each,Im=/[\s,]+/;function Am(e){_m(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}function Tm(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}Tm.prototype.parse=function(e,t){t=t||{};var i=Am(e);if(!i)throw new Error("Illegal svg");var n=new En;this._root=n;var a=i.getAttribute("viewBox")||"",r=parseFloat(i.getAttribute("width")||t.width),o=parseFloat(i.getAttribute("height")||t.height);isNaN(r)&&(r=null),isNaN(o)&&(o=null),Om(i,n,null,!0);for(var s,l,u=i.firstChild;u;)this._parseNode(u,n),u=u.nextSibling;if(a){var h=Sm(a).split(Im);h.length>=4&&(s={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(s&&null!=r&&null!=o&&(l=Bm(s,r,o),!t.ignoreViewBox)){var c=n;(n=new En).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return t.ignoreRootClip||null==r||null==o||n.setClipPath(new mu({shape:{x:0,y:0,width:r,height:o}})),{root:n,width:r,height:o,viewBoxRect:s,viewBoxTransform:l}},Tm.prototype._parseNode=function(e,t){var i,n,a=e.nodeName.toLowerCase();if("defs"===a?this._isDefine=!0:"text"===a&&(this._isText=!0),this._isDefine){if(n=Dm[a]){var r=n.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=r)}}else(n=Cm[a])&&(i=n.call(this,e,t),t.add(i));for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===a?this._isDefine=!1:"text"===a&&(this._isText=!1)},Tm.prototype._parseText=function(e,t){if(1===e.nodeType){var i=e.getAttribute("dx")||0,n=e.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var a=new Fl({style:{text:e.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Lm(t,a),Om(e,a,this._defs);var r=a.style.fontSize;r&&r<9&&(a.style.fontSize=9,a.scale=a.scale||[1,1],a.scale[0]*=r/9,a.scale[1]*=r/9);var o=a.getBoundingRect();return this._textX+=o.width,t.add(a),a};var Cm={g:function(e,t){var i=new En;return Lm(t,i),Om(e,i,this._defs),i},rect:function(e,t){var i=new mu;return Lm(t,i),Om(e,i,this._defs),i.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)}),i},circle:function(e,t){var i=new Hl;return Lm(t,i),Om(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),r:parseFloat(e.getAttribute("r")||0)}),i},line:function(e,t){var i=new xu;return Lm(t,i),Om(e,i,this._defs),i.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)}),i},ellipse:function(e,t){var i=new ym;return Lm(t,i),Om(e,i,this._defs),i.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)}),i},polygon:function(e,t){var i=e.getAttribute("points");i&&(i=Pm(i));var n=new su({shape:{points:i||[]}});return Lm(t,n),Om(e,n,this._defs),n},polyline:function(e,t){var i=new xl;Lm(t,i),Om(e,i,this._defs);var n=e.getAttribute("points");return n&&(n=Pm(n)),new lu({shape:{points:n||[]}})},image:function(e,t){var i=new Tr;return Lm(t,i),Om(e,i,this._defs),i.setStyle({image:e.getAttribute("xlink:href"),x:e.getAttribute("x"),y:e.getAttribute("y"),width:e.getAttribute("width"),height:e.getAttribute("height")}),i},text:function(e,t){var i=e.getAttribute("x")||0,n=e.getAttribute("y")||0,a=e.getAttribute("dx")||0,r=e.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(r);var o=new En;return Lm(t,o),Om(e,o,this._defs),o},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var a=e.getAttribute("dx")||0,r=e.getAttribute("dy")||0,o=new En;return Lm(t,o),Om(e,o,this._defs),this._textX+=a,this._textY+=r,o},path:function(e,t){var i=e.getAttribute("d")||"",n=xm(i);return Lm(t,n),Om(e,n,this._defs),n}},Dm={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||0,10),i=parseInt(e.getAttribute("y1")||0,10),n=parseInt(e.getAttribute("x2")||10,10),a=parseInt(e.getAttribute("y2")||0,10),r=new Eu(t,i,n,a);return function(e,t){var i=e.firstChild;for(;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var a=i.getAttribute("stop-color")||"#000000";t.addColorStop(n,a)}i=i.nextSibling}}(e,r),r},radialgradient:function(e){}};function Lm(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),wm(t.__inheritedStyle,e.__inheritedStyle))}function Pm(e){for(var t=Sm(e).split(Im),i=[],n=0;n<t.length;n+=2){var a=parseFloat(t[n]),r=parseFloat(t[n+1]);i.push([a,r])}return i}var km={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 Om(e,t,i,n){var a=t.__inheritedStyle||{},r="text"===t.type;if(1===e.nodeType&&(function(e,t){var i=e.getAttribute("transform");if(i){i=i.replace(/,/g," ");var n=null,a=[];i.replace(Nm,(function(e,t,i){a.push(t,i)}));for(var r=a.length-1;r>0;r-=2){var o=a[r],s=a[r-1];switch(n=n||ri.create(),s){case"translate":o=Sm(o).split(Im),ri.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=Sm(o).split(Im),ri.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=Sm(o).split(Im),ri.rotate(n,n,parseFloat(o[0]));break;case"skew":o=Sm(o).split(Im),console.warn("Skew transform is not supported yet");break;case"matrix":o=Sm(o).split(Im);n[0]=parseFloat(o[0]),n[1]=parseFloat(o[1]),n[2]=parseFloat(o[2]),n[3]=parseFloat(o[3]),n[4]=parseFloat(o[4]),n[5]=parseFloat(o[5])}}t.setLocalTransform(n)}}(e,t),bm(a,function(e){var t=e.getAttribute("style"),i={};if(!t)return i;var n,a={};zm.lastIndex=0;for(;null!=(n=zm.exec(t));)a[n[1]]=n[2];for(var r in km)km.hasOwnProperty(r)&&null!=a[r]&&(i[km[r]]=a[r]);return i}(e)),!n))for(var o in km)if(km.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(a[km[o]]=s)}var l=r?"textFill":"fill",u=r?"textStroke":"stroke";t.style=t.style||new ia;var h=t.style;null!=a.fill&&h.set(l,Em(a.fill,i)),null!=a.stroke&&h.set(u,Em(a.stroke,i)),Mm(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){var t="lineWidth"===e&&r?"textStrokeWidth":e;null!=a[e]&&h.set(t,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"),Mm(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=a[e]&&h.set(e,a[e])})),a.lineDash&&(t.style.lineDash=Sm(a.lineDash).split(Im)),h[u]&&"none"!==h[u]&&(t[u]=!0),t.__inheritedStyle=a}var Rm=/url\(\s*#(.*?)\)/;function Em(e,t){var i=t&&e&&e.match(Rm);return i?t[Sm(i[1])]:e}var Nm=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var zm=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Bm(e,t,i){var n=t/e.width,a=i/e.height,r=Math.min(n,a);return{scale:[r,r],position:[-(e.x+e.width/2)*r+t/2,-(e.y+e.height/2)*r+i/2]}}var Vm={parseXML:Am,makeViewBoxTransform:Bm,parseSVG:function(e,t){return(new Tm).parse(e,t)}},Gm=Fe.createHashMap,Fm=Fe.isString,Hm=Fe.isArray,Wm=Fe.each,Um=Vm.parseXML,jm=Gm(),Zm={registerMap:function(e,t,i){var n;return Hm(t)?n=t:t.svg?n=[{type:"svg",source:t.svg,specialAreas:t.specialAreas}]:(t.geoJson&&!t.features&&(i=t.specialAreas,t=t.geoJson),n=[{type:"geoJSON",source:t,specialAreas:i}]),Wm(n,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON"),(0,Ym[t])(e)})),jm.set(e,n)},retrieveMap:function(e){return jm.get(e)}},Ym={geoJSON:function(e){var t=e.source;e.geoJSON=Fm(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=Um(e.source)}},Xm=Zm;function qm(e){return e}function $m(e,t,i,n,a){this._old=e,this._new=t,this._oldKeyGetter=i||qm,this._newKeyGetter=n||qm,this.context=a}function Km(e,t,i,n,a){for(var r=0;r<e.length;r++){var o="_ec_"+a[n](e[r],r),s=t[o];null==s?(i.push(o),t[o]=r):(s.length||(t[o]=s=[s]),s.push(r))}}$m.prototype={constructor:$m,add:function(e){return this._add=e,this},update:function(e){return this._update=e,this},remove:function(e){return this._remove=e,this},execute:function(){var e=this._old,t=this._new,i={},n=[],a=[];for(Km(e,{},n,"_oldKeyGetter",this),Km(t,i,a,"_newKeyGetter",this),r=0;r<e.length;r++){if(null!=(s=i[o=n[r]]))(u=s.length)?(1===u&&(i[o]=null),s=s.shift()):i[o]=null,this._update&&this._update(s,r);else this._remove&&this._remove(r)}for(var r=0;r<a.length;r++){var o=a[r];if(i.hasOwnProperty(o)){var s;if(null==(s=i[o]))continue;if(s.length)for(var l=0,u=s.length;l<u;l++)this._add&&this._add(s[l]);else this._add&&this._add(s)}}}};var Jm=$m,Qm=Fe.each,ev=Fe.createHashMap,tv=ev(["tooltip","label","itemName","itemId","seriesName"]);function iv(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}var nv={OTHER_DIMENSIONS:tv,summarizeDimensions:function(e){var t={},i=t.encode={},n=ev(),a=[],r=[],o=t.userOutput={dimensionNames:e.dimensions.slice(),encode:{}};Qm(e.dimensions,(function(t){var s,l=e.getDimensionInfo(t),u=l.coordDim;if(u){var h=l.coordDimIndex;iv(i,u)[h]=t,l.isExtraCoord||(n.set(u,1),"ordinal"!==(s=l.type)&&"time"!==s&&(a[0]=t),iv(o.encode,u)[h]=l.index),l.defaultTooltip&&r.push(t)}tv.each((function(e,t){var n=iv(i,t),a=l.otherDims[t];null!=a&&!1!==a&&(n[a]=l.name)}))}));var s=[],l={};n.each((function(e,t){var n=i[t];l[t]=n[0],s=s.concat(n)})),t.dataDimsOnCoord=s,t.encodeFirstDimNotExtra=l;var u=i.label;u&&u.length&&(a=u.slice());var h=i.tooltip;return h&&h.length?r=h.slice():r.length||(r=a.slice()),i.defaultedLabel=a,i.defaultedTooltip=r,t},getDimensionTypeByAxis:function(e){return"category"===e?"ordinal":"time"===e?"time":"float"}};var av=function(e){null!=e&&Fe.extend(this,e),this.otherDims={}},rv=Mf.defaultDimValueGetters,ov=Mf.DefaultDataProvider,sv=nv.summarizeDimensions,lv=Fe.isObject,uv="undefined",hv={float:typeof Float64Array===uv?Array:Float64Array,int:typeof Int32Array===uv?Array:Int32Array,ordinal:Array,number:Array,time:Array},cv=typeof Uint32Array===uv?Array:Uint32Array,dv=typeof Int32Array===uv?Array:Int32Array,pv=typeof Uint16Array===uv?Array:Uint16Array;function fv(e){return e._rawCount>65535?cv:pv}var gv=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],mv=["_extent","_approximateExtent","_rawExtent"];function vv(e,t){Fe.each(gv.concat(t.__wrappedMethods||[]),(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e.__wrappedMethods=t.__wrappedMethods,Fe.each(mv,(function(i){e[i]=Fe.clone(t[i])})),e._calculationInfo=Fe.extend(t._calculationInfo)}var yv=function(e,t){e=e||["x","y"];for(var i={},n=[],a={},r=0;r<e.length;r++){var o=e[r];Fe.isString(o)?o=new av({name:o}):o instanceof av||(o=new av(o));var s=o.name;o.type=o.type||"float",o.coordDim||(o.coordDim=s,o.coordDimIndex=0),o.otherDims=o.otherDims||{},n.push(s),i[s]=o,o.index=r,o.createInvertedIndices&&(a[s]=[])}this.dimensions=n,this._dimensionInfos=i,this.hostModel=t,this.dataType,this._indices=null,this._count=0,this._rawCount=0,this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this._visual={},this._layout={},this._itemVisuals=[],this.hasItemVisual={},this._itemLayouts=[],this._graphicEls=[],this._chunkSize=1e5,this._chunkCount=0,this._rawData,this._rawExtent={},this._extent={},this._approximateExtent={},this._dimensionsSummary=sv(this),this._invertedIndicesMap=a,this._calculationInfo={},this.userOutput=this._dimensionsSummary.userOutput},xv=yv.prototype;function _v(e,t,i,n,a){var r=hv[t.type],o=n-1,s=t.name,l=e[s][o];if(l&&l.length<i){for(var u=new r(Math.min(a-o*i,i)),h=0;h<l.length;h++)u[h]=l[h];e[s][o]=u}for(var c=n*i;c<a;c+=i)e[s].push(new r(Math.min(a-c,i)))}function bv(e){var t=e._invertedIndicesMap;Fe.each(t,(function(i,n){var a=e._dimensionInfos[n].ordinalMeta;if(a){i=t[n]=new dv(a.categories.length);for(var r=0;r<i.length;r++)i[r]=-1;for(r=0;r<e._count;r++)i[e.get(n,r)]=r}}))}function wv(e,t,i){var n;if(null!=t){var a=e._chunkSize,r=Math.floor(i/a),o=i%a,s=e.dimensions[t],l=e._storage[s][r];if(l){n=l[o];var u=e._dimensionInfos[s].ordinalMeta;u&&u.categories.length&&(n=u.categories[n])}}return n}function Sv(e){return e}function Mv(e){return e<this._count&&e>=0?this._indices[e]:-1}function Iv(e,t){var i=e._idList[t];return null==i&&(i=wv(e,e._idDimIdx,t)),null==i&&(i="e\0\0"+t),i}function Av(e){return Fe.isArray(e)||(e=[e]),e}function Tv(e,t){var i=e.dimensions,n=new yv(Fe.map(i,e.getDimensionInfo,e),e.hostModel);vv(n,e);for(var a=n._storage={},r=e._storage,o=0;o<i.length;o++){var s=i[o];r[s]&&(Fe.indexOf(t,s)>=0?(a[s]=Cv(r[s]),n._rawExtent[s]=Dv(),n._extent[s]=null):a[s]=r[s])}return n}function Cv(e){for(var t,i,n=new Array(e.length),a=0;a<e.length;a++)n[a]=(t=e[a],i=void 0,(i=t.constructor)===Array?t.slice():new i(t));return n}function Dv(){return[1/0,-1/0]}xv.type="list",xv.hasItemOption=!0,xv.getDimension=function(e){return"number"!=typeof e&&(isNaN(e)||this._dimensionInfos.hasOwnProperty(e))||(e=this.dimensions[e]),e},xv.getDimensionInfo=function(e){return this._dimensionInfos[this.getDimension(e)]},xv.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},xv.mapDimension=function(e,t){var i=this._dimensionsSummary;if(null==t)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return!0===t?(n||[]).slice():n&&n[t]},xv.initData=function(e,t,i){(Md.isInstance(e)||Fe.isArrayLike(e))&&(e=new ov(e,this.dimensions.length)),this._rawData=e,this._storage={},this._indices=null,this._nameList=t||[],this._idList=[],this._nameRepeatCount={},i||(this.hasItemOption=!1),this.defaultDimValueGetter=rv[this._rawData.getSource().sourceFormat],this._dimValueGetter=i=i||this.defaultDimValueGetter,this._dimValueGetterArrayRows=rv.arrayRows,this._rawExtent={},this._initDataFromProvider(0,e.count()),e.pure&&(this.hasItemOption=!1)},xv.getProvider=function(){return this._rawData},xv.appendData=function(e){var t=this._rawData,i=this.count();t.appendData(e);var n=t.count();t.persistent||(n+=i),this._initDataFromProvider(i,n)},xv.appendValues=function(e,t){for(var i=this._chunkSize,n=this._storage,a=this.dimensions,r=a.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t?t.length:0),u=this._chunkCount,h=0;h<r;h++){o[v=a[h]]||(o[v]=Dv()),n[v]||(n[v]=[]),_v(n,this._dimensionInfos[v],i,u,l),this._chunkCount=n[v].length}for(var c=new Array(r),d=s;d<l;d++){for(var p=d-s,f=Math.floor(d/i),g=d%i,m=0;m<r;m++){var v=a[m],y=this._dimValueGetterArrayRows(e[p]||c,v,p,m);n[v][f][g]=y;var x=o[v];y<x[0]&&(x[0]=y),y>x[1]&&(x[1]=y)}t&&(this._nameList[d]=t[p])}this._rawCount=this._count=l,this._extent={},bv(this)},xv._initDataFromProvider=function(e,t){if(!(e>=t)){for(var i,n=this._chunkSize,a=this._rawData,r=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},p=this._chunkCount,f=0;f<s;f++){c[b=o[f]]||(c[b]=Dv());var g=l[b];0===g.otherDims.itemName&&(i=this._nameDimIdx=f),0===g.otherDims.itemId&&(this._idDimIdx=f),r[b]||(r[b]=[]),_v(r,g,n,p,t),this._chunkCount=r[b].length}for(var m=new Array(s),v=e;v<t;v++){m=a.getItem(v,m);for(var y=Math.floor(v/n),x=v%n,_=0;_<s;_++){var b,w=r[b=o[_]][y],S=this._dimValueGetter(m,b,v,_);w[x]=S;var M=c[b];S<M[0]&&(M[0]=S),S>M[1]&&(M[1]=S)}if(!a.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var A=o[i],T=r[A][y];if(T){I=T[x];var C=l[A].ordinalMeta;C&&C.categories.length&&(I=C.categories[I])}}var D=null==m?null:m.id;null==D&&null!=I&&(d[I]=d[I]||0,D=I,d[I]>0&&(D+="__ec__"+d[I]),d[I]++),null!=D&&(h[v]=D)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=t,this._extent={},bv(this)}},xv.count=function(){return this._count},xv.getIndices=function(){var e=this._indices;if(e){var t=e.constructor,i=this._count;if(t===Array){a=new t(i);for(var n=0;n<i;n++)a[n]=e[n]}else a=new t(e.buffer,0,i)}else{var a=new(t=fv(this))(this.count());for(n=0;n<a.length;n++)a[n]=n}return a},xv.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var i=this._storage;if(!i[e])return NaN;t=this.getRawIndex(t);var n=Math.floor(t/this._chunkSize),a=t%this._chunkSize;return i[e][n][a]},xv.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var i=this._storage[e];if(!i)return NaN;var n=Math.floor(t/this._chunkSize),a=t%this._chunkSize;return i[n][a]},xv._getFast=function(e,t){var i=Math.floor(t/this._chunkSize),n=t%this._chunkSize;return this._storage[e][i][n]},xv.getValues=function(e,t){var i=[];Fe.isArray(e)||(t=e,e=this.dimensions);for(var n=0,a=e.length;n<a;n++)i.push(this.get(e[n],t));return i},xv.hasValue=function(e){for(var t=this._dimensionsSummary.dataDimsOnCoord,i=0,n=t.length;i<n;i++)if(isNaN(this.get(t[i],e)))return!1;return!0},xv.getDataExtent=function(e){e=this.getDimension(e);var t=this._storage[e],i=Dv();if(!t)return i;var n,a=this.count();if(!this._indices)return this._rawExtent[e].slice();if(n=this._extent[e])return n.slice();for(var r=(n=i)[0],o=n[1],s=0;s<a;s++){var l=this._getFast(e,this.getRawIndex(s));l<r&&(r=l),l>o&&(o=l)}return n=[r,o],this._extent[e]=n,n},xv.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},xv.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},xv.getCalculationInfo=function(e){return this._calculationInfo[e]},xv.setCalculationInfo=function(e,t){lv(e)?Fe.extend(this._calculationInfo,e):this._calculationInfo[e]=t},xv.getSum=function(e){var t=0;if(this._storage[e])for(var i=0,n=this.count();i<n;i++){var a=this.get(e,i);isNaN(a)||(t+=a)}return t},xv.getMedian=function(e){var t=[];this.each(e,(function(e,i){isNaN(e)||t.push(e)}));var i=[].concat(t).sort((function(e,t){return e-t})),n=this.count();return 0===n?0:n%2==1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},xv.rawIndexOf=function(e,t){var i=(e&&this._invertedIndicesMap[e])[t];return null==i||isNaN(i)?-1:i},xv.indexOfName=function(e){for(var t=0,i=this.count();t<i;t++)if(this.getName(t)===e)return t;return-1},xv.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&i<this._count&&i===e)return e;for(var n=0,a=this._count-1;n<=a;){var r=(n+a)/2|0;if(t[r]<e)n=r+1;else{if(!(t[r]>e))return r;a=r-1}}return-1},xv.indicesOfNearest=function(e,t,i){var n=[];if(!this._storage[e])return n;null==i&&(i=1/0);for(var a=1/0,r=-1,o=0,s=0,l=this.count();s<l;s++){var u=t-this.get(e,s),h=Math.abs(u);h<=i&&((h<a||h===a&&u>=0&&r<0)&&(a=h,r=u,o=0),u===r&&(n[o++]=s))}return n.length=o,n},xv.getRawIndex=Sv,xv.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],i=0;i<this.dimensions.length;i++){var n=this.dimensions[i];t.push(this.get(n,e))}return t},xv.getName=function(e){var t=this.getRawIndex(e);return this._nameList[t]||wv(this,this._nameDimIdx,t)||""},xv.getId=function(e){return Iv(this,this.getRawIndex(e))},xv.each=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;for(var a=(e=Fe.map(Av(e),this.getDimension,this)).length,r=0;r<this.count();r++)switch(a){case 0:t.call(i,r);break;case 1:t.call(i,this.get(e[0],r),r);break;case 2:t.call(i,this.get(e[0],r),this.get(e[1],r),r);break;default:for(var o=0,s=[];o<a;o++)s[o]=this.get(e[o],r);s[o]=r,t.apply(i,s)}}},xv.filterSelf=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this,e=Fe.map(Av(e),this.getDimension,this);for(var a=this.count(),r=new(fv(this))(a),o=[],s=e.length,l=0,u=e[0],h=0;h<a;h++){var c,d=this.getRawIndex(h);if(0===s)c=t.call(i,h);else if(1===s){var p=this._getFast(u,d);c=t.call(i,p,h)}else{for(var f=0;f<s;f++)o[f]=this._getFast(u,d);o[f]=h,c=t.apply(i,o)}c&&(r[l++]=d)}return l<a&&(this._indices=r),this._count=l,this._extent={},this.getRawIndex=this._indices?Mv:Sv,this}},xv.selectRange=function(e){if(this._count){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);var n=t.length;if(n){var a=this.count(),r=new(fv(this))(a),o=0,s=t[0],l=e[s][0],u=e[s][1],h=!1;if(!this._indices){var c=0;if(1===n){for(var d=this._storage[t[0]],p=0;p<this._chunkCount;p++)for(var f=d[p],g=Math.min(this._count-p*this._chunkSize,this._chunkSize),m=0;m<g;m++){((b=f[m])>=l&&b<=u||isNaN(b))&&(r[o++]=c),c++}h=!0}else if(2===n){d=this._storage[s];var v=this._storage[t[1]],y=e[t[1]][0],x=e[t[1]][1];for(p=0;p<this._chunkCount;p++){f=d[p];var _=v[p];for(g=Math.min(this._count-p*this._chunkSize,this._chunkSize),m=0;m<g;m++){var b=f[m],w=_[m];(b>=l&&b<=u||isNaN(b))&&(w>=y&&w<=x||isNaN(w))&&(r[o++]=c),c++}}h=!0}}if(!h)if(1===n)for(m=0;m<a;m++){var S=this.getRawIndex(m);((b=this._getFast(s,S))>=l&&b<=u||isNaN(b))&&(r[o++]=S)}else for(m=0;m<a;m++){var M=!0;for(S=this.getRawIndex(m),p=0;p<n;p++){var I=t[p];((b=this._getFast(i,S))<e[I][0]||b>e[I][1])&&(M=!1)}M&&(r[o++]=this.getRawIndex(m))}return o<a&&(this._indices=r),this._count=o,this._extent={},this.getRawIndex=this._indices?Mv:Sv,this}}},xv.mapArray=function(e,t,i,n){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;var a=[];return this.each(e,(function(){a.push(t&&t.apply(this,arguments))}),i),a},xv.map=function(e,t,i,n){i=i||n||this;var a=Tv(this,e=Fe.map(Av(e),this.getDimension,this));a._indices=this._indices,a.getRawIndex=a._indices?Mv:Sv;for(var r=a._storage,o=[],s=this._chunkSize,l=e.length,u=this.count(),h=[],c=a._rawExtent,d=0;d<u;d++){for(var p=0;p<l;p++)h[p]=this.get(e[p],d);h[l]=d;var f=t&&t.apply(i,h);if(null!=f){"object"!=typeof f&&(o[0]=f,f=o);for(var g=this.getRawIndex(d),m=Math.floor(g/s),v=g%s,y=0;y<f.length;y++){var x=e[y],_=f[y],b=c[x],w=r[x];w&&(w[m][v]=_),_<b[0]&&(b[0]=_),_>b[1]&&(b[1]=_)}}}return a},xv.downSample=function(e,t,i,n){for(var a=Tv(this,[e]),r=a._storage,o=[],s=Math.floor(1/t),l=r[e],u=this.count(),h=this._chunkSize,c=a._rawExtent[e],d=new(fv(this))(u),p=0,f=0;f<u;f+=s){s>u-f&&(s=u-f,o.length=s);for(var g=0;g<s;g++){var m=this.getRawIndex(f+g),v=Math.floor(m/h),y=m%h;o[g]=l[v][y]}var x=i(o),_=this.getRawIndex(Math.min(f+n(o,x)||0,u-1)),b=_%h;l[Math.floor(_/h)][b]=x,x<c[0]&&(c[0]=x),x>c[1]&&(c[1]=x),d[p++]=_}return a._count=p,a._indices=d,a.getRawIndex=Mv,a},xv.getItemModel=function(e){var t=this.hostModel;return new pc(this.getRawDataItem(e),t,t&&t.ecModel)},xv.diff=function(e){var t=this;return new Jm(e?e.getIndices():[],this.getIndices(),(function(t){return Iv(e,t)}),(function(e){return Iv(t,e)}))},xv.getVisual=function(e){var t=this._visual;return t&&t[e]},xv.setVisual=function(e,t){if(lv(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},xv.setLayout=function(e,t){if(lv(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},xv.getLayout=function(e){return this._layout[e]},xv.getItemLayout=function(e){return this._itemLayouts[e]},xv.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?Fe.extend(this._itemLayouts[e]||{},t):t},xv.clearItemLayouts=function(){this._itemLayouts.length=0},xv.getItemVisual=function(e,t,i){var n=this._itemVisuals[e],a=n&&n[t];return null!=a||i?a:this.getVisual(t)},xv.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{},a=this.hasItemVisual;if(this._itemVisuals[e]=n,lv(t))for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r],a[r]=!0);else n[t]=i,a[t]=!0},xv.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var Lv=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};xv.setItemGraphicEl=function(e,t){var i=this.hostModel;t&&(t.dataIndex=e,t.dataType=this.dataType,t.seriesIndex=i&&i.seriesIndex,"group"===t.type&&t.traverse(Lv,t)),this._graphicEls[e]=t},xv.getItemGraphicEl=function(e){return this._graphicEls[e]},xv.eachItemGraphicEl=function(e,t){Fe.each(this._graphicEls,(function(i,n){i&&e&&e.call(t,i,n)}))},xv.cloneShallow=function(e){if(!e){var t=Fe.map(this.dimensions,this.getDimensionInfo,this);e=new yv(t,this.hostModel)}if(e._storage=this._storage,vv(e,this),this._indices){var i=this._indices.constructor;e._indices=new i(this._indices)}else e._indices=null;return e.getRawIndex=e._indices?Mv:Sv,e},xv.wrapMethod=function(e,t){var i=this[e];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=i.apply(this,arguments);return t.apply(this,[e].concat(Fe.slice(arguments)))})},xv.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],xv.CHANGABLE_METHODS=["filterSelf","selectRange"];var Pv=yv,kv=Fe.createHashMap,Ov=Fe.each,Rv=Fe.isString,Ev=Fe.defaults,Nv=Fe.extend,zv=Fe.isObject,Bv=Fe.clone,Vv=Ro.normalizeToArray,Gv=Jd.guessOrdinal,Fv=Jd.BE_ORDINAL,Hv=nv.OTHER_DIMENSIONS;function Wv(e,t,i){if(i||null!=t.get(e)){for(var n=0;null!=t.get(e+n);)n++;e+=n}return t.set(e,!0),e}var Uv=function(e,t,i){Md.isInstance(t)||(t=Md.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var n=(i.dimsDef||[]).slice(),a=kv(),r=kv(),o=[],s=function(e,t,i,n){var a=Math.max(e.dimensionsDetectCount||1,t.length,i.length,n||0);return Ov(t,(function(e){var t=e.dimsDef;t&&(a=Math.max(a,t.length))})),a}(t,e,n,i.dimCount),l=0;l<s;l++){var u=n[l]=Nv({},zv(n[l])?n[l]:{name:n[l]}),h=u.name,c=o[l]=new av;null!=h&&null==a.get(h)&&(c.name=c.displayName=h,a.set(h,l)),null!=u.type&&(c.type=u.type),null!=u.displayName&&(c.displayName=u.displayName)}var d=i.encodeDef;!d&&i.encodeDefaulter&&(d=i.encodeDefaulter(t,s)),(d=kv(d)).each((function(e,t){if(1===(e=Vv(e).slice()).length&&!Rv(e[0])&&e[0]<0)d.set(t,!1);else{var i=d.set(t,[]);Ov(e,(function(e,n){Rv(e)&&(e=a.get(e)),null!=e&&e<s&&(i[n]=e,f(o[e],t,n))}))}}));var p=0;function f(e,t,i){null!=Hv.get(t)?e.otherDims[t]=i:(e.coordDim=t,e.coordDimIndex=i,r.set(t,!0))}Ov(e,(function(e,t){var i,n,a;if(Rv(e))i=e,e={};else{i=e.name;var r=e.ordinalMeta;e.ordinalMeta=null,(e=Bv(e)).ordinalMeta=r,n=e.dimsDef,a=e.otherDims,e.name=e.coordDim=e.coordDimIndex=e.dimsDef=e.otherDims=null}if(!1!==(s=d.get(i))){var s;if(!(s=Vv(s)).length)for(var l=0;l<(n&&n.length||1);l++){for(;p<o.length&&null!=o[p].coordDim;)p++;p<o.length&&s.push(p++)}Ov(s,(function(t,r){var s=o[t];if(f(Ev(s,e),i,r),null==s.name&&n){var l=n[r];!zv(l)&&(l={name:l}),s.name=s.displayName=l.name,s.defaultTooltip=l.defaultTooltip}a&&Ev(s.otherDims,a)}))}}));var g=i.generateCoord,m=i.generateCoordCount,v=null!=m;m=g?m||1:0;for(var y=g||"value",x=0;x<s;x++){null==(c=o[x]=o[x]||new av).coordDim&&(c.coordDim=Wv(y,r,v),c.coordDimIndex=0,(!g||m<=0)&&(c.isExtraCoord=!0),m--),null==c.name&&(c.name=Wv(c.coordDim,a)),null!=c.type||Gv(t,x,c.name)!==Fv.Must&&(!c.isExtraCoord||null==c.otherDims.itemName&&null==c.otherDims.seriesName)||(c.type="ordinal")}return o},jv=Uv;var Zv=function(e,t){return jv((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})},Yv=Fe.createHashMap,Xv=Fe.each;function qv(e){this.coordSysName=e,this.coordSysDims=[],this.axisMap=Yv(),this.categoryAxisMap=Yv(),this.firstCategoryDimIndex=null}var $v={cartesian2d:function(e,t,i,n){var a=e.getReferringComponents("xAxis")[0],r=e.getReferringComponents("yAxis")[0];t.coordSysDims=["x","y"],i.set("x",a),i.set("y",r),Kv(a)&&(n.set("x",a),t.firstCategoryDimIndex=0),Kv(r)&&(n.set("y",r),t.firstCategoryDimIndex,t.firstCategoryDimIndex=1)},singleAxis:function(e,t,i,n){var a=e.getReferringComponents("singleAxis")[0];t.coordSysDims=["single"],i.set("single",a),Kv(a)&&(n.set("single",a),t.firstCategoryDimIndex=0)},polar:function(e,t,i,n){var a=e.getReferringComponents("polar")[0],r=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],i.set("radius",r),i.set("angle",o),Kv(r)&&(n.set("radius",r),t.firstCategoryDimIndex=0),Kv(o)&&(n.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,i,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,i,n){var a=e.ecModel,r=a.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=r.dimensions.slice();Xv(r.parallelAxisIndex,(function(e,r){var s=a.getComponent("parallelAxis",e),l=o[r];i.set(l,s),Kv(s)&&null==t.firstCategoryDimIndex&&(n.set(l,s),t.firstCategoryDimIndex=r)}))}};function Kv(e){return"category"===e.get("type")}var Jv={getCoordSysInfoBySeries:function(e){var t=e.get("coordinateSystem"),i=new qv(t),n=$v[t];if(n)return n(e,i,i.axisMap,i.categoryAxisMap),i}},Qv=Fe.each,ey=Fe.isString;function ty(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}var iy={enableDataStack:function(e,t,i){var n,a,r,o,s=(i=i||{}).byIndex,l=i.stackedCoordDimension,u=!(!e||!e.get("stack"));if(Qv(t,(function(e,i){ey(e)&&(t[i]=e={name:e}),u&&!e.isExtraCoord&&(s||n||!e.ordinalMeta||(n=e),a||"ordinal"===e.type||"time"===e.type||l&&l!==e.coordDim||(a=e))})),!a||s||n||(s=!0),a){r="__\0ecstackresult",o="__\0ecstackedover",n&&(n.createInvertedIndices=!0);var h=a.coordDim,c=a.type,d=0;Qv(t,(function(e){e.coordDim===h&&d++})),t.push({name:r,coordDim:h,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0}),d++,t.push({name:o,coordDim:o,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:a&&a.name,stackedByDimension:n&&n.name,isStackedByIndex:s,stackedOverDimension:o,stackResultDimension:r}},isDimensionStacked:ty,getStackedDimension:function(e,t){return ty(e,t)?e.getCalculationInfo("stackResultDimension"):t}},ny=fd.SOURCE_FORMAT_ORIGINAL,ay=nv.getDimensionTypeByAxis,ry=Ro.getDataItemValue,oy=Jv.getCoordSysInfoBySeries,sy=iy.enableDataStack,ly=Jd.makeSeriesEncodeForAxisCoordSys;var uy=function(e,t,i){i=i||{},Md.isInstance(e)||(e=Md.seriesDataToSource(e));var n,a=t.get("coordinateSystem"),r=Sp.get(a),o=oy(t);o&&(n=Fe.map(o.coordSysDims,(function(e){var t={name:e},i=o.axisMap.get(e);if(i){var n=i.get("type");t.type=ay(n)}return t}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]);var s,l,u=Zv(e,{coordDimensions:n,generateCoord:i.generateCoord,encodeDefaulter:i.useEncodeDefaulter?Fe.curry(ly,n,t):null});o&&Fe.each(u,(function(e,t){var i=e.coordDim,n=o.categoryAxisMap.get(i);n&&(null==s&&(s=t),e.ordinalMeta=n.getOrdinalMeta()),null!=e.otherDims.itemName&&(l=!0)})),l||null==s||(u[s].otherDims.itemName=0);var h=sy(t,u),c=new Pv(u,t);c.setCalculationInfo(h);var d=null!=s&&function(e){if(e.sourceFormat===ny){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return null!=t&&!Fe.isArray(ry(t))}}(e)?function(e,t,i,n){return n===s?i:this.defaultDimValueGetter(e,t,i,n)}:null;return c.hasItemOption=!1,c.initData(e,null,d),c},hy=uy;function cy(e){this._setting=e||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}cy.prototype.parse=function(e){return e},cy.prototype.getSetting=function(e){return this._setting[e]},cy.prototype.contain=function(e){var t=this._extent;return e>=t[0]&&e<=t[1]},cy.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},cy.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},cy.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},cy.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},cy.prototype.getExtent=function(){return this._extent.slice()},cy.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},cy.prototype.isBlank=function(){return this._isBlank},cy.prototype.setBlank=function(e){this._isBlank=e},cy.prototype.getLabel=null,Ho.enableClassExtend(cy),Ho.enableClassManagement(cy,{registerWhenExtend:!0});var dy=cy,py=Fe.createHashMap,fy=Fe.isObject,gy=Fe.map;function my(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}my.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&gy(i,xy);return new my({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var vy=my.prototype;function yy(e){return e._map||(e._map=py(e.categories))}function xy(e){return fy(e)&&null!=e.value?e.value:e+""}vy.getOrdinal=function(e){return yy(this).get(e)},vy.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=yy(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var _y=my,by=dy.prototype,wy=dy.extend({type:"ordinal",init:function(e,t){e&&!Fe.isArray(e)||(e=new _y({categories:e})),this._ordinalMeta=e,this._extent=t||[0,e.categories.length-1]},parse:function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},contain:function(e){return e=this.parse(e),by.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return by.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(by.scale.call(this,e))},getTicks:function(){for(var e=[],t=this._extent,i=t[0];i<=t[1];)e.push(i),i++;return e},getLabel:function(e){if(!this.isBlank())return this._ordinalMeta.categories[e]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:Fe.noop,niceExtent:Fe.noop});wy.create=function(){return new wy};var Sy=wy,My=Cc.round;function Iy(e){return Cc.getPrecisionSafe(e)+2}function Ay(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function Ty(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),Ay(e,0,t),Ay(e,1,t),e[0]>e[1]&&(e[0]=e[1])}var Cy={intervalScaleNiceTicks:function(e,t,i,n){var a={},r=e[1]-e[0],o=a.interval=Cc.nice(r/t,!0);null!=i&&o<i&&(o=a.interval=i),null!=n&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=Iy(o);return Ty(a.niceTickExtent=[My(Math.ceil(e[0]/o)*o,s),My(Math.floor(e[1]/o)*o,s)],e),a},getIntervalPrecision:Iy,fixExtent:Ty},Dy=Cc.round,Ly=dy.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(e,t){var i=this._extent;isNaN(e)||(i[0]=parseFloat(e)),isNaN(t)||(i[1]=parseFloat(t))},unionExtent:function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),Ly.prototype.setExtent.call(this,t[0],t[1])},getInterval:function(){return this._interval},setInterval:function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=Cy.getIntervalPrecision(e)},getTicks:function(e){var t=this._interval,i=this._extent,n=this._niceExtent,a=this._intervalPrecision,r=[];if(!t)return r;i[0]<n[0]&&(e?r.push(Dy(n[0]-t,a)):r.push(i[0]));for(var o=n[0];o<=n[1]&&(r.push(o),(o=Dy(o+t,a))!==r[r.length-1]);)if(r.length>1e4)return[];var s=r.length?r[r.length-1]:n[1];return i[1]>s&&(e?r.push(Dy(s+t,a)):r.push(i[1])),r},getMinorTicks:function(e){for(var t=this.getTicks(!0),i=[],n=this.getExtent(),a=1;a<t.length;a++){for(var r=t[a],o=t[a-1],s=0,l=[],u=(r-o)/e;s<e-1;){var h=Cc.round(o+(s+1)*u);h>n[0]&&h<n[1]&&l.push(h),s++}i.push(l)}return i},getLabel:function(e,t){if(null==e)return"";var i=t&&t.precision;return null==i?i=Cc.getPrecisionSafe(e)||0:"auto"===i&&(i=this._intervalPrecision),e=Dy(e,i,!0),Fc.addCommas(e)},niceTicks:function(e,t,i){e=e||5;var n=this._extent,a=n[1]-n[0];if(isFinite(a)){a<0&&(a=-a,n.reverse());var r=Cy.intervalScaleNiceTicks(n,e,t,i);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},niceExtent:function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var i=t[0];e.fixMax||(t[1]+=i/2),t[0]-=i/2}else t[1]=1;var n=t[1]-t[0];isFinite(n)||(t[0]=0,t[1]=1),this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var a=this._interval;e.fixMin||(t[0]=Dy(Math.floor(t[0]/a)*a)),e.fixMax||(t[1]=Dy(Math.ceil(t[1]/a)*a))}});Ly.create=function(){return new Ly};var Py=Ly,ky=Cc.parsePercent,Oy=iy.isDimensionStacked,Ry="__ec_stack_",Ey="undefined"!=typeof Float32Array?Float32Array:Array;function Ny(e){return e.get("stack")||Ry+e.seriesIndex}function zy(e){return e.dim+e.index}function By(e,t){var i=[];return t.eachSeriesByType(e,(function(e){Wy(e)&&!Uy(e)&&i.push(e)})),i}function Vy(e){var t=function(e){var t={};Fe.each(e,(function(e){var i=e.coordinateSystem.getBaseAxis();if("time"===i.type||"value"===i.type)for(var n=e.getData(),a=i.dim+"_"+i.index,r=n.mapDimension(i.dim),o=0,s=n.count();o<s;++o){var l=n.get(r,o);t[a]?t[a].push(l):t[a]=[l]}}));var i=[];for(var n in t)if(t.hasOwnProperty(n)){var a=t[n];if(a){a.sort((function(e,t){return e-t}));for(var r=null,o=1;o<a.length;++o){var s=a[o]-a[o-1];s>0&&(r=null===r?s:Math.min(r,s))}i[n]=r}}return i}(e),i=[];return Fe.each(e,(function(e){var n,a=e.coordinateSystem.getBaseAxis(),r=a.getExtent();if("category"===a.type)n=a.getBandWidth();else if("value"===a.type||"time"===a.type){var o=a.dim+"_"+a.index,s=t[o],l=Math.abs(r[1]-r[0]),u=a.scale.getExtent(),h=Math.abs(u[1]-u[0]);n=s?l/h*s:l}else{var c=e.getData();n=Math.abs(r[1]-r[0])/c.count()}var d=ky(e.get("barWidth"),n),p=ky(e.get("barMaxWidth"),n),f=ky(e.get("barMinWidth")||1,n),g=e.get("barGap"),m=e.get("barCategoryGap");i.push({bandWidth:n,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:zy(a),stackId:Ny(e)})})),Gy(i)}function Gy(e){var t={};Fe.each(e,(function(e,i){var n=e.axisKey,a=e.bandWidth,r=t[n]||{bandWidth:a,remainedWidth:a,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=r.stacks;t[n]=r;var s=e.stackId;o[s]||r.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var h=e.barMinWidth;h&&(o[s].minWidth=h);var c=e.barGap;null!=c&&(r.gap=c);var d=e.barCategoryGap;null!=d&&(r.categoryGap=d)}));var i={};return Fe.each(t,(function(e,t){i[t]={};var n=e.stacks,a=e.bandWidth,r=ky(e.categoryGap,a),o=ky(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-r)/(l+(l-1)*o);u=Math.max(u,0),Fe.each(n,(function(e){var t=e.maxWidth,i=e.minWidth;if(e.width){n=e.width;t&&(n=Math.min(n,t)),i&&(n=Math.max(n,i)),e.width=n,s-=n+o*n,l--}else{var n=u;t&&t<n&&(n=Math.min(t,s)),i&&i>n&&(n=i),n!==u&&(e.width=n,s-=n+o*n,l--)}})),u=(s-r)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Fe.each(n,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Fe.each(n,(function(e,n){i[t][n]=i[t][n]||{bandWidth:a,offset:d,width:e.width},d+=e.width*(1+o)}))})),i}function Fy(e,t,i){if(e&&t){var n=e[zy(t)];return null!=n&&null!=i&&(n=n[Ny(i)]),n}}var Hy={seriesType:"bar",plan:lg(),reset:function(e){if(Wy(e)&&Uy(e)){var t=e.getData(),i=e.coordinateSystem,n=i.grid.getRect(),a=i.getBaseAxis(),r=i.getOtherAxis(a),o=t.mapDimension(r.dim),s=t.mapDimension(a.dim),l=r.isHorizontal(),u=l?0:1,h=Fy(Vy([e]),a,e).width;return h>.5||(h=.5),{progress:function(e,t){var c,d=e.count,p=new Ey(2*d),f=new Ey(2*d),g=new Ey(d),m=[],v=[],y=0,x=0;for(;null!=(c=e.next());)v[u]=t.get(o,c),v[1-u]=t.get(s,c),m=i.dataToPoint(v,null,m),f[y]=l?n.x+n.width:m[0],p[y++]=m[0],f[y]=l?m[1]:n.y+n.height,p[y++]=m[1],g[x++]=c;t.setLayout({largePoints:p,largeDataIndices:g,largeBackgroundPoints:f,barWidth:h,valueAxisStart:jy(a,r),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function Wy(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function Uy(e){return e.pipelineContext&&e.pipelineContext.large}function jy(e,t,i){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}var Zy=function(e){var t=[],i=e.axis,n="axis0";if("category"===i.type){for(var a=i.getBandWidth(),r=0;r<e.count;r++)t.push(Fe.defaults({bandWidth:a,axisKey:n,stackId:Ry+r},e));var o=Gy(t),s=[];for(r=0;r<e.count;r++){var l=o[n][Ry+r];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}},Yy=function(e,t){var i=By(e,t),n=Vy(i),a={};Fe.each(i,(function(e){var t=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=Ny(e),s=n[zy(r)][o],l=s.offset,u=s.width,h=i.getOtherAxis(r),c=e.get("barMinHeight")||0;a[o]=a[o]||[],t.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var d=t.mapDimension(h.dim),p=t.mapDimension(r.dim),f=Oy(t,d),g=h.isHorizontal(),m=jy(r,h),v=0,y=t.count();v<y;v++){var x,_,b,w,S,M=t.get(d,v),I=t.get(p,v),A=M>=0?"p":"n",T=m;if(f&&(a[o][I]||(a[o][I]={p:m,n:m}),T=a[o][I][A]),g)x=T,_=(S=i.dataToPoint([M,I]))[1]+l,b=S[0]-m,w=u,Math.abs(b)<c&&(b=(b<0?-1:1)*c),isNaN(b)||f&&(a[o][I][A]+=b);else x=(S=i.dataToPoint([I,M]))[0]+l,_=T,b=u,w=S[1]-m,Math.abs(w)<c&&(w=(w<=0?-1:1)*c),isNaN(w)||f&&(a[o][I][A]+=w);t.setItemLayout(v,{x:x,y:_,width:b,height:w})}}),this)},Xy={getLayoutOnAxis:Zy,prepareLayoutBarSeries:By,makeColumnLayout:Vy,retrieveColumnLayout:Fy,layout:Yy,largeLayout:Hy},qy=Py.prototype,$y=Math.ceil,Ky=Math.floor,Jy=1e3,Qy=6e4,ex=36e5,tx=864e5,ix=Py.extend({type:"time",getLabel:function(e){var t=this._stepLvl,i=new Date(e);return Fc.formatTime(t[0],i,this.getSetting("useUTC"))},niceExtent:function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=tx,t[1]+=tx),t[1]===-1/0&&t[0]===1/0){var i=new Date;t[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),t[0]=t[1]-tx}this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var n=this._interval;e.fixMin||(t[0]=Cc.round(Ky(t[0]/n)*n)),e.fixMax||(t[1]=Cc.round($y(t[1]/n)*n))},niceTicks:function(e,t,i){e=e||10;var n=this._extent,a=n[1]-n[0],r=a/e;null!=t&&r<t&&(r=t),null!=i&&r>i&&(r=i);var o=nx.length,s=function(e,t,i,n){for(;i<n;){var a=i+n>>>1;e[a][1]<t?i=a+1:n=a}return i}(nx,r,0,o),l=nx[Math.min(s,o-1)],u=l[1];if("year"===l[0]){var h=a/u;u*=Cc.nice(h/e,!0)}var c=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,d=[Math.round($y((n[0]-c)/u)*u+c),Math.round(Ky((n[1]-c)/u)*u+c)];Cy.fixExtent(d,n),this._stepLvl=l,this._interval=u,this._niceExtent=d},parse:function(e){return+Cc.parseDate(e)}});Fe.each(["contain","normalize"],(function(e){ix.prototype[e]=function(t){return qy[e].call(this,this.parse(t))}}));var nx=[["hh:mm:ss",Jy],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",Qy],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",ex],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",tx],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",6048e6],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];ix.create=function(e){return new ix({useUTC:e.ecModel.get("useUTC")})};var ax=dy.prototype,rx=Py.prototype,ox=Cc.getPrecisionSafe,sx=Cc.round,lx=Math.floor,ux=Math.ceil,hx=Math.pow,cx=Math.log,dx=dy.extend({type:"log",base:10,$constructor:function(){dy.apply(this,arguments),this._originalScale=new Py},getTicks:function(e){var t=this._originalScale,i=this._extent,n=t.getExtent();return Fe.map(rx.getTicks.call(this,e),(function(e){var a=Cc.round(hx(this.base,e));return a=e===i[0]&&t.__fixMin?px(a,n[0]):a,a=e===i[1]&&t.__fixMax?px(a,n[1]):a}),this)},getMinorTicks:rx.getMinorTicks,getLabel:rx.getLabel,scale:function(e){return e=ax.scale.call(this,e),hx(this.base,e)},setExtent:function(e,t){var i=this.base;e=cx(e)/cx(i),t=cx(t)/cx(i),rx.setExtent.call(this,e,t)},getExtent:function(){var e=this.base,t=ax.getExtent.call(this);t[0]=hx(e,t[0]),t[1]=hx(e,t[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(t[0]=px(t[0],n[0])),i.__fixMax&&(t[1]=px(t[1],n[1])),t},unionExtent:function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=cx(e[0])/cx(t),e[1]=cx(e[1])/cx(t),ax.unionExtent.call(this,e)},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},niceTicks:function(e){e=e||10;var t=this._extent,i=t[1]-t[0];if(!(i===1/0||i<=0)){var n=Cc.quantity(i);for(e/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var a=[Cc.round(ux(t[0]/n)*n),Cc.round(lx(t[1]/n)*n)];this._interval=n,this._niceExtent=a}},niceExtent:function(e){rx.niceExtent.call(this,e);var t=this._originalScale;t.__fixMin=e.fixMin,t.__fixMax=e.fixMax}});function px(e,t){return sx(e,ox(t))}Fe.each(["contain","normalize"],(function(e){dx.prototype[e]=function(t){return t=cx(t)/cx(this.base),ax[e].call(this,t)}})),dx.create=function(){return new dx};var fx=dx,gx=Xy.prepareLayoutBarSeries,mx=Xy.makeColumnLayout,vx=Xy.retrieveColumnLayout;function yx(e,t){var i,n,a,r=e.type,o=t.getMin(),s=t.getMax(),l=e.getExtent();"ordinal"===r?i=t.getCategories().length:(n=t.get("boundaryGap"),Fe.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Cc.parsePercent(n[0],1),n[1]=Cc.parsePercent(n[1],1),a=l[1]-l[0]||Math.abs(l[0])),"dataMin"===o?o=l[0]:"function"==typeof o&&(o=o({min:l[0],max:l[1]})),"dataMax"===s?s=l[1]:"function"==typeof s&&(s=s({min:l[0],max:l[1]}));var u=null!=o,h=null!=s;null==o&&(o="ordinal"===r?i?0:NaN:l[0]-n[0]*a),null==s&&(s="ordinal"===r?i?i-1:NaN:l[1]+n[1]*a),(null==o||!isFinite(o))&&(o=NaN),(null==s||!isFinite(s))&&(s=NaN),e.setBlank(Fe.eqNaN(o)||Fe.eqNaN(s)||"ordinal"===r&&!e.getOrdinalMeta().categories.length),t.getNeedCrossZero()&&(o>0&&s>0&&!u&&(o=0),o<0&&s<0&&!h&&(s=0));var c=t.ecModel;if(c&&"time"===r){var d,p=gx("bar",c);if(Fe.each(p,(function(e){d|=e.getBaseAxis()===t.axis})),d){var f=mx(p),g=function(e,t,i,n){var a=i.axis.getExtent(),r=a[1]-a[0],o=vx(n,i.axis);if(void 0===o)return{min:e,max:t};var s=1/0;Fe.each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;Fe.each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-e,c=h/(1-(s+l)/r)-h;return t+=c*(l/u),e-=c*(s/u),{min:e,max:t}}(o,s,t,f);o=g.min,s=g.max}}return{extent:[o,s],fixMin:u,fixMax:h}}function xx(e){var t,i=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"string"==typeof i?(t=i,i=function(i){return i=e.scale.getLabel(i),t.replace("{value}",null!=i?i:"")}):"function"==typeof i?function(t,a){return null!=n&&(a=t-n),i(_x(e,t),a)}:function(t){return e.scale.getLabel(t)}}function _x(e,t){return"category"===e.type?e.scale.getLabel(t):t}function bx(e,t){var i=t*Math.PI/180,n=e.plain(),a=n.width,r=n.height,o=a*Math.cos(i)+r*Math.sin(i),s=a*Math.sin(i)+r*Math.cos(i);return new On(n.x,n.y,o,s)}function Sx(e){var t=e.get("interval");return null==t?"auto":t}var Mx=function(e,t){var i=yx(e,t),n=i.extent,a=t.get("splitNumber");"log"===e.type&&(e.base=t.get("logBase"));var r=e.type;e.setExtent(n[0],n[1]),e.niceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:"interval"===r||"time"===r?t.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)},Ix=function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Sy(e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),[1/0,-1/0]);case"value":return new Py;default:return(dy.getClass(t)||Py).create(e)}},Ax=function(e){var t=e.scale.getExtent(),i=t[0],n=t[1];return!(i>0&&n>0||i<0&&n<0)},Tx=function(e){var t=e.model,i=e.scale;if(t.get("axisLabel.show")&&!i.isBlank()){var n,a,r="category"===e.type,o=i.getExtent();a=r?i.count():(n=i.getTicks()).length;var s,l=e.getLabelModel(),u=xx(e),h=1;a>40&&(h=Math.ceil(a/40));for(var c=0;c<a;c+=h){var d=u(n?n[c]:o[0]+c),p=bx(l.getTextRect(d),l.get("rotate")||0);s?s.union(p):s=p}return s}},Cx={getScaleExtent:yx,niceScaleExtent:Mx,createScaleByModel:Ix,ifAxisCrossZero:Ax,makeLabelFormatter:xx,getAxisRawValue:_x,estimateLabelUnionRect:Tx,getOptionCategoryInterval:Sx,shouldShowAllLabels:function(e){return"category"===e.type&&0===Sx(e.getLabelModel())}},Dx={getMin:function(e){var t=this.option,i=e||null==t.rangeStart?t.min:t.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!Fe.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(e){var t=this.option,i=e||null==t.rangeEnd?t.max:t.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!Fe.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var e=this.option;return null==e.rangeStart&&null==e.rangeEnd&&!e.scale},getCoordSysModel:Fe.noop,setRange:function(e,t){this.option.rangeStart=e,this.option.rangeEnd=t},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},Lx=Dx,Px=Ha.calculateTextPosition,kx=Jh.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=t.width/2,r=t.height/2;e.moveTo(i,n-r),e.lineTo(i+a,n+r),e.lineTo(i-a,n+r),e.closePath()}}),Ox=Jh.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=t.width/2,r=t.height/2;e.moveTo(i,n-r),e.lineTo(i+a,n),e.lineTo(i,n+r),e.lineTo(i-a,n),e.closePath()}}),Rx=Jh.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.x,n=t.y,a=t.width/5*3,r=Math.max(a,t.height),o=a/2,s=o*o/(r-o),l=n-r+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),d=Math.cos(u),p=.6*o,f=.7*o;e.moveTo(i-h,l+s),e.arc(i,l,o,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(i+h-c*p,l+s+d*p,i,n-f,i,n),e.bezierCurveTo(i,n-f,i-h+c*p,l+s+d*p,i-h,l+s),e.closePath()}}),Ex=Jh.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.height,n=t.width,a=t.x,r=t.y,o=n/3*2;e.moveTo(a,r),e.lineTo(a+o,r+i),e.lineTo(a,r+i/4*3),e.lineTo(a-o,r+i),e.lineTo(a,r),e.closePath()}}),Nx={line:Jh.Line,rect:Jh.Rect,roundRect:Jh.Rect,square:Jh.Rect,circle:Jh.Circle,diamond:Ox,pin:Rx,arrow:Ex,triangle:kx},zx={line:function(e,t,i,n,a){a.x1=e,a.y1=t+n/2,a.x2=e+i,a.y2=t+n/2},rect:function(e,t,i,n,a){a.x=e,a.y=t,a.width=i,a.height=n},roundRect:function(e,t,i,n,a){a.x=e,a.y=t,a.width=i,a.height=n,a.r=Math.min(i,n)/4},square:function(e,t,i,n,a){var r=Math.min(i,n);a.x=e,a.y=t,a.width=r,a.height=r},circle:function(e,t,i,n,a){a.cx=e+i/2,a.cy=t+n/2,a.r=Math.min(i,n)/2},diamond:function(e,t,i,n,a){a.cx=e+i/2,a.cy=t+n/2,a.width=i,a.height=n},pin:function(e,t,i,n,a){a.x=e+i/2,a.y=t+n/2,a.width=i,a.height=n},arrow:function(e,t,i,n,a){a.x=e+i/2,a.y=t+n/2,a.width=i,a.height=n},triangle:function(e,t,i,n,a){a.cx=e+i/2,a.cy=t+n/2,a.width=i,a.height=n}},Bx={};Fe.each(Nx,(function(e,t){Bx[t]=new e}));var Vx=Jh.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,i){var n=Px(e,t,i),a=this.shape;return a&&"pin"===a.symbolType&&"inside"===t.textPosition&&(n.y=i.y+.4*i.height),n},buildPath:function(e,t,i){var n=t.symbolType;if("none"!==n){var a=Bx[n];a||(a=Bx[n="rect"]),zx[n](t.x,t.y,t.width,t.height,a.shape),a.buildPath(e,a.shape,i)}}});function Gx(e,t){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=e:this.__isEmptyBrush?(i.stroke=e,i.fill=t||"#fff"):(i.fill&&(i.fill=e),i.stroke&&(i.stroke=e)),this.dirty(!1)}}var Fx=function(e,t,i,n,a,r,o){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?Jh.makeImage(e.slice(8),new On(t,i,n,a),o?"center":"cover"):0===e.indexOf("path://")?Jh.makePath(e.slice(7),{},new On(t,i,n,a),o?"center":"cover"):new Vx({shape:{symbolType:e,x:t,y:i,width:n,height:a}})).__isEmptyBrush=l,s.setColor=Gx,s.setColor(r),s},Hx={createSymbol:Fx},Wx=ed.getLayoutRect,Ux=iy.enableDataStack,jx=iy.isDimensionStacked,Zx=iy.getStackedDimension;var Yx=function(e,t){var i=t;pc.isInstance(t)||(i=new pc(t),Fe.mixin(i,Lx));var n=Cx.createScaleByModel(i);return n.setExtent(e[0],e[1]),Cx.niceScaleExtent(n,i),n},Xx=function(e){Fe.mixin(e,Lx)},qx={getLayoutRect:Wx,completeDimensions:jv,createDimensions:Zv,createSymbol:Hx.createSymbol,createList:function(e){return hy(e.getSource(),e)},dataStack:{isDimensionStacked:jx,enableDataStack:Ux,getStackedDimension:Zx},createScale:Yx,mixinAxisModelCommonMethods:Xx};function $x(e,t){return Math.abs(e-t)<1e-8}var Kx=function(e,t,i){var n=0,a=e[0];if(!a)return!1;for(var r=1;r<e.length;r++){var o=e[r];n+=al(a[0],a[1],o[0],o[1],t,i),a=o}var s=e[0];return $x(a[0],s[0])&&$x(a[1],s[1])||(n+=al(a[0],a[1],s[0],s[1],t,i)),0!==n},Jx={contain:Kx};function Qx(e,t,i){if(this.name=e,this.geometries=t,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}Qx.prototype={constructor:Qx,properties:null,getBoundingRect:function(){var e=this._rect;if(e)return e;for(var t=Number.MAX_VALUE,i=[t,t],n=[-t,-t],a=[],r=[],o=this.geometries,s=0;s<o.length;s++)if("polygon"===o[s].type){var l=o[s].exterior;Os.fromPoints(l,a,r),ht.min(i,i,a),ht.max(n,n,r)}return 0===s&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new On(i[0],i[1],n[0]-i[0],n[1]-i[1])},contain:function(e){var t=this.getBoundingRect(),i=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var n=0,a=i.length;n<a;n++)if("polygon"===i[n].type){var r=i[n].exterior,o=i[n].interiors;if(Jx.contain(r,e[0],e[1])){for(var s=0;s<(o?o.length:0);s++)if(Jx.contain(o[s]))continue e;return!0}}return!1},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=a.width/a.height;i?n||(n=i/r):i=r*n;for(var o=new On(e,t,i,n),s=a.calculateTransform(o),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var h=l[u].exterior,c=l[u].interiors,d=0;d<h.length;d++)ht.applyTransform(h[d],h[d],s);for(var p=0;p<(c?c.length:0);p++)for(d=0;d<c[p].length;d++)ht.applyTransform(c[p][d],c[p][d],s)}(a=this._rect).copy(o),this.center=[a.x+a.width/2,a.y+a.height/2]},cloneShallow:function(e){null==e&&(e=this.name);var t=new Qx(e,this.geometries,this.center);return t._rect=this._rect,t.transformTo=null,t}};var e_=Qx;function t_(e,t,i){for(var n=[],a=t[0],r=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),a=s+=a,r=l+=r,n.push([s/i,l/i])}return n}var i_=function(e,t){return function(e){if(!e.UTF8Encoding)return e;var t=e.UTF8Scale;null==t&&(t=1024);for(var i=e.features,n=0;n<i.length;n++)for(var a=i[n].geometry,r=a.coordinates,o=a.encodeOffsets,s=0;s<r.length;s++){var l=r[s];if("Polygon"===a.type)r[s]=t_(l,o[s],t);else if("MultiPolygon"===a.type)for(var u=0;u<l.length;u++){var h=l[u];l[u]=t_(h,o[s][u],t)}}e.UTF8Encoding=!1}(e),Fe.map(Fe.filter(e.features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var i=e.properties,n=e.geometry,a=n.coordinates,r=[];"Polygon"===n.type&&r.push({type:"polygon",exterior:a[0],interiors:a.slice(1)}),"MultiPolygon"===n.type&&Fe.each(a,(function(e){e[0]&&r.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new e_(i[t||"name"],r,i.cp);return o.properties=i,o}))},n_=Ro.makeInner,a_=Cx.makeLabelFormatter,r_=Cx.getOptionCategoryInterval,o_=Cx.shouldShowAllLabels,s_=n_();function l_(e,t){var i,n,a=u_(e,"labels"),r=r_(t),o=h_(a,r);return o||(Fe.isFunction(r)?i=p_(e,r):(n="auto"===r?function(e){var t=s_(e).autoInterval;return null!=t?t:s_(e).autoInterval=e.calculateCategoryInterval()}(e):r,i=d_(e,n)),c_(a,r,{labels:i,labelCategoryInterval:n}))}function u_(e,t){return s_(e)[t]||(s_(e)[t]=[])}function h_(e,t){for(var i=0;i<e.length;i++)if(e[i].key===t)return e[i].value}function c_(e,t,i){return e.push({key:t,value:i}),i}function d_(e,t,i){var n=a_(e),a=e.scale,r=a.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=r[0],h=a.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=o_(e),d=o.get("showMinLabel")||c,p=o.get("showMaxLabel")||c;d&&u!==r[0]&&g(r[0]);for(var f=u;f<=r[1];f+=l)g(f);function g(e){s.push(i?e:{formattedLabel:n(e),rawLabel:a.getLabel(e),tickValue:e})}return p&&f-l!==r[1]&&g(r[1]),s}function p_(e,t,i){var n=e.scale,a=a_(e),r=[];return Fe.each(n.getTicks(),(function(e){var o=n.getLabel(e);t(e,o)&&r.push(i?e:{formattedLabel:a(e),rawLabel:o,tickValue:e})})),r}var f_={createAxisLabels:function(e){return"category"===e.type?function(e){var t=e.getLabelModel(),i=l_(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(e):function(e){var t=e.scale.getTicks(),i=a_(e);return{labels:Fe.map(t,(function(t,n){return{formattedLabel:i(t,n),rawLabel:e.scale.getLabel(t),tickValue:t}}))}}(e)},createAxisTicks:function(e,t){return"category"===e.type?function(e,t){var i,n,a=u_(e,"ticks"),r=r_(t),o=h_(a,r);if(o)return o;t.get("show")&&!e.scale.isBlank()||(i=[]);if(Fe.isFunction(r))i=p_(e,r,!0);else if("auto"===r){var s=l_(e,e.getLabelModel());n=s.labelCategoryInterval,i=Fe.map(s.labels,(function(e){return e.tickValue}))}else i=d_(e,n=r,!0);return c_(a,r,{ticks:i,tickCategoryInterval:n})}(e,t):{ticks:e.scale.getTicks()}},calculateCategoryInterval:function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),i=a_(e),n=(t.axisRotate-t.labelRotate)/180*Math.PI,a=e.scale,r=a.getExtent(),o=a.count();if(r[1]-r[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=r[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,p=0;l<=r[1];l+=s){var f,g,m=Ha.getBoundingRect(i(l),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var v=d/h,y=p/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var x=Math.max(0,Math.floor(Math.min(v,y))),_=s_(e.model),b=e.getExtent(),w=_.lastAutoInterval,S=_.lastTickCount;return null!=w&&null!=S&&Math.abs(w-x)<=1&&Math.abs(S-o)<=1&&w>x&&_.axisExtend0===b[0]&&_.axisExtend1===b[1]?x=w:(_.lastTickCount=o,_.lastAutoInterval=x,_.axisExtend0=b[0],_.axisExtend1=b[1]),x}},g_=Fe.each,m_=Fe.map,v_=Cc.linearMap,y_=Cc.getPixelPrecision,x_=Cc.round,__=f_.createAxisTicks,b_=f_.createAxisLabels,w_=f_.calculateCategoryInterval,S_=[0,1],M_=function(e,t,i){this.dim=e,this.scale=t,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function I_(e,t){var i=(e[1]-e[0])/t/2;e[0]+=i,e[1]-=i}M_.prototype={constructor:M_,contain:function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},containData:function(e){return this.scale.contain(e)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(e){return y_(e||this.scale.getExtent(),this._extent)},setExtent:function(e,t){var i=this._extent;i[0]=e,i[1]=t},dataToCoord:function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&"ordinal"===n.type&&I_(i=i.slice(),n.count()),v_(e,S_,i,t)},coordToData:function(e,t){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&I_(i=i.slice(),n.count());var a=v_(e,i,S_,t);return this.scale.scale(a)},pointToData:function(e,t){},getTicksCoords:function(e){var t=(e=e||{}).tickModel||this.getTickModel(),i=__(this,t).ticks,n=m_(i,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this);return function(e,t,i,n){var a=t.length;if(!e.onBand||i||!a)return;var r,o,s=e.getExtent();if(1===a)t[0].coord=s[0],r=t[1]={coord:s[0]};else{var l=t[a-1].tickValue-t[0].tickValue,u=(t[a-1].coord-t[0].coord)/l;g_(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,r={coord:t[a-1].coord+u*o},t.push(r)}var h=s[0]>s[1];c(t[0].coord,s[0])&&(n?t[0].coord=s[0]:t.shift());n&&c(s[0],t[0].coord)&&t.unshift({coord:s[0]});c(s[1],r.coord)&&(n?r.coord=s[1]:t.pop());n&&c(r.coord,s[1])&&t.push({coord:s[1]});function c(e,t){return e=x_(e),t=x_(t),h?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},getMinorTicksCoords:function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");e>0&&e<100||(e=5);var t=this.scale.getMinorTicks(e);return m_(t,(function(e){return m_(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},getViewLabels:function(){return b_(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return w_(this)}};var A_=M_,T_=xo,C_=ri,D_=ht,L_=Zi,P_=Cc,k_=Fc,O_=Ig.throttle,R_=qx,E_=i_,N_=Pv,z_=pc,B_=A_,V_=ae,G_=i_,F_={};Fe.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){F_[e]=Fe[e]}));var H_={};Fe.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],(function(e){H_[e]=Jh[e]}));var W_={zrender:T_,matrix:C_,vector:D_,color:L_,number:P_,format:k_,throttle:O_,helper:R_,parseGeoJSON:E_,List:N_,Model:z_,Axis:B_,env:V_,parseGeoJson:G_,util:F_,graphic:H_},U_=g((function(e,t){var i=Ig.throttle,n=Fe.assert,a=Fe.each,r=Fe.isFunction,o=Fe.isObject,s=od.parseClassType,l={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:3500,COMPONENT:4e3,BRUSH:5e3}},u="__flagInMainProcess",h="__optionUpdated",c=/^[a-zA-Z0-9_]+$/;function d(e,t){return function(i,n,a){t||!this._disposed?(i=i&&i.toLowerCase(),vt.prototype[e].call(this,i,n,a)):this.id}}function p(){vt.call(this)}function f(e,t,n){n=n||{},"string"==typeof t&&(t=B[t]),this.id,this.group,this._dom=e;var a=this._zr=xo.init(e,{renderer:n.renderer||"canvas",devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=i(Fe.bind(a.flush,a),17),(t=Fe.clone(t))&&Kp(t,!0),this._theme=t,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Sp;var r,o,s=this._api=(o=(r=this)._coordSysMgr,Fe.extend(new _p(r),{getCoordinateSystems:Fe.bind(o.getCoordinateSystems,o),getComponentByElement:function(e){for(;e;){var t=e.__ecComponentInfo;if(null!=t)return r._model.getComponent(t.mainType,t.index);e=e.parent}}}));function l(e,t){return e.__prio-t.__prio}Fn(z,l),Fn(R,l),this._scheduler=new sm(this,s,R,z),vt.call(this,this._ecEventProcessor=new P),this._messageCenter=new p,this._initEvents(),this.resize=Fe.bind(this.resize,this),this._pendingActions=[],a.animation.on("frame",this._onframe,this),function(e,t){e.on("rendered",(function(){t.trigger("rendered"),!e.animation.isFinished()||t[h]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))}(a,this),Fe.setAsPrimitive(this)}p.prototype.on=d("on",!0),p.prototype.off=d("off",!0),p.prototype.one=d("one",!0),Fe.mixin(p,vt);var g=f.prototype;function m(e,t,i){if(this._disposed)this.id;else{var n,a=this._model,r=this._coordSysMgr.getCoordinateSystems();t=Ro.parseFinder(a,t);for(var o=0;o<r.length;o++){var s=r[o];if(s[e]&&null!=(n=s[e](a,t,i)))return n}}}g._onframe=function(){if(!this._disposed){var e=this._scheduler;if(this[h]){var t=this[h].silent;this[u]=!0,y(this),v.update.call(this),this[u]=!1,this[h]=!1,w.call(this,t),S.call(this,t)}else if(e.unfinished){var i=1,n=this._model,a=this._api;e.unfinished=!1;do{var r=+new Date;e.performSeriesTasks(n),e.performDataProcessorTasks(n),_(this,n),e.performVisualTasks(n),T(this,this._model,a,"remain"),i-=+new Date-r}while(i>0&&e.unfinished);e.unfinished||this._zr.flush()}}},g.getDom=function(){return this._dom},g.getZr=function(){return this._zr},g.setOption=function(e,t,i){if(this._disposed)this.id;else{var n;if(o(t)&&(i=t.lazyUpdate,n=t.silent,t=t.notMerge),this[u]=!0,!this._model||t){var a=new kp(this._api),r=this._theme,s=this._model=new yp;s.scheduler=this._scheduler,s.init(null,null,r,a)}this._model.setOption(e,E),i?(this[h]={silent:n},this[u]=!1):(y(this),v.update.call(this),this._zr.flush(),this[h]=!1,this[u]=!1,w.call(this,n),S.call(this,n))}},g.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},g.getModel=function(){return this._model},g.getOption=function(){return this._model&&this._model.getOption()},g.getWidth=function(){return this._zr.getWidth()},g.getHeight=function(){return this._zr.getHeight()},g.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},g.getRenderedCanvas=function(e){if(ae.canvasSupported)return(e=e||{}).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},g.getSvgDataURL=function(){if(ae.svgSupported){var e=this._zr,t=e.storage.getDisplayList();return Fe.each(t,(function(e){e.stopAnimation(!0)})),e.painter.toDataURL()}},g.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,i=this._model,n=[],r=this;a(t,(function(e){i.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(n.push(t),t.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return a(n,(function(e){e.group.ignore=!1})),o}this.id},g.getConnectedDataURL=function(e){if(this._disposed)this.id;else if(ae.canvasSupported){var t="svg"===e.type,i=this.group,n=Math.min,r=Math.max,o=1/0;if(F[i]){var s=o,l=o,u=-1/0,h=-1/0,c=[],d=e&&e.pixelRatio||1;Fe.each(G,(function(a,o){if(a.group===i){var d=t?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(Fe.clone(e)),p=a.getDom().getBoundingClientRect();s=n(p.left,s),l=n(p.top,l),u=r(p.right,u),h=r(p.bottom,h),c.push({dom:d,left:p.left,top:p.top})}}));var p=(u*=d)-(s*=d),f=(h*=d)-(l*=d),g=Fe.createCanvas(),m=xo.init(g,{renderer:t?"svg":"canvas"});if(m.resize({width:p,height:f}),t){var v="";return a(c,(function(e){var t=e.left-s,i=e.top-l;v+='<g transform="translate('+t+","+i+')">'+e.dom+"</g>"})),m.painter.getSvgRoot().innerHTML=v,e.connectedBackgroundColor&&m.painter.setBackgroundColor(e.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}return e.connectedBackgroundColor&&m.add(new Jh.Rect({shape:{x:0,y:0,width:p,height:f},style:{fill:e.connectedBackgroundColor}})),a(c,(function(e){var t=new Jh.Image({style:{x:e.left*d-s,y:e.top*d-l,image:e.dom}});m.add(t)})),m.refreshImmediately(),g.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},g.convertToPixel=Fe.curry(m,"convertToPixel"),g.convertFromPixel=Fe.curry(m,"convertFromPixel"),g.containPixel=function(e,t){if(!this._disposed){var i,n=this._model;return e=Ro.parseFinder(n,e),Fe.each(e,(function(e,n){n.indexOf("Models")>=0&&Fe.each(e,(function(e){var a=e.coordinateSystem;if(a&&a.containPoint)i|=!!a.containPoint(t);else if("seriesModels"===n){var r=this._chartsMap[e.__viewId];r&&r.containPoint&&(i|=r.containPoint(t,e))}}),this)}),this),!!i}this.id},g.getVisual=function(e,t){var i=this._model,n=(e=Ro.parseFinder(i,e,{defaultMainType:"series"})).seriesModel.getData(),a=e.hasOwnProperty("dataIndexInside")?e.dataIndexInside:e.hasOwnProperty("dataIndex")?n.indexOfRawIndex(e.dataIndex):null;return null!=a?n.getItemVisual(a,t):n.getVisual(t)},g.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},g.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]};var v={prepareAndUpdate:function(e){y(this),v.update.call(this,e)},update:function(e){var t=this._model,i=this._api,n=this._zr,a=this._coordSysMgr,r=this._scheduler;if(t){r.restoreData(t,e),r.performSeriesTasks(t),a.create(t,i),r.performDataProcessorTasks(t,e),_(this,t),a.update(t,i),I(t),r.performVisualTasks(t,e),A(this,t,i,e);var o=t.get("backgroundColor")||"transparent";if(ae.canvasSupported)n.setBackgroundColor(o);else{var s=Zi.parse(o);o=Zi.stringify(s,"rgb"),0===s[3]&&(o="transparent")}C(t,i)}},updateTransform:function(e){var t=this._model,i=this,n=this._api;if(t){var a=[];t.eachComponent((function(r,o){var s=i.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,t,n,e);l&&l.update&&a.push(s)}else a.push(s)}));var r=Fe.createHashMap();t.eachSeries((function(a){var o=i._chartsMap[a.__viewId];if(o.updateTransform){var s=o.updateTransform(a,t,n,e);s&&s.update&&r.set(a.uid,1)}else r.set(a.uid,1)})),I(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0,dirtyMap:r}),T(i,t,n,e,r),C(t,this._api)}},updateView:function(e){var t=this._model;t&&(_g.markUpdateMethod(e,"updateView"),I(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),A(this,this._model,this._api,e),C(t,this._api))},updateVisual:function(e){v.update.call(this,e)},updateLayout:function(e){v.update.call(this,e)}};function y(e){var t=e._model,i=e._scheduler;i.restorePipelines(t),i.prepareStageTasks(),M(e,"component",t,i),M(e,"chart",t,i),i.plan()}function x(e,t,i,n,r){var o=e._model;if(n){var s={};s[n+"Id"]=i[n+"Id"],s[n+"Index"]=i[n+"Index"],s[n+"Name"]=i[n+"Name"];var l={mainType:n,query:s};r&&(l.subType=r);var u=i.excludeSeriesId;null!=u&&(u=Fe.createHashMap(Ro.normalizeToArray(u))),o&&o.eachComponent(l,(function(t){u&&null!=u.get(t.id)||h(e["series"===n?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else a(e._componentsViews.concat(e._chartsViews),h);function h(n){n&&n.__alive&&n[t]&&n[t](n.__model,o,e._api,i)}}function _(e,t){var i=e._chartsMap,n=e._scheduler;t.eachSeries((function(e){n.updateStreamModes(e,i[e.__viewId])}))}function b(e,t){var i=e.type,n=e.escapeConnect,r=k[i],o=r.actionInfo,l=(o.update||"update").split(":"),c=l.pop();l=null!=l[0]&&s(l[0]),this[u]=!0;var d=[e],p=!1;e.batch&&(p=!0,d=Fe.map(e.batch,(function(t){return(t=Fe.defaults(Fe.extend({},t),e)).batch=null,t})));var f,g=[],m="highlight"===i||"downplay"===i;a(d,(function(e){(f=(f=r.action(e,this._model,this._api))||Fe.extend({},e)).type=o.event||f.type,g.push(f),m?x(this,c,e,"series"):l&&x(this,c,e,l.main,l.sub)}),this),"none"===c||m||l||(this[h]?(y(this),v.update.call(this,e),this[h]=!1):v[c].call(this,e)),f=p?{type:o.event||i,escapeConnect:n,batch:g}:g[0],this[u]=!1,!t&&this._messageCenter.trigger(f.type,f)}function w(e){for(var t=this._pendingActions;t.length;){var i=t.shift();b.call(this,i,e)}}function S(e){!e&&this.trigger("updated")}function M(e,t,i,n){for(var a="component"===t,r=a?e._componentsViews:e._chartsViews,o=a?e._componentsMap:e._chartsMap,l=e._zr,u=e._api,h=0;h<r.length;h++)r[h].__alive=!1;function c(e){var t="_ec_"+e.id+"_"+e.type,h=o[t];if(!h){var c=s(e.type);(h=new(a?og.getClass(c.main,c.sub):_g.getClass(c.sub))).init(i,u),o[t]=h,r.push(h),l.add(h.group)}e.__viewId=h.__id=t,h.__alive=!0,h.__model=e,h.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!a&&n.prepareView(h,e,i,u)}a?i.eachComponent((function(e,t){"series"!==e&&c(t)})):i.eachSeries(c);for(h=0;h<r.length;){var d=r[h];d.__alive?h++:(!a&&d.renderTask.dispose(),l.remove(d.group),d.dispose(i,u),r.splice(h,1),delete o[d.__id],d.__id=d.group.__ecComponentInfo=null)}}function I(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function A(e,t,i,n){!function(e,t,i,n,r){a(r||e._componentsViews,(function(e){var a=e.__model;e.render(a,t,i,n),L(a,e)}))}(e,t,i,n),a(e._chartsViews,(function(e){e.__alive=!1})),T(e,t,i,n),a(e._chartsViews,(function(e){e.__alive||e.remove(t,i)}))}function T(e,t,i,n,a){var r,o=e._scheduler;t.eachSeries((function(t){var i=e._chartsMap[t.__viewId];i.__alive=!0;var s=i.renderTask;o.updatePayload(s,n),a&&a.get(t.uid)&&s.dirty(),r|=s.perform(o.getPerformArgs(s)),i.group.silent=!!t.get("silent"),L(t,i),function(e,t){var i=e.get("blendMode")||null;t.group.traverse((function(e){e.isGroup||e.style.blend!==i&&e.setStyle("blend",i),e.eachPendingDisplayable&&e.eachPendingDisplayable((function(e){e.setStyle("blend",i)}))}))}(t,i)})),o.unfinished|=r,function(e,t){var i=e._zr,n=i.storage,a=0;n.traverse((function(e){a++})),a>t.get("hoverLayerThreshold")&&!ae.node&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var i=e._chartsMap[t.__viewId];i.__alive&&i.group.traverse((function(e){e.useHoverLayer=!0}))}}))}(e,t),Pg(e._zr.dom,t)}function C(e,t){a(N,(function(i){i(e,t)}))}g.resize=function(e){if(this._disposed)this.id;else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var i=t.resetOption("media"),n=e&&e.silent;this[u]=!0,i&&y(this),v.update.call(this),this[u]=!1,w.call(this,n),S.call(this,n)}}},g.showLoading=function(e,t){if(this._disposed)this.id;else if(o(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),V[e]){var i=V[e](this._api,t),n=this._zr;this._loadingFX=i,n.add(i)}},g.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},g.makeActionFromEvent=function(e){var t=Fe.extend({},e);return t.type=O[e.type],t},g.dispatchAction=function(e,t){this._disposed?this.id:(o(t)||(t={silent:!!t}),k[e.type]&&this._model&&(this[u]?this._pendingActions.push(e):(b.call(this,e,t.silent),t.flush?this._zr.flush(!0):!1!==t.flush&&ae.browser.weChat&&this._throttledZrFlush(),w.call(this,t.silent),S.call(this,t.silent))))},g.appendData=function(e){if(this._disposed)this.id;else{var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0}},g.on=d("on",!1),g.off=d("off",!1),g.one=d("one",!1);var D=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function L(e,t){var i=e.get("z"),n=e.get("zlevel");t.group.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=n&&(e.zlevel=n))}))}function P(){this.eventInfo}g._initEvents=function(){a(D,(function(e){var t=function(t){var i,n=this.getModel(),a=t.target;if("globalout"===e)i={};else if(a&&null!=a.dataIndex){var r=a.dataModel||n.getSeriesByIndex(a.seriesIndex);i=r&&r.getDataParams(a.dataIndex,a.dataType,a)||{}}else a&&a.eventData&&(i=Fe.extend({},a.eventData));if(i){var o=i.componentType,s=i.componentIndex;"markLine"!==o&&"markPoint"!==o&&"markArea"!==o||(o="series",s=i.seriesIndex);var l=o&&null!=s&&n.getComponent(o,s),u=l&&this["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];i.event=t,i.type=e,this._ecEventProcessor.eventInfo={targetEl:a,packedEvent:i,model:l,view:u},this.trigger(e,i)}};t.zrEventfulCallAtLast=!0,this._zr.on(e,t,this)}),this),a(O,(function(e,t){this._messageCenter.on(t,(function(e){this.trigger(t,e)}),this)}),this)},g.isDisposed=function(){return this._disposed},g.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},g.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,Ro.setAttribute(this.getDom(),U,"");var e=this._api,t=this._model;a(this._componentsViews,(function(i){i.dispose(t,e)})),a(this._chartsViews,(function(i){i.dispose(t,e)})),this._zr.dispose(),delete G[this.id]}},Fe.mixin(f,vt),P.prototype={constructor:P,normalizeQuery:function(e){var t={},i={},n={};if(Fe.isString(e)){var a=s(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var r=["Index","Name","Id"],o={name:1,dataIndex:1,dataType:1};Fe.each(e,(function(e,a){for(var s=!1,l=0;l<r.length;l++){var u=r[l],h=a.lastIndexOf(u);if(h>0&&h===a.length-u.length){var c=a.slice(0,h);"data"!==c&&(t.mainType=c,t[u.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(a)&&(i[a]=e,s=!0),s||(n[a]=e)}))}return{cptQuery:t,dataQuery:i,otherQuery:n}},filter:function(e,t,i){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,r=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,r,"name")&&h(u,r,"dataIndex")&&h(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,a,r));function h(e,t,i,n){return null==e[i]||t[n||i]===e[i]}},afterTrigger:function(){this.eventInfo=null}};var k={},O={},R=[],E=[],N=[],z=[],B={},V={},G={},F={},H=new Date-0,W=new Date-0,U="_echarts_instance_";function j(e){F[e]=!1}var Z=j;function Y(e){return G[Ro.getAttribute(e,U)]}function X(e,t){B[e]=t}function q(e){E.push(e)}function $(e,t){Q(R,e,t,1e3)}function K(e,t,i){"function"==typeof t&&(i=t,t="");var a=o(e)?e.type:[e,e={event:t}][0];e.event=(e.event||a).toLowerCase(),t=e.event,n(c.test(a)&&c.test(t)),k[a]||(k[a]={action:i,actionInfo:e}),O[t]=a}function J(e,t){Q(z,e,t,3e3,"visual")}function Q(e,t,i,n,a){(r(t)||o(t))&&(i=t,t=n);var s=sm.wrapStageHandler(i,a);return s.__prio=t,s.__raw=i,e.push(s),s}function ee(e,t){V[e]=t}J(2e3,Cg),q(Kp),$(900,tf),ee("default",Og),K({type:"highlight",event:"highlight",update:"highlight"},Fe.noop),K({type:"downplay",event:"downplay",update:"downplay"},Fe.noop),X("light",um),X("dark",fm);t.version="4.8.0",t.dependencies={zrender:"4.3.1"},t.PRIORITY=l,t.init=function(e,t,i){var n=Y(e);if(n)return n;var r=new f(e,t,i);return r.id="ec_"+H++,G[r.id]=r,Ro.setAttribute(e,U,r.id),function(e){var t="__connectUpdateStatus";function i(e,i){for(var n=0;n<e.length;n++)e[n][t]=i}a(O,(function(n,r){e._messageCenter.on(r,(function(n){if(F[e.group]&&0!==e[t]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),o=[];a(G,(function(t){t!==e&&t.group===e.group&&o.push(t)})),i(o,0),a(o,(function(e){1!==e[t]&&e.dispatchAction(r)})),i(o,2)}}))}))}(r),r},t.connect=function(e){if(Fe.isArray(e)){var t=e;e=null,a(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+W++,a(t,(function(t){t.group=e}))}return F[e]=!0,e},t.disConnect=j,t.disconnect=Z,t.dispose=function(e){"string"==typeof e?e=G[e]:e instanceof f||(e=Y(e)),e instanceof f&&!e.isDisposed()&&e.dispose()},t.getInstanceByDom=Y,t.getInstanceById=function(e){return G[e]},t.registerTheme=X,t.registerPreprocessor=q,t.registerProcessor=$,t.registerPostUpdate=function(e){N.push(e)},t.registerAction=K,t.registerCoordinateSystem=function(e,t){Sp.register(e,t)},t.getCoordinateSystemDimensions=function(e){var t=Sp.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},t.registerLayout=function(e,t){Q(z,e,t,1e3,"layout")},t.registerVisual=J,t.registerLoading=ee,t.extendComponentModel=function(e){return od.extend(e)},t.extendComponentView=function(e){return og.extend(e)},t.extendSeriesModel=function(e){return ng.extend(e)},t.extendChartView=function(e){return _g.extend(e)},t.setCanvasCreator=function(e){Fe.$override("createCanvas",e)},t.registerMap=function(e,t,i){Xm.registerMap(e,t,i)},t.getMap=function(e){var t=Xm.retrieveMap(e);return t&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.dataTool={},function(){for(var e in W_)W_.hasOwnProperty(e)&&(t[e]=W_[e])}()}));ng.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(e,t){return hy(this.getSource(),this,{useEncodeDefaulter:!0})},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},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}});var j_=Mf.retrieveRawValue;var Z_=function(e,t){var i=e.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return j_(e,t,i[0]);if(n){for(var a=[],r=0;r<i.length;r++){var o=j_(e,t,i[r]);a.push(o)}return a.join(" ")}},Y_={getDefaultLabel:Z_},X_=Hx.createSymbol,q_=Cc.parsePercent,$_=Y_.getDefaultLabel;function K_(e,t,i){Jh.Group.call(this),this.updateData(e,t,i)}var J_=K_.prototype,Q_=K_.getSymbolSize=function(e,t){var i=e.getItemVisual(t,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};function eb(e){return[e[0]/2,e[1]/2]}function tb(e,t){this.parent.drift(e,t)}J_._createSymbol=function(e,t,i,n,a){this.removeAll();var r=t.getItemVisual(i,"color"),o=X_(e,-1,-1,2,2,r,a);o.attr({z2:100,culling:!0,scale:eb(n)}),o.drift=tb,this._symbolType=e,this.add(o)},J_.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(e)},J_.getSymbolPath=function(){return this.childAt(0)},J_.getScale=function(){return this.childAt(0).scale},J_.highlight=function(){this.childAt(0).trigger("emphasis")},J_.downplay=function(){this.childAt(0).trigger("normal")},J_.setZ=function(e,t){var i=this.childAt(0);i.zlevel=e,i.z=t},J_.setDraggable=function(e){var t=this.childAt(0);t.draggable=e,t.cursor=e?"move":t.cursor},J_.updateData=function(e,t,i){this.silent=!1;var n=e.getItemVisual(t,"symbol")||"circle",a=e.hostModel,r=Q_(e,t),o=n!==this._symbolType;if(o){var s=e.getItemVisual(t,"symbolKeepAspect");this._createSymbol(n,e,t,r,s)}else{(l=this.childAt(0)).silent=!1,Jh.updateProps(l,{scale:eb(r)},a,t)}if(this._updateCommon(e,t,r,i),o){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),Jh.initProps(l,h,a,t)}this._seriesModel=a};var ib=["itemStyle"],nb=["emphasis","itemStyle"],ab=["label"],rb=["emphasis","label"];function ob(e,t){if(!this.incremental&&!this.useHoverLayer)if("emphasis"===t){var i=this.__symbolOriginalScale,n=i[1]/i[0],a={scale:[Math.max(1.1*i[0],i[0]+3),Math.max(1.1*i[1],i[1]+3*n)]};this.animateTo(a,400,"elasticOut")}else"normal"===t&&this.animateTo({scale:this.__symbolOriginalScale},400,"elasticOut")}J_._updateCommon=function(e,t,i,n){var a=this.childAt(0),r=e.hostModel,o=e.getItemVisual(t,"color");"image"!==a.type?a.useStyle({strokeNoScale:!0}):a.setStyle({opacity:null,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});var s=n&&n.itemStyle,l=n&&n.hoverItemStyle,u=n&&n.symbolOffset,h=n&&n.labelModel,c=n&&n.hoverLabelModel,d=n&&n.hoverAnimation,p=n&&n.cursorStyle;if(!n||e.hasItemOption){var f=n&&n.itemModel?n.itemModel:e.getItemModel(t);s=f.getModel(ib).getItemStyle(["color"]),l=f.getModel(nb).getItemStyle(),u=f.getShallow("symbolOffset"),h=f.getModel(ab),c=f.getModel(rb),d=f.getShallow("hoverAnimation"),p=f.getShallow("cursor")}else l=Fe.extend({},l);var g=a.style,m=e.getItemVisual(t,"symbolRotate");a.attr("rotation",(m||0)*Math.PI/180||0),u&&a.attr("position",[q_(u[0],i[0]),q_(u[1],i[1])]),p&&a.attr("cursor",p),a.setColor(o,n&&n.symbolInnerColor),a.setStyle(s);var v=e.getItemVisual(t,"opacity");null!=v&&(g.opacity=v);var y=e.getItemVisual(t,"liftZ"),x=a.__z2Origin;null!=y?null==x&&(a.__z2Origin=a.z2,a.z2+=y):null!=x&&(a.z2=x,a.__z2Origin=null);var _=n&&n.useNameLabel;Jh.setLabelStyle(g,l,h,c,{labelFetcher:r,labelDataIndex:t,defaultText:function(t,i){return _?e.getName(t):$_(e,t)},isRectText:!0,autoColor:o}),a.__symbolOriginalScale=eb(i),a.hoverStyle=l,a.highDownOnUpdate=d&&r.isAnimationEnabled()?ob:null,Jh.setHoverStyle(a)},J_.fadeOut=function(e,t){var i=this.childAt(0);this.silent=i.silent=!0,(!t||!t.keepLabel)&&(i.style.text=null),Jh.updateProps(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,e)},Fe.inherits(K_,Jh.Group);var sb=K_,lb=Fe.isObject;function ub(e){this.group=new Jh.Group,this._symbolCtor=e||sb}var hb=ub.prototype;function cb(e,t,i,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(i,"symbol")}function db(e){return null==e||lb(e)||(e={isIgnore:e}),e||{}}function pb(e){var t=e.hostModel;return{itemStyle:t.getModel("itemStyle").getItemStyle(["color"]),hoverItemStyle:t.getModel("emphasis.itemStyle").getItemStyle(),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label"),cursorStyle:t.get("cursor")}}hb.updateData=function(e,t){t=db(t);var i=this.group,n=e.hostModel,a=this._data,r=this._symbolCtor,o=pb(e);a||i.removeAll(),e.diff(a).add((function(n){var a=e.getItemLayout(n);if(cb(e,a,n,t)){var s=new r(e,n,o);s.attr("position",a),e.setItemGraphicEl(n,s),i.add(s)}})).update((function(s,l){var u=a.getItemGraphicEl(l),h=e.getItemLayout(s);cb(e,h,s,t)?(u?(u.updateData(e,s,o),Jh.updateProps(u,{position:h},n)):(u=new r(e,s)).attr("position",h),i.add(u),e.setItemGraphicEl(s,u)):i.remove(u)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&t.fadeOut((function(){i.remove(t)}))})).execute(),this._data=e},hb.isPersistent=function(){return!0},hb.updateLayout=function(){var e=this._data;e&&e.eachItemGraphicEl((function(t,i){var n=e.getItemLayout(i);t.attr("position",n)}))},hb.incrementalPrepareUpdate=function(e){this._seriesScope=pb(e),this._data=null,this.group.removeAll()},hb.incrementalUpdate=function(e,t,i){function n(e){e.isGroup||(e.incremental=e.useHoverLayer=!0)}i=db(i);for(var a=e.start;a<e.end;a++){var r=t.getItemLayout(a);if(cb(t,r,a,i)){var o=new this._symbolCtor(t,a,this._seriesScope);o.traverse(n),o.attr("position",r),this.group.add(o),t.setItemGraphicEl(a,o)}}},hb.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}))})):t.removeAll()};var fb=ub,gb=iy.isDimensionStacked,mb=Fe.map;var vb={prepareDataCoordInfo:function(e,t,i){var n,a=e.getBaseAxis(),r=e.getOtherAxis(a),o=function(e,t){var i=0,n=e.scale.getExtent();"start"===t?i=n[0]:"end"===t?i=n[1]:n[0]>0?i=n[0]:n[1]<0&&(i=n[1]);return i}(r,i),s=a.dim,l=r.dim,u=t.mapDimension(l),h=t.mapDimension(s),c="x"===l||"radius"===l?1:0,d=mb(e.dimensions,(function(e){return t.mapDimension(e)})),p=t.getCalculationInfo("stackResultDimension");return(n|=gb(t,d[0]))&&(d[0]=p),(n|=gb(t,d[1]))&&(d[1]=p),{dataDimsForPoint:d,valueStart:o,valueAxisDim:l,baseAxisDim:s,stacked:!!n,valueDim:u,baseDim:h,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}},getStackedOnPoint:function(e,t,i,n){var a=NaN;e.stacked&&(a=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=e.valueStart);var r=e.baseDataOffset,o=[];return o[r]=i.get(e.baseDim,n),o[1-r]=a,t.dataToPoint(o)}},yb=vb.prepareDataCoordInfo,xb=vb.getStackedOnPoint;var _b=function(e,t,i,n,a,r,o,s){for(var l=function(e,t){var i=[];return t.diff(e).add((function(e){i.push({cmd:"+",idx:e})})).update((function(e,t){i.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){i.push({cmd:"-",idx:e})})).execute(),i}(e,t),u=[],h=[],c=[],d=[],p=[],f=[],g=[],m=yb(a,t,o),v=yb(r,e,s),y=0;y<l.length;y++){var x=l[y],_=!0;switch(x.cmd){case"=":var b=e.getItemLayout(x.idx),w=t.getItemLayout(x.idx1);(isNaN(b[0])||isNaN(b[1]))&&(b=w.slice()),u.push(b),h.push(w),c.push(i[x.idx]),d.push(n[x.idx1]),g.push(t.getRawIndex(x.idx1));break;case"+":var S=x.idx;u.push(a.dataToPoint([t.get(m.dataDimsForPoint[0],S),t.get(m.dataDimsForPoint[1],S)])),h.push(t.getItemLayout(S).slice()),c.push(xb(m,a,t,S)),d.push(n[S]),g.push(t.getRawIndex(S));break;case"-":S=x.idx;var M=e.getRawIndex(S);M!==S?(u.push(e.getItemLayout(S)),h.push(r.dataToPoint([e.get(v.dataDimsForPoint[0],S),e.get(v.dataDimsForPoint[1],S)])),c.push(i[S]),d.push(xb(v,r,e,S)),g.push(M)):_=!1}_&&(p.push(x),f.push(f.length))}f.sort((function(e,t){return g[e]-g[t]}));var I=[],A=[],T=[],C=[],D=[];for(y=0;y<f.length;y++){S=f[y];I[y]=u[S],A[y]=h[S],T[y]=c[S],C[y]=d[S],D[y]=p[S]}return{current:I,next:A,stackedOnCurrent:T,stackedOnNext:C,status:D}},bb=ht.min,wb=ht.max,Sb=ht.scaleAndAdd,Mb=ht.copy,Ib=[],Ab=[],Tb=[];function Cb(e){return isNaN(e[0])||isNaN(e[1])}function Db(e,t,i,n,a,r,o,s,l,u,h){return"none"!==u&&u?Lb.apply(this,arguments):Pb.apply(this,arguments)}function Lb(e,t,i,n,a,r,o,s,l,u,h){for(var c=0,d=i,p=0;p<n;p++){var f=t[d];if(d>=a||d<0)break;if(Cb(f)){if(h){d+=r;continue}break}if(d===i)e[r>0?"moveTo":"lineTo"](f[0],f[1]);else if(l>0){var g=t[c],m="y"===u?1:0,v=(f[m]-g[m])*l;Mb(Ab,g),Ab[m]=g[m]+v,Mb(Tb,f),Tb[m]=f[m]-v,e.bezierCurveTo(Ab[0],Ab[1],Tb[0],Tb[1],f[0],f[1])}else e.lineTo(f[0],f[1]);c=d,d+=r}return p}function Pb(e,t,i,n,a,r,o,s,l,u,h){for(var c=0,d=i,p=0;p<n;p++){var f=t[d];if(d>=a||d<0)break;if(Cb(f)){if(h){d+=r;continue}break}if(d===i)e[r>0?"moveTo":"lineTo"](f[0],f[1]),Mb(Ab,f);else if(l>0){var g=d+r,m=t[g];if(h)for(;m&&Cb(t[g]);)m=t[g+=r];var v=.5,y=t[c];if(!(m=t[g])||Cb(m))Mb(Tb,f);else{var x,_;if(Cb(m)&&!h&&(m=f),ht.sub(Ib,m,y),"x"===u||"y"===u){var b="x"===u?0:1;x=Math.abs(f[b]-y[b]),_=Math.abs(f[b]-m[b])}else x=ht.dist(f,y),_=ht.dist(f,m);Sb(Tb,f,Ib,-l*(1-(v=_/(_+x))))}bb(Ab,Ab,s),wb(Ab,Ab,o),bb(Tb,Tb,s),wb(Tb,Tb,o),e.bezierCurveTo(Ab[0],Ab[1],Tb[0],Tb[1],f[0],f[1]),Sb(Ab,f,Ib,l*v)}else e.lineTo(f[0],f[1]);c=d,d+=r}return p}function kb(e,t){var i=[1/0,1/0],n=[-1/0,-1/0];if(t)for(var a=0;a<e.length;a++){var r=e[a];r[0]<i[0]&&(i[0]=r[0]),r[1]<i[1]&&(i[1]=r[1]),r[0]>n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1])}return{min:t?i:n,max:t?n:i}}var Ob=xl.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:Ul(xl.prototype.brush),buildPath:function(e,t){var i=t.points,n=0,a=i.length,r=kb(i,t.smoothConstraint);if(t.connectNulls){for(;a>0&&Cb(i[a-1]);a--);for(;n<a&&Cb(i[n]);n++);}for(;n<a;)n+=Db(e,i,n,a,a,1,r.min,r.max,t.smooth,t.smoothMonotone,t.connectNulls)+1}}),Rb=xl.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:Ul(xl.prototype.brush),buildPath:function(e,t){var i=t.points,n=t.stackedOnPoints,a=0,r=i.length,o=t.smoothMonotone,s=kb(i,t.smoothConstraint),l=kb(n,t.smoothConstraint);if(t.connectNulls){for(;r>0&&Cb(i[r-1]);r--);for(;a<r&&Cb(i[a]);a++);}for(;a<r;){var u=Db(e,i,a,r,r,1,s.min,s.max,t.smooth,o,t.connectNulls);Db(e,n,a+u-1,u,r,-1,l.min,l.max,t.stackedOnSmooth,o,t.connectNulls),a+=u+1,e.closePath()}}}),Eb={Polyline:Ob,Polygon:Rb},Nb=Cc.round;function zb(e,t,i){var n=e.getArea(),a=e.getBaseAxis().isHorizontal(),r=n.x,o=n.y,s=n.width,l=n.height,u=i.get("lineStyle.width")||2;r-=u/2,o-=u/2,s+=u,l+=u,r=Math.floor(r),s=Math.round(s);var h=new Jh.Rect({shape:{x:r,y:o,width:s,height:l}});return t&&(h.shape[a?"width":"height"]=0,Jh.initProps(h,{shape:{width:s,height:l}},i)),h}function Bb(e,t,i){var n=e.getArea(),a=new Jh.Sector({shape:{cx:Nb(e.cx,1),cy:Nb(e.cy,1),r0:Nb(n.r0,1),r:Nb(n.r,1),startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});return t&&(a.shape.endAngle=n.startAngle,Jh.initProps(a,{shape:{endAngle:n.endAngle}},i)),a}var Vb={createGridClipPath:zb,createPolarClipPath:Bb,createClipPath:function(e,t,i){return e?"polar"===e.type?Bb(e,t,i):"cartesian2d"===e.type?zb(e,t,i):null:null}},Gb=Os.fromPoints,Fb=Eb.Polyline,Hb=Eb.Polygon,Wb=vb.prepareDataCoordInfo,Ub=vb.getStackedOnPoint,jb=Vb.createGridClipPath,Zb=Vb.createPolarClipPath;function Yb(e,t){if(e.length===t.length){for(var i=0;i<e.length;i++){var n=e[i],a=t[i];if(n[0]!==a[0]||n[1]!==a[1])return}return!0}}function Xb(e,t){var i=[],n=[],a=[],r=[];return Gb(e,i,n),Gb(t,a,r),Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(n[0]-r[0]),Math.abs(n[1]-r[1]))}function qb(e){return"number"==typeof e?e:e?.5:0}function $b(e,t,i){for(var n=t.getBaseAxis(),a="x"===n.dim||"radius"===n.dim?0:1,r=[],o=0;o<e.length-1;o++){var s=e[o+1],l=e[o];r.push(l);var u=[];switch(i){case"end":u[a]=s[a],u[1-a]=l[1-a],r.push(u);break;case"middle":var h=(l[a]+s[a])/2,c=[];u[a]=c[a]=h,u[1-a]=l[1-a],c[1-a]=s[1-a],r.push(u),r.push(c);break;default:u[a]=l[a],u[1-a]=s[1-a],r.push(u)}}return e[o]&&r.push(e[o]),r}function Kb(e,t,i){var n=e.get("showAllSymbol"),a="auto"===n;if(!n||a){var r=i.getAxesByScale("ordinal")[0];if(r&&(!a||!function(e,t){var i=e.getExtent(),n=Math.abs(i[1]-i[0])/e.scale.count();isNaN(n)&&(n=0);for(var a=t.count(),r=Math.max(1,Math.round(a/5)),o=0;o<a;o+=r)if(1.5*sb.getSymbolSize(t,o)[e.isHorizontal()?1:0]>n)return!1;return!0}(r,t))){var o=t.mapDimension(r.dim),s={};return Fe.each(r.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function Jb(e,t,i){if("cartesian2d"===e.type){var n=e.getBaseAxis().isHorizontal(),a=jb(e,t,i);if(!i.get("clip",!0)){var r=a.shape,o=Math.max(r.width,r.height);n?(r.y-=o,r.height+=2*o):(r.x-=o,r.width+=2*o)}return a}return Zb(e,t,i)}_g.extend({type:"line",init:function(){var e=new Jh.Group,t=new fb;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},render:function(e,t,i){var n=e.coordinateSystem,a=this.group,r=e.getData(),o=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=r.mapArray(r.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,p=this._polygon,f=this._lineGroup,g=e.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(e,t,i){if(!i.valueDim)return[];for(var n=[],a=0,r=t.count();a<r;a++)n.push(Ub(i,e,t,a));return n}(n,r,Wb(n,r,v)),x=e.get("showSymbol"),_=x&&!u&&Kb(e,r,n),b=this._data;b&&b.eachItemGraphicEl((function(e,t){e.__temp&&(a.remove(e),b.setItemGraphicEl(t,null))})),x||c.remove(),a.add(f);var w,S=!u&&e.get("step");n&&n.getArea&&e.get("clip",!0)&&(null!=(w=n.getArea()).width?(w.x-=.1,w.y-=.1,w.width+=.2,w.height+=.2):w.r0&&(w.r0-=.5,w.r1+=.5)),this._clipShapeForSymbol=w,d&&h.type===n.type&&S===this._step?(m&&!p?p=this._newPolygon(l,y,n,g):p&&!m&&(f.remove(p),p=this._polygon=null),f.setClipPath(Jb(n,!1,e)),x&&c.updateData(r,{isIgnore:_,clipShape:w}),r.eachItemGraphicEl((function(e){e.stopAnimation(!0)})),Yb(this._stackedOnPoints,y)&&Yb(this._points,l)||(g?this._updateAnimation(r,y,n,i,S,v):(S&&(l=$b(l,n,S),y=$b(y,n,S)),d.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:y})))):(x&&c.updateData(r,{isIgnore:_,clipShape:w}),S&&(l=$b(l,n,S),y=$b(y,n,S)),d=this._newPolyline(l,n,g),m&&(p=this._newPolygon(l,y,n,g)),f.setClipPath(Jb(n,!0,e)));var M=function(e,t){var i=e.getVisual("visualMeta");if(i&&i.length&&e.count()&&"cartesian2d"===t.type){for(var n,a,r=i.length-1;r>=0;r--){var o=i[r].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){a=i[r];break}}if(a){var u=t.getAxis(n),h=Fe.map(a.stops,(function(e){return{coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),c=h.length,d=a.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),d.reverse());var p=h[0].coord-10,f=h[c-1].coord+10,g=f-p;if(g<.001)return"transparent";Fe.each(h,(function(e){e.offset=(e.coord-p)/g})),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new Jh.LinearGradient(0,0,0,0,h,!0);return m[n]=p,m[n+"2"]=f,m}}}(r,n)||r.getVisual("color");d.useStyle(Fe.defaults(o.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=e.get("smooth");if(I=qb(e.get("smooth")),d.setShape({smooth:I,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),p){var A=r.getCalculationInfo("stackedOnSeries"),T=0;p.useStyle(Fe.defaults(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),A&&(T=qb(A.get("smooth"))),p.setShape({smooth:I,stackedOnSmooth:T,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")})}this._data=r,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=S,this._valueOrigin=v},dispose:function(){},highlight:function(e,t,i,n){var a=e.getData(),r=Ro.queryDataIndex(a,n);if(!(r instanceof Array)&&null!=r&&r>=0){var o=a.getItemGraphicEl(r);if(!o){var s=a.getItemLayout(r);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(o=new sb(a,r)).position=s,o.setZ(e.get("zlevel"),e.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,a.setItemGraphicEl(r,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else _g.prototype.highlight.call(this,e,t,i,n)},downplay:function(e,t,i,n){var a=e.getData(),r=Ro.queryDataIndex(a,n);if(null!=r&&r>=0){var o=a.getItemGraphicEl(r);o&&(o.__temp?(a.setItemGraphicEl(r,null),this.group.remove(o)):o.downplay())}else _g.prototype.downplay.call(this,e,t,i,n)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new Fb({shape:{points:e},silent:!0,z2:10}),this._lineGroup.add(t),this._polyline=t,t},_newPolygon:function(e,t){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new Hb({shape:{points:e,stackedOnPoints:t},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(e,t,i,n,a,r){var o=this._polyline,s=this._polygon,l=e.hostModel,u=_b(this._data,e,this._stackedOnPoints,t,this._coordSys,i,this._valueOrigin,r),h=u.current,c=u.stackedOnCurrent,d=u.next,p=u.stackedOnNext;if(a&&(h=$b(u.current,i,a),c=$b(u.stackedOnCurrent,i,a),d=$b(u.next,i,a),p=$b(u.stackedOnNext,i,a)),Xb(h,d)>3e3||s&&Xb(c,p)>3e3)return o.setShape({points:d}),void(s&&s.setShape({points:d,stackedOnPoints:p}));o.shape.__points=u.current,o.shape.points=h,Jh.updateProps(o,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),Jh.updateProps(s,{shape:{points:d,stackedOnPoints:p}},l));for(var f=[],g=u.status,m=0;m<g.length;m++){if("="===g[m].cmd){var v=e.getItemGraphicEl(g[m].idx1);v&&f.push({el:v,ptIdx:m})}}o.animators&&o.animators.length&&o.animators[0].during((function(){for(var e=0;e<f.length;e++){f[e].el.attr("position",o.shape.__points[f[e].ptIdx])}}))},remove:function(e){var t=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl((function(e,n){e.__temp&&(t.remove(e),i.setItemGraphicEl(n,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}});var Qb=Fe.isFunction;var ew=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,a){var r=e.getData(),o=e.get("symbol"),s=e.get("symbolSize"),l=e.get("symbolKeepAspect"),u=e.get("symbolRotate"),h=Qb(o),c=Qb(s),d=Qb(u),p=h||c||d,f=!h&&o?o:t,g=c?null:s;if(r.setVisual({legendSymbol:i||f,symbol:f,symbolSize:g,symbolKeepAspect:l,symbolRotate:u}),!n.isSeriesFiltered(e))return{dataEach:r.hasItemOption||p?function(t,i){if(p){var n=e.getRawValue(i),a=e.getDataParams(i);h&&t.setItemVisual(i,"symbol",o(n,a)),c&&t.setItemVisual(i,"symbolSize",s(n,a)),d&&t.setItemVisual(i,"symbolRotate",u(n,a))}if(t.hasItemOption){var r=t.getItemModel(i),l=r.getShallow("symbol",!0),f=r.getShallow("symbolSize",!0),g=r.getShallow("symbolRotate",!0),m=r.getShallow("symbolKeepAspect",!0);null!=l&&t.setItemVisual(i,"symbol",l),null!=f&&t.setItemVisual(i,"symbolSize",f),null!=g&&t.setItemVisual(i,"symbolRotate",g),null!=m&&t.setItemVisual(i,"symbolKeepAspect",m)}}:null}}}},tw=Fe.map,iw=iy.isDimensionStacked;var nw=function(e){return{seriesType:e,plan:lg(),reset:function(e){var t=e.getData(),i=e.coordinateSystem,n=e.pipelineContext.large;if(i){var a=tw(i.dimensions,(function(e){return t.mapDimension(e)})).slice(0,2),r=a.length,o=t.getCalculationInfo("stackResultDimension");return iw(t,a[0])&&(a[0]=o),iw(t,a[1])&&(a[1]=o),r&&{progress:function(e,t){for(var o=e.end-e.start,s=n&&new Float32Array(o*r),l=e.start,u=0,h=[],c=[];l<e.end;l++){var d;if(1===r){var p=t.get(a[0],l);d=!isNaN(p)&&i.dataToPoint(p,null,c)}else{p=h[0]=t.get(a[0],l);var f=h[1]=t.get(a[1],l);d=!isNaN(p)&&!isNaN(f)&&i.dataToPoint(h,null,c)}n?(s[u++]=d?d[0]:NaN,s[u++]=d?d[1]:NaN):t.setItemLayout(l,d&&d.slice()||[NaN,NaN])}n&&t.setLayout("symbolPoints",s)}}}}}},aw={average:function(e){for(var t=0,i=0,n=0;n<e.length;n++)isNaN(e[n])||(t+=e[n],i++);return 0===i?NaN:t/i},sum:function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i]||0;return t},max:function(e){for(var t=-1/0,i=0;i<e.length;i++)e[i]>t&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;i<e.length;i++)e[i]<t&&(t=e[i]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},rw=function(e,t){return Math.round(e.length/2)};var ow=function(e){return{seriesType:e,modifyOutputEnd:!0,reset:function(e,t,i){var n=e.getData(),a=e.get("sampling"),r=e.coordinateSystem;if("cartesian2d"===r.type&&a){var o,s=r.getBaseAxis(),l=r.getOtherAxis(s),u=s.getExtent(),h=u[1]-u[0],c=Math.round(n.count()/h);if(c>1)"string"==typeof a?o=aw[a]:"function"==typeof a&&(o=a),o&&e.setData(n.downSample(n.mapDimension(l.dim),1/c,o,rw))}}}};function sw(e){return this._axes[e]}var lw=function(e){this._axes={},this._dimList=[],this.name=e||""};lw.prototype={constructor:lw,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return Fe.map(this._dimList,sw,this)},getAxesByScale:function(e){return e=e.toLowerCase(),Fe.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var i=this._dimList,n=e instanceof Array?[]:{},a=0;a<i.length;a++){var r=i[a],o=this._axes[r];n[r]=o[t](e[r])}return n}};var uw=lw;function hw(e){uw.call(this,e)}hw.prototype={constructor:hw,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(e){var t=this.getAxis("x"),i=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&i.contain(i.toLocalCoord(e[1]))},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},dataToPoint:function(e,t,i){var n=this.getAxis("x"),a=this.getAxis("y");return(i=i||[])[0]=n.toGlobalCoord(n.dataToCoord(e[0])),i[1]=a.toGlobalCoord(a.dataToCoord(e[1])),i},clampData:function(e,t){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,a=i.getExtent(),r=n.getExtent(),o=i.parse(e[0]),s=n.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(a[0],a[1]),o),Math.max(a[0],a[1])),t[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),t},pointToData:function(e,t){var i=this.getAxis("x"),n=this.getAxis("y");return(t=t||[])[0]=i.coordToData(i.toLocalCoord(e[0])),t[1]=n.coordToData(n.toLocalCoord(e[1])),t},getOtherAxis:function(e){return this.getAxis("x"===e.dim?"y":"x")},getArea:function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1]),n=Math.min(t[0],t[1]),a=Math.max(e[0],e[1])-i,r=Math.max(t[0],t[1])-n;return new On(i,n,a,r)}},Fe.inherits(hw,uw);var cw=hw,dw=function(e,t,i,n,a){A_.call(this,e,t,i),this.type=n||"value",this.position=a||"bottom"};dw.prototype={constructor:dw,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},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},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},toLocalCoord:null,toGlobalCoord:null},Fe.inherits(dw,A_);var pw=dw,fw={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:"#333",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:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},gw={};gw.categoryAxis=Fe.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},fw),gw.valueAxis=Fe.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},fw),gw.timeAxis=Fe.defaults({scale:!0,min:"dataMin",max:"dataMax"},gw.valueAxis),gw.logAxis=Fe.defaults({scale:!0,logBase:10},gw.valueAxis);var mw=gw,vw=ed.getLayoutParams,yw=ed.mergeLayoutParam,xw=["value","category","time","log"];var _w=function(e,t,i,n){Fe.each(xw,(function(a){t.extend({type:e+"Axis."+a,mergeDefaultAndTheme:function(t,n){var r=this.layoutMode,o=r?vw(t):{},s=n.getTheme();Fe.merge(t,s.get(a+"Axis")),Fe.merge(t,this.getDefaultOption()),t.type=i(e,t),r&&yw(t,o,r)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=_y.createByAxisModel(this))},getCategories:function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:Fe.mergeAll([{},mw[a+"Axis"],n],!0)})})),od.registerSubTypeDefaulter(e+"Axis",Fe.curry(i,e))},bw=od.extend({type:"cartesian2dAxis",axis:null,init:function(){bw.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){bw.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){bw.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function ww(e,t){return t.type||(t.data?"category":"value")}Fe.merge(bw.prototype,Lx);var Sw={offset:0};_w("x",bw,ww,Sw),_w("y",bw,ww,Sw),od.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Mw=Fe.isObject,Iw=Fe.each,Aw=Fe.map,Tw=Fe.indexOf,Cw=ed.getLayoutRect,Dw=Cx.createScaleByModel,Lw=Cx.ifAxisCrossZero,Pw=Cx.niceScaleExtent,kw=Cx.estimateLabelUnionRect,Ow=iy.getStackedDimension;function Rw(e,t,i){return e.getCoordSysModel()===t}function Ew(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}var Nw=Ew.prototype;function zw(e,t,i,n){i.getAxesOnZeroOf=function(){return a?[a]:[]};var a,r=e[t],o=i.model,s=o.get("axisLine.onZero"),l=o.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)Bw(r[l])&&(a=r[l]);else for(var u in r)if(r.hasOwnProperty(u)&&Bw(r[u])&&!n[h(r[u])]){a=r[u];break}a&&(n[h(a)]=!0)}function h(e){return e.dim+"_"+e.index}}function Bw(e){return e&&"category"!==e.type&&"time"!==e.type&&Lw(e)}Nw.type="grid",Nw.axisPointerEnabled=!0,Nw.getRect=function(){return this._rect},Nw.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model),Iw(i.x,(function(e){Pw(e.scale,e.model)})),Iw(i.y,(function(e){Pw(e.scale,e.model)}));var n={};Iw(i.x,(function(e){zw(i,"y",e,n)})),Iw(i.y,(function(e){zw(i,"x",e,n)})),this.resize(this.model,t)},Nw.resize=function(e,t,i){var n=Cw(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});this._rect=n;var a=this._axesList;function r(){Iw(a,(function(e){var t=e.isHorizontal(),i=t?[0,n.width]:[0,n.height],a=e.inverse?1:0;e.setExtent(i[a],i[1-a]),function(e,t){var i=e.getExtent(),n=i[0]+i[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return n-e+t}}(e,t?n.x:n.y)}))}r(),!i&&e.get("containLabel")&&(Iw(a,(function(e){if(!e.model.get("axisLabel.inside")){var t=kw(e);if(t){var i=e.isHorizontal()?"height":"width",a=e.model.get("axisLabel.margin");n[i]-=t[i]+a,"top"===e.position?n.y+=t.height+a:"left"===e.position&&(n.x+=t.width+a)}}})),r())},Nw.getAxis=function(e,t){var i=this._axesMap[e];if(null!=i){if(null==t)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[t]}},Nw.getAxes=function(){return this._axesList.slice()},Nw.getCartesian=function(e,t){if(null!=e&&null!=t){var i="x"+e+"y"+t;return this._coordsMap[i]}Mw(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===e||a[n].getAxis("y").index===t)return a[n]},Nw.getCartesians=function(){return this._coordsList.slice()},Nw.convertToPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},Nw.convertFromPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},Nw._findConvertTarget=function(e,t){var i,n,a=t.seriesModel,r=t.xAxisModel||a&&a.getReferringComponents("xAxis")[0],o=t.yAxisModel||a&&a.getReferringComponents("yAxis")[0],s=t.gridModel,l=this._coordsList;if(a)i=a.coordinateSystem,Tw(l,i)<0&&(i=null);else if(r&&o)i=this.getCartesian(r.componentIndex,o.componentIndex);else if(r)n=this.getAxis("x",r.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(s){s.coordinateSystem===this&&(i=this._coordsList[0])}return{cartesian:i,axis:n}},Nw.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},Nw._initCartesian=function(e,t,i){var n={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},r={x:0,y:0};if(t.eachComponent("xAxis",o("x"),this),t.eachComponent("yAxis",o("y"),this),!r.x||!r.y)return this._axesMap={},void(this._axesList=[]);function o(t){return function(i,o){if(Rw(i,e)){var s=i.get("position");"x"===t?"top"!==s&&"bottom"!==s&&(s=n.bottom?"top":"bottom"):"left"!==s&&"right"!==s&&(s=n.left?"right":"left"),n[s]=!0;var l=new pw(t,Dw(i),[0,0],i.get("type"),s),u="category"===l.type;l.onBand=u&&i.get("boundaryGap"),l.inverse=i.get("inverse"),i.axis=l,l.model=i,l.grid=this,l.index=o,this._axesList.push(l),a[t][o]=l,r[t]++}}}this._axesMap=a,Iw(a.x,(function(t,i){Iw(a.y,(function(n,a){var r="x"+i+"y"+a,o=new cw(r);o.grid=this,o.model=e,this._coordsMap[r]=o,this._coordsList.push(o),o.addAxis(t),o.addAxis(n)}),this)}),this)},Nw._updateScale=function(e,t){function i(e,t,i){Iw(e.mapDimension(t.dim,!0),(function(i){t.scale.unionExtentFromData(e,Ow(e,i))}))}Iw(this._axesList,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeries((function(e){if(Fw(e)){var n=Gw(e),a=n[0],r=n[1];if(!Rw(a,t)||!Rw(r,t))return;var o=this.getCartesian(a.componentIndex,r.componentIndex),s=e.getData(),l=o.getAxis("x"),u=o.getAxis("y");"list"===s.type&&(i(s,l),i(s,u))}}),this)},Nw.getTooltipAxes=function(e){var t=[],i=[];return Iw(this.getCartesians(),(function(n){var a=null!=e&&"auto"!==e?n.getAxis(e):n.getBaseAxis(),r=n.getOtherAxis(a);Tw(t,a)<0&&t.push(a),Tw(i,r)<0&&i.push(r)})),{baseAxes:t,otherAxes:i}};var Vw=["xAxis","yAxis"];function Gw(e,t){return Aw(Vw,(function(t){return e.getReferringComponents(t)[0]}))}function Fw(e){return"cartesian2d"===e.get("coordinateSystem")}Ew.create=function(e,t){var i=[];return e.eachComponent("grid",(function(n,a){var r=new Ew(n,e,t);r.name="grid_"+a,r.resize(n,t,!0),n.coordinateSystem=r,i.push(r)})),e.eachSeries((function(e){if(Fw(e)){var t=Gw(e),i=t[0],n=t[1],a=i.getCoordSysModel().coordinateSystem;e.coordinateSystem=a.getCartesian(i.componentIndex,n.componentIndex)}})),i},Ew.dimensions=Ew.prototype.dimensions=cw.prototype.dimensions,Sp.register("cartesian2d",Ew);var Hw=Fe.retrieve,Ww=Fe.defaults,Uw=Fe.extend,jw=Fe.each,Zw=Cc.isRadianAroundZero,Yw=Cc.remRadian,Xw=Hx.createSymbol,qw=ht.applyTransform,$w=Cx.shouldShowAllLabels,Kw=Math.PI,Jw=function(e,t){this.opt=t,this.axisModel=e,Ww(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new Jh.Group;var i=new Jh.Group({position:t.position.slice(),rotation:t.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i};Jw.prototype={constructor:Jw,hasBuilder:function(e){return!!Qw[e]},add:function(e){Qw[e].call(this)},getGroup:function(){return this.group}};var Qw={axisLine:function(){var e=this.opt,t=this.axisModel;if(t.get("axisLine.show")){var i=this.axisModel.axis.getExtent(),n=this._transform,a=[i[0],0],r=[i[1],0];n&&(qw(a,a,n),qw(r,r,n));var o=Uw({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new Jh.Line({anid:"line",subPixelOptimize:!0,shape:{x1:a[0],y1:a[1],x2:r[0],y2:r[1]},style:o,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1}));var s=t.get("axisLine.symbol"),l=t.get("axisLine.symbolSize"),u=t.get("axisLine.symbolOffset")||0;if("number"==typeof u&&(u=[u,u]),null!=s){"string"==typeof s&&(s=[s,s]),"string"!=typeof l&&"number"!=typeof l||(l=[l,l]);var h=l[0],c=l[1];jw([{rotate:e.rotation+Math.PI/2,offset:u[0],r:0},{rotate:e.rotation-Math.PI/2,offset:u[1],r:Math.sqrt((a[0]-r[0])*(a[0]-r[0])+(a[1]-r[1])*(a[1]-r[1]))}],(function(t,i){if("none"!==s[i]&&null!=s[i]){var n=Xw(s[i],-h/2,-c/2,h,c,o.stroke,!0),r=t.r+t.offset,l=[a[0]+r*Math.cos(e.rotation),a[1]-r*Math.sin(e.rotation)];n.attr({rotation:t.rotate,position:l,silent:!0,z2:11}),this.group.add(n)}}),this)}}},axisTickLabel:function(){var e=this.axisModel,t=this.opt,i=function(e,t,i){var n=t.axis,a=t.getModel("axisTick");if(!a.get("show")||n.scale.isBlank())return;for(var r=a.getModel("lineStyle"),o=i.tickDirection*a.get("length"),s=oS(n.getTicksCoords(),e._transform,o,Ww(r.getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")}),"ticks"),l=0;l<s.length;l++)e.group.add(s[l]);return s}(this,e,t),n=function(e,t,i){var n=t.axis,a=Hw(i.axisLabelShow,t.get("axisLabel.show"));if(!a||n.scale.isBlank())return;var r=t.getModel("axisLabel"),o=r.get("margin"),s=n.getViewLabels(),l=(Hw(i.labelRotate,r.get("rotate"))||0)*Kw/180,u=tS(i.rotation,l,i.labelDirection),h=t.getCategories&&t.getCategories(!0),c=[],d=iS(t),p=t.get("triggerEvent");return jw(s,(function(a,s){var l=a.tickValue,f=a.formattedLabel,g=a.rawLabel,m=r;h&&h[l]&&h[l].textStyle&&(m=new pc(h[l].textStyle,r,t.ecModel));var v=m.getTextColor()||t.get("axisLine.lineStyle.color"),y=[n.dataToCoord(l),i.labelOffset+i.labelDirection*o],x=new Jh.Text({anid:"label_"+l,position:y,rotation:u.rotation,silent:d,z2:10});Jh.setTextStyle(x.style,m,{text:f,textAlign:m.getShallow("align",!0)||u.textAlign,textVerticalAlign:m.getShallow("verticalAlign",!0)||m.getShallow("baseline",!0)||u.textVerticalAlign,textFill:"function"==typeof v?v("category"===n.type?g:"value"===n.type?l+"":l,s):v}),p&&(x.eventData=eS(t),x.eventData.targetType="axisLabel",x.eventData.value=g),e._dumbGroup.add(x),x.updateTransform(),c.push(x),e.group.add(x),x.decomposeTransform()})),c}(this,e,t);!function(e,t,i){if($w(e.axis))return;var n=e.get("axisLabel.showMinLabel"),a=e.get("axisLabel.showMaxLabel");t=t||[],i=i||[];var r=t[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(nS(r),nS(u)):aS(r,o)&&(n?(nS(o),nS(h)):(nS(r),nS(u)));!1===a?(nS(s),nS(c)):aS(l,s)&&(a?(nS(l),nS(d)):(nS(s),nS(c)))}(e,n,i),function(e,t,i){var n=t.axis,a=t.getModel("minorTick");if(!a.get("show")||n.scale.isBlank())return;var r=n.getMinorTicksCoords();if(!r.length)return;for(var o=a.getModel("lineStyle"),s=i.tickDirection*a.get("length"),l=Ww(o.getLineStyle(),Ww(t.getModel("axisTick").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})),u=0;u<r.length;u++)for(var h=oS(r[u],e._transform,s,l,"minorticks_"+u),c=0;c<h.length;c++)e.group.add(h[c])}(this,e,t)},axisName:function(){var e=this.opt,t=this.axisModel,i=Hw(e.axisName,t.get("name"));if(i){var n,a,r=t.get("nameLocation"),o=e.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=this.axisModel.axis.getExtent(),h=u[0]>u[1]?-1:1,c=["start"===r?u[0]-h*l:"end"===r?u[1]+h*l:(u[0]+u[1])/2,rS(r)?e.labelOffset+o*l:0],d=t.get("nameRotate");null!=d&&(d=d*Kw/180),rS(r)?n=tS(e.rotation,null!=d?d:e.rotation,o):(n=function(e,t,i,n){var a,r,o=Yw(i-e.rotation),s=n[0]>n[1],l="start"===t&&!s||"start"!==t&&s;Zw(o-Kw/2)?(r=l?"bottom":"top",a="center"):Zw(o-1.5*Kw)?(r=l?"top":"bottom",a="center"):(r="middle",a=o<1.5*Kw&&o>Kw/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:a,textVerticalAlign:r}}(e,r,d||0,u),null!=(a=e.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(n.rotation)),!isFinite(a)&&(a=null)));var p=s.getFont(),f=t.get("nameTruncate",!0)||{},g=f.ellipsis,m=Hw(e.nameTruncateMaxWidth,f.maxWidth,a),v=null!=g&&null!=m?Fc.truncateText(i,m,p,g,{minChar:2,placeholder:f.placeholder}):i,y=t.get("tooltip",!0),x=t.mainType,_={componentType:x,name:i,$vars:["name"]};_[x+"Index"]=t.componentIndex;var b=new Jh.Text({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:iS(t),z2:1,tooltip:y&&y.show?Uw({content:i,formatter:function(){return i},formatterParams:_},y):null});Jh.setTextStyle(b.style,s,{text:v,textFont:p,textFill:s.getTextColor()||t.get("axisLine.lineStyle.color"),textAlign:s.get("align")||n.textAlign,textVerticalAlign:s.get("verticalAlign")||n.textVerticalAlign}),t.get("triggerEvent")&&(b.eventData=eS(t),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},eS=Jw.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},tS=Jw.innerTextLayout=function(e,t,i){var n,a,r=Yw(t-e);return Zw(r)?(a=i>0?"top":"bottom",n="center"):Zw(r-Kw)?(a=i>0?"bottom":"top",n="center"):(a="middle",n=r>0&&r<Kw?i>0?"right":"left":i>0?"left":"right"),{rotation:r,textAlign:n,textVerticalAlign:a}};var iS=Jw.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)};function nS(e){e&&(e.ignore=!0)}function aS(e,t,i){var n=e&&e.getBoundingRect().clone(),a=t&&t.getBoundingRect().clone();if(n&&a){var r=ri.identity([]);return ri.rotate(r,r,-e.rotation),n.applyTransform(ri.mul([],r,e.getLocalTransform())),a.applyTransform(ri.mul([],r,t.getLocalTransform())),n.intersect(a)}}function rS(e){return"middle"===e||"center"===e}function oS(e,t,i,n,a){for(var r=[],o=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=i,t&&(qw(o,o,t),qw(s,s,t));var h=new Jh.Line({anid:a+"_"+e[l].tickValue,subPixelOptimize:!0,shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,silent:!0});r.push(h)}return r}var sS=Jw,lS=Fe.each,uS=Fe.curry;function hS(e,t){return"all"===e||Fe.isArray(e)&&Fe.indexOf(e,t)>=0||e===t}function cS(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[pS(e)]}function dS(e){return!!e.get("handle.show")}function pS(e){return e.type+"||"+e.id}var fS=function(e,t){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,i){var n=t.getComponent("tooltip"),a=t.getComponent("axisPointer"),r=a.get("link",!0)||[],o=[];lS(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var s=pS(i.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=i;var u=i.model.getModel("tooltip",n);if(lS(i.getAxes(),uS(p,!1,null)),i.getTooltipAxes&&n&&u.get("show")){var h="axis"===u.get("trigger"),c="cross"===u.get("axisPointer.type"),d=i.getTooltipAxes(u.get("axisPointer.axis"));(h||c)&&lS(d.baseAxes,uS(p,!c||"cross",h)),c&&lS(d.otherAxes,uS(p,"cross",!1))}}function p(n,s,h){var c=h.model.getModel("axisPointer",a),d=c.get("show");if(d&&("auto"!==d||n||dS(c))){null==s&&(s=c.get("triggerTooltip")),c=n?function(e,t,i,n,a,r){var o=t.getModel("axisPointer"),s={};lS(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=Fe.clone(o.get(e))})),s.snap="category"!==e.type&&!!r,"cross"===o.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===a){var u=o.get("label.show");if(l.show=null==u||u,!r){var h=s.lineStyle=o.get("crossStyle");h&&Fe.defaults(l,h.textStyle)}}return e.model.getModel("axisPointer",new pc(s,i,n))}(h,u,a,t,n,s):c;var p=c.get("snap"),f=pS(h.model),g=s||p||"category"===h.type,m=e.axesInfo[f]={key:f,axis:h,coordSys:i,axisPointerModel:c,triggerTooltip:s,involveSeries:g,snap:p,useHandle:dS(c),seriesModels:[]};l[f]=m,e.seriesInvolved|=g;var v=function(e,t){for(var i=t.model,n=t.dim,a=0;a<e.length;a++){var r=e[a]||{};if(hS(r[n+"AxisId"],i.id)||hS(r[n+"AxisIndex"],i.componentIndex)||hS(r[n+"AxisName"],i.name))return a}}(r,h);if(null!=v){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[f]=m,y.mapper=r[v].mapper,m.linkGroup=y}}}}))}(i,e,t),i.seriesInvolved&&function(e,t){t.eachSeries((function(t){var i=t.coordinateSystem,n=t.get("tooltip.trigger",!0),a=t.get("tooltip.show",!0);i&&"none"!==n&&!1!==n&&"item"!==n&&!1!==a&&!1!==t.get("axisPointer.show",!0)&&lS(e.coordSysAxesInfo[pS(i.model)],(function(e){var n=e.axis;i.getAxis(n.dim)===n&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}),this)}(i,e),i},gS=function(e){var t=cS(e);if(t){var i=t.axisPointerModel,n=t.axis.scale,a=i.option,r=i.get("status"),o=i.get("value");null!=o&&(o=n.parse(o));var s=dS(i);null==r&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),a.value=o,s&&(a.status=t.axis.scale.isBlank()?"hide":"show")}},mS={collect:fS,fixValue:gS,getAxisInfo:cS,getAxisPointerModel:function(e){var t=cS(e);return t&&t.axisPointerModel},makeKey:pS},vS=U_.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(e,t,i,n){this.axisPointerClass&&mS.fixValue(e),vS.superApply(this,"render",arguments),yS(this,e,t,i,n,!0)},updateAxisPointer:function(e,t,i,n,a){yS(this,e,t,i,n,!1)},remove:function(e,t){var i=this._axisPointer;i&&i.remove(t),vS.superApply(this,"remove",arguments)},dispose:function(e,t){xS(this,t),vS.superApply(this,"dispose",arguments)}});function yS(e,t,i,n,a,r){var o=vS.getAxisPointerClass(e.axisPointerClass);if(o){var s=mS.getAxisPointerModel(t);s?(e._axisPointer||(e._axisPointer=new o)).render(t,s,n,r):xS(e,n)}}function xS(e,t,i){var n=e._axisPointer;n&&n.dispose(t,i),e._axisPointer=null}var _S=[];vS.registerAxisPointerClass=function(e,t){_S[e]=t},vS.getAxisPointerClass=function(e){return e&&_S[e]};var bS=vS;var wS=function(e,t,i){i=i||{};var n=e.coordinateSystem,a=t.axis,r={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,u=a.dim,h=n.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[c[2]-p,c[3]+p]:[c[0]-p,c[1]+p];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}r.position=["y"===u?f[d[l]]:c[0],"x"===u?f[d[l]]:c[3]],r.rotation=Math.PI/2*("x"===u?0:1),r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],r.labelOffset=o?f[d[s]]-f[d.onZero]:0,t.get("axisTick.inside")&&(r.tickDirection=-r.tickDirection),Fe.retrieve(i.labelInside,t.get("axisLabel.inside"))&&(r.labelDirection=-r.labelDirection);var m=t.get("axisLabel.rotate");return r.labelRotate="top"===l?-m:m,r.z2=1,r},SS={layout:wS};var MS=function(e,t,i,n){var a=i.axis;if(!a.scale.isBlank()){var r=i.getModel("splitArea"),o=r.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),u=a.getTicksCoords({tickModel:r,clamp:!0});if(u.length){var h=s.length,c=e.__splitAreaColors,d=Fe.createHashMap(),p=0;if(c)for(var f=0;f<u.length;f++){var g=c.get(u[f].tickValue);if(null!=g){p=(g+(h-1)*f)%h;break}}var m=a.toGlobalCoord(u[0].coord),v=o.getAreaStyle();s=Fe.isArray(s)?s:[s];for(f=1;f<u.length;f++){var y,x,_,b,w=a.toGlobalCoord(u[f].coord);a.isHorizontal()?(y=m,x=l.y,_=w-y,b=l.height,m=y+_):(y=l.x,x=m,_=l.width,m=x+(b=w-x));var S=u[f-1].tickValue;null!=S&&d.set(S,p),t.add(new Jh.Rect({anid:null!=S?"area_"+S:null,shape:{x:y,y:x,width:_,height:b},style:Fe.defaults({fill:s[p]},v),silent:!0})),p=(p+1)%h}e.__splitAreaColors=d}}},IS={rectCoordAxisBuildSplitArea:MS,rectCoordAxisHandleRemove:function(e){e.__splitAreaColors=null}},AS=IS.rectCoordAxisBuildSplitArea,TS=IS.rectCoordAxisHandleRemove,CS=["axisLine","axisTickLabel","axisName"],DS=["splitArea","splitLine","minorSplitLine"],LS=bS.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,i,n){this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new Jh.Group,this.group.add(this._axisGroup),e.get("show")){var r=e.getCoordSysModel(),o=SS.layout(r,e),s=new sS(e,o);Fe.each(CS,s.add,s),this._axisGroup.add(s.getGroup()),Fe.each(DS,(function(t){e.get(t+".show")&&this["_"+t](e,r)}),this),Jh.groupTransition(a,this._axisGroup,e),LS.superCall(this,"render",e,t,i,n)}},remove:function(){TS(this)},_splitLine:function(e,t){var i=e.axis;if(!i.scale.isBlank()){var n=e.getModel("splitLine"),a=n.getModel("lineStyle"),r=a.get("color");r=Fe.isArray(r)?r:[r];for(var o=t.coordinateSystem.getRect(),s=i.isHorizontal(),l=0,u=i.getTicksCoords({tickModel:n}),h=[],c=[],d=a.getLineStyle(),p=0;p<u.length;p++){var f=i.toGlobalCoord(u[p].coord);s?(h[0]=f,h[1]=o.y,c[0]=f,c[1]=o.y+o.height):(h[0]=o.x,h[1]=f,c[0]=o.x+o.width,c[1]=f);var g=l++%r.length,m=u[p].tickValue;this._axisGroup.add(new Jh.Line({anid:null!=m?"line_"+u[p].tickValue:null,subPixelOptimize:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:Fe.defaults({stroke:r[g]},d),silent:!0}))}}},_minorSplitLine:function(e,t){var i=e.axis,n=e.getModel("minorSplitLine").getModel("lineStyle"),a=t.coordinateSystem.getRect(),r=i.isHorizontal(),o=i.getMinorTicksCoords();if(o.length)for(var s=[],l=[],u=n.getLineStyle(),h=0;h<o.length;h++)for(var c=0;c<o[h].length;c++){var d=i.toGlobalCoord(o[h][c].coord);r?(s[0]=d,s[1]=a.y,l[0]=d,l[1]=a.y+a.height):(s[0]=a.x,s[1]=d,l[0]=a.x+a.width,l[1]=d),this._axisGroup.add(new Jh.Line({anid:"minor_line_"+o[h][c].tickValue,subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,silent:!0}))}},_splitArea:function(e,t){AS(this,this._axisGroup,e,t)}});LS.extend({type:"xAxis"}),LS.extend({type:"yAxis"}),U_.extendComponentView({type:"grid",render:function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new Jh.Rect({shape:e.coordinateSystem.getRect(),style:Fe.defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))}}),U_.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})),U_.registerVisual(ew("line","circle","line")),U_.registerLayout(nw("line")),U_.registerProcessor(U_.PRIORITY.PROCESSOR.STATISTIC,ow("line"));var PS=ng.extend({type:"series.__base_bar__",getInitialData:function(e,t){return hy(this.getSource(),this,{useEncodeDefaulter:!0})},getMarkerPosition:function(e){var t=this.coordinateSystem;if(t){var i=t.dataToPoint(t.clampData(e)),n=this.getData(),a=n.getLayout("offset"),r=n.getLayout("size");return i[t.getBaseAxis().isHorizontal()?0:1]+=a+r/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});PS.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},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}}});var kS=Y_.getDefaultLabel;function OS(e,t){"outside"===e.textPosition&&(e.textPosition=t)}var RS=function(e,t,i,n,a,r,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");Jh.setLabelStyle(e,t,s,l,{labelFetcher:a,labelDataIndex:r,defaultText:kS(a.getData(),r),isRectText:!0,autoColor:n}),OS(e),OS(t)},ES={setLabel:RS},NS=Wo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),zS={getBarItemStyle:function(e){var t=NS(this,e);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(t.lineDash=i)}return t}},BS=zS,VS=(0,Jh.extendShape)({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=Math.max(t.r0||0,0),r=Math.max(t.r,0),o=.5*(r-a),s=a+o,l=t.startAngle,u=t.endAngle,h=t.clockwise,c=Math.cos(l),d=Math.sin(l),p=Math.cos(u),f=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(c*a+i,d*a+n),e.arc(c*s+i,d*s+n,o,-Math.PI+l,l,!h)),e.arc(i,n,r,l,u,!h),e.moveTo(p*r+i,f*r+n),e.arc(p*s+i,f*s+n,o,u-2*Math.PI,u-Math.PI,!h),0!==a&&(e.arc(i,n,a,u,l,h),e.moveTo(c*a+i,f*a+n)),e.closePath()}}),GS=ES.setLabel,FS=Ig.throttle,HS=Vb.createClipPath,WS=["itemStyle","barBorderWidth"],US=[0,0];Fe.extend(pc.prototype,BS),U_.extendChartView({type:"bar",render:function(e,t,i){this._updateDrawMode(e);var n=e.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(e,t,i):this._renderNormal(e,t,i)),this.group},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._incrementalRenderLarge(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e,t,i){var n,a=this.group,r=e.getData(),o=this._data,s=e.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=e.isAnimationEnabled()?e:null,h=e.get("clip",!0),c=function(e,t){var i=e.getArea&&e.getArea();if("cartesian2d"===e.type){var n=e.getBaseAxis();if("category"!==n.type||!n.onBand){var a=t.getLayout("bandWidth");n.isHorizontal()?(i.x-=a,i.width+=2*a):(i.y-=a,i.height+=2*a)}}return i}(s,r);a.removeClipPath();var d=e.get("roundCap",!0),p=e.get("showBackground",!0),f=e.getModel("backgroundStyle"),g=f.get("barBorderRadius")||0,m=[],v=this._backgroundEls||[];r.diff(o).add((function(t){var i=r.getItemModel(t),o=KS[s.type](r,t,i);if(p){var l=KS[s.type](r,t),v=function(e,t,i){var n="polar"===e.type?Jh.Sector:Jh.Rect;return new n({shape:nM(t,i,e),silent:!0,z2:0})}(s,n,l);v.useStyle(f.getBarItemStyle()),"cartesian2d"===s.type&&v.setShape("r",g),m[t]=v}if(r.hasValue(t)){if(h)if(YS[s.type](c,o))return void a.remove(y);var y=XS[s.type](t,o,n,u,!1,d);r.setItemGraphicEl(t,y),a.add(y),QS(y,r,t,i,o,e,n,"polar"===s.type)}})).update((function(t,i){var l=r.getItemModel(t),y=KS[s.type](r,t,l);if(p){var x=v[i];x.useStyle(f.getBarItemStyle()),"cartesian2d"===s.type&&x.setShape("r",g),m[t]=x;var _=KS[s.type](r,t),b=nM(n,_,s);Jh.updateProps(x,{shape:b},u,t)}var w=o.getItemGraphicEl(i);if(r.hasValue(t)){if(h)if(YS[s.type](c,y))return void a.remove(w);w?Jh.updateProps(w,{shape:y},u,t):w=XS[s.type](t,y,n,u,!0,d),r.setItemGraphicEl(t,w),a.add(w),QS(w,r,t,l,y,e,n,"polar"===s.type)}else a.remove(w)})).remove((function(e){var t=o.getItemGraphicEl(e);"cartesian2d"===s.type?t&&qS(e,u,t):t&&$S(e,u,t)})).execute();var y=this._backgroundGroup||(this._backgroundGroup=new En);y.removeAll();for(var x=0;x<m.length;++x)y.add(m[x]);a.add(y),this._backgroundEls=m,this._data=r},_renderLarge:function(e,t,i){this._clear(),tM(e,this.group);var n=e.get("clip",!0)?HS(e.coordinateSystem,!1,e):null;n?this.group.setClipPath(n):this.group.removeClipPath()},_incrementalRenderLarge:function(e,t){this._removeBackground(),tM(t,this.group,!0)},dispose:Fe.noop,remove:function(e){this._clear(e)},_clear:function(e){var t=this.group,i=this._data;e&&e.get("animation")&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(t){"sector"===t.type?$S(t.dataIndex,e,t):qS(t.dataIndex,e,t)}))):t.removeAll(),this._data=null},_removeBackground:function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null}});var jS=Math.max,ZS=Math.min,YS={cartesian2d:function(e,t){var i=t.width<0?-1:1,n=t.height<0?-1:1;i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var a=jS(t.x,e.x),r=ZS(t.x+t.width,e.x+e.width),o=jS(t.y,e.y),s=ZS(t.y+t.height,e.y+e.height);t.x=a,t.y=o,t.width=r-a,t.height=s-o;var l=t.width<0||t.height<0;return i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),l},polar:function(e){return!1}},XS={cartesian2d:function(e,t,i,n,a){var r=new Jh.Rect({shape:Fe.extend({},t),z2:1});if(r.name="item",n){var o=i?"height":"width",s={};r.shape[o]=0,s[o]=t[o],Jh[a?"updateProps":"initProps"](r,{shape:s},n,e)}return r},polar:function(e,t,i,n,a,r){var o=t.startAngle<t.endAngle,s=new(!i&&r?VS:Jh.Sector)({shape:Fe.defaults({clockwise:o},t),z2:1});if(s.name="item",n){var l=i?"r":"endAngle",u={};s.shape[l]=i?0:t.startAngle,u[l]=t[l],Jh[a?"updateProps":"initProps"](s,{shape:u},n,e)}return s}};function qS(e,t,i){i.style.text=null,Jh.updateProps(i,{shape:{width:0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}function $S(e,t,i){i.style.text=null,Jh.updateProps(i,{shape:{r:i.shape.r0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}var KS={cartesian2d:function(e,t,i){var n=e.getItemLayout(t),a=i?function(e,t){var i=e.get(WS)||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,a)}(i,n):0,r=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+r*a/2,y:n.y+o*a/2,width:n.width-r*a,height:n.height-o*a}},polar:function(e,t,i){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};function JS(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function QS(e,t,i,n,a,r,o,s){var l=t.getItemVisual(i,"color"),u=t.getItemVisual(i,"opacity"),h=t.getVisual("borderColor"),c=n.getModel("itemStyle"),d=n.getModel("emphasis.itemStyle").getBarItemStyle();s||e.setShape("r",c.get("barBorderRadius")||0),e.useStyle(Fe.defaults({stroke:JS(a)?"none":h,fill:JS(a)?"none":l,opacity:u},c.getBarItemStyle()));var p=n.getShallow("cursor");p&&e.attr("cursor",p);var f=o?a.height>0?"bottom":"top":a.width>0?"left":"right";s||GS(e.style,d,n,l,r,i,f),JS(a)&&(d.fill=d.stroke="none"),Jh.setHoverStyle(e,d)}var eM=xl.extend({type:"largeBar",shape:{points:[]},buildPath:function(e,t){for(var i=t.points,n=this.__startPoint,a=this.__baseDimIdx,r=0;r<i.length;r+=2)n[a]=i[r+a],e.moveTo(n[0],n[1]),e.lineTo(i[r],i[r+1])}});function tM(e,t,i){var n=e.getData(),a=[],r=n.getLayout("valueAxisHorizontal")?1:0;a[1-r]=n.getLayout("valueAxisStart");var o=n.getLayout("largeDataIndices"),s=n.getLayout("barWidth"),l=e.getModel("backgroundStyle");if(e.get("showBackground",!0)){var u=n.getLayout("largeBackgroundPoints"),h=[];h[1-r]=n.getLayout("backgroundStart");var c=new eM({shape:{points:u},incremental:!!i,__startPoint:h,__baseDimIdx:r,__largeDataIndices:o,__barWidth:s,silent:!0,z2:0});!function(e,t,i){var n=t.get("borderColor")||t.get("color"),a=t.getItemStyle(["color","borderColor"]);e.useStyle(a),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(c,l,n),t.add(c)}var d=new eM({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:a,__baseDimIdx:r,__largeDataIndices:o,__barWidth:s});t.add(d),function(e,t,i){var n=i.getVisual("borderColor")||i.getVisual("color"),a=t.getModel("itemStyle").getItemStyle(["color","borderColor"]);e.useStyle(a),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(d,e,n),d.seriesIndex=e.seriesIndex,e.get("silent")||(d.on("mousedown",iM),d.on("mousemove",iM))}var iM=FS((function(e){var t=function(e,t,i){var n=e.__baseDimIdx,a=1-n,r=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[a];US[0]=t,US[1]=i;for(var u=US[n],h=US[1-n],c=u-s,d=u+s,p=0,f=r.length/2;p<f;p++){var g=2*p,m=r[g+n],v=r[g+a];if(m>=c&&m<=d&&(l<=v?h>=l&&h<=v:h>=v&&h<=l))return o[p]}return-1}(this,e.offsetX,e.offsetY);this.dataIndex=t>=0?t:null}),30,!1);function nM(e,t,i){var n,a="polar"===i.type;return n=a?i.getArea():i.grid.getRect(),a?{cx:n.cx,cy:n.cy,r0:e?n.r0:t.r0,r:e?n.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}:{x:e?t.x:n.x,y:e?n.y:t.y,width:e?t.width:n.width,height:e?n.height:t.height}}var aM=Xy.layout,rM=Xy.largeLayout;U_.registerLayout(U_.PRIORITY.VISUAL.LAYOUT,Fe.curry(aM,"bar")),U_.registerLayout(U_.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rM),U_.registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}});var oM=Fe.extend,sM=Fe.isArray;var lM=function(e,t,i){t=sM(t)&&{coordDimensions:t}||oM({},t);var n=e.getSource(),a=Zv(n,t),r=new Pv(a,e);return r.initData(n,i),r},uM={updateSelectedMap:function(e){this._targetList=Fe.isArray(e)?e.slice():[],this._selectTargetMap=Fe.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),Fe.createHashMap())},select:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);"single"===this.get("selectedMode")&&this._selectTargetMap.each((function(e){e.selected=!1})),i&&(i.selected=!0)},unSelect:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);i&&(i.selected=!1)},toggleSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);if(null!=i)return this[i.selected?"unSelect":"select"](e,t),i.selected},isSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);return i&&i.selected}};var hM=function(e,t){this.getAllNames=function(){var e=t();return e.mapArray(e.getName)},this.containName=function(e){return t().indexOfName(e)>=0},this.indexOfName=function(t){return e().indexOfName(t)},this.getItemVisual=function(t,i){return e().getItemVisual(t,i)}},cM=Cc.getPercentWithPrecision,dM=Mf.retrieveRawAttr,pM=Jd.makeSeriesEncodeForNameBased,fM=U_.extendSeriesModel({type:"series.pie",init:function(e){fM.superApply(this,"init",arguments),this.legendVisualProvider=new hM(Fe.bind(this.getData,this),Fe.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(e)},mergeOption:function(e){fM.superCall(this,"mergeOption",e),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(e,t){return lM(this,{coordDimensions:["value"],encodeDefaulter:Fe.curry(pM,this)})},_createSelectableList:function(){for(var e=this.getRawData(),t=e.mapDimension("value"),i=[],n=0,a=e.count();n<a;n++)i.push({name:e.getName(n),value:e.get(t,n),selected:dM(e,n,"selected")});return i},getDataParams:function(e){var t=this.getData(),i=fM.superCall(this,"getDataParams",e),n=[];return t.each(t.mapDimension("value"),(function(e){n.push(e)})),i.percent=cM(n,e,t.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(e){Ro.defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,hoverOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:!1,show:!0,position:"outer",alignTo:"none",margin:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},animationType:"expansion",animationTypeUpdate:"transition",animationEasing:"cubicOut"}});function gM(e,t,i,n){var a=t.getData(),r=this.dataIndex,o=a.getName(r),s=t.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:e,name:o,seriesId:t.id}),a.each((function(e){mM(a.getItemGraphicEl(e),a.getItemLayout(e),t.isSelected(a.getName(e)),s,i)}))}function mM(e,t,i,n,a){var r=(t.startAngle+t.endAngle)/2,o=i?n:0,s=[Math.cos(r)*o,Math.sin(r)*o];a?e.animate().when(200,{position:s}).start("bounceOut"):e.attr("position",s)}function vM(e,t){Jh.Group.call(this);var i=new Jh.Sector({z2:2}),n=new Jh.Polyline,a=new Jh.Text;this.add(i),this.add(n),this.add(a),this.updateData(e,t,!0)}Fe.mixin(fM,uM);var yM=vM.prototype;yM.updateData=function(e,t,i){var n=this.childAt(0),a=this.childAt(1),r=this.childAt(2),o=e.hostModel,s=e.getItemModel(t),l=e.getItemLayout(t),u=Fe.extend({},l);u.label=null;var h=o.getShallow("animationTypeUpdate");i?(n.setShape(u),"scale"===o.getShallow("animationType")?(n.shape.r=l.r0,Jh.initProps(n,{shape:{r:l.r}},o,t)):(n.shape.endAngle=l.startAngle,Jh.updateProps(n,{shape:{endAngle:l.endAngle}},o,t))):"expansion"===h?n.setShape(u):Jh.updateProps(n,{shape:u},o,t);var c=e.getItemVisual(t,"color");n.useStyle(Fe.defaults({lineJoin:"bevel",fill:c},s.getModel("itemStyle").getItemStyle())),n.hoverStyle=s.getModel("emphasis.itemStyle").getItemStyle();var d=s.getShallow("cursor");d&&n.attr("cursor",d),mM(this,e.getItemLayout(t),o.isSelected(e.getName(t)),o.get("selectedOffset"),o.get("animation"));var p=!i&&"transition"===h;this._updateLabel(e,t,p),this.highDownOnUpdate=o.get("silent")?null:function(e,t){var i=o.isAnimationEnabled()&&s.get("hoverAnimation");"emphasis"===t?(a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r+o.get("hoverOffset")}},300,"elasticOut"))):(a.ignore=a.normalIgnore,r.ignore=r.normalIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r}},300,"elasticOut")))},Jh.setHoverStyle(this)},yM._updateLabel=function(e,t,i){var n=this.childAt(1),a=this.childAt(2),r=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"color");if(!s||isNaN(s.x)||isNaN(s.y))a.ignore=a.normalIgnore=a.hoverIgnore=n.ignore=n.normalIgnore=n.hoverIgnore=!0;else{var u={points:s.linePoints||[[s.x,s.y],[s.x,s.y],[s.x,s.y]]},h={x:s.x,y:s.y};i?(Jh.updateProps(n,{shape:u},r,t),Jh.updateProps(a,{style:h},r,t)):(n.attr({shape:u}),a.attr({style:h})),a.attr({rotation:s.rotation,origin:[s.x,s.y],z2:10});var c=o.getModel("label"),d=o.getModel("emphasis.label"),p=o.getModel("labelLine"),f=o.getModel("emphasis.labelLine");l=e.getItemVisual(t,"color");Jh.setLabelStyle(a.style,a.hoverStyle={},c,d,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:s.text,autoColor:l,useInsideStyle:!!s.inside},{textAlign:s.textAlign,textVerticalAlign:s.verticalAlign,opacity:e.getItemVisual(t,"opacity")}),a.ignore=a.normalIgnore=!c.get("show"),a.hoverIgnore=!d.get("show"),n.ignore=n.normalIgnore=!p.get("show"),n.hoverIgnore=!f.get("show"),n.setStyle({stroke:l,opacity:e.getItemVisual(t,"opacity")}),n.setStyle(p.getModel("lineStyle").getLineStyle()),n.hoverStyle=f.getModel("lineStyle").getLineStyle();var g=p.get("smooth");g&&!0===g&&(g=.4),n.setShape({smooth:g})}},Fe.inherits(vM,Jh.Group),_g.extend({type:"pie",init:function(){var e=new Jh.Group;this._sectorGroup=e},render:function(e,t,i,n){if(!n||n.from!==this.uid){var a=e.getData(),r=this._data,o=this.group,s=t.get("animation"),l=!r,u=e.get("animationType"),h=e.get("animationTypeUpdate"),c=Fe.curry(gM,this.uid,e,s,i),d=e.get("selectedMode");if(a.diff(r).add((function(e){var t=new vM(a,e);l&&"scale"!==u&&t.eachChild((function(e){e.stopAnimation(!0)})),d&&t.on("click",c),a.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var i=r.getItemGraphicEl(t);l||"transition"===h||i.eachChild((function(e){e.stopAnimation(!0)})),i.updateData(a,e),i.off("click"),d&&i.on("click",c),o.add(i),a.setItemGraphicEl(e,i)})).remove((function(e){var t=r.getItemGraphicEl(e);o.remove(t)})).execute(),s&&a.count()>0&&(l?"scale"!==u:"transition"!==h)){for(var p=a.getItemLayout(0),f=1;isNaN(p.startAngle)&&f<a.count();++f)p=a.getItemLayout(f);var g=Math.max(i.getWidth(),i.getHeight())/2,m=Fe.bind(o.removeClipPath,o);o.setClipPath(this._createClipPath(p.cx,p.cy,g,p.startAngle,p.clockwise,m,e,l))}else o.removeClipPath();this._data=a}},dispose:function(){},_createClipPath:function(e,t,i,n,a,r,o,s){var l=new Jh.Sector({shape:{cx:e,cy:t,r0:0,r:i,startAngle:n,endAngle:n,clockwise:a}});return(s?Jh.initProps:Jh.updateProps)(l,{shape:{endAngle:n+(a?1:-1)*Math.PI*2}},o,r),l},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,a=e[1]-i.cy,r=Math.sqrt(n*n+a*a);return r<=i.r&&r>=i.r0}}});var xM=function(e,t){Fe.each(t,(function(t){t.update="updateView",U_.registerAction(t,(function(i,n){var a={};return n.eachComponent({mainType:"series",subType:e,query:i},(function(e){e[t.method]&&e[t.method](i.name,i.dataIndex);var n=e.getData();n.each((function(t){var i=n.getName(t);a[i]=e.isSelected(i)||!1}))})),{name:i.name,selected:a,seriesId:i.seriesId}}))}))},_M=Fe.createHashMap;var bM=function(e){return{getTargetSeries:function(t){var i={},n=_M();return t.eachSeriesByType(e,(function(e){e.__paletteScope=i,n.set(e.uid,e)})),n},reset:function(e,t){var i=e.getRawData(),n={},a=e.getData();a.each((function(e){var t=a.getRawIndex(e);n[t]=e})),i.each((function(t){var r,o=n[t],s=null!=o&&a.getItemVisual(o,"color",!0),l=null!=o&&a.getItemVisual(o,"borderColor",!0);if(s&&l||(r=i.getItemModel(t)),!s){var u=r.get("itemStyle.color")||e.getColorFromPalette(i.getName(t)||t+"",e.__paletteScope,i.count());null!=o&&a.setItemVisual(o,"color",u)}if(!l){var h=r.get("itemStyle.borderColor");null!=o&&a.setItemVisual(o,"borderColor",h)}}))}}},wM=Cc.parsePercent,SM=Math.PI/180;function MM(e,t,i,n,a,r,o,s,l,u){function h(t,i,n,a){for(var r=t;r<i&&!(e[r].y+n>l+o);r++)if(e[r].y+=n,r>t&&r+1<i&&e[r+1].y>e[r].y+e[r].height)return void c(r,n/2);c(i-1,n/2)}function c(t,i){for(var n=t;n>=0&&!(e[n].y-i<l)&&(e[n].y-=i,!(n>0&&e[n].y>e[n-1].y+e[n-1].height));n--);}function d(e,t,i,n,a,r){for(var o=t?Number.MAX_VALUE:0,s=0,l=e.length;s<l;s++)if("none"===e[s].labelAlignTo){var u=Math.abs(e[s].y-n),h=e[s].len,c=e[s].len2,d=u<a+h?Math.sqrt((a+h+c)*(a+h+c)-u*u):Math.abs(e[s].x-i);t&&d>=o&&(d=o-10),!t&&d<=o&&(d=o+10),e[s].x=i+d*r,o=d}}e.sort((function(e,t){return e.y-t.y}));for(var p,f=0,g=e.length,m=[],v=[],y=0;y<g;y++){if("outer"===e[y].position&&"labelLine"===e[y].labelAlignTo){var x=e[y].x-u;e[y].linePoints[1][0]+=x,e[y].x=u}(p=e[y].y-f)<0&&h(y,g,-p),f=e[y].y+e[y].height}o-f<0&&c(g-1,f-o);for(y=0;y<g;y++)e[y].y>=i?v.push(e[y]):m.push(e[y]);d(m,!1,t,i,n,a),d(v,!0,t,i,n,a)}function IM(e){return"center"===e.position}var AM=function(e,t,i,n,a,r){var o,s,l=e.getData(),u=[],h=!1,c=(e.get("minShowLabelAngle")||0)*SM;l.each((function(n){var r=l.getItemLayout(n),d=l.getItemModel(n),p=d.getModel("label"),f=p.get("position")||d.get("emphasis.label.position"),g=p.get("distanceToLabelLine"),m=p.get("alignTo"),v=wM(p.get("margin"),i),y=p.get("bleedMargin"),x=p.getFont(),_=d.getModel("labelLine"),b=_.get("length");b=wM(b,i);var w=_.get("length2");if(w=wM(w,i),!(r.angle<c)){var S,M,I,A,T=(r.startAngle+r.endAngle)/2,C=Math.cos(T),D=Math.sin(T);o=r.cx,s=r.cy;var L,P=e.getFormattedLabel(n,"normal")||l.getName(n),k=Ha.getBoundingRect(P,x,A,"top"),O="inside"===f||"inner"===f;if("center"===f)S=r.cx,M=r.cy,A="center";else{var R=(O?(r.r+r.r0)/2*C:r.r*C)+o,E=(O?(r.r+r.r0)/2*D:r.r*D)+s;if(S=R+3*C,M=E+3*D,!O){var N=R+C*(b+t-r.r),z=E+D*(b+t-r.r),B=N+(C<0?-1:1)*w;S="edge"===m?C<0?a+v:a+i-v:B+(C<0?-g:g),M=z,I=[[R,E],[N,z],[B,z]]}A=O?"center":"edge"===m?C>0?"right":"left":C>0?"left":"right"}var V=p.get("rotate");L="number"==typeof V?V*(Math.PI/180):V?C<0?-T+Math.PI:-T:0,h=!!L,r.label={x:S,y:M,position:f,height:k.height,len:b,len2:w,linePoints:I,textAlign:A,verticalAlign:"middle",rotation:L,inside:O,labelDistance:g,labelAlignTo:m,labelMargin:v,bleedMargin:y,textRect:k,text:P,font:x},O||u.push(r.label)}})),!h&&e.get("avoidLabelOverlap")&&function(e,t,i,n,a,r,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<e.length;d++)IM(e[d])||(e[d].x<t?(h=Math.min(h,e[d].x),l.push(e[d])):(c=Math.max(c,e[d].x),u.push(e[d])));for(MM(u,t,i,n,1,0,r,0,s,c),MM(l,t,i,n,-1,0,r,0,s,h),d=0;d<e.length;d++){var p=e[d];if(!IM(p)){var f=p.linePoints;if(f){var g,m="edge"===p.labelAlignTo,v=p.textRect.width;(g=m?p.x<t?f[2][0]-p.labelDistance-o-p.labelMargin:o+a-p.labelMargin-f[2][0]-p.labelDistance:p.x<t?p.x-o-p.bleedMargin:o+a-p.x-p.bleedMargin)<p.textRect.width&&(p.text=Ha.truncateText(p.text,g,p.font),"edge"===p.labelAlignTo&&(v=Ha.getWidth(p.text,p.font)));var y=f[1][0]-f[2][0];m?p.x<t?f[2][0]=o+p.labelMargin+v+p.labelDistance:f[2][0]=o+a-p.labelMargin-v-p.labelDistance:(p.x<t?f[2][0]=p.x+p.labelDistance:f[2][0]=p.x-p.labelDistance,f[1][0]=f[2][0]+y),f[1][1]=f[2][1]=p.y}}}}(u,o,s,t,i,n,a,r)},TM=Cc.parsePercent,CM=Cc.linearMap,DM=2*Math.PI,LM=Math.PI/180;var PM=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),n=t.mapDimension("value"),a=function(e,t){return ed.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,i),r=e.get("center"),o=e.get("radius");Fe.isArray(o)||(o=[0,o]),Fe.isArray(r)||(r=[r,r]);var s=TM(a.width,i.getWidth()),l=TM(a.height,i.getHeight()),u=Math.min(s,l),h=TM(r[0],s)+a.x,c=TM(r[1],l)+a.y,d=TM(o[0],u/2),p=TM(o[1],u/2),f=-e.get("startAngle")*LM,g=e.get("minAngle")*LM,m=0;t.each(n,(function(e){!isNaN(e)&&m++}));var v=t.getSum(n),y=Math.PI/(v||m)*2,x=e.get("clockwise"),_=e.get("roseType"),b=e.get("stillShowZeroSum"),w=t.getDataExtent(n);w[0]=0;var S=DM,M=0,I=f,A=x?1:-1;if(t.each(n,(function(e,i){var n;if(isNaN(e))t.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:h,cy:c,r0:d,r:_?NaN:p,viewRect:a});else{(n="area"!==_?0===v&&b?y:e*y:DM/m)<g?(n=g,S-=g):M+=e;var r=I+A*n;t.setItemLayout(i,{angle:n,startAngle:I,endAngle:r,clockwise:x,cx:h,cy:c,r0:d,r:_?CM(e,w,[d,p]):p,viewRect:a}),I=r}})),S<DM&&m)if(S<=.001){var T=DM/m;t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i);n.angle=T,n.startAngle=f+A*i*T,n.endAngle=f+A*(i+1)*T}}))}else y=S/M,I=f,t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i),a=n.angle===g?g:e*y;n.startAngle=I,n.endAngle=I+A*a,I+=A*a}}));AM(e,p,a.width,a.height,a.x,a.y)}))};var kM=function(e){return{seriesType:e,reset:function(e,t){var i=t.findComponents({mainType:"legend"});if(i&&i.length){var n=e.getData();n.filterSelf((function(e){for(var t=n.getName(e),a=0;a<i.length;a++)if(!i[a].isSelected(t))return!1;return!0}))}}}};xM("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),U_.registerVisual(bM("pie")),U_.registerLayout(Fe.curry(PM,"pie")),U_.registerProcessor(kM("pie")),ng.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(e,t){return hy(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},clip:!0}});var OM=Hx.createSymbol,RM=Jh.extendShape({shape:{points:null},symbolProxy:null,softClipShape:null,buildPath:function(e,t){var i=t.points,n=t.size,a=this.symbolProxy,r=a.shape;if(!((e.getContext?e.getContext():e)&&n[0]<4))for(var o=0;o<i.length;){var s=i[o++],l=i[o++];isNaN(s)||isNaN(l)||(this.softClipShape&&!this.softClipShape.contain(s,l)||(r.x=s-n[0]/2,r.y=l-n[1]/2,r.width=n[0],r.height=n[1],a.buildPath(e,r,!0)))}},afterBrush:function(e){var t=this.shape,i=t.points,n=t.size;if(n[0]<4){this.setTransform(e);for(var a=0;a<i.length;){var r=i[a++],o=i[a++];isNaN(r)||isNaN(o)||(this.softClipShape&&!this.softClipShape.contain(r,o)||e.fillRect(r-n[0]/2,o-n[1]/2,n[0],n[1]))}this.restoreTransform(e)}},findDataIndex:function(e,t){for(var i=this.shape,n=i.points,a=i.size,r=Math.max(a[0],4),o=Math.max(a[1],4),s=n.length/2-1;s>=0;s--){var l=2*s,u=n[l]-r/2,h=n[l+1]-o/2;if(e>=u&&t>=h&&e<=u+r&&t<=h+o)return s}return-1}});function EM(){this.group=new Jh.Group}var NM=EM.prototype;NM.isPersistent=function(){return!this._incremental},NM.updateData=function(e,t){this.group.removeAll();var i=new RM({rectHover:!0,cursor:"default"});i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!1,t),this.group.add(i),this._incremental=null},NM.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("symbolPoints");this.group.eachChild((function(e){if(null!=e.startIndex){var i=2*(e.endIndex-e.startIndex),n=4*e.startIndex*2;t=new Float32Array(t.buffer,n,i)}e.setShape("points",t)}))}},NM.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new Fu({silent:!0})),this.group.add(this._incremental)):this._incremental=null},NM.incrementalUpdate=function(e,t,i){var n;this._incremental?(n=new RM,this._incremental.addDisplayable(n,!0)):((n=new RM({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(n)),n.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(n,t,!!this._incremental,i)},NM._setCommon=function(e,t,i,n){var a=t.hostModel;n=n||{};var r=t.getVisual("symbolSize");e.setShape("size",r instanceof Array?r:[r,r]),e.softClipShape=n.clipShape||null,e.symbolProxy=OM(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(a.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("color");s&&e.setColor(s),i||(e.seriesIndex=a.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>=0&&(e.dataIndex=i+(e.startIndex||0))})))},NM.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},NM._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var zM=EM;function BM(e,t,i){A_.call(this,e,t,i),this.type="value",this.angle=0,this.name="",this.model}U_.extendChartView({type:"scatter",render:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).updateData(n,{clipShape:this._getClipShape(e)}),this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(e,t,i){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var a=nw().reset(e);a.progress&&a.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_getClipShape:function(e){var t=e.coordinateSystem,i=t&&t.getArea&&t.getArea();return e.get("clip",!0)?i:null},_updateSymbolDraw:function(e,t){var i=this._symbolDraw,n=t.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new zM:new fb,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),U_.registerVisual(ew("scatter","circle")),U_.registerLayout(nw("scatter")),Fe.inherits(BM,A_);var VM=BM,GM=Cx.getScaleExtent,FM=Cx.niceScaleExtent;function HM(e,t,i){this._model=e,this.dimensions=[],this._indicatorAxes=Fe.map(e.getIndicatorModels(),(function(e,t){var i="indicator_"+t,n=new VM(i,"log"===e.get("axisType")?new fx:new Py);return n.name=e.get("name"),n.model=e,e.axis=n,this.dimensions.push(i),n}),this),this.resize(e,i),this.cx,this.cy,this.r,this.r0,this.startAngle}HM.prototype.getIndicatorAxes=function(){return this._indicatorAxes},HM.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},HM.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(i),this.cy-e*Math.sin(i)]},HM.prototype.pointToData=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=Math.sqrt(t*t+i*i);t/=n,i/=n;for(var a,r=Math.atan2(-i,t),o=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],h=Math.abs(r-u.angle);h<o&&(a=u,s=l,o=h)}return[s,+(a&&a.coordToData(n))]},HM.prototype.resize=function(e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight(),r=Math.min(n,a)/2;this.cx=Cc.parsePercent(i[0],n),this.cy=Cc.parsePercent(i[1],a),this.startAngle=e.get("startAngle")*Math.PI/180;var o=e.get("radius");"string"!=typeof o&&"number"!=typeof o||(o=[0,o]),this.r0=Cc.parsePercent(o[0],r),this.r=Cc.parsePercent(o[1],r),Fe.each(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var i=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),e.angle=i}),this)},HM.prototype.update=function(e,t){var i=this._indicatorAxes,n=this._model;Fe.each(i,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,a){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===n){var r=t.getData();Fe.each(i,(function(e){e.scale.unionExtentFromData(r,r.mapDimension(e.dim))}))}}),this);var a=n.get("splitNumber");function r(e){var t=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/t;return 2===i?i=5:i*=2,i*t}Fe.each(i,(function(e,t){var i=GM(e.scale,e.model).extent;FM(e.scale,e.model);var n=e.model,o=e.scale,s=n.getMin(),l=n.getMax(),u=o.getInterval();if(null!=s&&null!=l)o.setExtent(+s,+l),o.setInterval((l-s)/a);else if(null!=s){do{h=s+u*a,o.setExtent(+s,h),o.setInterval(u),u=r(u)}while(h<i[1]&&isFinite(h)&&isFinite(i[1]))}else if(null!=l){do{c=l-u*a,o.setExtent(c,+l),o.setInterval(u),u=r(u)}while(c>i[0]&&isFinite(c)&&isFinite(i[0]))}else{o.getTicks().length-1>a&&(u=r(u));var h=Math.ceil(i[1]/u)*u,c=Cc.round(h-u*a);o.setExtent(c,h),o.setInterval(u)}}))},HM.dimensions=[],HM.create=function(e,t){var i=[];return e.eachComponent("radar",(function(n){var a=new HM(n,e,t);i.push(a),n.coordinateSystem=a})),e.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},Sp.register("radar",HM);var WM=mw.valueAxis;function UM(e,t){return Fe.defaults({show:t},e)}U_.extendComponentModel({type:"radar",optionUpdated:function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),a=this.get("axisTick"),r=this.get("axisType"),o=this.get("axisLabel"),s=this.get("name"),l=this.get("name.show"),u=this.get("name.formatter"),h=this.get("nameGap"),c=this.get("triggerEvent"),d=Fe.map(this.get("indicator")||[],(function(d){null!=d.max&&d.max>0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var p=s;if(null!=d.color&&(p=Fe.defaults({color:d.color},s)),d=Fe.merge(Fe.clone(d),{boundaryGap:e,splitNumber:t,scale:i,axisLine:n,axisTick:a,axisType:r,axisLabel:o,name:d.text,nameLocation:"end",nameGap:h,nameTextStyle:p,triggerEvent:c},!1),l||(d.name=""),"string"==typeof u){var f=d.name;d.name=u.replace("{value}",null!=f?f:"")}else"function"==typeof u&&(d.name=u(d.name,d));var g=Fe.extend(new pc(d,null,this.ecModel),Lx);return g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this.getIndicatorModels=function(){return d}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:Fe.merge({lineStyle:{color:"#bbb"}},WM.axisLine),axisLabel:UM(WM.axisLabel,!1),axisTick:UM(WM.axisTick,!1),axisType:"interval",splitLine:UM(WM.splitLine,!0),splitArea:UM(WM.splitArea,!0),indicator:[]}});var jM=["axisLine","axisTickLabel","axisName"];U_.extendComponentView({type:"radar",render:function(e,t,i){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},_buildAxes:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes(),n=Fe.map(i,(function(e){return new sS(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));Fe.each(n,(function(e){Fe.each(jM,e.add,e),this.group.add(e.getGroup())}),this)},_buildSplitLineAndArea:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes();if(i.length){var n=e.get("shape"),a=e.getModel("splitLine"),r=e.getModel("splitArea"),o=a.getModel("lineStyle"),s=r.getModel("areaStyle"),l=a.get("show"),u=r.get("show"),h=o.get("color"),c=s.get("color");h=Fe.isArray(h)?h:[h],c=Fe.isArray(c)?c:[c];var d=[],p=[];if("circle"===n)for(var f=i[0].getTicksCoords(),g=t.cx,m=t.cy,v=0;v<f.length;v++){if(l)d[I(d,h,v)].push(new Jh.Circle({shape:{cx:g,cy:m,r:f[v].coord}}));if(u&&v<f.length-1)p[I(p,c,v)].push(new Jh.Ring({shape:{cx:g,cy:m,r0:f[v].coord,r:f[v+1].coord}}))}else{var y,x=Fe.map(i,(function(e,i){var n=e.getTicksCoords();return y=null==y?n.length-1:Math.min(n.length-1,y),Fe.map(n,(function(e){return t.coordToPoint(e.coord,i)}))})),_=[];for(v=0;v<=y;v++){for(var b=[],w=0;w<i.length;w++)b.push(x[w][v]);if(b[0]&&b.push(b[0].slice()),l)d[I(d,h,v)].push(new Jh.Polyline({shape:{points:b}}));if(u&&_)p[I(p,c,v-1)].push(new Jh.Polygon({shape:{points:b.concat(_)}}));_=b.slice().reverse()}}var S=o.getLineStyle(),M=s.getAreaStyle();Fe.each(p,(function(e,t){this.group.add(Jh.mergePath(e,{style:Fe.defaults({stroke:"none",fill:c[t%c.length]},M),silent:!0}))}),this),Fe.each(d,(function(e,t){this.group.add(Jh.mergePath(e,{style:Fe.defaults({fill:"none",stroke:h[t%h.length]},S),silent:!0}))}),this)}function I(e,t,i){var n=i%t.length;return e[n]=e[n]||[],n}}});var ZM=Fc.encodeHTML,YM=ng.extend({type:"series.radar",dependencies:["radar"],init:function(e){YM.superApply(this,"init",arguments),this.legendVisualProvider=new hM(Fe.bind(this.getData,this),Fe.bind(this.getRawData,this))},getInitialData:function(e,t){return lM(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(e){var t=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),n=this.getData().getName(e);return ZM(""===n?this.name:n)+"<br/>"+Fe.map(i,(function(i,n){var a=t.get(t.mapDimension(i.dim),e);return ZM(i.name+" : "+a)})).join("<br />")},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,n=t.getValues(Fe.map(i.dimensions,(function(e){return t.mapDimension(e)})),e,!0),a=0,r=n.length;a<r;a++)if(!isNaN(n[a])){var o=i.getIndicatorAxes();return i.coordToPoint(o[a].dataToCoord(n[a]),a)}},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});function XM(e){return!isNaN(e[0])&&!isNaN(e[1])}function qM(e){return[e.cx,e.cy]}U_.extendChartView({type:"radar",render:function(e,t,i){var n=e.coordinateSystem,a=this.group,r=e.getData(),o=this._data;function s(e,t){var i=e.getItemVisual(t,"symbol")||"circle",n=e.getItemVisual(t,"color");if("none"!==i){var a=function(e){return Fe.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),r=Hx.createSymbol(i,-1,-1,2,2,n);return r.attr({style:{strokeNoScale:!0},z2:100,scale:[a[0]/2,a[1]/2]}),r}}function l(t,i,n,a,r,o){n.removeAll();for(var l=0;l<i.length-1;l++){var u=s(a,r);u&&(u.__dimIdx=l,t[l]?(u.attr("position",t[l]),Jh[o?"initProps":"updateProps"](u,{position:i[l]},e,r)):u.attr("position",i[l]),n.add(u))}}function u(e){return Fe.map(e,(function(e){return[n.cx,n.cy]}))}r.diff(o).add((function(t){var i=r.getItemLayout(t);if(i){var n=new Jh.Polygon,a=new Jh.Polyline,o={shape:{points:i}};n.shape.points=u(i),a.shape.points=u(i),Jh.initProps(n,o,e,t),Jh.initProps(a,o,e,t);var s=new Jh.Group,h=new Jh.Group;s.add(a),s.add(n),s.add(h),l(a.shape.points,i,h,r,t,!0),r.setItemGraphicEl(t,s)}})).update((function(t,i){var n=o.getItemGraphicEl(i),a=n.childAt(0),s=n.childAt(1),u=n.childAt(2),h={shape:{points:r.getItemLayout(t)}};h.shape.points&&(l(a.shape.points,h.shape.points,u,r,t,!1),Jh.updateProps(a,h,e),Jh.updateProps(s,h,e),r.setItemGraphicEl(t,n))})).remove((function(e){a.remove(o.getItemGraphicEl(e))})).execute(),r.eachItemGraphicEl((function(e,t){var i=r.getItemModel(t),n=e.childAt(0),o=e.childAt(1),s=e.childAt(2),l=r.getItemVisual(t,"color");a.add(e),n.useStyle(Fe.defaults(i.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:l})),n.hoverStyle=i.getModel("emphasis.lineStyle").getLineStyle();var u=i.getModel("areaStyle"),h=i.getModel("emphasis.areaStyle"),c=u.isEmpty()&&u.parentModel.isEmpty(),d=h.isEmpty()&&h.parentModel.isEmpty();d=d&&c,o.ignore=c,o.useStyle(Fe.defaults(u.getAreaStyle(),{fill:l,opacity:.7})),o.hoverStyle=h.getAreaStyle();var p=i.getModel("itemStyle").getItemStyle(["color"]),f=i.getModel("emphasis.itemStyle").getItemStyle(),g=i.getModel("label"),m=i.getModel("emphasis.label");s.eachChild((function(e){e.setStyle(p),e.hoverStyle=Fe.clone(f);var i=r.get(r.dimensions[e.__dimIdx],t);(null==i||isNaN(i))&&(i=""),Jh.setLabelStyle(e.style,e.hoverStyle,g,m,{labelFetcher:r.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,autoColor:l,isRectText:!0})})),e.highDownOnUpdate=function(e,t){o.attr("ignore","emphasis"===t?d:c)},Jh.setHoverStyle(e)})),this._data=r},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var $M=function(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),i=[],n=e.coordinateSystem;if(n){var a=n.getIndicatorAxes();Fe.each(a,(function(e,r){t.each(t.mapDimension(a[r].dim),(function(e,t){i[t]=i[t]||[];var a=n.dataToPoint(e,r);i[t][r]=XM(a)?a:qM(n)}))})),t.each((function(e){var a=Fe.find(i[e],(function(e){return XM(e)}))||qM(n);i[e].push(a.slice()),t.setItemLayout(e,i[e])}))}}))};var KM=function(e){var t=e.polar;if(t){Fe.isArray(t)||(t=[t]);var i=[];Fe.each(t,(function(t,n){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],Fe.isArray(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):i.push(t)})),e.polar=i}Fe.each(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))};U_.registerVisual(bM("radar")),U_.registerVisual(ew("radar","circle")),U_.registerLayout($M),U_.registerProcessor(kM("radar")),U_.registerPreprocessor(KM);for(var JM=[126,25],QM=[[[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]]],eI=0;eI<QM.length;eI++)for(var tI=0;tI<QM[eI].length;tI++)QM[eI][tI][0]/=10.5,QM[eI][tI][1]/=-14,QM[eI][tI][0]+=JM[0],QM[eI][tI][1]+=JM[1];var iI=function(e,t){"china"===e&&t.push(new e_("南海诸岛",Fe.map(QM,(function(e){return{type:"polygon",exterior:e}})),JM))},nI={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};var aI=function(e,t){if("china"===e){var i=nI[t.name];if(i){var n=t.center;n[0]+=i[0]/10.5,n[1]+=-i[1]/14}}},rI={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var oI=function(e,t){if("world"===e){var i=rI[t.name];if(i){var n=t.center;n[0]=i[0],n[1]=i[1]}}},sI=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var lI=function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:sI[0]})},uI=Fe.each,hI=(0,Ro.makeInner)();function cI(e){for(var t,i=0;i<e.length;i++){var n=e[i].getBoundingRect();(t=t||n.clone()).union(n)}return t}var dI={load:function(e,t,i){var n=hI(t).parsed;if(n)return n;var a,r=t.specialAreas||{},o=t.geoJSON;try{a=o?i_(o,i):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return iI(e,a),uI(a,(function(t){var i=t.name;aI(e,t),oI(e,t),lI(e,t);var n=r[i];n&&t.transformTo(n.left,n.top,n.width,n.height)})),hI(t).parsed={regions:a,boundingRect:cI(a)}}},pI=Vm.parseSVG,fI=Vm.makeViewBoxTransform,gI=Fe.assert,mI=Fe.createHashMap,vI=(0,Ro.makeInner)(),yI={load:function(e,t){var i=vI(t).originRoot;if(i)return{root:i,boundingRect:vI(t).boundingRect};var n=xI(t);return vI(t).originRoot=n.root,vI(t).boundingRect=n.boundingRect,n},makeGraphic:function(e,t,i){var n=vI(t),a=n.rootMap||(n.rootMap=mI()),r=a.get(i);if(r)return r;var o=n.originRoot,s=n.boundingRect;return n.originRootHostKey?r=xI(t,s).root:(n.originRootHostKey=i,r=o),a.set(i,r)},removeGraphic:function(e,t,i){var n=vI(t),a=n.rootMap;a&&a.removeKey(i),i===n.originRootHostKey&&(n.originRootHostKey=null)}};function xI(e,t){var i,n,a=e.svgXML;try{n=(i=a&&pI(a,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,gI(null!=n)}catch(e){throw new Error("Invalid svg format\n"+e.message)}var r=i.width,o=i.height,s=i.viewBoxRect;if(t||(t=null==r||null==o?n.getBoundingRect():new On(0,0,0,0),null!=r&&(t.width=r),null!=o&&(t.height=o)),s){var l=fI(s,t.width,t.height),u=n;(n=new En).add(u),u.scale=l.scale,u.position=l.position}return n.setClipPath(new mu({shape:t.plain()})),{root:n,boundingRect:t}}var _I=yI,bI=Fe.each,wI=Fe.createHashMap,SI={geoJSON:dI,svg:_I};function MI(e){return function(t,i){var n=II(t),a=[];return bI(n,(function(n){var r=SI[n.type][e];r&&a.push(r(t,n,i))})),a}}function II(e){return Xm.retrieveMap(e)||[]}var AI={load:function(e,t,i){var n,a=[],r=wI(),o=wI(),s=II(e);return bI(s,(function(s){var l=SI[s.type].load(e,s,i);bI(l.regions,(function(e){var i=e.name;t&&t.hasOwnProperty(i)&&(e=e.cloneShallow(i=t[i])),a.push(e),r.set(i,e),o.set(i,e.center)}));var u=l.boundingRect;u&&(n?n.union(u):n=u.clone())})),{regions:a,regionsMap:r,nameCoordMap:o,boundingRect:n||new On(0,0,0,0)}},makeGraphic:MI("makeGraphic"),removeGraphic:MI("removeGraphic")},TI=Fc.encodeHTML,CI=Fc.addCommas,DI=Mf.retrieveRawAttr,LI=Jd.makeSeriesEncodeForNameBased,PI=ng.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(e){for(var t=lM(this,{coordDimensions:["value"],encodeDefaulter:Fe.curry(LI,this)}),i=t.mapDimension("value"),n=Fe.createHashMap(),a=[],r=[],o=0,s=t.count();o<s;o++){var l=t.getName(o);n.set(l,!0),a.push({name:l,value:t.get(i,o),selected:DI(t,o,"selected")})}var u=AI.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return Fe.each(u.regions,(function(e){var t=e.name;n.get(t)||(a.push({name:t}),r.push(t))})),this.updateSelectedMap(a),t.appendValues([],r),t},getHostGeoModel:function(){var e=this.option.geoIndex;return null!=e?this.dependentModels.geo[e]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},getRawValue:function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},getRegionModel:function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},formatTooltip:function(e){for(var t=this.getData(),i=CI(this.getRawValue(e)),n=t.getName(e),a=this.seriesGroup,r=[],o=0;o<a.length;o++){var s=a[o].originalData.indexOfName(n),l=t.mapDimension("value");isNaN(a[o].originalData.get(l,s))||r.push(TI(a[o].name))}return r.join(", ")+"<br />"+TI(n+" : "+i)},getTooltipPosition:function(e){if(null!=e){var t=this.getData().getName(e),i=this.coordinateSystem,n=i.getRegion(t);return n&&i.dataToPoint(n.center)}},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,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)"}},nameProperty:"name"}});Fe.mixin(PI,uM);var kI="\0_ec_interaction_mutex";function OI(e){return e[kI]||(e[kI]={})}U_.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){}));var RI={take:function(e,t,i){OI(e)[t]=i},release:function(e,t,i){var n=OI(e);n[t]===i&&(n[t]=null)},isTaken:function(e,t){return!!OI(e)[t]}};function EI(e){this.pointerChecker,this._zr=e,this._opt={};var t=Fe.bind,i=t(NI,this),n=t(zI,this),a=t(BI,this),r=t(VI,this),o=t(GI,this);vt.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(t,s){this.disable(),this._opt=Fe.defaults(Fe.clone(s)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",n),e.on("mouseup",a)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",r),e.on("pinch",o))},this.disable=function(){e.off("mousedown",i),e.off("mousemove",n),e.off("mouseup",a),e.off("mousewheel",r),e.off("pinch",o)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function NI(e){if(!(zt.isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable)){var t=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,i)&&(this._x=t,this._y=i,this._dragging=!0)}}function zI(e){if(this._dragging&&WI("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!RI.isTaken(this._zr,"globalPan")){var t=e.offsetX,i=e.offsetY,n=this._x,a=this._y,r=t-n,o=i-a;this._x=t,this._y=i,this._opt.preventDefaultMouseMove&&zt.stop(e.event),HI(this,"pan","moveOnMouseMove",e,{dx:r,dy:o,oldX:n,oldY:a,newX:t,newY:i})}}function BI(e){zt.isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)}function VI(e){var t=WI("zoomOnMouseWheel",e,this._opt),i=WI("moveOnMouseWheel",e,this._opt),n=e.wheelDelta,a=Math.abs(n),r=e.offsetX,o=e.offsetY;if(0!==n&&(t||i)){if(t){var s=a>3?1.4:a>1?1.2:1.1;FI(this,"zoom","zoomOnMouseWheel",e,{scale:n>0?s:1/s,originX:r,originY:o})}if(i){var l=Math.abs(n);FI(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:o})}}}function GI(e){RI.isTaken(this._zr,"globalPan")||FI(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY})}function FI(e,t,i,n,a){e.pointerChecker&&e.pointerChecker(n,a.originX,a.originY)&&(zt.stop(n.event),HI(e,t,i,n,a))}function HI(e,t,i,n,a){a.isAvailableBehavior=Fe.bind(WI,null,i,n),e.trigger(t,a)}function WI(e,t,i){var n=i[e];return!e||n&&(!Fe.isString(n)||t.event[n+"Key"])}Fe.mixin(EI,vt);var UI=EI;var jI=function(e,t,i,n){var a=e.target,r=e.zoomLimit,o=a.position,s=a.scale,l=e.zoom=e.zoom||1;if(l*=t,r){var u=r.min||0,h=r.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/e.zoom;e.zoom=l,o[0]-=(i-o[0])*(c-1),o[1]-=(n-o[1])*(c-1),s[0]*=c,s[1]*=c,a.dirty()},ZI={updateViewOnPan:function(e,t,i){var n=e.target,a=n.position;a[0]+=t,a[1]+=i,n.dirty()},updateViewOnZoom:jI},YI={axisPointer:1,tooltip:1,brush:1};var XI=function(e,t,i){var n=t.getComponentByElement(e.topTarget),a=n&&n.coordinateSystem;return n&&n!==i&&!YI[n.mainType]&&a&&a.model!==i},qI={onIrrelevantElement:XI},$I=qI.onIrrelevantElement,KI=mc.getUID;function JI(e){var t=e.getItemStyle(),i=e.get("areaColor");return null!=i&&(t.fill=i),t}function QI(e,t){t.eachChild((function(t){Fe.each(t.__regions,(function(i){t.trigger(e.isSelected(i.name)?"emphasis":"normal")}))}))}function eA(e,t){var i=new Jh.Group;this.uid=KI("ec_map_draw"),this._controller=new UI(e.getZr()),this._controllerHost={target:t?i:null},this.group=i,this._updateGroup=t,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new Jh.Group),i.add(this._backgroundGroup=new Jh.Group)}eA.prototype={constructor:eA,draw:function(e,t,i,n,a){var r="geo"===e.mainType,o=e.getData&&e.getData();r&&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=this._regionsGroup,h=this.group,c=s.getTransformInfo(),d=!u.childAt(0)||a;if(d)h.transform=c.roamTransform,h.decomposeTransform(),h.dirty();else{var p=new fi;p.transform=c.roamTransform,p.decomposeTransform();var f={scale:p.scale,position:p.position};l=p.scale,Jh.updateProps(h,f,e)}var g=c.rawScale,m=c.rawPosition;u.removeAll();var v=["itemStyle"],y=["emphasis","itemStyle"],x=["label"],_=["emphasis","label"],b=Fe.createHashMap();Fe.each(s.regions,(function(t){var i=b.get(t.name)||b.set(t.name,new Jh.Group),n=new Jh.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(n);var a,s=(R=e.getRegionModel(t.name)||e).getModel(v),c=R.getModel(y),p=JI(s),f=JI(c),w=R.getModel(x),S=R.getModel(_);if(o){a=o.indexOfName(t.name);var M=o.getItemVisual(a,"color",!0);M&&(p.fill=M)}var I=function(e){return[e[0]*g[0]+m[0],e[1]*g[1]+m[1]]};Fe.each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],i=0;i<e.exterior.length;++i)t.push(I(e.exterior[i]));n.shape.paths.push(new Jh.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}));for(i=0;i<(e.interiors?e.interiors.length:0);++i){for(var a=e.interiors[i],r=(t=[],0);r<a.length;++r)t.push(I(a[r]));n.shape.paths.push(new Jh.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}))}}})),n.setStyle(p),n.style.strokeNoScale=!0,n.culling=!0;var A=w.get("show"),T=S.get("show"),C=o&&isNaN(o.get(o.mapDimension("value"),a)),D=o&&o.getItemLayout(a);if(r||C&&(A||T)||D&&D.showLabel){var L,P=r?t.name:a;(!o||a>=0)&&(L=e);var k=new Jh.Text({position:I(t.center.slice()),scale:[1/h.scale[0],1/h.scale[1]],z2:10,silent:!0});if(Jh.setLabelStyle(k.style,k.hoverStyle={},w,S,{labelFetcher:L,labelDataIndex:P,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),!d){var O=[1/l[0],1/l[1]];Jh.updateProps(k,{scale:O},e)}i.add(k)}if(o)o.setItemGraphicEl(a,i);else{var R=e.getRegionModel(t.name);n.eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:R&&R.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),Jh.setHoverStyle(i,f),u.add(i)})),this._updateController(e,t,i),function(e,t,i,n,a){i.off("click"),i.off("mousedown"),t.get("selectedMode")&&(i.on("mousedown",(function(){e._mouseDownFlag=!0})),i.on("click",(function(r){if(e._mouseDownFlag){e._mouseDownFlag=!1;for(var o=r.target;!o.__regions;)o=o.parent;if(o){var s={type:("geo"===t.mainType?"geo":"map")+"ToggleSelect",batch:Fe.map(o.__regions,(function(e){return{name:e.name,from:a.uid}}))};s[t.mainType+"Id"]=t.id,n.dispatchAction(s),QI(t,i)}}})))}(this,e,u,i,n),QI(e,u)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&AI.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(e){var t=e.map;this._mapName!==t&&Fe.each(AI.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},_updateController:function(e,t,i){var n=e.coordinateSystem,a=this._controller,r=this._controllerHost;r.zoomLimit=e.get("scaleLimit"),r.zoom=n.getZoom(),a.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}a.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,ZI.updateViewOnPan(r,e.dx,e.dy),i.dispatchAction(Fe.extend(s(),{dx:e.dx,dy:e.dy}))}),this),a.off("zoom").on("zoom",(function(e){if(this._mouseDownFlag=!1,ZI.updateViewOnZoom(r,e.scale,e.originX,e.originY),i.dispatchAction(Fe.extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY})),this._updateGroup){var t=this.group.scale;this._regionsGroup.traverse((function(e){"text"===e.type&&e.attr("scale",[1/t[0],1/t[1]])}))}}),this),a.setPointerChecker((function(t,a,r){return n.getViewRectAfterRoam().contain(a,r)&&!$I(t,i,e)}))}};var tA=eA,iA="__seriesMapHighDown",nA="__seriesMapCallKey";function aA(e){var t=this[iA];t&&t.recordVersion===this[nA]&&rA(t,e)}function rA(e,t){var i=e.circle,n=e.labelModel,a=e.hoverLabelModel,r=e.emphasisText,o=e.normalText;t?(i.style.extendFrom(Jh.setTextStyle({},a,{text:a.get("show")?r:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=Jh.Z2_EMPHASIS_LIFT):(Jh.setTextStyle(i.style,n,{text:n.get("show")?o:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}U_.extendChartView({type:"map",render:function(e,t,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var a=this.group;if(a.removeAll(),!e.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===e.id)(r=this._mapDraw)&&a.add(r.group);else if(e.needsDrawMap){var r=this._mapDraw||new tA(i,!0);a.add(r.group),r.draw(e,t,i,this,n),this._mapDraw=r}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(e,t,i){var n=e.originalData,a=this.group;n.each(n.mapDimension("value"),(function(t,i){if(!isNaN(t)){var r=n.getItemLayout(i);if(r&&r.point){var o=r.point,s=r.offset,l=new Jh.Circle({style:{fill:e.getData().getVisual("color")},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:Jh.Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),p=d.getModel("label"),f=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=Fe.retrieve2(e.getFormattedLabel(c,"normal"),h),v=Fe.retrieve2(e.getFormattedLabel(c,"emphasis"),m),y=g[iA],x=Math.random();if(!y){y=g[iA]={};var _=Fe.curry(aA,!0),b=Fe.curry(aA,!1);g.on("mouseover",_).on("mouseout",b).on("emphasis",_).on("normal",b)}g[nA]=x,Fe.extend(y,{recordVersion:x,circle:l,labelModel:p,hoverLabelModel:f,emphasisText:v,normalText:m}),rA(y,!1)}a.add(l)}}}))}});var oA=function(e,t,i){var n=e.getZoom(),a=e.getCenter(),r=t.zoom,o=e.dataToPoint(a);if(null!=t.dx&&null!=t.dy){o[0]-=t.dx,o[1]-=t.dy;a=e.pointToData(o);e.setCenter(a)}if(null!=r){if(i){var s=i.min||0,l=i.max||1/0;r=Math.max(Math.min(n*r,l),s)/n}e.scale[0]*=r,e.scale[1]*=r;var u=e.position,h=(t.originX-u[0])*(r-1),c=(t.originY-u[1])*(r-1);u[0]-=h,u[1]-=c,e.updateTransform();a=e.pointToData(o);e.setCenter(a),e.setZoom(r*n)}return{center:e.getCenter(),zoom:e.getZoom()}},sA={updateCenterAndZoom:oA},lA=sA.updateCenterAndZoom;U_.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},(function(t){var n=t.coordinateSystem;if("geo"===n.type){var a=lA(n,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(a.center),t.setZoom&&t.setZoom(a.zoom),"series"===i&&Fe.each(t.seriesGroup,(function(e){e.setCenter(a.center),e.setZoom(a.zoom)}))}}))}));var uA=ht.applyTransform;function hA(){fi.call(this)}function cA(e){this.name=e,this.zoomLimit,fi.call(this),this._roamTransformable=new hA,this._rawTransformable=new hA,this._center,this._zoom}function dA(e,t,i,n){var a=i.seriesModel,r=a?a.coordinateSystem:null;return r===this?r[e](n):null}Fe.mixin(hA,fi),cA.prototype={constructor:cA,type:"view",dimensions:["x","y"],setBoundingRect:function(e,t,i,n){return this._rect=new On(e,t,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(e,t,i,n){this.transformTo(e,t,i,n),this._viewRect=new On(e,t,i,n)},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=this._rawTransformable;r.transform=a.calculateTransform(new On(e,t,i,n)),r.decomposeTransform(),this._updateTransform()},setCenter:function(e){e&&(this._center=e,this._updateCenterAndZoom())},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()},getDefaultCenter:function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),a=this.getZoom();n=ht.applyTransform([],n,e),i=ht.applyTransform([],i,e),t.origin=n,t.position=[i[0]-n[0],i[1]-n[1]],t.scale=[a,a],this._updateTransform()},_updateTransform:function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),ri.copy(this.transform||(this.transform=[]),t.transform||ri.create()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],ri.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?Fe.slice(e):ri.create(),rawScale:Fe.slice(t.scale),rawPosition:Fe.slice(t.position)}},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},dataToPoint:function(e,t,i){var n=t?this._rawTransform:this.transform;return i=i||[],n?uA(i,e,n):ht.copy(i,e)},pointToData:function(e){var t=this.invTransform;return t?uA([],e,t):[e[0],e[1]]},convertToPixel:Fe.curry(dA,"dataToPoint"),convertFromPixel:Fe.curry(dA,"pointToData"),containPoint:function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])}},Fe.mixin(cA,fi);var pA=cA;function fA(e,t,i,n){pA.call(this,e),this.map=t;var a=AI.load(t,i);this._nameCoordMap=a.nameCoordMap,this._regionsMap=a.regionsMap,this._invertLongitute=null==n||n,this.regions=a.regions,this._rect=a.boundingRect}function gA(e,t,i,n){var a=i.geoModel,r=i.seriesModel,o=a?a.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return o===this?o[e](n):null}fA.prototype={constructor:fA,type:"geo",dimensions:["lng","lat"],containCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return!0;return!1},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=this._invertLongitute;a=a.clone(),r&&(a.y=-a.y-a.height);var o=this._rawTransformable;if(o.transform=a.calculateTransform(new On(e,t,i,n)),o.decomposeTransform(),r){var s=o.scale;s[1]=-s[1]}o.updateTransform(),this._updateTransform()},getRegion:function(e){return this._regionsMap.get(e)},getRegionByCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return t[i]},addGeoCoord:function(e,t){this._nameCoordMap.set(e,t)},getGeoCoord:function(e){return this._nameCoordMap.get(e)},getBoundingRect:function(){return this._rect},dataToPoint:function(e,t,i){if("string"==typeof e&&(e=this.getGeoCoord(e)),e)return pA.prototype.dataToPoint.call(this,e,t,i)},convertToPixel:Fe.curry(gA,"dataToPoint"),convertFromPixel:Fe.curry(gA,"pointToData")},Fe.mixin(fA,pA);var mA=fA;function vA(e,t){var i=e.get("boundingCoords");if(null!=i){var n=i[0],a=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(a[0])||isNaN(a[1])||this.setBoundingRect(n[0],n[1],a[0]-n[0],a[1]-n[1])}var r,o=this.getBoundingRect(),s=e.get("layoutCenter"),l=e.get("layoutSize"),u=t.getWidth(),h=t.getHeight(),c=o.width/o.height*this.aspectScale,d=!1;if(s&&l&&(s=[Cc.parsePercent(s[0],u),Cc.parsePercent(s[1],h)],l=Cc.parsePercent(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0)),d){var p={};c>1?(p.width=l,p.height=l/c):(p.height=l,p.width=l*c),p.y=s[1]-p.height/2,p.x=s[0]-p.width/2}else(r=e.getBoxLayoutParams()).aspect=c,p=ed.getLayoutRect(r,{width:u,height:h});this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function yA(e,t){Fe.each(t.get("geoCoord"),(function(t,i){e.addGeoCoord(i,t)}))}var xA={dimensions:mA.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("geo",(function(e,n){var a=e.get("map"),r=e.get("aspectScale"),o=!0,s=Xm.retrieveMap(a);s&&s[0]&&"svg"===s[0].type?(null==r&&(r=1),o=!1):null==r&&(r=.75);var l=new mA(a+n,a,e.get("nameMap"),o);l.aspectScale=r,l.zoomLimit=e.get("scaleLimit"),i.push(l),yA(l,e),e.coordinateSystem=l,l.model=e,l.resize=vA,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=i[t]}}));var n={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();n[t]=n[t]||[],n[t].push(e)}})),Fe.each(n,(function(e,n){var a=Fe.map(e,(function(e){return e.get("nameMap")})),r=new mA(n,n,Fe.mergeAll(a));r.zoomLimit=Fe.retrieve.apply(null,Fe.map(e,(function(e){return e.get("scaleLimit")}))),i.push(r),r.resize=vA,r.aspectScale=e[0].get("aspectScale"),r.resize(e[0],t),Fe.each(e,(function(e){e.coordinateSystem=r,yA(r,e)}))})),i},getFilledRegions:function(e,t,i){for(var n=(e||[]).slice(),a=Fe.createHashMap(),r=0;r<n.length;r++)a.set(n[r].name,n[r]);var o=AI.load(t,i);return Fe.each(o.regions,(function(e){var t=e.name;!a.get(t)&&n.push({name:t})})),n}};U_.registerCoordinateSystem("geo",xA);var _A=xA;var bA=function(e){var t={};e.eachSeriesByType("map",(function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!t[n]){var a={};Fe.each(i.seriesGroup,(function(t){var i=t.coordinateSystem,n=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&n.each(n.mapDimension("value"),(function(e,t){var r=n.getName(t),o=i.getRegion(r);if(o&&!isNaN(e)){var s=a[r]||0,l=i.dataToPoint(o.center);a[r]=s+1,n.setItemLayout(t,{point:l,offset:s})}}))}));var r=i.getData();r.each((function(e){var t=r.getName(e),i=r.getItemLayout(e)||{};i.showLabel=!a[t],r.setItemLayout(e,i)})),t[n]=!0}}))};var wA=function(e){e.eachSeriesByType("map",(function(e){var t=e.get("color"),i=e.getModel("itemStyle"),n=i.get("areaColor"),a=i.get("color")||t[e.seriesIndex%t.length];e.getData().setVisual({areaColor:n,color:a})}))};var SA=function(e){var t={};e.eachSeriesByType("map",(function(e){var i=e.getHostGeoModel(),n=i?"o"+i.id:"i"+e.getMapType();(t[n]=t[n]||[]).push(e)})),Fe.each(t,(function(e,t){for(var i,n,a,r=(i=Fe.map(e,(function(e){return e.getData()})),n=e[0].get("mapValueCalculation"),a={},Fe.each(i,(function(e){e.each(e.mapDimension("value"),(function(t,i){var n="ec-"+e.getName(i);a[n]=a[n]||[],isNaN(t)||a[n].push(t)}))})),i[0].map(i[0].mapDimension("value"),(function(e,t){for(var r="ec-"+i[0].getName(t),o=0,s=1/0,l=-1/0,u=a[r].length,h=0;h<u;h++)s=Math.min(s,a[r][h]),l=Math.max(l,a[r][h]),o+=a[r][h];return 0===u?NaN:"min"===n?s:"max"===n?l:"average"===n?o/u:o}))),o=0;o<e.length;o++)e[o].originalData=e[o].getData();for(o=0;o<e.length;o++)e[o].seriesGroup=e,e[o].needsDrawMap=0===o&&!e[o].getHostGeoModel(),e[o].setData(r.cloneShallow()),e[o].mainSeries=e[0]}))};var MA=function(e){Fe.each(e.series,(function(e){e&&"map"===e.type&&(e.map=e.map||e.mapType,Fe.defaults(e,e.mapLocation))}))};U_.registerLayout(bA),U_.registerVisual(wA),U_.registerProcessor(U_.PRIORITY.PROCESSOR.STATISTIC,SA),U_.registerPreprocessor(MA),xM("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var IA=Fe.each,AA="\0__link_datas",TA="\0__link_mainData";function CA(e,t){if((n=this)[TA]===n){var i=Fe.extend({},this[AA]);i[this.dataType]=t,kA(t,i,e)}else OA(t,this.dataType,this[TA],e);var n;return t}function DA(e,t){return e.struct&&e.struct.update(this),t}function LA(e,t){return IA(t[AA],(function(i,n){i!==t&&OA(i.cloneShallow(),n,t,e)})),t}function PA(e){var t=this[TA];return null==e||null==t?t:t[AA][e]}function kA(e,t,i){e[AA]={},IA(t,(function(t,n){OA(t,n,e,i)}))}function OA(e,t,i,n){i[AA][t]=e,e[TA]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=PA}var RA=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,kA(t,i,e),IA(i,(function(i){IA(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,Fe.curry(CA,e))}))})),t.wrapMethod("cloneShallow",Fe.curry(LA,e)),IA(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,Fe.curry(DA,e))})),Fe.assert(i[t.dataType]===t)},EA=function(e,t){this.name=e||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=t};function NA(e,t){this.root,this.data,this._nodes=[],this.hostModel=e,this.levelModels=Fe.map(t||[],(function(t){return new pc(t,e,e.ecModel)}))}EA.prototype={constructor:EA,isRemoved:function(){return this.dataIndex<0},eachNode:function(e,t,i){"function"==typeof e&&(i=t,t=e,e=null),e=e||{},Fe.isString(e)&&(e={order:e});var n,a=e.order||"preorder",r=this[e.attr||"children"];"preorder"===a&&(n=t.call(i,this));for(var o=0;!n&&o<r.length;o++)r[o].eachNode(e,t,i);"postorder"===a&&t.call(i,this)},updateDepthAndHeight:function(e){var t=0;this.depth=e;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(e+1),n.height>t&&(t=n.height)}this.height=t+1},getNodeById:function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t<n;t++){var a=i[t].getNodeById(e);if(a)return a}},contains:function(e){if(e===this)return!0;for(var t=0,i=this.children,n=i.length;t<n;t++){var a=i[t].contains(e);if(a)return a}},getAncestors:function(e){for(var t=[],i=e?this:this.parentNode;i;)t.push(i),i=i.parentNode;return t.reverse(),t},getValue:function(e){var t=this.hostTree.data;return t.get(t.getDimension(e||"value"),this.dataIndex)},setLayout:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(e){if(!(this.dataIndex<0)){var t=this.hostTree.data.getItemModel(this.dataIndex),i=this.getLevelModel();return i?t.getModel(e,i.getModel(e)):t.getModel(e)}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},setVisual:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},getVisual:function(e,t){return this.hostTree.data.getItemVisual(this.dataIndex,e,t)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},isDescendantOf:function(e){return e!==this&&e.isAncestorOf(this)}},NA.prototype={constructor:NA,type:"tree",eachNode:function(e,t,i){this.root.eachNode(e,t,i)},getNodeByDataIndex:function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},getNodeByName:function(e){return this.root.getNodeByName(e)},update:function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;i<n;i++)t[i].dataIndex=-1;for(i=0,n=e.count();i<n;i++)t[e.getRawIndex(i)].dataIndex=i},clearLayouts:function(){this.data.clearItemLayouts()}},NA.createTree=function(e,t,i,n){var a=new NA(t,i&&i.levels),r=[],o=1;!function e(t,i){var n=t.value;o=Math.max(o,Fe.isArray(n)?n.length:1),r.push(t);var s=new EA(t.name,a);i?function(e,t){var i=t.children;if(e.parentNode===t)return;i.push(e),e.parentNode=t}(s,i):a.root=s,a._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(e),a.root.updateDepthAndHeight(0);var s=Zv(r,{coordDimensions:["value"],dimensionsCount:o}),l=new Pv(s,t);return l.initData(r),n&&n(l),RA({mainData:l,struct:a,structAttr:"tree"}),a.update(),a};var zA=NA,BA=Fc.encodeHTML;function VA(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function GA(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function FA(e,t,i){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:i}function HA(e,t,i){var n=i/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=i,t.hierNode.modifier+=i,t.hierNode.prelim+=i,e.hierNode.change+=n}function WA(e,t){return e.parentNode===t.parentNode?1:2}ng.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(e){var t={name:e.name,children:e.data},i=e.leaves||{},n=new pc(i,this,this.ecModel),a=zA.createTree(t,this,{},(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=a.getNodeByDataIndex(t);return i.children.length&&i.isExpand||(e.parentModel=n),e}))}));var r=0;a.eachNode("preorder",(function(e){e.depth>r&&(r=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:r;return a.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),a.data},getOrient:function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},formatTooltip:function(e){for(var t=this.getData().tree,i=t.root.children[0],n=t.getNodeByDataIndex(e),a=n.getValue(),r=n.name;n&&n!==i;)r=n.parentNode.name+"."+r,n=n.parentNode;return BA(r+(isNaN(a)||null==a?"":" : "+a))},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,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var UA=function(e){e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t,i,n=[e];t=n.pop();)if(i=t.children,t.isExpand&&i.length)for(var a=i.length-1;a>=0;a--){var r=i[a];r.hierNode={defaultAncestor:null,ancestor:r,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},n.push(r)}},jA=function(e,t){var i=e.isExpand?e.children:[],n=e.parentNode.children,a=e.hierNode.i?n[e.hierNode.i-1]:null;if(i.length){!function(e){var t=e.children,i=t.length,n=0,a=0;for(;--i>=0;){var r=t[i];r.hierNode.prelim+=n,r.hierNode.modifier+=n,a+=r.hierNode.change,n+=r.hierNode.shift+a}}(e);var r=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;a?(e.hierNode.prelim=a.hierNode.prelim+t(e,a),e.hierNode.modifier=e.hierNode.prelim-r):e.hierNode.prelim=r}else a&&(e.hierNode.prelim=a.hierNode.prelim+t(e,a));e.parentNode.hierNode.defaultAncestor=function(e,t,i,n){if(t){for(var a=e,r=e,o=r.parentNode.children[0],s=t,l=a.hierNode.modifier,u=r.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=VA(s),r=GA(r),s&&r;){a=VA(a),o=GA(o),a.hierNode.ancestor=e;var d=s.hierNode.prelim+c-r.hierNode.prelim-u+n(s,r);d>0&&(HA(FA(s,e,i),e,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=r.hierNode.modifier,l+=a.hierNode.modifier,h+=o.hierNode.modifier}s&&!VA(a)&&(a.hierNode.thread=s,a.hierNode.modifier+=c-l),r&&!GA(o)&&(o.hierNode.thread=r,o.hierNode.modifier+=u-h,i=e)}return i}(e,a,e.parentNode.hierNode.defaultAncestor||n[0],t)},ZA=function(e){return arguments.length?e:WA},YA={init:UA,firstWalk:jA,secondWalk:function(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier},separation:ZA,radialCoordinate:function(e,t){var i={};return e-=Math.PI/2,i.x=t*Math.cos(e),i.y=t*Math.sin(e),i},getViewRect:function(e,t){return ed.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}},XA=YA.radialCoordinate,qA=qI.onIrrelevantElement,$A=Cc.parsePercent,KA=Jh.extendShape({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.childPoints,n=i.length,a=t.parentPoint,r=i[0],o=i[n-1];if(1===n)return e.moveTo(a[0],a[1]),void e.lineTo(r[0],r[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=$A(t.forkPosition,1),c=[];c[l]=a[l],c[u]=a[u]+(o[u]-a[u])*h,e.moveTo(a[0],a[1]),e.lineTo(c[0],c[1]),e.moveTo(r[0],r[1]),c[l]=r[l],e.lineTo(c[0],c[1]),c[l]=o[l],e.lineTo(c[0],c[1]),e.lineTo(o[0],o[1]);for(var d=1;d<n-1;d++){var p=i[d];e.moveTo(p[0],p[1]),c[l]=p[l],e.lineTo(c[0],c[1])}}});function JA(e,t){var i=e.getItemLayout(t);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==e.getItemVisual(t,"symbol")}function QA(e,t,i){return i.itemModel=t,i.itemStyle=t.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=t.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=t.getModel("lineStyle").getLineStyle(),i.labelModel=t.getModel("label"),i.hoverLabelModel=t.getModel("emphasis.label"),!1===e.isExpand&&0!==e.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function eT(e,t,i,n,a,r){var o=!i,s=e.tree.getNodeByDataIndex(t),l=s.getModel(),u=(r=QA(s,l,r),e.tree.root),h=s.parentNode===u?s:s.parentNode||s,c=e.getItemGraphicEl(h.dataIndex),d=h.getLayout(),p=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,f=s.getLayout();o?(i=new sb(e,t,r)).attr("position",[p.x,p.y]):i.updateData(e,t,r),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=f.rawX,i.__radialRawY=f.rawY,n.add(i),e.setItemGraphicEl(t,i),Jh.updateProps(i,{position:[f.x,f.y]},a);var g=i.getSymbolPath();if("radial"===r.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(f.x===x.x&&!0===s.isExpand){var b={};b.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,b.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(b.y-x.y,b.x-x.x))<0&&(m=2*Math.PI+m),(v=b.x<x.x)&&(m-=Math.PI)}else(m=Math.atan2(f.y-x.y,f.x-x.x))<0&&(m=2*Math.PI+m),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(v=f.x<x.x)&&(m-=Math.PI):(v=f.x>x.x)||(m-=Math.PI);var w=v?"left":"right",S=r.labelModel.get("rotate"),M=S*(Math.PI/180);g.setStyle({textPosition:r.labelModel.get("position")||w,textRotation:null==S?-m:M,textOrigin:"center",verticalAlign:"middle"})}!function(e,t,i,n,a,r,o,s,l){var u=l.edgeShape,h=n.__edge;if("curve"===u)t.parentNode&&t.parentNode!==i&&(h||(h=n.__edge=new Jh.BezierCurve({shape:iT(l,a,a),style:Fe.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),Jh.updateProps(h,{shape:iT(l,r,o),style:{opacity:1}},e));else if("polyline"===u&&"orthogonal"===l.layout&&t!==i&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var c=t.children,d=[],p=0;p<c.length;p++){var f=c[p].getLayout();d.push([f.x,f.y])}h||(h=n.__edge=new KA({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:l.orient,forkPosition:l.edgeForkPosition},style:Fe.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),Jh.updateProps(h,{shape:{parentPoint:[o.x,o.y],childPoints:d},style:{opacity:1}},e)}s.add(h)}(a,s,u,i,p,d,f,n,r)}function tT(e,t,i,n,a,r){for(var o,s=e.tree.getNodeByDataIndex(t),l=e.tree.root,u=s.getModel(),h=(r=QA(s,u,r),s.parentNode===l?s:s.parentNode||s),c=r.edgeShape;null==(o=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;Jh.updateProps(i,{position:[o.x+1,o.y+1]},a,(function(){n.remove(i),e.setItemGraphicEl(t,null)})),i.fadeOut(null,{keepLabel:!0});var d=e.getItemGraphicEl(h.dataIndex).__edge,p=i.__edge||(!1===h.isExpand||1===h.children.length?d:void 0);c=r.edgeShape;p&&("curve"===c?Jh.updateProps(p,{shape:iT(r,o,o),style:{opacity:0}},a,(function(){n.remove(p)})):"polyline"===c&&"orthogonal"===r.layout&&Jh.updateProps(p,{shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]]},style:{opacity:0}},a,(function(){n.remove(p)})))}function iT(e,t,i){var n,a,r,o,s,l,u,h,c=e.orient;if("radial"===e.layout){s=t.rawX,u=t.rawY,l=i.rawX,h=i.rawY;var d=XA(s,u),p=XA(s,u+(h-u)*e.curvature),f=XA(l,h+(u-h)*e.curvature),g=XA(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:p.x,cpy1:p.y,cpx2:f.x,cpy2:f.y}}return s=t.x,u=t.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*e.curvature,a=u,r=l+(s-l)*e.curvature,o=h),"TB"!==c&&"BT"!==c||(n=s,a=u+(h-u)*e.curvature,r=l,o=h+(u-h)*e.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:a,cpx2:r,cpy2:o}}U_.extendChartView({type:"tree",init:function(e,t){this._oldTree,this._mainGroup=new Jh.Group,this._controller=new UI(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(e,t,i,n){var a=e.getData(),r=e.layoutInfo,o=this._mainGroup,s=e.get("layout");"radial"===s?o.attr("position",[r.x+r.width/2,r.y+r.height/2]):o.attr("position",[r.x,r.y]),this._updateViewCoordSys(e,r,s),this._updateController(e,t,i);var l=this._data,u={expandAndCollapse:e.get("expandAndCollapse"),layout:s,edgeShape:e.get("edgeShape"),edgeForkPosition:e.get("edgeForkPosition"),orient:e.getOrient(),curvature:e.get("lineStyle.curveness"),symbolRotate:e.get("symbolRotate"),symbolOffset:e.get("symbolOffset"),hoverAnimation:e.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};a.diff(l).add((function(t){JA(a,t)&&eT(a,t,null,o,e,u)})).update((function(t,i){var n=l.getItemGraphicEl(i);JA(a,t)?eT(a,t,n,o,e,u):n&&tT(l,i,n,o,e,u)})).remove((function(t){var i=l.getItemGraphicEl(t);i&&tT(l,t,i,o,e,u)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===u.expandAndCollapse&&a.eachItemGraphicEl((function(t,n){t.off("click").on("click",(function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:n})}))})),this._data=a},_updateViewCoordSys:function(e){var t=e.getData(),i=[];t.each((function(e){var n=t.getItemLayout(e);!n||isNaN(n.x)||isNaN(n.y)||i.push([+n.x,+n.y])}));var n=[],a=[];Os.fromPoints(i,n,a);var r=this._min,o=this._max;a[0]-n[0]==0&&(n[0]=r?r[0]:n[0]-1,a[0]=o?o[0]:a[0]+1),a[1]-n[1]==0&&(n[1]=r?r[1]:n[1]-1,a[1]=o?o[1]:a[1]+1);var s=e.coordinateSystem=new pA;s.zoomLimit=e.get("scaleLimit"),s.setBoundingRect(n[0],n[1],a[0]-n[0],a[1]-n[1]),s.setCenter(e.get("center")),s.setZoom(e.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=n,this._max=a},_updateController:function(e,t,i){var n=this._controller,a=this._controllerHost,r=this.group;n.setPointerChecker((function(t,n,a){var o=r.getBoundingRect();return o.applyTransform(r.transform),o.contain(n,a)&&!qA(t,i,e)})),n.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){ZI.updateViewOnPan(a,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})}),this).on("zoom",(function(t){ZI.updateViewOnZoom(a,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(e)}),this)},_updateNodeAndLinkScale:function(e){var t=e.getData(),i=this._getNodeGlobalScale(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},_getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=this._nodeScaleRatio,n=t.scale,a=n&&n[0]||1;return((t.getZoom()-1)*i+1)/a},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}});var nT=sA.updateCenterAndZoom;U_.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=e.dataIndex,n=t.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand}))})),U_.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=t.coordinateSystem,n=nT(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var aT=function(e,t,i){for(var n,a=[e],r=[];n=a.pop();)if(r.push(n),n.isExpand){var o=n.children;if(o.length)for(var s=0;s<o.length;s++)a.push(o[s])}for(;n=r.pop();)t(n,i)},rT=function(e,t){for(var i,n=[e];i=n.pop();)if(t(i),i.isExpand){var a=i.children;if(a.length)for(var r=a.length-1;r>=0;r--)n.push(a[r])}},oT={eachAfter:aT,eachBefore:rT},sT=oT.eachAfter,lT=oT.eachBefore,uT=YA.init,hT=YA.firstWalk,cT=YA.secondWalk,dT=YA.separation,pT=YA.radialCoordinate,fT=YA.getViewRect;var gT=function(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var i=fT(e,t);e.layoutInfo=i;var n=e.get("layout"),a=0,r=0,o=null;"radial"===n?(a=2*Math.PI,r=Math.min(i.height,i.width)/2,o=dT((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(a=i.width,r=i.height,o=dT());var s=e.getData().tree.root,l=s.children[0];if(l){uT(s),sT(l,hT,o),s.hierNode.modifier=-l.hierNode.prelim,lT(l,cT);var u=l,h=l,c=l;lT(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>h.getLayout().x&&(h=e),e.depth>c.depth&&(c=e)}));var d=u===h?1:o(u,h)/2,p=d-u.getLayout().x,f=0,g=0,m=0,v=0;if("radial"===n)f=a/(h.getLayout().x+d+p),g=r/(c.depth-1||1),lT(l,(function(e){m=(e.getLayout().x+p)*f,v=(e.depth-1)*g;var t=pT(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=r/(h.getLayout().x+d+p),f=a/(c.depth-1||1),lT(l,(function(e){v=(e.getLayout().x+p)*g,m="LR"===y?(e.depth-1)*f:a-(e.depth-1)*f,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(f=a/(h.getLayout().x+d+p),g=r/(c.depth-1||1),lT(l,(function(e){m=(e.getLayout().x+p)*f,v="TB"===y?(e.depth-1)*g:r-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))};function mT(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}U_.registerVisual(ew("tree","circle")),U_.registerLayout(gT);var vT={retrieveTargetInfo:function(e,t,i){if(e&&Fe.indexOf(t,e.type)>=0){var n=i.getData().tree.root,a=e.targetNode;if("string"==typeof a&&(a=n.getNodeById(a)),a&&n.contains(a))return{node:a};var r=e.targetNodeId;if(null!=r&&(a=n.getNodeById(r)))return{node:a}}},getPathToRoot:mT,aboveViewRoot:function(e,t){var i=mT(e);return Fe.indexOf(i,t)>=0},wrapTreePathInfo:function(e,t){for(var i=[];e;){var n=e.dataIndex;i.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return i.reverse(),i}},yT=Fc.encodeHTML,xT=Fc.addCommas,_T=vT.wrapTreePathInfo;function bT(e){var t=0;Fe.each(e.children,(function(e){bT(e);var i=e.value;Fe.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;Fe.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),Fe.isArray(e.value)?e.value[0]=i:e.value=i}ng.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,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)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(e,t){var i={name:e.name,children:e.data};bT(i);var n=e.levels||[];n=e.levels=function(e,t){var i,n=t.get("color");if(!n)return;if(e=e||[],Fe.each(e,(function(e){var t=new pc(e),n=t.get("color");(t.get("itemStyle.color")||n&&"none"!==n)&&(i=!0)})),!i){(e[0]||(e[0]={})).color=n.slice()}return e}(n,t);var a=Fe.map(n||[],(function(e){return new pc(e,this,t)}),this),r=zA.createTree(i,this,null,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=r.getNodeByDataIndex(t),n=a[i.depth];return n&&(e.parentModel=n),e}))}));return r.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=Fe.isArray(i)?xT(i[0]):xT(i),a=t.getName(e);return yT(a+": "+n)},getDataParams:function(e){var t=ng.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=_T(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},Fe.extend(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=Fe.createHashMap(),this._idIndexMapCount=0);var i=t.get(e);return null==i&&t.set(e,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},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)}});var wT=vT.wrapTreePathInfo;function ST(e){this.group=new Jh.Group,e.add(this.group)}function MT(e,t,i,n,a,r){var o=[[a?e:e-5,t],[e+i,t],[e+i,t+n],[a?e:e-5,t+n]];return!r&&o.splice(2,0,[e+i+5,t+n/2]),!a&&o.push([e,t+n/2]),o}function IT(e,t,i){e.eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&wT(i,t)}}ST.prototype={constructor:ST,render:function(e,t,i,n){var a=e.getModel("breadcrumb"),r=this.group;if(r.removeAll(),a.get("show")&&i){var o=a.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(e,l,o,s,n),ed.positionElement(r,l.pos,l.box)}},_prepare:function(e,t,i){for(var n=e;n;n=n.parentNode){var a=n.getModel().get("name"),r=i.getTextRect(a),o=Math.max(r.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:n,text:a,width:o})}},_renderContent:function(e,t,i,n,a){for(var r=0,o=t.emptyItemWidth,s=e.get("breadcrumb.height"),l=ed.getAvailableSize(t.pos,t.box),u=t.totalWidth,h=t.renderList,c=h.length-1;c>=0;c--){var d=h[c],p=d.node,f=d.width,g=d.text;u>l.width&&(u-=f-o,f=o,g=null);var m=new Jh.Polygon({shape:{points:MT(r,0,f,s,c===h.length-1,0===c)},style:Fe.defaults(i.getItemStyle(),{lineJoin:"bevel",text:g,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:Fe.curry(a,p)});this.group.add(m),IT(m,e,p),r+=f+8}},remove:function(){this.group.removeAll()}};var AT=ST;var TT=function(){var e,t=[],i={};return{add:function(e,n,a,r,o){return Fe.isString(r)&&(o=r,r=0),!i[e.id]&&(i[e.id]=1,t.push({el:e,target:n,time:a,delay:r,easing:o}),!0)},done:function(t){return e=t,this},start:function(){for(var n=t.length,a=0,r=t.length;a<r;a++){var o=t[a];o.el.animateTo(o.target,o.time,o.delay,o.easing,s)}return this;function s(){--n||(t.length=0,i={},e&&e())}}}},CT={createWrap:TT},DT=Fc.windowOpen,LT=Fe.bind,PT=Jh.Group,kT=Jh.Rect,OT=Fe.each,RT=["label"],ET=["emphasis","label"],NT=["upperLabel"],zT=["emphasis","upperLabel"],BT=Wo([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),VT=function(e){var t=BT(e);return t.stroke=t.fill=t.lineWidth=null,t};function GT(e,t,i,n,a,r,o,s,l,u){if(o){var h=o.getLayout(),c=e.getData();if(c.setItemGraphicEl(o.dataIndex,null),h&&h.isInView){var d=h.width,p=h.height,f=h.borderWidth,g=h.invisible,m=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,x=h.upperHeight,_=y&&y.length,b=o.getModel("itemStyle"),w=o.getModel("emphasis.itemStyle"),S=L("nodeGroup",PT);if(S){if(l.add(S),S.attr("position",[h.x||0,h.y||0]),S.__tmNodeWidth=d,S.__tmNodeHeight=p,h.isAboveViewRoot)return S;var M=o.getModel(),I=L("background",kT,u,1);if(I&&function(t,i,n){if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,i.setShape({x:0,y:0,width:d,height:p}),g)T(i);else{i.invisible=!1;var a=o.getVisual("borderColor",!0),r=w.get("borderColor"),s=VT(b);s.fill=a;var l=BT(w);if(l.fill=r,n){var u=d-2*f;C(s,l,a,u,x,{x:f,y:0,width:u,height:x})}else s.text=l.text=null;i.setStyle(s),Jh.setElementHoverStyle(i,l)}t.add(i)}(S,I,_&&h.upperLabelHeight),_)Jh.isHighDownDispatcher(S)&&Jh.setAsHighDownDispatcher(S,!1),I&&(Jh.setAsHighDownDispatcher(I,!0),c.setItemGraphicEl(o.dataIndex,I));else{var A=L("content",kT,u,2);A&&function(t,i){i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var n=Math.max(d-2*f,0),a=Math.max(p-2*f,0);if(i.culling=!0,i.setShape({x:f,y:f,width:n,height:a}),g)T(i);else{i.invisible=!1;var r=o.getVisual("color",!0),s=VT(b);s.fill=r;var l=BT(w);C(s,l,r,n,a),i.setStyle(s),Jh.setElementHoverStyle(i,l)}t.add(i)}(S,A),I&&Jh.isHighDownDispatcher(I)&&Jh.setAsHighDownDispatcher(I,!1),Jh.setAsHighDownDispatcher(S,!0),c.setItemGraphicEl(o.dataIndex,S)}return S}}}function T(e){!e.invisible&&r.push(e)}function C(t,i,n,a,r,s){var l=M.get("name"),u=M.getModel(s?NT:RT),c=M.getModel(s?zT:ET),d=u.getShallow("show");Jh.setLabelStyle(t,i,u,c,{defaultText:d?l:null,autoColor:n,isRectText:!0,labelFetcher:e,labelDataIndex:o.dataIndex,labelProp:s?"upperLabel":"label"}),D(t,s,h),D(i,s,h),s&&(t.textRect=Fe.clone(s)),t.truncate=d&&u.get("ellipsis")?{outerWidth:a,outerHeight:r,minChar:2}:null}function D(t,i,n){var a=t.text;if(!i&&n.isLeafRoot&&null!=a){var r=e.get("drillDownIcon",!0);t.text=r?r+" "+a:a}}function L(e,r,s,l){var u=null!=v&&i[e][v],h=a[e];return u?(i[e][v]=null,function(e,t,i){var n=e[m]={};n.old="nodeGroup"===i?t.position.slice():Fe.extend({},t.shape)}(h,u,e)):g||((u=new r({z:FT(s,l)})).__tmDepth=s,u.__tmStorageName=e,function(e,t,i){var r=e[m]={},s=o.parentNode;if(s&&(!n||"drillDown"===n.direction)){var l=0,u=0,h=a.background[s.getRawIndex()];!n&&h&&h.old&&(l=h.old.width,u=h.old.height),r.old="nodeGroup"===i?[0,u]:{x:l,y:u,width:0,height:0}}r.fadein="nodeGroup"!==i}(h,0,e)),t[e][m]=u}}function FT(e,t){var i=10*e+t;return(i-1)/i}U_.extendChartView({type:"treemap",init:function(e,t){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(e,t,i,n){var a=t.findComponents({mainType:"series",subType:"treemap",query:n});if(!(Fe.indexOf(a,e)<0)){this.seriesModel=e,this.api=i,this.ecModel=t;var r=vT.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),o=n&&n.type,s=e.layoutInfo,l=!this._oldTree,u=this._storage,h="treemapRootToNode"===o&&r&&u?{rootNodeGroup:u.nodeGroup[r.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(s),d=this._doRender(c,e,h);l||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,h),this._resetController(i),this._renderBreadcrumb(e,i,r)}},_giveContainerGroup:function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new PT,this._initEvents(t),this.group.add(t)),t.attr("position",[e.x,e.y]),t},_doRender:function(e,t,i){var n=t.getData().tree,a=this._oldTree,r={nodeGroup:[],background:[],content:[]},o={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],u=Fe.curry(GT,t,o,s,i,r,l);!function e(t,i,n,a,r){a?(i=t,OT(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new Jm(i,t,o,o).add(s).update(s).remove(Fe.curry(s,null)).execute();function o(e){return e.getId()}function s(o,s){var l=null!=o?t[o]:null,h=null!=s?i[s]:null,c=u(l,h,n,r);c&&e(l&&l.viewChildren||[],h&&h.viewChildren||[],c,a,r+1)}}(n.root?[n.root]:[],a&&a.root?[a.root]:[],e,n===a||!a,0);var h=function(e){var t={nodeGroup:[],background:[],content:[]};return e&&OT(e,(function(e,i){var n=t[i];OT(e,(function(e){e&&(n.push(e),e.__tmWillDelete=1)}))})),t}(s);return this._oldTree=n,this._storage=o,{lastsForAnimation:r,willDeleteEls:h,renderFinally:function(){OT(h,(function(e){OT(e,(function(e){e.parent&&e.parent.remove(e)}))})),OT(l,(function(e){e.invisible=!0,e.dirty()}))}}},_doAnimation:function(e,t,i,n){if(i.get("animation")){var a=i.get("animationDurationUpdate"),r=i.get("animationEasing"),o=CT.createWrap();OT(t.willDeleteEls,(function(e,t){OT(e,(function(e,i){if(!e.invisible){var s,l=e.parent;if(n&&"drillDown"===n.direction)s=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),s="nodeGroup"===t?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}s&&o.add(e,s,a,r)}}))})),OT(this._storage,(function(e,i){OT(e,(function(e,n){var s=t.lastsForAnimation[i][n],l={};s&&("nodeGroup"===i?s.old&&(l.position=e.position.slice(),e.attr("position",s.old)):(s.old&&(l.shape=Fe.extend({},e.shape),e.setShape(s.old)),s.fadein?(e.setStyle("opacity",0),l.style={opacity:1}):1!==e.style.opacity&&(l.style={opacity:1})),o.add(e,l,a,r))}))}),this),this._state="animating",o.done(LT((function(){this._state="ready",t.renderFinally()}),this)).start()}},_resetController:function(e){var t=this._controller;t||((t=this._controller=new UI(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",LT(this._onPan,this)),t.on("zoom",LT(this._onZoom,this)));var i=new On(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,n){return i.contain(t,n)}))},_clearController:function(){var e=this._controller;e&&(e.dispose(),e=null)},_onPan:function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var i=t.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+e.dx,y:i.y+e.dy,width:i.width,height:i.height}})}},_onZoom:function(e){var t=e.originX,i=e.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var a=n.getLayout();if(!a)return;var r=new On(a.x,a.y,a.width,a.height),o=this.seriesModel.layoutInfo;t-=o.x,i-=o.y;var s=ri.create();ri.translate(s,s,[-t,-i]),ri.scale(s,s,[e.scale,e.scale]),ri.translate(s,s,[t,i]),r.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:r.x,y:r.y,width:r.width,height:r.height}})}},_initEvents:function(e){e.on("click",(function(e){if("ready"===this._state){var t=this.seriesModel.get("nodeClick",!0);if(t){var i=this.findTarget(e.offsetX,e.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===t)this._zoomToNode(i);else if("link"===t){var a=n.hostTree.data.getItemModel(n.dataIndex),r=a.get("link",!0),o=a.get("target",!0)||"blank";r&&DT(r,o)}}}}}),this)},_renderBreadcrumb:function(e,t,i){i||(i=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(i={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new AT(this.group))).render(e,t,i.node,LT((function(t){"animating"!==this._state&&(vT.aboveViewRoot(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))}),this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},_rootToNode:function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},findTarget:function(e,t){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(n){var a=this._storage.background[n.getRawIndex()];if(a){var r=a.transformCoordToLocal(e,t),o=a.shape;if(!(o.x<=r[0]&&r[0]<=o.x+o.width&&o.y<=r[1]&&r[1]<=o.y+o.height))return!1;i={node:n,offsetX:r[0],offsetY:r[1]}}}),this),i}});for(var HT=function(){},WT=["treemapZoomToNode","treemapRender","treemapMove"],UT=0;UT<WT.length;UT++)U_.registerAction({type:WT[UT],update:"updateView"},HT);U_.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,i){var n=vT.retrieveTargetInfo(e,["treemapZoomToNode","treemapRootToNode"],t);if(n){var a=t.getViewRoot();a&&(e.direction=vT.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var jT=Cc.linearMap,ZT=Fe.each,YT=Fe.isObject,XT=-1,qT=function(e){var t=e.mappingMethod,i=e.type,n=this.option=Fe.clone(e);this.type=i,this.mappingMethod=t,this._normalizeData=oC[t];var a=$T[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._doMap=a._doMap[t],"piecewise"===t?(KT(n),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,Fe.each(t,(function(t,i){t.originIndex=i,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(n)):"category"===t?n.categories?function(e){var t=e.categories,i=e.visual,n=e.categoryMap={};if(ZT(t,(function(e,t){n[e]=t})),!Fe.isArray(i)){var a=[];Fe.isObject(i)?ZT(i,(function(e,t){var i=n[t];a[null!=i?i:XT]=e})):a[-1]=i,i=rC(e,a)}for(var r=t.length-1;r>=0;r--)null==i[r]&&(delete n[t[r]],t.pop())}(n):KT(n,!0):(Fe.assert("linear"!==t||n.dataExtent),KT(n))};qT.prototype={constructor:qT,mapValueToVisual:function(e){var t=this._normalizeData(e);return this._doMap(t,e)},getNormalizer:function(){return Fe.bind(this._normalizeData,this)}};var $T=qT.visualHandlers={color:{applyVisual:eC("color"),getColorMapper:function(){var e=this.option;return Fe.bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),tC.call(this,e)}:function(t,i,n){var a=!!n;return!i&&(t=this._normalizeData(t)),n=Zi.fastLerp(t,e.parsedVisual,n),a?n:Zi.stringify(n,"rgba")},this)},_doMap:{linear:function(e){return Zi.stringify(Zi.fastLerp(e,this.option.parsedVisual),"rgba")},category:tC,piecewise:function(e,t){var i=aC.call(this,t);return null==i&&(i=Zi.stringify(Zi.fastLerp(e,this.option.parsedVisual),"rgba")),i},fixed:iC}},colorHue:JT((function(e,t){return Zi.modifyHSL(e,t)})),colorSaturation:JT((function(e,t){return Zi.modifyHSL(e,null,t)})),colorLightness:JT((function(e,t){return Zi.modifyHSL(e,null,null,t)})),colorAlpha:JT((function(e,t){return Zi.modifyAlpha(e,t)})),opacity:{applyVisual:eC("opacity"),_doMap:nC([0,1])},liftZ:{applyVisual:eC("liftZ"),_doMap:{linear:iC,category:iC,piecewise:iC,fixed:iC}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);if(Fe.isString(n))i("symbol",n);else if(YT(n))for(var a in n)n.hasOwnProperty(a)&&i(a,n[a])},_doMap:{linear:QT,category:tC,piecewise:function(e,t){var i=aC.call(this,t);return null==i&&(i=QT.call(this,e)),i},fixed:iC}},symbolSize:{applyVisual:eC("symbolSize"),_doMap:nC([0,1])}};function KT(e,t){var i=e.visual,n=[];Fe.isObject(i)?ZT(i,(function(e){n.push(e)})):null!=i&&n.push(i);t||1!==n.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(n[1]=n[0]),rC(e,n)}function JT(e){return{applyVisual:function(t,i,n){t=this.mapValueToVisual(t),n("color",e(i("color"),t))},_doMap:nC([0,1])}}function QT(e){var t=this.option.visual;return t[Math.round(jT(e,[0,1],[0,t.length-1],!0))]||{}}function eC(e){return function(t,i,n){n(e,this.mapValueToVisual(t))}}function tC(e){var t=this.option.visual;return t[this.option.loop&&e!==XT?e%t.length:e]}function iC(){return this.option.visual[0]}function nC(e){return{linear:function(t){return jT(t,e,this.option.visual,!0)},category:tC,piecewise:function(t,i){var n=aC.call(this,i);return null==n&&(n=jT(t,e,this.option.visual,!0)),n},fixed:iC}}function aC(e){var t=this.option,i=t.pieceList;if(t.hasSpecialVisual){var n=i[qT.findPieceIndex(e,i)];if(n&&n.visual)return n.visual[this.type]}}function rC(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=Fe.map(t,(function(e){return Zi.parse(e)}))),t}var oC={linear:function(e){return jT(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,i=qT.findPieceIndex(e,t,!0);if(null!=i)return jT(i,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?XT:t},fixed:Fe.noop};function sC(e,t,i){return e?t<=i:t<i}qT.listVisualTypes=function(){var e=[];return Fe.each($T,(function(t,i){e.push(i)})),e},qT.addVisualHandler=function(e,t){$T[e]=t},qT.isValidType=function(e){return $T.hasOwnProperty(e)},qT.eachVisual=function(e,t,i){Fe.isObject(e)?Fe.each(e,t,i):t.call(i,e)},qT.mapVisual=function(e,t,i){var n,a=Fe.isArray(e)?[]:Fe.isObject(e)?{}:(n=!0,null);return qT.eachVisual(e,(function(e,r){var o=t.call(i,e,r);n?a=o:a[r]=o})),a},qT.retrieveVisuals=function(e){var t,i={};return e&&ZT($T,(function(n,a){e.hasOwnProperty(a)&&(i[a]=e[a],t=!0)})),t?i:null},qT.prepareVisualTypes=function(e){if(YT(e)){var t=[];ZT(e,(function(e,i){t.push(i)})),e=t}else{if(!Fe.isArray(e))return[];e=e.slice()}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},qT.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},qT.findPieceIndex=function(e,t,i){for(var n,a=1/0,r=0,o=t.length;r<o;r++){var s=t[r].value;if(null!=s){if(s===e||"string"==typeof s&&s===e+"")return r;i&&c(s,r)}}for(r=0,o=t.length;r<o;r++){var l=t[r],u=l.interval,h=l.close;if(u){if(u[0]===-1/0){if(sC(h[1],e,u[1]))return r}else if(u[1]===1/0){if(sC(h[0],u[0],e))return r}else if(sC(h[0],u[0],e)&&sC(h[1],e,u[1]))return r;i&&c(u[0],r),i&&c(u[1],r)}}if(i)return e===1/0?t.length-1:e===-1/0?0:n;function c(t,i){var r=Math.abs(t-e);r<a&&(a=r,n=i)}};var lC=qT,uC=Fe.isArray,hC="itemStyle";function cC(e,t,i,n,a,r){var o=e.getModel(),s=e.getLayout();if(s&&!s.invisible&&s.isInView){var l,u=e.getModel(hC),h=function(e,t,i,n){var a=Fe.extend({},t);return Fe.each(["color","colorAlpha","colorSaturation"],(function(r){var o=e.get(r,!0);null==o&&i&&(o=i[r]),null==o&&(o=t[r]),null==o&&(o=n.get(r)),null!=o&&(a[r]=o)})),a}(u,t,i[e.depth],n),c=u.get("borderColor"),d=u.get("borderColorSaturation");null!=d&&(c=function(e,t){return null!=t?Zi.modifyHSL(t,null,null,e):null}(d,l=dC(h))),e.setVisual("borderColor",c);var p=e.viewChildren;if(p&&p.length){var f=function(e,t,i,n,a,r){if(!r||!r.length)return;var o=fC(t,"color")||null!=a.color&&"none"!==a.color&&(fC(t,"colorAlpha")||fC(t,"colorSaturation"));if(!o)return;var s=t.get("visualMin"),l=t.get("visualMax"),u=i.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var h=t.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new lC(c);return d.__drColorMappingBy=h,d}(0,o,s,0,h,p);Fe.each(p,(function(e,t){if(e.depth>=a.length||e===a[e.depth]){var s=function(e,t,i,n,a,r){var o=Fe.extend({},t);if(a){var s=a.type,l="color"===s&&a.__drColorMappingBy,u="index"===l?n:"id"===l?r.mapIdToIndex(i.getId()):i.getValue(e.get("visualDimension"));o[s]=a.mapValueToVisual(u)}return o}(o,h,e,t,f,r);cC(e,s,i,n,a,r)}}))}else l=dC(h),e.setVisual("color",l)}}function dC(e){var t=pC(e,"color");if(t){var i=pC(e,"colorAlpha"),n=pC(e,"colorSaturation");return n&&(t=Zi.modifyHSL(t,null,null,n)),i&&(t=Zi.modifyAlpha(t,i)),t}}function pC(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function fC(e,t){var i=e.get(t);return uC(i)&&i.length?{name:t,range:i}:null}var gC={seriesType:"treemap",reset:function(e,t,i,n){var a=e.getData().tree,r=a.root,o=e.getModel(hC);r.isRemoved()||cC(r,{},Fe.map(a.levelModels,(function(e){return e?e.get(hC):null})),o,e.getViewRoot().getAncestors(),e)}},mC=Cc.parsePercent,vC=Cc.MAX_SAFE_INTEGER,yC=Math.max,xC=Math.min,_C=Fe.retrieve,bC=Fe.each,wC=["itemStyle","borderWidth"],SC=["itemStyle","gapWidth"],MC=["upperLabel","show"],IC=["upperLabel","height"],AC={seriesType:"treemap",reset:function(e,t,i,n){var a=i.getWidth(),r=i.getHeight(),o=e.option,s=ed.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=mC(_C(s.width,l[0]),a),h=mC(_C(s.height,l[1]),r),c=n&&n.type,d=vT.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===c||"treemapMove"===c?n.rootRect:null,f=e.getViewRoot(),g=vT.getPathToRoot(f);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(e,t,i,n,a){var r,o=(t||{}).node,s=[n,a];if(!o||o===i)return s;var l=n*a,u=l*e.option.zoomToNodeRatio;for(;r=o.parentNode;){for(var h=0,c=r.children,d=0,p=c.length;d<p;d++)h+=c[d].getValue();var f=o.getValue();if(0===f)return s;u*=h/f;var g=r.getModel(),m=g.get(wC);(u+=4*m*m+(3*m+Math.max(m,PC(g)))*Math.pow(u,.5))>vC&&(u=vC),o=r}u<l&&(u=l);var v=Math.pow(u/l,.5);return[n*v,a*v]}(e,d,f,u,h):p?[p.width,p.height]:[u,h],v=o.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:o.squareRatio,sort:v,leafDepth:o.leafDepth};f.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(x),TC(f,y,!1,0);x=f.getLayout();bC(g,(function(e,t){var i=(g[t+1]||f).getValue();e.setLayout(Fe.extend({dataExtent:[i,i],borderWidth:0,upperHeight:0},x))}))}var _=e.getData().tree.root;_.setLayout(function(e,t,i){if(t)return{x:t.x,y:t.y};var n={x:0,y:0};if(!i)return n;var a=i.node,r=a.getLayout();if(!r)return n;var o=[r.width/2,r.height/2],s=a;for(;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]}}(s,p,d),!0),e.setLayoutInfo(s),LC(_,new On(-s.x,-s.y,a,r),g,f,0)}};function TC(e,t,i,n){var a,r;if(!e.isRemoved()){var o=e.getLayout();a=o.width,r=o.height;var s=(p=e.getModel()).get(wC),l=p.get(SC)/2,u=PC(p),h=Math.max(s,u),c=s-l,d=h-l,p=e.getModel();e.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var f=(a=yC(a-2*c,0))*(r=yC(r-c-d,0)),g=function(e,t,i,n,a,r){var o=e.children||[],s=n.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=n.leafDepth&&n.leafDepth<=r;if(a&&!l)return e.viewChildren=[];o=Fe.filter(o,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,i){var n="asc"===t?e.getValue()-i.getValue():i.getValue()-e.getValue();return 0===n?"asc"===t?e.dataIndex-i.dataIndex:i.dataIndex-e.dataIndex:n}))}(o,s);var u=function(e,t,i){for(var n=0,a=0,r=t.length;a<r;a++)n+=t[a].getValue();var o=e.get("visualDimension");if(t&&t.length)if("value"===o&&i)s=[t[t.length-1].getValue(),t[0].getValue()],"asc"===i&&s.reverse();else{var s=[1/0,-1/0];bC(t,(function(e){var t=e.getValue(o);t<s[0]&&(s[0]=t),t>s[1]&&(s[1]=t)}))}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,i,n,a){if(!n)return i;for(var r=e.get("visibleMin"),o=a.length,s=o,l=o-1;l>=0;l--){var u=a["asc"===n?o-l-1:l].getValue();u/i*t<r&&(s=l,i-=u)}return"asc"===n?a.splice(0,o-s):a.splice(s,o-s),i}(t,i,u.sum,s,o),0===u.sum)return e.viewChildren=[];for(var h=0,c=o.length;h<c;h++){var d=o[h].getValue()/u.sum*i;o[h].setLayout({area:d})}l&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0);return e.viewChildren=o,e.setLayout({dataExtent:u.dataExtent},!0),o}(e,p,f,t,i,n);if(g.length){var m={x:c,y:d,width:a,height:r},v=xC(a,r),y=1/0,x=[];x.area=0;for(var _=0,b=g.length;_<b;){var w=g[_];x.push(w),x.area+=w.getLayout().area;var S=CC(x,v,t.squareRatio);S<=y?(_++,y=S):(x.area-=x.pop().getLayout().area,DC(x,v,m,l,!1),v=xC(m.width,m.height),x.length=x.area=0,y=1/0)}if(x.length&&DC(x,v,m,l,!0),!i){var M=p.get("childrenVisibleMin");null!=M&&f<M&&(i=!0)}for(_=0,b=g.length;_<b;_++)TC(g[_],t,i,n+1)}}}function CC(e,t,i){for(var n,a=0,r=1/0,o=0,s=e.length;o<s;o++)(n=e[o].getLayout().area)&&(n<r&&(r=n),n>a&&(a=n));var l=e.area*e.area,u=t*t*i;return l?yC(u*a/l,l/(u*r)):1/0}function DC(e,t,i,n,a){var r=t===i.width?0:1,o=1-r,s=["x","y"],l=["width","height"],u=i[s[r]],h=t?e.area/t:0;(a||h>i[l[o]])&&(h=i[l[o]]);for(var c=0,d=e.length;c<d;c++){var p=e[c],f={},g=h?p.getLayout().area/h:0,m=f[l[o]]=yC(h-2*n,0),v=i[s[r]]+i[l[r]]-u,y=c===d-1||v<g?v:g,x=f[l[r]]=yC(y-2*n,0);f[s[o]]=i[s[o]]+xC(n,m/2),f[s[r]]=u+xC(n,x/2),u+=y,p.setLayout(f,!0)}i[s[o]]+=h,i[l[o]]-=h}function LC(e,t,i,n,a){var r=e.getLayout(),o=i[a],s=o&&o===e;if(!(o&&!s||a===i.length&&e!==n)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(r),isAboveViewRoot:s},!0);var l=new On(t.x-r.x,t.y-r.y,t.width,t.height);bC(e.viewChildren||[],(function(e){LC(e,l,i,n,a+1)}))}}function PC(e){return e.get(MC)?e.get(IC):0}var kC=AC;U_.registerVisual(gC),U_.registerLayout(kC);var OC=Ho.enableClassCheck;function RC(e){return"_EC_"+e}var EC=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},NC=EC.prototype;function zC(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function BC(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}NC.type="graph",NC.isDirected=function(){return this._directed},NC.addNode=function(e,t){e=null==e?""+t:""+e;var i=this._nodesMap;if(!i[RC(e)]){var n=new zC(e,t);return n.hostGraph=this,this.nodes.push(n),i[RC(e)]=n,n}},NC.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},NC.getNodeById=function(e){return this._nodesMap[RC(e)]},NC.addEdge=function(e,t,i){var n=this._nodesMap,a=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),zC.isInstance(e)||(e=n[RC(e)]),zC.isInstance(t)||(t=n[RC(t)]),e&&t){var r=e.id+"-"+t.id;if(!a[r]){var o=new BC(e,t,i);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),a[r]=o,o}}},NC.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},NC.getEdge=function(e,t){zC.isInstance(e)&&(e=e.id),zC.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},NC.eachNode=function(e,t){for(var i=this.nodes,n=i.length,a=0;a<n;a++)i[a].dataIndex>=0&&e.call(t,i[a],a)},NC.eachEdge=function(e,t){for(var i=this.edges,n=i.length,a=0;a<n;a++)i[a].dataIndex>=0&&i[a].node1.dataIndex>=0&&i[a].node2.dataIndex>=0&&e.call(t,i[a],a)},NC.breadthFirstTraverse=function(e,t,i,n){if(zC.isInstance(t)||(t=this._nodesMap[RC(t)]),t){for(var a="out"===i?"outEdges":"in"===i?"inEdges":"edges",r=0;r<this.nodes.length;r++)this.nodes[r].__visited=!1;if(!e.call(n,t,null))for(var o=[t];o.length;){var s=o.shift(),l=s[a];for(r=0;r<l.length;r++){var u=l[r],h=u.node1===s?u.node2:u.node1;if(!h.__visited){if(e.call(n,h,s))return;o.push(h),h.__visited=!0}}}}},NC.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,a=0,r=i.length;a<r;a++)i[a].dataIndex=-1;for(a=0,r=e.count();a<r;a++)i[e.getRawIndex(a)].dataIndex=a;t.filterSelf((function(e){var i=n[t.getRawIndex(e)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0}));for(a=0,r=n.length;a<r;a++)n[a].dataIndex=-1;for(a=0,r=t.count();a<r;a++)n[t.getRawIndex(a)].dataIndex=a},NC.clone=function(){for(var e=new EC(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<i.length;n++){var a=i[n];e.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return e},zC.prototype={constructor:zC,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},BC.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var VC=function(e,t){return{getValue:function(i){var n=this[e][t];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},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)}}};Fe.mixin(zC,VC("hostGraph","data")),Fe.mixin(BC,VC("hostGraph","edgeData")),EC.Node=zC,EC.Edge=BC,OC(zC),OC(BC);var GC=EC;var FC=function(e,t,i,n,a){for(var r=new GC(n),o=0;o<e.length;o++)r.addNode(Fe.retrieve(e[o].id,e[o].name,o),o);var s=[],l=[],u=0;for(o=0;o<t.length;o++){var h=t[o],c=h.source,d=h.target;r.addEdge(c,d,u)&&(l.push(h),s.push(Fe.retrieve(h.id,c+" > "+d)),u++)}var p,f=i.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=hy(e,i);else{var g=Sp.get(f),m=g&&"view"!==g.type&&g.dimensions||[];Fe.indexOf(m,"value")<0&&m.concat(["value"]);var v=Zv(e,{coordDimensions:m});(p=new Pv(v,i)).initData(e)}var y=new Pv(["value"],i);return y.initData(l,s),a&&a(p,y),RA({mainData:p,struct:r,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r},HC=Ro.defaultEmphasis,WC=Fc.encodeHTML,UC=U_.extendSeriesModel({type:"series.graph",init:function(e){UC.superApply(this,"init",arguments);var t=this;function i(){return t._categoriesData}this.legendVisualProvider=new hM(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeOption:function(e){UC.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(e){UC.superApply(this,"mergeDefaultAndTheme",arguments),HC(e,["edgeLabel"],["show"])},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],a=this;if(n&&i)return FC(n,i,this,!0,(function(e,i){e.wrapMethod("getItemModel",(function(e){var t=a._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=a.getModel("edgeLabel"),r=new pc({label:n.option},n.parentModel,t),o=a.getModel("emphasis.edgeLabel"),s=new pc({emphasis:{label:o.option}},o.parentModel,t);function l(e){return(e=this.parsePath(e))&&"label"===e[0]?r:e&&"emphasis"===e[0]&&"label"===e[1]?s:this.parentModel}i.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(l),e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getData(),a=this.getDataParams(e,i),r=n.graph.getEdgeByIndex(e),o=n.getName(r.node1.dataIndex),s=n.getName(r.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),l=WC(l.join(" > ")),a.value&&(l+=" : "+WC(a.value)),l}return UC.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=Fe.map(this.option.categories||[],(function(e){return null!=e.value?e:Fe.extend({value:0},e)})),t=new Pv(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},isAnimationEnabled:function(){return UC.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!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,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),jC=Jh.Line.prototype,ZC=Jh.BezierCurve.prototype;function YC(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var XC=Jh.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(e,t){this[YC(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:jC.buildPath,_buildPathCurve:ZC.buildPath,pointAt:function(e){return this[YC(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:jC.pointAt,_pointAtCurve:ZC.pointAt,tangentAt:function(e){var t=this.shape,i=YC(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return ht.normalize(i,i)},_tangentAtCurve:ZC.tangentAt}),qC=Cc.round,$C=["fromSymbol","toSymbol"];function KC(e){return"_"+e+"Type"}function JC(e,t,i){var n=t.getItemVisual(i,"color"),a=t.getItemVisual(i,e),r=t.getItemVisual(i,e+"Size");if(a&&"none"!==a){Fe.isArray(r)||(r=[r,r]);var o=Hx.createSymbol(a,-r[0]/2,-r[1]/2,r[0],r[1],n);return o.name=e,o}}function QC(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 i=t[2];i?(e.cpx1=i[0],e.cpy1=i[1]):(e.cpx1=NaN,e.cpy1=NaN)}function eD(e,t,i){Jh.Group.call(this),this._createLine(e,t,i)}var tD=eD.prototype;tD.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),i=e.childOfName("toSymbol"),n=e.childOfName("label");if(t||i||!n.ignore){for(var a=1,r=this.parent;r;)r.scale&&(a/=r.scale[0]),r=r.parent;var o=e.childOfName("line");if(this.__dirty||o.__dirty){var s=o.shape.percent,l=o.pointAt(0),u=o.pointAt(s),h=ht.sub([],u,l);if(ht.normalize(h,h),t){t.attr("position",l);var c=o.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),t.attr("scale",[a*s,a*s])}if(i){i.attr("position",u);c=o.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),i.attr("scale",[a*s,a*s])}if(!n.ignore){var d,p,f,g;n.attr("position",u);var m=n.__labelDistance,v=m[0]*a,y=m[1]*a,x=s/2,_=[(c=o.tangentAt(x))[1],-c[0]],b=o.pointAt(x);_[1]>0&&(_[0]=-_[0],_[1]=-_[1]);var w,S=c[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var M=-Math.atan2(c[1],c[0]);u[0]<l[0]&&(M=Math.PI+M),n.attr("rotation",M)}switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-y,f="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=y,f="top";break;default:w=0,f="middle"}switch(n.__position){case"end":d=[h[0]*v+u[0],h[1]*y+u[1]],p=h[0]>.8?"left":h[0]<-.8?"right":"center",f=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":d=[-h[0]*v+l[0],-h[1]*y+l[1]],p=h[0]>.8?"right":h[0]<-.8?"left":"center",f=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":d=[v*S+l[0],l[1]+w],p=c[0]<0?"right":"left",g=[-v*S,-w];break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":d=[b[0],b[1]+w],p="center",g=[0,-w];break;case"insideEndTop":case"insideEnd":case"insideEndBottom":d=[-v*S+u[0],u[1]+w],p=c[0]>=0?"right":"left",g=[v*S,-w]}n.attr({style:{textVerticalAlign:n.__verticalAlign||f,textAlign:n.__textAlign||p},position:d,scale:[a,a],origin:g})}}}},tD._createLine=function(e,t,i){var n=e.hostModel,a=function(e){var t=new XC({name:"line",subPixelOptimize:!0});return QC(t.shape,e),t}(e.getItemLayout(t));a.shape.percent=0,Jh.initProps(a,{shape:{percent:1}},n,t),this.add(a);var r=new Jh.Text({name:"label",lineLabelOriginalOpacity:1});this.add(r),Fe.each($C,(function(i){var n=JC(i,e,t);this.add(n),this[KC(i)]=e.getItemVisual(t,i)}),this),this._updateCommonStl(e,t,i)},tD.updateData=function(e,t,i){var n=e.hostModel,a=this.childOfName("line"),r=e.getItemLayout(t),o={shape:{}};QC(o.shape,r),Jh.updateProps(a,o,n,t),Fe.each($C,(function(i){var n=e.getItemVisual(t,i),a=KC(i);if(this[a]!==n){this.remove(this.childOfName(i));var r=JC(i,e,t);this.add(r)}this[a]=n}),this),this._updateCommonStl(e,t,i)},tD._updateCommonStl=function(e,t,i){var n=e.hostModel,a=this.childOfName("line"),r=i&&i.lineStyle,o=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||e.hasItemOption){var u=e.getItemModel(t);r=u.getModel("lineStyle").getLineStyle(),o=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var h=e.getItemVisual(t,"color"),c=Fe.retrieve3(e.getItemVisual(t,"opacity"),r.opacity,1);a.useStyle(Fe.defaults({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},r)),a.hoverStyle=o,Fe.each($C,(function(e){var t=this.childOfName(e);t&&(t.setColor(h),t.setStyle({opacity:c}))}),this);var d,p,f=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((f||g)&&(d=h||"#000",null==(p=n.getFormattedLabel(t,"normal",e.dataType)))){var v=n.getRawValue(t);p=null==v?e.getName(t):isFinite(v)?qC(v):v}var y=f?p:null,x=g?Fe.retrieve2(n.getFormattedLabel(t,"emphasis",e.dataType),p):null,_=m.style;if(null!=y||null!=x){Jh.setTextStyle(m.style,s,{text:y},{autoColor:d}),m.__textAlign=_.textAlign,m.__verticalAlign=_.textVerticalAlign,m.__position=s.get("position")||"middle";var b=s.get("distance");Fe.isArray(b)||(b=[b,b]),m.__labelDistance=b}m.hoverStyle=null!=x?{text:x,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!f&&!g,Jh.setHoverStyle(this)},tD.highlight=function(){this.trigger("emphasis")},tD.downplay=function(){this.trigger("normal")},tD.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},tD.setLinePoints=function(e){var t=this.childOfName("line");QC(t.shape,e),t.dirty()},Fe.inherits(eD,Jh.Group);var iD=eD;function nD(e){this._ctor=e||iD,this.group=new Jh.Group}var aD=nD.prototype;function rD(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),hoverLineStyle:t.getModel("emphasis.lineStyle").getLineStyle(),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label")}}function oD(e){return isNaN(e[0])||isNaN(e[1])}function sD(e){return!oD(e[0])&&!oD(e[1])}aD.isPersistent=function(){return!0},aD.updateData=function(e){var t=this,i=t.group,n=t._lineData;t._lineData=e,n||i.removeAll();var a=rD(e);e.diff(n).add((function(i){!function(e,t,i,n){var a=t.getItemLayout(i);if(!sD(a))return;var r=new e._ctor(t,i,n);t.setItemGraphicEl(i,r),e.group.add(r)}(t,e,i,a)})).update((function(i,r){!function(e,t,i,n,a,r){var o=t.getItemGraphicEl(n);if(!sD(i.getItemLayout(a)))return void e.group.remove(o);o?o.updateData(i,a,r):o=new e._ctor(i,a,r);i.setItemGraphicEl(a,o),e.group.add(o)}(t,n,e,r,i,a)})).remove((function(e){i.remove(n.getItemGraphicEl(e))})).execute()},aD.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,i){t.updateLayout(e,i)}),this)},aD.incrementalPrepareUpdate=function(e){this._seriesScope=rD(e),this._lineData=null,this.group.removeAll()},aD.incrementalUpdate=function(e,t){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=e.useHoverLayer=!0)}for(var n=e.start;n<e.end;n++){if(sD(t.getItemLayout(n))){var a=new this._ctor(t,n,this._seriesScope);a.traverse(i),this.group.add(a),t.setItemGraphicEl(n,a)}}},aD.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},aD._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var lD=nD;var uD={getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=e.option.nodeScaleRatio,n=t.scale,a=n&&n[0]||1;return((t.getZoom()-1)*i+1)/a},getSymbolSize:function(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}},hD=uD.getSymbolSize,cD=[],dD=[],pD=[],fD=vs.quadraticAt,gD=ht.distSquare,mD=Math.abs;function vD(e,t,i){for(var n,a=e[0],r=e[1],o=e[2],s=1/0,l=i*i,u=.1,h=.1;h<=.9;h+=.1){cD[0]=fD(a[0],r[0],o[0],h),cD[1]=fD(a[1],r[1],o[1],h),(p=mD(gD(cD,t)-l))<s&&(s=p,n=h)}for(var c=0;c<32;c++){var d=n+u;dD[0]=fD(a[0],r[0],o[0],n),dD[1]=fD(a[1],r[1],o[1],n),pD[0]=fD(a[0],r[0],o[0],d),pD[1]=fD(a[1],r[1],o[1],d);var p=gD(dD,t)-l;if(mD(p)<.01)break;var f=gD(pD,t)-l;u/=2,p<0?f>=0?n+=u:n-=u:f>=0?n-=u:n+=u}return n}var yD=function(e,t){var i=[],n=vs.quadraticSubdivide,a=[[],[],[]],r=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),h=e.getVisual("toSymbol");l.__original||(l.__original=[ht.clone(l[0]),ht.clone(l[1])],l[2]&&l.__original.push(ht.clone(l[2])));var c=l.__original;if(null!=l[2]){if(ht.copy(a[0],c[0]),ht.copy(a[1],c[2]),ht.copy(a[2],c[1]),u&&"none"!==u){var d=hD(e.node1),p=vD(a,c[0],d*t);n(a[0][0],a[1][0],a[2][0],p,i),a[0][0]=i[3],a[1][0]=i[4],n(a[0][1],a[1][1],a[2][1],p,i),a[0][1]=i[3],a[1][1]=i[4]}if(h&&"none"!==h){d=hD(e.node2),p=vD(a,c[1],d*t);n(a[0][0],a[1][0],a[2][0],p,i),a[1][0]=i[1],a[2][0]=i[2],n(a[0][1],a[1][1],a[2][1],p,i),a[1][1]=i[1],a[2][1]=i[2]}ht.copy(l[0],a[0]),ht.copy(l[1],a[2]),ht.copy(l[2],a[1])}else{if(ht.copy(r[0],c[0]),ht.copy(r[1],c[1]),ht.sub(o,r[1],r[0]),ht.normalize(o,o),u&&"none"!==u){d=hD(e.node1);ht.scaleAndAdd(r[0],r[0],o,d*t)}if(h&&"none"!==h){d=hD(e.node2);ht.scaleAndAdd(r[1],r[1],o,-d*t)}ht.copy(l[0],r[0]),ht.copy(l[1],r[1])}}))},xD=qI.onIrrelevantElement,_D=uD.getNodeGlobalScale,bD="__focusNodeAdjacency",wD="__unfocusNodeAdjacency",SD=["itemStyle","opacity"],MD=["lineStyle","opacity"];function ID(e,t){var i=e.getVisual("opacity");return null!=i?i:e.getModel().get(t)}function AD(e,t,i){var n=e.getGraphicEl(),a=ID(e,t);null!=i&&(null==a&&(a=1),a*=i),n.downplay&&n.downplay(),n.traverse((function(e){if(!e.isGroup){var t=e.lineLabelOriginalOpacity;null!=t&&null==i||(t=a),e.setStyle("opacity",t)}}))}function TD(e,t){var i=ID(e,t),n=e.getGraphicEl();n.traverse((function(e){!e.isGroup&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}U_.extendChartView({type:"graph",init:function(e,t){var i=new fb,n=new lD,a=this.group;this._controller=new UI(t.getZr()),this._controllerHost={target:a},a.add(i.group),a.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(e,t,i){var n=this,a=e.coordinateSystem;this._model=e;var r=this._symbolDraw,o=this._lineDraw,s=this.group;if("view"===a.type){var l={position:a.position,scale:a.scale};this._firstRender?s.attr(l):Jh.updateProps(s,l,e)}yD(e.getGraph(),_D(e));var u=e.getData();r.updateData(u);var h=e.getEdgeData();o.updateData(h),this._updateNodeAndLinkScale(),this._updateController(e,t,i),clearTimeout(this._layoutTimeout);var c=e.forceLayout,d=e.get("force.layoutAnimation");c&&this._startForceLayoutIteration(c,d),u.eachItemGraphicEl((function(t,a){var r=u.getItemModel(a);t.off("drag").off("dragend");var o=r.get("draggable");o&&t.on("drag",(function(){c&&(c.warmUp(),!this._layouting&&this._startForceLayoutIteration(c,d),c.setFixed(a),u.setItemLayout(a,t.position))}),this).on("dragend",(function(){c&&c.setUnfixed(a)}),this),t.setDraggable(o&&c),t[bD]&&t.off("mouseover",t[bD]),t[wD]&&t.off("mouseout",t[wD]),r.get("focusNodeAdjacency")&&(t.on("mouseover",t[bD]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex})}),t.on("mouseout",t[wD]=function(){n._dispatchUnfocus(i)}))}),this),u.graph.eachEdge((function(t){var a=t.getGraphicEl();a[bD]&&a.off("mouseover",a[bD]),a[wD]&&a.off("mouseout",a[wD]),t.getModel().get("focusNodeAdjacency")&&(a.on("mouseover",a[bD]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex})}),a.on("mouseout",a[wD]=function(){n._dispatchUnfocus(i)}))}));var p="circular"===e.get("layout")&&e.get("circular.rotateLabel"),f=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var i=u.getItemModel(t).get("label.rotate")||0,n=e.getSymbolPath();if(p){var a=u.getItemLayout(t),r=Math.atan2(a[1]-g,a[0]-f);r<0&&(r=2*Math.PI+r);var o=a[0]<f;o&&(r-=Math.PI);var s=o?"left":"right";Jh.modifyLabelStyle(n,{textRotation:-r,textPosition:s,textOrigin:"center"},{textPosition:s})}else Jh.modifyLabelStyle(n,{textRotation:i*=Math.PI/180})})),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={},this._clearTimer()},_dispatchUnfocus:function(e,t){var i=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){i._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:i._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var a=e.getData().graph,r=n.dataIndex,o=n.edgeDataIndex,s=a.getNodeByIndex(r),l=a.getEdgeByIndex(o);(s||l)&&(a.eachNode((function(e){AD(e,SD,.1)})),a.eachEdge((function(e){AD(e,MD,.1)})),s&&(TD(s,SD),Fe.each(s.edges,(function(e){e.dataIndex<0||(TD(e,MD),TD(e.node1,SD),TD(e.node2,SD))}))),l&&(TD(l,MD),TD(l.node1,SD),TD(l.node2,SD)))},unfocusNodeAdjacency:function(e,t,i,n){var a=e.getData().graph;a.eachNode((function(e){AD(e,SD)})),a.eachEdge((function(e){AD(e,MD)}))},_startForceLayoutIteration:function(e,t){var i=this;!function n(){e.step((function(e){i.updateLayout(i._model),(i._layouting=!e)&&(t?i._layoutTimeout=setTimeout(n,16):n())}))}()},_updateController:function(e,t,i){var n=this._controller,a=this._controllerHost,r=this.group;n.setPointerChecker((function(t,n,a){var o=r.getBoundingRect();return o.applyTransform(r.transform),o.contain(n,a)&&!xD(t,i,e)})),"view"===e.coordinateSystem.type?(n.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){ZI.updateViewOnPan(a,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){ZI.updateViewOnZoom(a,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(),yD(e.getGraph(),_D(e)),this._lineDraw.updateLayout()}),this)):n.disable()},_updateNodeAndLinkScale:function(){var e=this._model,t=e.getData(),i=_D(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},updateLayout:function(e){yD(e.getGraph(),_D(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}}),U_.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),U_.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){}));var CD=sA.updateCenterAndZoom;U_.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){var i=t.coordinateSystem,n=CD(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var DD=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getGraph().data,a=i.mapArray(i.getName);n.filterSelf((function(e){var i=n.getItemModel(e).getShallow("category");if(null!=i){"number"==typeof i&&(i=a[i]);for(var r=0;r<t.length;r++)if(!t[r].isSelected(i))return!1}return!0}))}),this)};var LD=function(e){var t={};e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getData(),a={};i.each((function(n){var r=i.getName(n);a["ec-"+r]=n;var o=i.getItemModel(n),s=o.get("itemStyle.color")||e.getColorFromPalette(r,t);i.setItemVisual(n,"color",s);for(var l=["opacity","symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var h=o.getShallow(l[u],!0);null!=h&&i.setItemVisual(n,l[u],h)}})),i.count()&&n.each((function(e){var t=n.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=a["ec-"+t]);for(var r=["color","opacity","symbol","symbolSize","symbolKeepAspect"],o=0;o<r.length;o++)null==n.getItemVisual(e,r[o],!0)&&n.setItemVisual(e,r[o],i.getItemVisual(t,r[o]))}}))}))};function PD(e){return e instanceof Array||(e=[e,e]),e}var kD=function(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n=PD(e.get("edgeSymbol")),a=PD(e.get("edgeSymbolSize")),r="lineStyle.color".split("."),o="lineStyle.opacity".split(".");i.setVisual("fromSymbol",n&&n[0]),i.setVisual("toSymbol",n&&n[1]),i.setVisual("fromSymbolSize",a&&a[0]),i.setVisual("toSymbolSize",a&&a[1]),i.setVisual("color",e.get(r)),i.setVisual("opacity",e.get(o)),i.each((function(e){var n=i.getItemModel(e),a=t.getEdgeByIndex(e),s=PD(n.getShallow("symbol",!0)),l=PD(n.getShallow("symbolSize",!0)),u=n.get(r),h=n.get(o);switch(u){case"source":u=a.node1.getVisual("color");break;case"target":u=a.node2.getVisual("color")}s[0]&&a.setVisual("fromSymbol",s[0]),s[1]&&a.setVisual("toSymbol",s[1]),l[0]&&a.setVisual("fromSymbolSize",l[0]),l[1]&&a.setVisual("toSymbolSize",l[1]),a.setVisual("color",u),a.setVisual("opacity",h)}))}))};function OD(e){e.eachEdge((function(e){var t=e.getModel().get("lineStyle.curveness")||0,i=ht.clone(e.node1.getLayout()),n=ht.clone(e.node2.getLayout()),a=[i,n];+t&&a.push([(i[0]+n[0])/2-(i[1]-n[1])*t,(i[1]+n[1])/2-(n[0]-i[0])*t]),e.setLayout(a)}))}var RD=function(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var i=e.getGraph();i.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),OD(i)}},ED={simpleLayout:RD,simpleLayoutEdge:OD},ND=Fe.each,zD=ED.simpleLayout,BD=ED.simpleLayoutEdge;var VD=function(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),i=e.coordinateSystem;if(i&&"view"!==i.type){var n=e.getData(),a=[];ND(i.dimensions,(function(e){a=a.concat(n.mapDimension(e,!0))}));for(var r=0;r<n.count();r++){for(var o=[],s=!1,l=0;l<a.length;l++){var u=n.get(a[l],r);isNaN(u)||(s=!0),o.push(u)}s?n.setItemLayout(r,i.dataToPoint(o)):n.setItemLayout(r,[NaN,NaN])}BD(n.graph)}else t&&"none"!==t||zD(e)}))},GD=uD.getSymbolSize,FD=uD.getNodeGlobalScale,HD=Math.PI,WD=[];var UD={value:function(e,t,i,n,a,r,o,s){var l=0,u=n.getSum("value"),h=2*Math.PI/(u||s);i.eachNode((function(e){var t=e.getValue("value"),i=h*(u?t:1)/2;l+=i,e.setLayout([a*Math.cos(l)+r,a*Math.sin(l)+o]),l+=i}))},symbolSize:function(e,t,i,n,a,r,o,s){var l=0;WD.length=s;var u=FD(e);i.eachNode((function(e){var t=GD(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=u;var i=Math.asin(t/2/a);isNaN(i)&&(i=HD/2),WD[e.dataIndex]=i,l+=2*i}));var h=(2*HD-l)/s/2,c=0;i.eachNode((function(e){var t=h+WD[e.dataIndex];c+=t,e.setLayout([a*Math.cos(c)+r,a*Math.sin(c)+o]),c+=t}))}},jD=function(e,t){var i=e.coordinateSystem;if(!i||"view"===i.type){var n=i.getBoundingRect(),a=e.getData(),r=a.graph,o=n.width/2+n.x,s=n.height/2+n.y,l=Math.min(n.width,n.height)/2,u=a.count();a.setLayout({cx:o,cy:s}),u&&(UD[t](e,i,r,a,l,o,s,u),r.eachEdge((function(e){var t,i=e.getModel().get("lineStyle.curveness")||0,n=ht.clone(e.node1.getLayout()),a=ht.clone(e.node2.getLayout()),r=(n[0]+a[0])/2,l=(n[1]+a[1])/2;+i&&(t=[o*(i*=3)+r*(1-i),s*i+l*(1-i)]),e.setLayout([n,a,t])})))}},ZD={circularLayout:jD},YD=ZD.circularLayout;var XD=function(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&YD(e,"symbolSize")}))},qD=ht.scaleAndAdd;var $D=function(e,t,i){for(var n=i.rect,a=n.width,r=n.height,o=[n.x+a/2,n.y+r/2],s=null==i.gravity?.1:i.gravity,l=0;l<e.length;l++){var u=e[l];u.p||(u.p=ht.create(a*(Math.random()-.5)+o[0],r*(Math.random()-.5)+o[1])),u.pp=ht.clone(u.p),u.edges=null}var h=null==i.friction?.6:i.friction,c=h;return{warmUp:function(){c=.8*h},setFixed:function(t){e[t].fixed=!0},setUnfixed:function(t){e[t].fixed=!1},step:function(i){for(var n=[],a=e.length,r=0;r<t.length;r++){var l=t[r];if(!l.ignoreForceLayout){var u=l.n1,h=l.n2;ht.sub(n,h.p,u.p);var d=ht.len(n)-l.d,p=h.w/(u.w+h.w);isNaN(p)&&(p=0),ht.normalize(n,n),!u.fixed&&qD(u.p,u.p,n,p*d*c),!h.fixed&&qD(h.p,h.p,n,-(1-p)*d*c)}}for(r=0;r<a;r++){(v=e[r]).fixed||(ht.sub(n,o,v.p),qD(v.p,v.p,n,s*c))}for(r=0;r<a;r++){u=e[r];for(var f=r+1;f<a;f++){h=e[f];ht.sub(n,h.p,u.p),0===(d=ht.len(n))&&(ht.set(n,Math.random()-.5,Math.random()-.5),d=1);var g=(u.rep+h.rep)/d/d;!u.fixed&&qD(u.pp,u.pp,n,g),!h.fixed&&qD(h.pp,h.pp,n,-g)}}var m=[];for(r=0;r<a;r++){var v;(v=e[r]).fixed||(ht.sub(m,v.p,v.pp),qD(v.p,v.p,m,c),ht.copy(v.pp,v.p))}c*=.992,i&&i(e,t,c<.01)}}},KD={forceLayout:$D}.forceLayout,JD=ED.simpleLayout,QD=ZD.circularLayout,eL=Cc.linearMap;var tL=function(e){e.eachSeriesByType("graph",(function(e){if(!(c=e.coordinateSystem)||"view"===c.type)if("force"===e.get("layout")){var t=e.preservedPoints||{},i=e.getGraph(),n=i.data,a=i.edgeData,r=e.getModel("force"),o=r.get("initLayout");e.preservedPoints?n.each((function(e){var i=n.getId(e);n.setItemLayout(e,t[i]||[NaN,NaN])})):o&&"none"!==o?"circular"===o&&QD(e,"value"):JD(e);var s=n.getDataExtent("value"),l=a.getDataExtent("value"),u=r.get("repulsion"),h=r.get("edgeLength");Fe.isArray(u)||(u=[u,u]),Fe.isArray(h)||(h=[h,h]),h=[h[1],h[0]];var c,d=n.mapArray("value",(function(e,t){var i=n.getItemLayout(t),a=eL(e,s,u);return isNaN(a)&&(a=(u[0]+u[1])/2),{w:a,rep:a,fixed:n.getItemModel(t).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}})),p=a.mapArray("value",(function(e,t){var n=i.getEdgeByIndex(t),a=eL(e,l,h);isNaN(a)&&(a=(h[0]+h[1])/2);var r=n.getModel();return{n1:d[n.node1.dataIndex],n2:d[n.node2.dataIndex],d:a,curveness:r.get("lineStyle.curveness")||0,ignoreForceLayout:r.get("ignoreForceLayout")}})),f=(c=e.coordinateSystem).getBoundingRect(),g=KD(d,p,{rect:f,gravity:r.get("gravity"),friction:r.get("friction")}),m=g.step;g.step=function(e){for(var a=0,r=d.length;a<r;a++)d[a].fixed&&ht.copy(d[a].p,i.getNodeByIndex(a).getLayout());m((function(a,r,o){for(var s=0,l=a.length;s<l;s++)a[s].fixed||i.getNodeByIndex(s).setLayout(a[s].p),t[n.getId(s)]=a[s].p;for(s=0,l=r.length;s<l;s++){var u=r[s],h=i.getEdgeByIndex(s),c=u.n1.p,d=u.n2.p,p=h.getLayout();(p=p?p.slice():[])[0]=p[0]||[],p[1]=p[1]||[],ht.copy(p[0],c),ht.copy(p[1],d),+u.curveness&&(p[2]=[(c[0]+d[0])/2-(c[1]-d[1])*u.curveness,(c[1]+d[1])/2-(d[0]-c[0])*u.curveness]),h.setLayout(p)}e&&e(o)}))},e.forceLayout=g,e.preservedPoints=t,g.step()}else e.forceLayout=null}))},iL=ed.getLayoutRect;var nL=function(e,t){var i=[];return e.eachSeriesByType("graph",(function(e){var n=e.get("coordinateSystem");if(!n||"view"===n){var a=e.getData(),r=a.mapArray((function(e){var t=a.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o=[],s=[];Os.fromPoints(r,o,s),s[0]-o[0]==0&&(s[0]+=1,o[0]-=1),s[1]-o[1]==0&&(s[1]+=1,o[1]-=1);var l=(s[0]-o[0])/(s[1]-o[1]),u=function(e,t,i){var n=e.getBoxLayoutParams();return n.aspect=i,iL(n,{width:t.getWidth(),height:t.getHeight()})}(e,t,l);isNaN(l)&&(o=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var h=s[0]-o[0],c=s[1]-o[1],d=u.width,p=u.height,f=e.coordinateSystem=new pA;f.zoomLimit=e.get("scaleLimit"),f.setBoundingRect(o[0],o[1],h,c),f.setViewRect(u.x,u.y,d,p),f.setCenter(e.get("center")),f.setZoom(e.get("zoom")),i.push(f)}})),i};U_.registerProcessor(DD),U_.registerVisual(ew("graph","circle",null)),U_.registerVisual(LD),U_.registerVisual(kD),U_.registerLayout(VD),U_.registerLayout(U_.PRIORITY.VISUAL.POST_CHART_LAYOUT,XD),U_.registerLayout(tL),U_.registerCoordinateSystem("graphView",{create:nL}),ng.extend({type:"series.gauge",getInitialData:function(e,t){return lM(this,["value"])},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,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}});var aL=xl.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(e,t){var i=Math.cos,n=Math.sin,a=t.r,r=t.width,o=t.angle,s=t.x-i(o)*r*(r>=a/3?1:2),l=t.y-n(o)*r*(r>=a/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+i(o)*r,t.y+n(o)*r),e.lineTo(t.x+i(t.angle)*a,t.y+n(t.angle)*a),e.lineTo(t.x-i(o)*r,t.y-n(o)*r),e.lineTo(s,l)}}),rL=aL,oL=Cc.parsePercent,sL=Cc.round,lL=Cc.linearMap;function uL(e,t){return t&&("string"==typeof t?e=t.replace("{value}",null!=e?e:""):"function"==typeof t&&(e=t(e))),e}var hL=2*Math.PI;_g.extend({type:"gauge",render:function(e,t,i){this.group.removeAll();var n=e.get("axisLine.lineStyle.color"),a=function(e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight(),r=Math.min(n,a);return{cx:oL(i[0],t.getWidth()),cy:oL(i[1],t.getHeight()),r:oL(e.get("radius"),r/2)}}(e,i);this._renderMain(e,t,i,n,a)},dispose:function(){},_renderMain:function(e,t,i,n,a){for(var r=this.group,o=e.getModel("axisLine"),s=o.getModel("lineStyle"),l=e.get("clockwise"),u=-e.get("startAngle")/180*Math.PI,h=((g=-e.get("endAngle")/180*Math.PI)-u)%hL,c=u,d=s.get("width"),p=o.get("show"),f=0;p&&f<n.length;f++){var g=u+h*Math.min(Math.max(n[f][0],0),1),m=new Jh.Sector({shape:{startAngle:c,endAngle:g,cx:a.cx,cy:a.cy,clockwise:l,r0:a.r-d,r:a.r},silent:!0});m.setStyle({fill:n[f][1]}),m.setStyle(s.getLineStyle(["color","borderWidth","borderColor"])),r.add(m),c=g}var v=function(e){if(e<=0)return n[0][1];for(var t=0;t<n.length;t++)if(n[t][0]>=e&&(0===t?0:n[t-1][0])<e)return n[t][1];return n[t-1][1]};if(!l){var y=u;u=g,g=y}this._renderTicks(e,t,i,v,a,u,g,l),this._renderPointer(e,t,i,v,a,u,g,l),this._renderTitle(e,t,i,v,a),this._renderDetail(e,t,i,v,a)},_renderTicks:function(e,t,i,n,a,r,o,s){for(var l=this.group,u=a.cx,h=a.cy,c=a.r,d=+e.get("min"),p=+e.get("max"),f=e.getModel("splitLine"),g=e.getModel("axisTick"),m=e.getModel("axisLabel"),v=e.get("splitNumber"),y=g.get("splitNumber"),x=oL(f.get("length"),c),_=oL(g.get("length"),c),b=r,w=(o-r)/v,S=w/y,M=f.getModel("lineStyle").getLineStyle(),I=g.getModel("lineStyle").getLineStyle(),A=0;A<=v;A++){var T=Math.cos(b),C=Math.sin(b);if(f.get("show")){var D=new Jh.Line({shape:{x1:T*c+u,y1:C*c+h,x2:T*(c-x)+u,y2:C*(c-x)+h},style:M,silent:!0});"auto"===M.stroke&&D.setStyle({stroke:n(A/v)}),l.add(D)}if(m.get("show")){var L=uL(sL(A/v*(p-d)+d),m.get("formatter")),P=m.get("distance"),k=n(A/v);l.add(new Jh.Text({style:Jh.setTextStyle({},m,{text:L,x:T*(c-x-P)+u,y:C*(c-x-P)+h,textVerticalAlign:C<-.4?"top":C>.4?"bottom":"middle",textAlign:T<-.4?"left":T>.4?"right":"center"},{autoColor:k}),silent:!0}))}if(g.get("show")&&A!==v){for(var O=0;O<=y;O++){T=Math.cos(b),C=Math.sin(b);var R=new Jh.Line({shape:{x1:T*c+u,y1:C*c+h,x2:T*(c-_)+u,y2:C*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&R.setStyle({stroke:n((A+O/y)/v)}),l.add(R),b+=S}b-=S}else b+=w}},_renderPointer:function(e,t,i,n,a,r,o,s){var l=this.group,u=this._data;if(e.get("pointer.show")){var h=[+e.get("min"),+e.get("max")],c=[r,o],d=e.getData(),p=d.mapDimension("value");d.diff(u).add((function(t){var i=new rL({shape:{angle:r}});Jh.initProps(i,{shape:{angle:lL(d.get(p,t),h,c,!0)}},e),l.add(i),d.setItemGraphicEl(t,i)})).update((function(t,i){var n=u.getItemGraphicEl(i);Jh.updateProps(n,{shape:{angle:lL(d.get(p,t),h,c,!0)}},e),l.add(n),d.setItemGraphicEl(t,n)})).remove((function(e){var t=u.getItemGraphicEl(e);l.remove(t)})).execute(),d.eachItemGraphicEl((function(e,t){var i=d.getItemModel(t),r=i.getModel("pointer");e.setShape({x:a.cx,y:a.cy,width:oL(r.get("width"),a.r),r:oL(r.get("length"),a.r)}),e.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===e.style.fill&&e.setStyle("fill",n(lL(d.get(p,t),h,[0,1],!0))),Jh.setHoverStyle(e,i.getModel("emphasis.itemStyle").getItemStyle())})),this._data=d}else u&&u.eachItemGraphicEl((function(e){l.remove(e)}))},_renderTitle:function(e,t,i,n,a){var r=e.getData(),o=r.mapDimension("value"),s=e.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=a.cx+oL(l[0],a.r),h=a.cy+oL(l[1],a.r),c=+e.get("min"),d=+e.get("max"),p=e.getData().get(o,0),f=n(lL(p,[c,d],[0,1],!0));this.group.add(new Jh.Text({silent:!0,style:Jh.setTextStyle({},s,{x:u,y:h,text:r.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(e,t,i,n,a){var r=e.getModel("detail"),o=+e.get("min"),s=+e.get("max");if(r.get("show")){var l=r.get("offsetCenter"),u=a.cx+oL(l[0],a.r),h=a.cy+oL(l[1],a.r),c=oL(r.get("width"),a.r),d=oL(r.get("height"),a.r),p=e.getData(),f=p.get(p.mapDimension("value"),0),g=n(lL(f,[o,s],[0,1],!0));this.group.add(new Jh.Text({silent:!0,style:Jh.setTextStyle({},r,{x:u,y:h,text:uL(f,r.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}});var cL=Ro.defaultEmphasis,dL=Jd.makeSeriesEncodeForNameBased,pL=U_.extendSeriesModel({type:"series.funnel",init:function(e){pL.superApply(this,"init",arguments),this.legendVisualProvider=new hM(Fe.bind(this.getData,this),Fe.bind(this.getRawData,this)),this._defaultLabelLine(e)},getInitialData:function(e,t){return lM(this,{coordDimensions:["value"],encodeDefaulter:Fe.curry(dL,this)})},_defaultLabelLine:function(e){cL(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},getDataParams:function(e){var t=this.getData(),i=pL.superCall(this,"getDataParams",e),n=t.mapDimension("value"),a=t.getSum(n);return i.percent=a?+(t.get(n,e)/a*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}});function fL(e,t){Jh.Group.call(this);var i=new Jh.Polygon,n=new Jh.Polyline,a=new Jh.Text;this.add(i),this.add(n),this.add(a),this.highDownOnUpdate=function(e,t){"emphasis"===t?(n.ignore=n.hoverIgnore,a.ignore=a.hoverIgnore):(n.ignore=n.normalIgnore,a.ignore=a.normalIgnore)},this.updateData(e,t,!0)}var gL=fL.prototype,mL=["itemStyle","opacity"];gL.updateData=function(e,t,i){var n=this.childAt(0),a=e.hostModel,r=e.getItemModel(t),o=e.getItemLayout(t),s=e.getItemModel(t).get(mL);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:o.points}),n.setStyle({opacity:0}),Jh.initProps(n,{style:{opacity:s}},a,t)):Jh.updateProps(n,{style:{opacity:s},shape:{points:o.points}},a,t);var l=r.getModel("itemStyle"),u=e.getItemVisual(t,"color");n.setStyle(Fe.defaults({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(e,t),Jh.setHoverStyle(this)},gL._updateLabel=function(e,t){var i=this.childAt(1),n=this.childAt(2),a=e.hostModel,r=e.getItemModel(t),o=e.getItemLayout(t).label,s=e.getItemVisual(t,"color");Jh.updateProps(i,{shape:{points:o.linePoints||o.linePoints}},a,t),Jh.updateProps(n,{style:{x:o.x,y:o.y}},a,t),n.attr({rotation:o.rotation,origin:[o.x,o.y],z2:10});var l=r.getModel("label"),u=r.getModel("emphasis.label"),h=r.getModel("labelLine"),c=r.getModel("emphasis.labelLine");s=e.getItemVisual(t,"color");Jh.setLabelStyle(n.style,n.hoverStyle={},l,u,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:e.getName(t),autoColor:s,useInsideStyle:!!o.inside},{textAlign:o.textAlign,textVerticalAlign:o.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},Fe.inherits(fL,Jh.Group),_g.extend({type:"funnel",render:function(e,t,i){var n=e.getData(),a=this._data,r=this.group;n.diff(a).add((function(e){var t=new fL(n,e);n.setItemGraphicEl(e,t),r.add(t)})).update((function(e,t){var i=a.getItemGraphicEl(t);i.updateData(n,e),r.add(i),n.setItemGraphicEl(e,i)})).remove((function(e){var t=a.getItemGraphicEl(e);r.remove(t)})).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var vL=Cc.parsePercent,yL=Cc.linearMap;var xL=function(e,t,i){e.eachSeriesByType("funnel",(function(e){var i=e.getData(),n=i.mapDimension("value"),a=e.get("sort"),r=function(e,t){return ed.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),o=function(e,t){for(var i=e.mapDimension("value"),n=e.mapArray(i,(function(e){return e})),a=[],r="ascending"===t,o=0,s=e.count();o<s;o++)a[o]=o;return"function"==typeof t?a.sort(t):"none"!==t&&a.sort((function(e,t){return r?n[e]-n[t]:n[t]-n[e]})),a}(i,a),s=[vL(e.get("minSize"),r.width),vL(e.get("maxSize"),r.width)],l=i.getDataExtent(n),u=e.get("min"),h=e.get("max");null==u&&(u=Math.min(l[0],0)),null==h&&(h=l[1]);var c=e.get("funnelAlign"),d=e.get("gap"),p=(r.height-d*(i.count()-1))/i.count(),f=r.y,g=function(e,t){var a,o=i.get(n,e)||0,l=yL(o,[u,h],s,!0);switch(c){case"left":a=r.x;break;case"center":a=r.x+(r.width-l)/2;break;case"right":a=r.x+r.width-l}return[[a,t],[a+l,t]]};"ascending"===a&&(p=-p,d=-d,f+=r.height,o=o.reverse());for(var m=0;m<o.length;m++){var v=o[m],y=o[m+1],x=i.getItemModel(v).get("itemStyle.height");null==x?x=p:(x=vL(x,r.height),"ascending"===a&&(x=-x));var _=g(v,f),b=g(y,f+x);f+=x+d,i.setItemLayout(v,{points:_.concat(b.slice().reverse())})}!function(e){e.each((function(t){var i,n,a,r,o=e.getItemModel(t),s=o.getModel("label").get("position"),l=o.getModel("labelLine"),u=e.getItemLayout(t),h=u.points,c="inner"===s||"inside"===s||"center"===s||"insideLeft"===s||"insideRight"===s;if(c)"insideLeft"===s?(n=(h[0][0]+h[3][0])/2+5,a=(h[0][1]+h[3][1])/2,i="left"):"insideRight"===s?(n=(h[1][0]+h[2][0])/2-5,a=(h[1][1]+h[2][1])/2,i="right"):(n=(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"),r=[[n,a],[n,a]];else{var d,p,f,g=l.get("length");"left"===s?(d=(h[3][0]+h[0][0])/2,p=(h[3][1]+h[0][1])/2,n=(f=d-g)-5,i="right"):"right"===s?(d=(h[1][0]+h[2][0])/2,p=(h[1][1]+h[2][1])/2,n=(f=d+g)+5,i="left"):"rightTop"===s?(d=h[1][0],p=h[1][1],n=(f=d+g)+5,i="top"):"rightBottom"===s?(d=h[2][0],p=h[2][1],n=(f=d+g)+5,i="bottom"):"leftTop"===s?(d=h[0][0],p=h[1][1],n=(f=d-g)-5,i="right"):"leftBottom"===s?(d=h[3][0],p=h[2][1],n=(f=d-g)-5,i="right"):(d=(h[1][0]+h[2][0])/2,p=(h[1][1]+h[2][1])/2,n=(f=d+g)+5,i="left"),r=[[d,p],[f,p]],a=p}u.label={linePoints:r,x:n,y:a,verticalAlign:"middle",textAlign:i,inside:c}}))}(i)}))};U_.registerVisual(bM("funnel")),U_.registerLayout(xL),U_.registerProcessor(kM("funnel"));var _L=function(e){!function(e){if(e.parallel)return;var t=!1;Fe.each(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=Ro.normalizeToArray(e.parallelAxis);Fe.each(t,(function(t){if(Fe.isObject(t)){var i=t.parallelIndex||0,n=Ro.normalizeToArray(e.parallel)[i];n&&n.parallelAxisDefault&&Fe.merge(t,n.parallelAxisDefault,!1)}}))}(e)},bL=function(e,t,i,n,a){A_.call(this,e,t,i),this.type=n||"value",this.axisIndex=a};bL.prototype={constructor:bL,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},Fe.inherits(bL,A_);var wL=bL;function SL(e,t){var i=e[t]-e[1-t];return{span:Math.abs(i),sign:i>0?-1:i<0?1:t?-1:1}}function ML(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var IL=function(e,t,i,n,a,r){e=e||0;var o=i[1]-i[0];if(null!=a&&(a=ML(a,[0,o])),null!=r&&(r=Math.max(r,null!=a?a:0)),"all"===n){var s=Math.abs(t[1]-t[0]);s=ML(s,[0,o]),a=r=ML(s,[a,r]),n=0}t[0]=ML(t[0],i),t[1]=ML(t[1],i);var l=SL(t,n);t[n]+=e;var u=a||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,t[n]=ML(t[n],h);var c=SL(t,n);return null!=a&&(c.sign!==l.sign||c.span<a)&&(t[1-n]=t[n]+l.sign*a),c=SL(t,n),null!=r&&c.span>r&&(t[1-n]=t[n]+c.sign*r),t},AL=Fe.each,TL=Math.min,CL=Math.max,DL=Math.floor,LL=Math.ceil,PL=Cc.round,kL=Math.PI;function OL(e,t,i){this._axesMap=Fe.createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._rect,this._model=e,this._init(e,t,i)}function RL(e,t){return TL(CL(e,t[0]),t[1])}function EL(e,t){var i=t.layoutLength/(t.axisCount-1);return{position:i*e,axisNameAvailableWidth:i,axisLabelShow:!0}}function NL(e,t){var i,n,a=t.layoutLength,r=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,h=!1;return e<l[0]?(i=e*s,n=s):e<=l[1]?(i=t.axisExpandWindow0Pos+e*r-t.axisExpandWindow[0],u=r,h=!0):(i=a-(o-1-e)*s,n=s),{position:i,axisNameAvailableWidth:u,axisLabelShow:h,nameTruncateMaxWidth:n}}OL.prototype={type:"parallel",constructor:OL,_init:function(e,t,i){var n=e.dimensions,a=e.parallelAxisIndex;AL(n,(function(e,i){var n=a[i],r=t.getComponent("parallelAxis",n),o=this._axesMap.set(e,new wL(e,Cx.createScaleByModel(r),[0,0],r.get("type"),n)),s="category"===o.type;o.onBand=s&&r.get("boundaryGap"),o.inverse=r.get("inverse"),r.axis=o,o.model=r,o.coordinateSystem=r.coordinateSystem=this}),this)},update:function(e,t){this._updateAxesFromSeries(this._model,e)},containPoint:function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,a=t.pixelDimIndex,r=e[1-a],o=e[a];return r>=i&&r<=i+t.axisLength&&o>=n&&o<=n+t.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,t){t.eachSeries((function(i){if(e.contains(i,t)){var n=i.getData();AL(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(n,n.mapDimension(e)),Cx.niceScaleExtent(t.scale,t.model)}),this)}}),this)},resize:function(e,t){this._rect=ed.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var e,t=this._model,i=this._rect,n=["x","y"],a=["width","height"],r=t.get("layout"),o="horizontal"===r?0:1,s=i[a[o]],l=[0,s],u=this.dimensions.length,h=RL(t.get("axisExpandWidth"),l),c=RL(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,p=t.get("axisExpandWindow");p?(e=RL(p[1]-p[0],l),p[1]=p[0]+e):(e=RL(h*(c-1),l),(p=[h*(t.get("axisExpandCenter")||DL(u/2))-e/2])[1]=p[0]+e);var f=(s-e)/(u-c);f<3&&(f=0);var g=[DL(PL(p[0]/h,1))+1,LL(PL(p[1]/h,1))-1],m=f/h*p[0];return{layout:r,pixelDimIndex:o,layoutBase:i[n[o]],layoutLength:s,axisBase:i[n[1-o]],axisLength:i[a[1-o]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),a=n.layout;t.each((function(e){var t=[0,n.axisLength],i=e.inverse?1:0;e.setExtent(t[i],t[1-i])})),AL(i,(function(t,i){var r=(n.axisExpandable?NL:EL)(i,n),o={horizontal:{x:r.position,y:n.axisLength},vertical:{x:0,y:r.position}},s={horizontal:kL/2,vertical:0},l=[o[a].x+e.x,o[a].y+e.y],u=s[a],h=ri.create();ri.rotate(h,h,u),ri.translate(h,h,l),this._axesLayout[t]={position:l,rotation:u,transform:h,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},getAxis:function(e){return this._axesMap.get(e)},dataToPoint:function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},eachActiveState:function(e,t,i,n){null==i&&(i=0),null==n&&(n=e.count());var a=this._axesMap,r=this.dimensions,o=[],s=[];Fe.each(r,(function(t){o.push(e.mapDimension(t)),s.push(a.get(t).model)}));for(var l=this.hasAxisBrushed(),u=i;u<n;u++){var h;if(l){h="active";for(var c=e.getValues(o,u),d=0,p=r.length;d<p;d++){if("inactive"===s[d].getActiveState(c[d])){h="inactive";break}}}else h="normal";t(h,u)}},hasAxisBrushed:function(){for(var e=this.dimensions,t=this._axesMap,i=!1,n=0,a=e.length;n<a;n++)"normal"!==t.get(e[n]).model.getActiveState()&&(i=!0);return i},axisCoordToPoint:function(e,t){var i=this._axesLayout[t];return Jh.applyTransform([e,0],i.transform)},getAxisLayout:function(e){return Fe.clone(this._axesLayout[e])},getSlidedAxisExpandWindow:function(e){var t=this._makeLayoutInfo(),i=t.pixelDimIndex,n=t.axisExpandWindow.slice(),a=n[1]-n[0],r=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:n};var o,s=e[i]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),c=null!=h[0];if(u)c&&u&&s<a*h[0]?(l="jump",o=s-a*h[2]):c&&u&&s>a*(1-h[0])?(l="jump",o=s-a*(1-h[2])):(o=s-a*h[1])>=0&&(o=s-a*(1-h[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?IL(o,n,r,"all"):l="none";else{a=n[1]-n[0];(n=[CL(0,r[1]*s/a-a/2)])[1]=TL(r[1],n[0]+a),n[0]=n[1]-a}return{axisExpandWindow:n,behavior:l}}};var zL=OL;Sp.register("parallel",{create:function(e,t){var i=[];return e.eachComponent("parallel",(function(n,a){var r=new zL(n,e,t);r.name="parallel_"+a,r.resize(n,t),n.coordinateSystem=r,r.model=n,i.push(r)})),e.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}});var BL=od.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Wo([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=Fe.clone(e);if(t)for(var i=t.length-1;i>=0;i--)Cc.asc(t[i])},getActiveState:function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(e))return"inactive";if(1===t.length){var i=t[0];if(i[0]<=e&&e<=i[1])return"active"}else for(var n=0,a=t.length;n<a;n++)if(t[n][0]<=e&&e<=t[n][1])return"active";return"inactive"}});Fe.merge(BL.prototype,Lx),_w("parallel",BL,(function(e,t){return t.type||(t.data?"category":"value")}),{type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10}),od.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",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},init:function(){od.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(e){var t=this.option;e&&Fe.merge(t,e,!0),this._initDimensions()},contains:function(e,t){var i=e.get("parallelIndex");return null!=i&&t.getComponent("parallel",i)===this},setAxisExpand:function(e){Fe.each(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},_initDimensions:function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[],i=Fe.filter(this.dependentModels.parallelAxis,(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this);Fe.each(i,(function(i){e.push("dim"+i.get("dim")),t.push(i.componentIndex)}))}});U_.registerAction({type:"axisAreaSelect",event:"axisAreaSelected"},(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),U_.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}));var VL=Fe.curry,GL=Fe.each,FL=Fe.map,HL=Math.min,WL=Math.max,UL=Math.pow,jL="globalPan",ZL={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},YL={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},XL={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},qL=0;function $L(e){vt.call(this),this._zr=e,this.group=new Jh.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+qL++,this._handlers={},GL(SP,(function(e,t){this._handlers[t]=Fe.bind(e,this)}),this)}function KL(e,t){var i=IP[t.brushType].createCover(e,t);return i.__brushOption=t,eP(i,t),e.group.add(i),i}function JL(e,t){var i=iP(t);return i.endCreating&&(i.endCreating(e,t),eP(t,t.__brushOption)),t}function QL(e,t){var i=t.__brushOption;iP(t).updateCoverShape(e,t,i.range,i)}function eP(e,t){var i=t.z;null==i&&(i=1e4),e.traverse((function(e){e.z=i,e.z2=i}))}function tP(e,t){iP(t).updateCommon(e,t),QL(e,t)}function iP(e){return IP[e.__brushOption.brushType]}function nP(e,t,i){var n,a=e._panels;if(!a)return!0;var r=e._transform;return GL(a,(function(e){e.isTargetByCursor(t,i,r)&&(n=e)})),n}function aP(e,t){var i=e._panels;if(!i)return!0;var n=t.__brushOption.panelId;return null==n||i[n]}function rP(e){var t=e._covers,i=t.length;return GL(t,(function(t){e.group.remove(t)}),e),t.length=0,!!i}function oP(e,t){var i=FL(e._covers,(function(e){var t=e.__brushOption,i=Fe.clone(t.range);return{brushType:t.brushType,panelId:t.panelId,range:i}}));e.trigger("brush",i,{isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function sP(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function lP(e,t,i,n){var a=new Jh.Group;return a.add(new Jh.Rect({name:"main",style:dP(i),silent:!0,draggable:!0,cursor:"move",drift:VL(e,t,a,"nswe"),ondragend:VL(oP,t,{isEnd:!0})})),GL(n,(function(i){a.add(new Jh.Rect({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:VL(e,t,a,i),ondragend:VL(oP,t,{isEnd:!0})}))})),a}function uP(e,t,i,n){var a=n.brushStyle.lineWidth||0,r=WL(a,6),o=i[0][0],s=i[1][0],l=o-a/2,u=s-a/2,h=i[0][1],c=i[1][1],d=h-r+a/2,p=c-r+a/2,f=h-o,g=c-s,m=f+a,v=g+a;cP(e,t,"main",o,s,f,g),n.transformable&&(cP(e,t,"w",l,u,r,v),cP(e,t,"e",d,u,r,v),cP(e,t,"n",l,u,m,r),cP(e,t,"s",l,p,m,r),cP(e,t,"nw",l,u,r,r),cP(e,t,"ne",d,u,r,r),cP(e,t,"sw",l,p,r,r),cP(e,t,"se",d,p,r,r))}function hP(e,t){var i=t.__brushOption,n=i.transformable,a=t.childAt(0);a.useStyle(dP(i)),a.attr({silent:!n,cursor:n?"move":"default"}),GL(["w","e","n","s","se","sw","ne","nw"],(function(i){var a=t.childOfName(i),r=fP(e,i);a&&a.attr({silent:!n,invisible:!n,cursor:n?YL[r]+"-resize":null})}))}function cP(e,t,i,n,a,r,o){var s=t.childOfName(i);s&&s.setShape(function(e){var t=HL(e[0][0],e[1][0]),i=HL(e[0][1],e[1][1]),n=WL(e[0][0],e[1][0]),a=WL(e[0][1],e[1][1]);return{x:t,y:i,width:n-t,height:a-i}}(yP(e,t,[[n,a],[n+r,a+o]])))}function dP(e){return Fe.defaults({strokeNoScale:!0},e.brushStyle)}function pP(e,t,i,n){var a=[HL(e,i),HL(t,n)],r=[WL(e,i),WL(t,n)];return[[a[0],r[0]],[a[1],r[1]]]}function fP(e,t){if(t.length>1)return("e"===(i=[fP(e,(t=t.split(""))[0]),fP(e,t[1])])[0]||"w"===i[0])&&i.reverse(),i.join("");var i=Jh.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return Jh.getTransform(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function gP(e,t,i,n,a,r,o,s){var l=n.__brushOption,u=e(l.range),h=vP(i,r,o);GL(a.split(""),(function(e){var t=ZL[e];u[t[0]][t[1]]+=h[t[0]]})),l.range=t(pP(u[0][0],u[1][0],u[0][1],u[1][1])),tP(i,n),oP(i,{isEnd:!1})}function mP(e,t,i,n,a){var r=t.__brushOption.range,o=vP(e,i,n);GL(r,(function(e){e[0]+=o[0],e[1]+=o[1]})),tP(e,t),oP(e,{isEnd:!1})}function vP(e,t,i){var n=e.group,a=n.transformCoordToLocal(t,i),r=n.transformCoordToLocal(0,0);return[a[0]-r[0],a[1]-r[1]]}function yP(e,t,i){var n=aP(e,t);return n&&!0!==n?n.clipPath(i,e._transform):Fe.clone(i)}function xP(e){var t=e.event;t.preventDefault&&t.preventDefault()}function _P(e,t,i){return e.childOfName("main").contain(t,i)}function bP(e,t,i,n){var a,r=e._creatingCover,o=e._creatingPanel,s=e._brushOption;if(e._track.push(i.slice()),function(e){var t=e._track;if(!t.length)return!1;var i=t[t.length-1],n=t[0],a=i[0]-n[0],r=i[1]-n[1];return UL(a*a+r*r,.5)>6}(e)||r){if(o&&!r){"single"===s.brushMode&&rP(e);var l=Fe.clone(s);l.brushType=wP(l.brushType,o),l.panelId=!0===o?null:o.panelId,r=e._creatingCover=KL(e,l),e._covers.push(r)}if(r){var u=IP[wP(e._brushType,o)];r.__brushOption.range=u.getCreatingRange(yP(e,r,e._track)),n&&(JL(e,r),u.updateCommon(e,r)),QL(e,r),a={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&nP(e,t,i)&&rP(e)&&(a={isEnd:n,removeOnClick:!0});return a}function wP(e,t){return"auto"===e?t.defaultBrushType:e}$L.prototype={constructor:$L,enableBrush:function(e){var t,i;return this._brushType&&(i=(t=this)._zr,RI.release(i,jL,t._uid),function(e,t){GL(t,(function(t,i){e.off(i,t)}))}(i,t._handlers),t._brushType=t._brushOption=null),e.brushType&&function(e,t){var i=e._zr;e._enableGlobalPan||RI.take(i,jL,e._uid);(function(e,t){GL(t,(function(t,i){e.on(i,t)}))})(i,e._handlers),e._brushType=t.brushType,e._brushOption=Fe.merge(Fe.clone(XL),t,!0)}(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};Fe.each(e,(function(e){t[e.panelId]=Fe.clone(e)}))}else this._panels=null;return this},mount:function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({position:e.position||[0,0],rotation:e.rotation||0,scale:e.scale||[1,1]}),this._transform=t.getLocalTransform(),this},eachCover:function(e,t){GL(this._covers,e,t)},updateCovers:function(e){e=Fe.map(e,(function(e){return Fe.merge(Fe.clone(XL),e,!0)}));var t=this._covers,i=this._covers=[],n=this,a=this._creatingCover;return new Jm(t,e,(function(e,t){return r(e.__brushOption,t)}),r).add(o).update(o).remove((function(e){t[e]!==a&&n.group.remove(t[e])})).execute(),this;function r(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function o(r,o){var s=e[r];if(null!=o&&t[o]===a)i[r]=t[o];else{var l=i[r]=null!=o?(t[o].__brushOption=s,t[o]):JL(n,KL(n,s));tP(n,l)}}},unmount:function(){return this.enableBrush(!1),rP(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},Fe.mixin($L,vt);var SP={mousedown:function(e){if(this._dragging)MP(this,e);else if(!e.target||!e.target.draggable){xP(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=nP(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,i=e.offsetY,n=this.group.transformCoordToLocal(t,i);if(function(e,t,i){if(e._brushType&&!function(e,t,i){var n=e._zr;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}(e,t)){var n=e._zr,a=e._covers,r=nP(e,t,i);if(!e._dragging)for(var o=0;o<a.length;o++){var s=a[o].__brushOption;if(r&&(!0===r||s.panelId===r.panelId)&&IP[s.brushType].contain(a[o],i[0],i[1]))return}r&&n.setCursorStyle("crosshair")}}(this,e,n),this._dragging){xP(e);var a=bP(this,e,n,!1);a&&oP(this,a)}},mouseup:function(e){MP(this,e)}};function MP(e,t){if(e._dragging){xP(t);var i=t.offsetX,n=t.offsetY,a=e.group.transformCoordToLocal(i,n),r=bP(e,t,a,!0);e._dragging=!1,e._track=[],e._creatingCover=null,r&&oP(e,r)}}var IP={lineX:AP(0),lineY:AP(1),rect:{createCover:function(e,t){return lP(VL(gP,(function(e){return e}),(function(e){return e})),e,t,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(e){var t=sP(e);return pP(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,i,n){uP(e,t,i,n)},updateCommon:hP,contain:_P},polygon:{createCover:function(e,t){var i=new Jh.Group;return i.add(new Jh.Polyline({name:"main",style:dP(t),silent:!0})),i},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Jh.Polygon({name:"main",draggable:!0,drift:VL(mP,e,t),ondragend:VL(oP,e,{isEnd:!0})}))},updateCoverShape:function(e,t,i,n){t.childAt(0).setShape({points:yP(e,t,i)})},updateCommon:hP,contain:_P}};function AP(e){return{createCover:function(t,i){return lP(VL(gP,(function(t){var i=[t,[0,100]];return e&&i.reverse(),i}),(function(t){return t[e]})),t,i,[["w","e"],["n","s"]][e])},getCreatingRange:function(t){var i=sP(t);return[HL(i[0][e],i[1][e]),WL(i[0][e],i[1][e])]},updateCoverShape:function(t,i,n,a){var r,o=aP(t,i);if(!0!==o&&o.getLinearBrushOtherExtent)r=o.getLinearBrushOtherExtent(e,t._transform);else{var s=t._zr;r=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,r];e&&l.reverse(),uP(t,i,l,a)},updateCommon:hP,contain:_P}}var TP=$L,CP=qI.onIrrelevantElement;function DP(e){return On.create(e)}var LP=function(e,t){return e=DP(e),function(i){var n=null!=t?t:i,a=n?e.width:e.height,r=n?e.x:e.y;return[r,r+(a||0)]}},PP={makeRectPanelClipPath:function(e){return e=DP(e),function(t,i){return Jh.clipPointsByRect(t,e)}},makeLinearBrushOtherExtent:LP,makeRectIsTargetByCursor:function(e,t,i){return e=DP(e),function(n,a,r){return e.contain(a[0],a[1])&&!CP(n,t,i)}}},kP=["axisLine","axisTickLabel","axisName"],OP=U_.extendComponentView({type:"parallelAxis",init:function(e,t){OP.superApply(this,"init",arguments),(this._brushController=new TP(t.getZr())).on("brush",Fe.bind(this._onBrush,this))},render:function(e,t,i,n){if(!function(e,t,i){return i&&"axisAreaSelect"===i.type&&t.findComponents({mainType:"parallelAxis",query:i})[0]===e}(e,t,n)){this.axisModel=e,this.api=i,this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new Jh.Group,this.group.add(this._axisGroup),e.get("show")){var r=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),o=r.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,h=o.getAxisLayout(u),c=Fe.extend({strokeContainThreshold:l},h),d=new sS(e,c);Fe.each(kP,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,e,r,l,i);var p=n&&!1===n.animation?null:e;Jh.groupTransition(a,this._axisGroup,p)}}},_refreshBrushController:function(e,t,i,n,a,r){var o=i.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=Jh.BoundingRect.create({x:o[0],y:-a/2,width:s,height:a});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,position:e.position}).setPanels([{panelId:"pl",clipPath:PP.makeRectPanelClipPath(u),isTargetByCursor:PP.makeRectIsTargetByCursor(u,r,n),getLinearBrushOtherExtent:PP.makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return Fe.map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(i))},_onBrush:function(e,t){var i=this.axisModel,n=i.axis,a=Fe.map(e,(function(e){return[n.coordToData(e.range[0],!0),n.coordToData(e.range[1],!0)]}));(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:a})},dispose:function(){this._brushController.dispose()}});U_.extendComponentView({type:"parallel",render:function(e,t,i){this._model=e,this._api=i,this._handlers||(this._handlers={},Fe.each(RP,(function(e,t){i.getZr().on(t,this._handlers[t]=Fe.bind(e,this))}),this)),Ig.createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},dispose:function(e,t){Fe.each(this._handlers,(function(e,i){t.getZr().off(i,e)})),this._handlers=null},_throttledDispatchExpand:function(e){this._dispatchExpand(e)},_dispatchExpand:function(e){e&&this._api.dispatchAction(Fe.extend({type:"parallelAxisExpand"},e))}});var RP={mousedown:function(e){EP(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(EP(this,"click")&&t){var i=[e.offsetX,e.offsetY];if(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2)>5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&EP(this,"mousemove")){var t=this._model,i=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};function EP(e,t){var i=e._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===t}U_.registerPreprocessor(_L);var NP=Fe.each,zP=Fe.createHashMap;ng.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=this.getSource();return function(e,t){if(e.encodeDefine)return;var i=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(!i)return;var n=e.encodeDefine=zP();NP(i.dimensions,(function(e){var t=+e.replace("dim","");n.set(e,t)}))}(i,this),hy(i,this)},getRawIndicesByActiveState:function(e){var t=this.coordinateSystem,i=this.getData(),n=[];return t.eachActiveState(i,(function(t,a){e===t&&n.push(i.getRawIndex(a))})),n},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"}});function BP(e,t,i,n){for(var a,r=[],o=0;o<i.length;o++){var s=i[o],l=e.get(e.mapDimension(s),t);a=l,("category"===n.getAxis(s).type?null==a:null==a||isNaN(a))||r.push(n.dataToPoint(l,s))}return r}function VP(e,t,i,n,a){var r=BP(e,i,n,a),o=new Jh.Polyline({shape:{points:r},silent:!0,z2:10});return t.add(o),e.setItemGraphicEl(i,o),o}function GP(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),{lineStyle:e.getModel("lineStyle").getLineStyle(),smooth:null!=t?t:.3}}function FP(e,t,i,n){var a=n.lineStyle;t.hasItemOption&&(a=t.getItemModel(i).getModel("lineStyle").getLineStyle());e.useStyle(a);var r=e.style;r.fill=null,r.stroke=t.getItemVisual(i,"color"),r.opacity=t.getItemVisual(i,"opacity"),n.smooth&&(e.shape.smooth=n.smooth)}_g.extend({type:"parallel",init:function(){this._dataGroup=new Jh.Group,this.group.add(this._dataGroup),this._data,this._initialized},render:function(e,t,i,n){var a=this._dataGroup,r=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=GP(e);if(r.diff(o).add((function(e){var t=VP(r,a,e,l,s);FP(t,r,e,u)})).update((function(t,i){var a=o.getItemGraphicEl(i),h=BP(r,t,l,s);r.setItemGraphicEl(t,a);var c=n&&!1===n.animation?null:e;Jh.updateProps(a,{shape:{points:h}},c,t),FP(a,r,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);a.remove(t)})).execute(),!this._initialized){this._initialized=!0;var h=function(e,t,i){var n=e.model,a=e.getRect(),r=new Jh.Rect({shape:{x:a.x,y:a.y,width:a.width,height:a.height}}),o="horizontal"===n.get("layout")?"width":"height";return r.setShape(o,0),Jh.initProps(r,{shape:{width:a.width,height:a.height}},t,i),r}(s,e,(function(){setTimeout((function(){a.removeClipPath()}))}));a.setClipPath(h)}this._data=r},incrementalPrepareRender:function(e,t,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(e,t,i){for(var n=t.getData(),a=t.coordinateSystem,r=a.dimensions,o=GP(t),s=e.start;s<e.end;s++){var l=VP(n,this._dataGroup,s,r,a);l.incremental=!0,FP(l,n,s,o)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var HP=["lineStyle","normal","opacity"],WP={seriesType:"parallel",reset:function(e,t,i){var n=e.getModel("itemStyle"),a=e.getModel("lineStyle"),r=t.get("color"),o=a.get("color")||n.get("color")||r[e.seriesIndex%r.length],s=e.get("inactiveOpacity"),l=e.get("activeOpacity"),u=e.getModel("lineStyle").getLineStyle(),h=e.coordinateSystem,c=e.getData(),d={normal:u.opacity,active:l,inactive:s};return c.setVisual("color",o),{progress:function(e,t){h.eachActiveState(t,(function(e,i){var n=d[e];if("normal"===e&&t.hasItemOption){var a=t.getItemModel(i).get(HP,!0);null!=a&&(n=a)}t.setItemVisual(i,"opacity",n)}),e.start,e.end)}}}},UP=WP;U_.registerVisual(UP);var jP=Fc.encodeHTML,ZP=ng.extend({type:"series.sankey",layoutInfo:null,levelModels:null,getInitialData:function(e,t){for(var i=e.edges||e.links,n=e.data||e.nodes,a=e.levels,r=this.levelModels={},o=0;o<a.length;o++)null!=a[o].depth&&a[o].depth>=0&&(r[a[o].depth]=new pc(a[o],this,t));if(n&&i){var s=FC(n,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getData().getItemLayout(t).depth;return i.levelModels[n]||this.parentModel})),e})),t.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;return i.levelModels[n]||this.parentModel})),e}))}));return s.data}},setNodePosition:function(e,t){var i=this.option.data[e];i.localX=t[0],i.localY=t[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getDataParams(e,i),a=n.data,r=a.source+" -- "+a.target;return n.value&&(r+=" : "+n.value),jP(r)}if("node"===i){var o=this.getGraph().getNodeByIndex(e).getLayout().value,s=this.getDataParams(e,i).data.name;if(o)r=s+" : "+o;return jP(r)}return ZP.superCall(this,"formatTooltip",e,t)},optionUpdated:function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},getDataParams:function(e,t){var i=ZP.superCall(this,"getDataParams",e,t);if(null==i.value&&"node"===t){var n=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=n}return i},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,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",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},animationEasing:"linear",animationDuration:1e3}}),YP=["itemStyle","opacity"],XP=["emphasis","itemStyle","opacity"],qP=["lineStyle","opacity"],$P=["emphasis","lineStyle","opacity"];function KP(e,t){return e.getVisual("opacity")||e.getModel().get(t)}function JP(e,t,i){var n=e.getGraphicEl(),a=KP(e,t);null!=i&&(null==a&&(a=1),a*=i),n.downplay&&n.downplay(),n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",a)}))}function QP(e,t){var i=KP(e,t),n=e.getGraphicEl();n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}var ek=Jh.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(e,t){var i=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+i,t.y2),e.bezierCurveTo(t.cpx2+i,t.cpy2,t.cpx1+i,t.cpy1,t.x1+i,t.y1)):(e.lineTo(t.x2,t.y2+i),e.bezierCurveTo(t.cpx2,t.cpy2+i,t.cpx1,t.cpy1+i,t.x1,t.y1+i)),e.closePath()},highlight:function(){this.trigger("emphasis")},downplay:function(){this.trigger("normal")}});U_.extendChartView({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(e,t,i){var n=this,a=e.getGraph(),r=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),h=e.getData("edge"),c=e.get("orient");this._model=e,r.removeAll(),r.attr("position",[o.x,o.y]),a.eachEdge((function(t){var i=new ek;i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var n,a,o,u,d,p,f,g,m=t.getModel("lineStyle"),v=m.get("curveness"),y=t.node1.getLayout(),x=t.node1.getModel(),_=x.get("localX"),b=x.get("localY"),w=t.node2.getLayout(),S=t.node2.getModel(),M=S.get("localX"),I=S.get("localY"),A=t.getLayout();switch(i.shape.extent=Math.max(1,A.dy),i.shape.orient=c,"vertical"===c?(n=(null!=_?_*s:y.x)+A.sy,a=(null!=b?b*l:y.y)+y.dy,o=(null!=M?M*s:w.x)+A.ty,d=n,p=a*(1-v)+(u=null!=I?I*l:w.y)*v,f=o,g=a*v+u*(1-v)):(n=(null!=_?_*s:y.x)+y.dx,a=(null!=b?b*l:y.y)+A.sy,d=n*(1-v)+(o=null!=M?M*s:w.x)*v,p=a,f=n*v+o*(1-v),g=u=(null!=I?I*l:w.y)+A.ty),i.setShape({x1:n,y1:a,x2:o,y2:u,cpx1:d,cpy1:p,cpx2:f,cpy2:g}),i.setStyle(m.getItemStyle()),i.style.fill){case"source":i.style.fill=t.node1.getVisual("color");break;case"target":i.style.fill=t.node2.getVisual("color")}Jh.setHoverStyle(i,t.getModel("emphasis.lineStyle").getItemStyle()),r.add(i),h.setItemGraphicEl(t.dataIndex,i)})),a.eachNode((function(t){var i=t.getLayout(),n=t.getModel(),a=n.get("localX"),o=n.get("localY"),h=n.getModel("label"),c=n.getModel("emphasis.label"),d=new Jh.Rect({shape:{x:null!=a?a*s:i.x,y:null!=o?o*l:i.y,width:i.dx,height:i.dy},style:n.getModel("itemStyle").getItemStyle()}),p=t.getModel("emphasis.itemStyle").getItemStyle();Jh.setLabelStyle(d.style,p,h,c,{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),d.setStyle("fill",t.getVisual("color")),Jh.setHoverStyle(d,p),r.add(d),u.setItemGraphicEl(t.dataIndex,d),d.dataType="node"})),u.eachItemGraphicEl((function(t,a){var r=u.getItemModel(a);r.get("draggable")&&(t.drift=function(t,r){n._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=r,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(a),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){n._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move"),t.highlight=function(){this.trigger("emphasis")},t.downplay=function(){this.trigger("normal")},t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),r.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),h.eachItemGraphicEl((function(t,a){var r=h.getItemModel(a);t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),r.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),!this._data&&e.get("animation")&&r.setClipPath(function(e,t,i){var n=new Jh.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Jh.initProps(n,{shape:{width:e.width+20}},t,i),n}(r.getBoundingRect(),e,(function(){r.removeClipPath()}))),this._data=e.getData()},dispose:function(){this._clearTimer()},_dispatchUnfocus:function(e){var t=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){t._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:t._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var a=e.getData(),r=a.graph,o=n.dataIndex,s=a.getItemModel(o),l=n.edgeDataIndex;if(null!=o||null!=l){var u=r.getNodeByIndex(o),h=r.getEdgeByIndex(l);if(r.eachNode((function(e){JP(e,YP,.1)})),r.eachEdge((function(e){JP(e,qP,.1)})),u){QP(u,XP);var c=s.get("focusNodeAdjacency");"outEdges"===c?Fe.each(u.outEdges,(function(e){e.dataIndex<0||(QP(e,$P),QP(e.node2,XP))})):"inEdges"===c?Fe.each(u.inEdges,(function(e){e.dataIndex<0||(QP(e,$P),QP(e.node1,XP))})):"allEdges"===c&&Fe.each(u.edges,(function(e){e.dataIndex<0||(QP(e,$P),e.node1!==u&&QP(e.node1,XP),e.node2!==u&&QP(e.node2,XP))}))}h&&(QP(h,$P),QP(h.node1,XP),QP(h.node2,XP))}},unfocusNodeAdjacency:function(e,t,i,n){var a=e.getGraph();a.eachNode((function(e){JP(e,YP)})),a.eachEdge((function(e){JP(e,qP)}))}}),U_.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])}))}));var tk=Ro.groupData;function ik(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function nk(e,t,i,n,a){var r="vertical"===a?"x":"y";Fe.each(e,(function(e){var o,s,l;e.sort((function(e,t){return e.getLayout()[r]-t.getLayout()[r]}));for(var u=0,h=e.length,c="vertical"===a?"dx":"dy",d=0;d<h;d++)(l=u-(s=e[d]).getLayout()[r])>0&&(o=s.getLayout()[r]+l,"vertical"===a?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[r]+s.getLayout()[c]+t;if((l=u-t-("vertical"===a?n:i))>0)for(o=s.getLayout()[r]-l,"vertical"===a?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o,d=h-2;d>=0;--d)(l=(s=e[d]).getLayout()[r]+s.getLayout()[c]+t-u)>0&&(o=s.getLayout()[r]-l,"vertical"===a?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[r]}))}function ak(e,t,i){Fe.each(e.slice().reverse(),(function(e){Fe.each(e,(function(e){if(e.outEdges.length){var n=ck(e.outEdges,rk,i)/ck(e.outEdges,hk,i);if(isNaN(n)){var a=e.outEdges.length;n=a?ck(e.outEdges,ok,i)/a:0}if("vertical"===i){var r=e.getLayout().x+(n-uk(e,i))*t;e.setLayout({x:r},!0)}else{var o=e.getLayout().y+(n-uk(e,i))*t;e.setLayout({y:o},!0)}}}))}))}function rk(e,t){return uk(e.node2,t)*e.getValue()}function ok(e,t){return uk(e.node2,t)}function sk(e,t){return uk(e.node1,t)*e.getValue()}function lk(e,t){return uk(e.node1,t)}function uk(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function hk(e){return e.getValue()}function ck(e,t,i){for(var n=0,a=e.length,r=-1;++r<a;){var o=+t.call(e,e[r],i);isNaN(o)||(n+=o)}return n}function dk(e,t,i){Fe.each(e,(function(e){Fe.each(e,(function(e){if(e.inEdges.length){var n=ck(e.inEdges,sk,i)/ck(e.inEdges,hk,i);if(isNaN(n)){var a=e.inEdges.length;n=a?ck(e.inEdges,lk,i)/a:0}if("vertical"===i){var r=e.getLayout().x+(n-uk(e,i))*t;e.setLayout({x:r},!0)}else{var o=e.getLayout().y+(n-uk(e,i))*t;e.setLayout({y:o},!0)}}}))}))}var pk=function(e,t,i){e.eachSeriesByType("sankey",(function(e){var i=e.get("nodeWidth"),n=e.get("nodeGap"),a=function(e,t){return ed.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=a;var r=a.width,o=a.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){Fe.each(e,(function(e){var t=ck(e.outEdges,hk),i=ck(e.inEdges,hk),n=e.getValue()||0,a=Math.max(t,i,n);e.setLayout({value:a},!0)}))}(l),function(e,t,i,n,a,r,o,s,l){(function(e,t,i,n,a,r,o){for(var s=[],l=[],u=[],h=[],c=0,d=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]);var f=-1;for(;u.length;){for(var g=0;g<u.length;g++){var m=u[g],v=m.hostGraph.data.getRawDataItem(m.dataIndex),y=null!=v.depth&&v.depth>=0;y&&v.depth>f&&(f=v.depth),m.setLayout({depth:y?v.depth:c},!0),"vertical"===r?m.setLayout({dy:i},!0):m.setLayout({dx:i},!0);for(var x=0;x<m.outEdges.length;x++){var _=m.outEdges[x];s[t.indexOf(_)]=0;var b=_.node2;0==--l[e.indexOf(b)]&&h.indexOf(b)<0&&h.push(b)}}++c,u=h,h=[]}for(p=0;p<s.length;p++)if(1===s[p])throw new Error("Sankey is a DAG, the original data has cycle!");var w=f>c-1?f:c-1;o&&"left"!==o&&function(e,t,i,n){if("right"===t){for(var a=[],r=e,o=0;r.length;){for(var s=0;s<r.length;s++){var l=r[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];a.indexOf(h.node1)<0&&a.push(h.node1)}}r=a,a=[],++o}Fe.each(e,(function(e){ik(e)||e.setLayout({depth:Math.max(0,n-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){Fe.each(e,(function(e){ik(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,n)}(e,o,0,w);d="vertical"===r?(a-i)/w:(n-i)/w;!function(e,t,i){Fe.each(e,(function(e){var n=e.getLayout().depth*t;"vertical"===i?e.setLayout({y:n},!0):e.setLayout({x:n},!0)}))}(e,d,r)})(e,t,i,a,r,s,l),function(e,t,i,n,a,r,o){var s=function(e,t){var i=[],n="vertical"===t?"y":"x",a=tk(e,(function(e){return e.getLayout()[n]}));return a.keys.sort((function(e,t){return e-t})),Fe.each(a.keys,(function(e){i.push(a.buckets.get(e))})),i}(e,o);(function(e,t,i,n,a,r){var o=1/0;Fe.each(e,(function(e){var t=e.length,s=0;Fe.each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===r?(n-(t-1)*a)/s:(i-(t-1)*a)/s;l<o&&(o=l)})),Fe.each(e,(function(e){Fe.each(e,(function(e,t){var i=e.getLayout().value*o;"vertical"===r?(e.setLayout({x:t},!0),e.setLayout({dx:i},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:i},!0))}))})),Fe.each(t,(function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)}))})(s,t,i,n,a,o),nk(s,a,i,n,o);for(var l=1;r>0;r--)ak(s,l*=.99,o),nk(s,a,i,n,o),dk(s,l,o),nk(s,a,i,n,o)}(e,t,r,a,n,o,s),function(e,t){var i="vertical"===t?"x":"y";Fe.each(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[i]-t.node2.getLayout()[i]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[i]-t.node1.getLayout()[i]}))})),Fe.each(e,(function(e){var t=0,i=0;Fe.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),Fe.each(e.inEdges,(function(e){e.setLayout({ty:i},!0),i+=e.getLayout().dy}))}))}(e,s)}(l,u,i,n,r,o,0!==Fe.filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))};var fk=function(e,t){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var i=1/0,n=-1/0;Fe.each(t,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>n&&(n=t)})),Fe.each(t,(function(t){var a=new lC({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),r=t.getModel().get("itemStyle.color");null!=r?t.setVisual("color",r):t.setVisual("color",a)}))}}))};U_.registerLayout(pk),U_.registerVisual(fk);var gk=nv.getDimensionTypeByAxis,mk=Jd.makeSeriesEncodeForAxisCoordSys,vk={seriesModelMixin:{_baseAxisDim:null,getInitialData:function(e,t){var i,n,a=t.getComponent("xAxis",this.get("xAxisIndex")),r=t.getComponent("yAxis",this.get("yAxisIndex")),o=a.get("type"),s=r.get("type");"category"===o?(e.layout="horizontal",i=a.getOrdinalMeta(),n=!0):"category"===s?(e.layout="vertical",i=r.getOrdinalMeta(),n=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[a,r],p=d[u].get("type"),f=d[1-u].get("type"),g=e.data;if(g&&n){var m=[];Fe.each(g,(function(e,t){var i;e.value&&Fe.isArray(e.value)?(i=e.value.slice(),e.value.unshift(t)):Fe.isArray(e)?(i=e.slice(),e.unshift(t)):i=e,m.push(i)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:h,type:gk(p),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:gk(f),dimsDef:v.slice()}];return lM(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:Fe.curry(mk,y,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}}},yk=vk.seriesModelMixin,xk=ng.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});Fe.mixin(xk,yk,!0);var _k=["itemStyle"],bk=["emphasis","itemStyle"];_g.extend({type:"boxplot",render:function(e,t,i){var n=e.getData(),a=this.group,r=this._data;this._data||a.removeAll();var o="horizontal"===e.get("layout")?1:0;n.diff(r).add((function(e){if(n.hasValue(e)){var t=Sk(n.getItemLayout(e),n,e,o,!0);n.setItemGraphicEl(e,t),a.add(t)}})).update((function(e,t){var i=r.getItemGraphicEl(t);if(n.hasValue(e)){var s=n.getItemLayout(e);i?Mk(s,i,n,e):i=Sk(s,n,e,o),a.add(i),n.setItemGraphicEl(e,i)}else a.remove(i)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&a.remove(t)})).execute(),this._data=n},remove:function(e){var t=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl((function(e){e&&t.remove(e)}))},dispose:Fe.noop});var wk=xl.extend({type:"boxplotBoxPath",shape:{},buildPath:function(e,t){var i=t.points,n=0;for(e.moveTo(i[n][0],i[n][1]),n++;n<4;n++)e.lineTo(i[n][0],i[n][1]);for(e.closePath();n<i.length;n++)e.moveTo(i[n][0],i[n][1]),n++,e.lineTo(i[n][0],i[n][1])}});function Sk(e,t,i,n,a){var r=e.ends,o=new wk({shape:{points:a?Ik(r,n,e):r}});return Mk(e,o,t,i,a),o}function Mk(e,t,i,n,a){var r=i.hostModel;(0,Jh[a?"initProps":"updateProps"])(t,{shape:{points:e.ends}},r,n);var o=i.getItemModel(n),s=o.getModel(_k),l=i.getItemVisual(n,"color"),u=s.getItemStyle(["borderColor"]);u.stroke=l,u.strokeNoScale=!0,t.useStyle(u),t.z2=100;var h=o.getModel(bk).getItemStyle();Jh.setHoverStyle(t,h)}function Ik(e,t,i){return Fe.map(e,(function(e){return(e=e.slice())[t]=i.initBaseline,e}))}var Ak=["itemStyle","borderColor"];var Tk=function(e,t){var i=e.get("color");e.eachRawSeriesByType("boxplot",(function(t){var n=i[t.seriesIndex%i.length],a=t.getData();a.setVisual({legendSymbol:"roundRect",color:t.get(Ak)||n}),e.isSeriesFiltered(t)||a.each((function(e){var t=a.getItemModel(e);a.setItemVisual(e,{color:t.get(Ak,!0)})}))}))},Ck=Cc.parsePercent,Dk=Fe.each;var Lk=function(e){var t=function(e){var t=[],i=[];return e.eachSeriesByType("boxplot",(function(e){var n=e.getBaseAxis(),a=Fe.indexOf(i,n);a<0&&(a=i.length,i[a]=n,t[a]={axis:n,seriesModels:[]}),t[a].seriesModels.push(e)})),t}(e);Dk(t,(function(e){var t=e.seriesModels;t.length&&(!function(e){var t,i,n=e.axis,a=e.seriesModels,r=a.length,o=e.boxWidthList=[],s=e.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;Dk(a,(function(e){u=Math.max(u,e.getData().count())})),t=n.getExtent(),Math.abs(t[1]-t[0])}Dk(a,(function(e){var t=e.get("boxWidth");Fe.isArray(t)||(t=[t,t]),l.push([Ck(t[0],i)||0,Ck(t[1],i)||0])}));var h=.8*i-2,c=h/r*.3,d=(h-c*(r-1))/r,p=d/2-h/2;Dk(a,(function(e,t){s.push(p),p+=c+d,o.push(Math.min(Math.max(d,l[t][0]),l[t][1]))}))}(e),Dk(t,(function(t,i){!function(e,t,i){var n=e.coordinateSystem,a=e.getData(),r=i/2,o="horizontal"===e.get("layout")?0:1,s=1-o,l=["x","y"],u=a.mapDimension(l[o]),h=a.mapDimension(l[s],!0);if(null==u||h.length<5)return;for(var c=0;c<a.count();c++){var d=a.get(u,c),p=x(d,h[2],c),f=x(d,h[0],c),g=x(d,h[1],c),m=x(d,h[3],c),v=x(d,h[4],c),y=[];_(y,g,0),_(y,m,1),y.push(f,g,v,m),b(y,f),b(y,v),b(y,p),a.setItemLayout(c,{initBaseline:p[s],ends:y})}function x(e,i,r){var l,u=a.get(i,r),h=[];return h[o]=e,h[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=n.dataToPoint(h))[o]+=t,l}function _(e,t,i){var n=t.slice(),a=t.slice();n[o]+=r,a[o]-=r,i?e.push(n,a):e.push(a,n)}function b(e,t){var i=t.slice(),n=t.slice();i[o]-=r,n[o]+=r,e.push(i,n)}}(t,e.boxOffsetList[i],e.boxWidthList[i])})))}))};U_.registerVisual(Tk),U_.registerLayout(Lk);var Pk=vk.seriesModelMixin,kk=ng.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(e,t,i){var n=t.getItemLayout(e);return n&&i.rect(n.brushRect)}});Fe.mixin(kk,Pk,!0);var Ok=Vb.createClipPath,Rk=["itemStyle"],Ek=["emphasis","itemStyle"],Nk=["color","color0","borderColor","borderColor0"];_g.extend({type:"candlestick",render:function(e,t,i){this.group.removeClipPath(),this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e){var t=e.getData(),i=this._data,n=this.group,a=t.getLayout("isSimpleBox"),r=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||n.removeAll(),t.diff(i).add((function(i){if(t.hasValue(i)){var o,l=t.getItemLayout(i);if(r&&Vk(s,l))return;o=Bk(l,i,!0),Jh.initProps(o,{shape:{points:l.ends}},e,i),Gk(o,t,i,a),n.add(o),t.setItemGraphicEl(i,o)}})).update((function(o,l){var u=i.getItemGraphicEl(l);if(t.hasValue(o)){var h=t.getItemLayout(o);r&&Vk(s,h)?n.remove(u):(u?Jh.updateProps(u,{shape:{points:h.ends}},e,o):u=Bk(h),Gk(u,t,o,a),n.add(u),t.setItemGraphicEl(o,u))}else n.remove(u)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&n.remove(t)})).execute(),this._data=t},_renderLarge:function(e){this._clear(),Wk(e,this.group);var t=e.get("clip",!0)?Ok(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},_incrementalRenderNormal:function(e,t){for(var i,n=t.getData(),a=n.getLayout("isSimpleBox");null!=(i=e.next());){var r;Gk(r=Bk(n.getItemLayout(i)),n,i,a),r.incremental=!0,this.group.add(r)}},_incrementalRenderLarge:function(e,t){Wk(t,this.group,!0)},remove:function(e){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:Fe.noop});var zk=xl.extend({type:"normalCandlestickBox",shape:{},buildPath:function(e,t){var i=t.points;this.__simpleBox?(e.moveTo(i[4][0],i[4][1]),e.lineTo(i[6][0],i[6][1])):(e.moveTo(i[0][0],i[0][1]),e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]),e.lineTo(i[3][0],i[3][1]),e.closePath(),e.moveTo(i[4][0],i[4][1]),e.lineTo(i[5][0],i[5][1]),e.moveTo(i[6][0],i[6][1]),e.lineTo(i[7][0],i[7][1]))}});function Bk(e,t,i){var n=e.ends;return new zk({shape:{points:i?Fk(n,e):n},z2:100})}function Vk(e,t){for(var i=!0,n=0;n<t.ends.length;n++)if(e.contain(t.ends[n][0],t.ends[n][1])){i=!1;break}return i}function Gk(e,t,i,n){var a=t.getItemModel(i),r=a.getModel(Rk),o=t.getItemVisual(i,"color"),s=t.getItemVisual(i,"borderColor")||o,l=r.getItemStyle(Nk);e.useStyle(l),e.style.strokeNoScale=!0,e.style.fill=o,e.style.stroke=s,e.__simpleBox=n;var u=a.getModel(Ek).getItemStyle();Jh.setHoverStyle(e,u)}function Fk(e,t){return Fe.map(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var Hk=xl.extend({type:"largeCandlestickBox",shape:{},buildPath:function(e,t){for(var i=t.points,n=0;n<i.length;)if(this.__sign===i[n++]){var a=i[n++];e.moveTo(a,i[n++]),e.lineTo(a,i[n++])}else n+=3}});function Wk(e,t,i){var n=e.getData(),a=n.getLayout("largePoints"),r=new Hk({shape:{points:a},__sign:1});t.add(r);var o=new Hk({shape:{points:a},__sign:-1});t.add(o),Uk(1,r,e,n),Uk(-1,o,e,n),i&&(r.incremental=!0,o.incremental=!0)}function Uk(e,t,i,n){var a=e>0?"P":"N",r=n.getVisual("borderColor"+a)||n.getVisual("color"+a),o=i.getModel(Rk).getItemStyle(Nk);t.useStyle(o),t.style.fill=null,t.style.stroke=r}var jk=function(e){e&&Fe.isArray(e.series)&&Fe.each(e.series,(function(e){Fe.isObject(e)&&"k"===e.type&&(e.type="candlestick")}))},Zk=["itemStyle","borderColor"],Yk=["itemStyle","borderColor0"],Xk=["itemStyle","color"],qk=["itemStyle","color0"],$k={seriesType:"candlestick",plan:lg(),performRawSeries:!0,reset:function(e,t){if(e.getData().setVisual({legendSymbol:"roundRect",colorP:i(1,e),colorN:i(-1,e),borderColorP:n(1,e),borderColorN:n(-1,e)}),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){var a;for(;null!=(a=e.next());){var r=t.getItemModel(a),o=t.getItemLayout(a).sign;t.setItemVisual(a,{color:i(o,r),borderColor:n(o,r)})}}};function i(e,t){return t.get(e>0?Xk:qk)}function n(e,t){return t.get(e>0?Zk:Yk)}}},Kk=$k,Jk=Jh.subPixelOptimize,Qk=Cc.parsePercent,eO=Fe.retrieve2,tO="undefined"!=typeof Float32Array?Float32Array:Array,iO={seriesType:"candlestick",plan:lg(),reset:function(e){var t=e.coordinateSystem,i=e.getData(),n=function(e,t){var i,n=e.getBaseAxis(),a="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/t.count()),r=Qk(eO(e.get("barMaxWidth"),a),a),o=Qk(eO(e.get("barMinWidth"),1),a),s=e.get("barWidth");return null!=s?Qk(s,a):Math.max(Math.min(a/2,r),o)}(e,i),a=["x","y"],r=i.mapDimension(a[0]),o=i.mapDimension(a[1],!0),s=o[0],l=o[1],u=o[2],h=o[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==r||o.length<4))return{progress:e.pipelineContext.large?function(e,i){var n,a,o=new tO(4*e.count),c=0,d=[],p=[];for(;null!=(a=e.next());){var f=i.get(r,a),g=i.get(s,a),m=i.get(l,a),v=i.get(u,a),y=i.get(h,a);isNaN(f)||isNaN(v)||isNaN(y)?(o[c++]=NaN,c+=3):(o[c++]=nO(i,a,g,m,l),d[0]=f,d[1]=v,n=t.dataToPoint(d,null,p),o[c++]=n?n[0]:NaN,o[c++]=n?n[1]:NaN,d[1]=y,n=t.dataToPoint(d,null,p),o[c++]=n?n[1]:NaN)}i.setLayout("largePoints",o)}:function(e,i){var a;for(;null!=(a=e.next());){var o=i.get(r,a),c=i.get(s,a),d=i.get(l,a),p=i.get(u,a),f=i.get(h,a),g=Math.min(c,d),m=Math.max(c,d),v=w(g,o),y=w(m,o),x=w(p,o),_=w(f,o),b=[];S(b,y,0),S(b,v,1),b.push(I(_),I(y),I(x),I(v)),i.setItemLayout(a,{sign:nO(i,a,c,d,l),initBaseline:c>d?y[1]:v[1],ends:b,brushRect:M(p,f,o)})}function w(e,i){var n=[];return n[0]=i,n[1]=e,isNaN(i)||isNaN(e)?[NaN,NaN]:t.dataToPoint(n)}function S(e,t,i){var a=t.slice(),r=t.slice();a[0]=Jk(a[0]+n/2,1,!1),r[0]=Jk(r[0]-n/2,1,!0),i?e.push(a,r):e.push(r,a)}function M(e,t,i){var a=w(e,i),r=w(t,i);return a[0]-=n/2,r[0]-=n/2,{x:a[0],y:a[1],width:n,height:r[1]-a[1]}}function I(e){return e[0]=Jk(e[0],1),e}}}}};function nO(e,t,i,n,a){return i>n?-1:i<n?1:t>0?e.get(a,t-1)<=n?1:-1:1}var aO=iO;U_.registerPreprocessor(jk),U_.registerVisual(Kk),U_.registerLayout(aO),ng.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(e,t){return hy(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",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}});var rO=Hx.createSymbol,oO=Jh.Group,sO=Cc.parsePercent;function lO(e,t){var i=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?i:null,fill:"fill"===t.brushType?i:null}})}))}function uO(e,t){oO.call(this);var i=new sb(e,t),n=new oO;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(e,t)}var hO=uO.prototype;hO.stopEffectAnimation=function(){this.childAt(1).removeAll()},hO.startEffectAnimation=function(e){for(var t=e.symbolType,i=e.color,n=this.childAt(1),a=0;a<3;a++){var r=rO(t,-1,-1,2,2,i);r.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var o=-a/3*e.period+e.effectOffset;r.animate("",!0).when(e.period,{scale:[e.rippleScale/2,e.rippleScale/2]}).delay(o).start(),r.animateStyle(!0).when(e.period,{opacity:0}).delay(o).start(),n.add(r)}lO(n,e)},hO.updateEffectAnimation=function(e){for(var t=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],a=0;a<n.length;a++){var r=n[a];if(t[r]!==e[r])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}lO(i,e)},hO.highlight=function(){this.trigger("emphasis")},hO.downplay=function(){this.trigger("normal")},hO.updateData=function(e,t){var i=e.hostModel;this.childAt(0).updateData(e,t);var n=this.childAt(1),a=e.getItemModel(t),r=e.getItemVisual(t,"symbol"),o=function(e){return Fe.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),s=e.getItemVisual(t,"color");n.attr("scale",o),n.traverse((function(e){e.attr({fill:s})}));var l=a.getShallow("symbolOffset");if(l){var u=n.position;u[0]=sO(l[0],o[0]),u[1]=sO(l[1],o[1])}var h=e.getItemVisual(t,"symbolRotate");n.rotation=(h||0)*Math.PI/180||0;var c={};if(c.showEffectOn=i.get("showEffectOn"),c.rippleScale=a.get("rippleEffect.scale"),c.brushType=a.get("rippleEffect.brushType"),c.period=1e3*a.get("rippleEffect.period"),c.effectOffset=t/e.count(),c.z=a.getShallow("z")||0,c.zlevel=a.getShallow("zlevel")||0,c.symbolType=r,c.color=s,c.rippleEffectColor=a.get("rippleEffect.color"),this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===c.showEffectOn)this._effectCfg?this.updateEffectAnimation(c):this.startEffectAnimation(c),this._effectCfg=c;else{this._effectCfg=null,this.stopEffectAnimation();var d=this.childAt(0),p=function(){d.highlight(),"render"!==c.showEffectOn&&this.startEffectAnimation(c)},f=function(){d.downplay(),"render"!==c.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",p,this).on("mouseout",f,this).on("emphasis",p,this).on("normal",f,this)}this._effectCfg=c},hO.fadeOut=function(e){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),e&&e()},Fe.inherits(uO,oO);var cO=uO;U_.extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new fb(cO)},render:function(e,t,i){var n=e.getData(),a=this._symbolDraw;a.updateData(n),this.group.add(a.group)},updateTransform:function(e,t,i){var n=e.getData();this.group.dirty();var a=nw().reset(e);a.progress&&a.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateGroupTransform:function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=ri.clone(t.getRoamTransform()),this.group.decomposeTransform())},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(t)},dispose:function(){}}),U_.registerVisual(ew("effectScatter","circle")),U_.registerLayout(nw("effectScatter"));var dO=Fe.concatArray,pO=Fe.mergeAll,fO=Fe.map,gO=Fc.encodeHTML,mO="undefined"==typeof Uint32Array?Array:Uint32Array,vO="undefined"==typeof Float64Array?Array:Float64Array;function yO(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=fO(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),pO([t,e[0],e[1]])})))}var xO=ng.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(e){e.data=e.data||[],yO(e);var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),xO.superApply(this,"init",arguments)},mergeOption:function(e){if(e.data=e.data||[],yO(e),e.data){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count))}xO.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=dO(this._flatCoords,t.flatCoords),this._flatCoordsOffset=dO(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e);return t.option instanceof Array?t.option:t.getShallow("coords")},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],a=0;a<n;a++)t[a]=t[a]||[],t[a][0]=this._flatCoords[i+2*a],t[a][1]=this._flatCoords[i+2*a+1];return n}var r=this._getCoordsFromItemModel(e);for(a=0;a<r.length;a++)t[a]=t[a]||[],t[a][0]=r[a][0],t[a][1]=r[a][1];return r.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var i=e.length,n=new mO(i),a=new vO(i),r=0,o=0,s=0,l=0;l<i;){s++;var u=e[l++];n[o++]=r+t,n[o++]=u;for(var h=0;h<u;h++){var c=e[l++],d=e[l++];a[r++]=c,a[r++]=d}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:a,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new Pv(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,a){if(e instanceof Array)return NaN;i.hasItemOption=!0;var r=e.value;return null!=r?r instanceof Array?r[a]:r:void 0})),i},formatTooltip:function(e){var t=this.getData().getItemModel(e),i=t.get("name");if(i)return i;var n=t.get("fromName"),a=t.get("toName"),r=[];return null!=n&&r.push(n),null!=a&&r.push(a),gO(r.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!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}}}),_O=Hx.createSymbol;function bO(e,t,i){Jh.Group.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var wO=bO.prototype;wO.createLine=function(e,t,i){return new iD(e,t,i)},wO._updateEffectSymbol=function(e,t){var i=e.getItemModel(t).getModel("effect"),n=i.get("symbolSize"),a=i.get("symbol");Fe.isArray(n)||(n=[n,n]);var r=i.get("color")||e.getItemVisual(t,"color"),o=this.childAt(1);this._symbolType!==a&&(this.remove(o),(o=_O(a,-.5,-.5,1,1,r)).z2=100,o.culling=!0,this.add(o)),o&&(o.setStyle("shadowColor",r),o.setStyle(i.getItemStyle(["color"])),o.attr("scale",n),o.setColor(r),o.attr("scale",n),this._symbolType=a,this._symbolScale=n,this._updateEffectAnimation(e,i,t))},wO._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var a=this,r=e.getItemLayout(i),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=Fe.retrieve(t.get("delay"),(function(t){return t/e.count()*o/3})),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,r),l>0&&(o=this.getLineLength(n)/l*1e3),o!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-o*n.__t),n.__t=0;var d=n.animate("",s).when(o,{__t:1}).delay(c).during((function(){a.updateSymbolPosition(n)}));s||d.done((function(){a.remove(n)})),d.start()}this._period=o,this._loop=s}},wO.getLineLength=function(e){return ht.dist(e.__p1,e.__cp1)+ht.dist(e.__cp1,e.__p2)},wO.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]},wO.updateData=function(e,t,i){this.childAt(0).updateData(e,t,i),this._updateEffectSymbol(e,t)},wO.updateSymbolPosition=function(e){var t=e.__p1,i=e.__p2,n=e.__cp1,a=e.__t,r=e.position,o=[r[0],r[1]],s=vs.quadraticAt,l=vs.quadraticDerivativeAt;r[0]=s(t[0],n[0],i[0],a),r[1]=s(t[1],n[1],i[1],a);var u=l(t[0],n[0],i[0],a),h=l(t[1],n[1],i[1],a);if(e.rotation=-Math.atan2(h,u)-Math.PI/2,"line"===this._symbolType||"rect"===this._symbolType||"roundRect"===this._symbolType)if(void 0!==e.__lastT&&e.__lastT<e.__t){var c=1.05*ht.dist(o,r);e.attr("scale",[e.scale[0],c]),1===a&&(r[0]=o[0]+(r[0]-o[0])/2,r[1]=o[1]+(r[1]-o[1])/2)}else if(1===e.__lastT){c=2*ht.dist(t,r);e.attr("scale",[e.scale[0],c])}else e.attr("scale",this._symbolScale);e.__lastT=e.__t,e.ignore=!1},wO.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var i=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,i,t)},Fe.inherits(bO,Jh.Group);var SO=bO;function MO(e,t,i){Jh.Group.call(this),this._createPolyline(e,t,i)}var IO=MO.prototype;IO._createPolyline=function(e,t,i){var n=e.getItemLayout(t),a=new Jh.Polyline({shape:{points:n}});this.add(a),this._updateCommonStl(e,t,i)},IO.updateData=function(e,t,i){var n=e.hostModel,a=this.childAt(0),r={shape:{points:e.getItemLayout(t)}};Jh.updateProps(a,r,n,t),this._updateCommonStl(e,t,i)},IO._updateCommonStl=function(e,t,i){var n=this.childAt(0),a=e.getItemModel(t),r=e.getItemVisual(t,"color"),o=i&&i.lineStyle,s=i&&i.hoverLineStyle;i&&!e.hasItemOption||(o=a.getModel("lineStyle").getLineStyle(),s=a.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(Fe.defaults({strokeNoScale:!0,fill:"none",stroke:r},o)),n.hoverStyle=s,Jh.setHoverStyle(this)},IO.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},Fe.inherits(MO,Jh.Group);var AO=MO;function TO(e,t,i){SO.call(this,e,t,i),this._lastFrame=0,this._lastFramePercent=0}var CO=TO.prototype;CO.createLine=function(e,t,i){return new AO(e,t,i)},CO.updateAnimationPoints=function(e,t){this._points=t;for(var i=[0],n=0,a=1;a<t.length;a++){var r=t[a-1],o=t[a];n+=ht.dist(r,o),i.push(n)}if(0!==n){for(a=0;a<i.length;a++)i[a]/=n;this._offsets=i,this._length=n}},CO.getLineLength=function(e){return this._length},CO.updateSymbolPosition=function(e){var t=e.__t,i=this._points,n=this._offsets,a=i.length;if(n){var r=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(r+1,a-1);o>=0&&!(n[o]<=t);o--);o=Math.min(o,a-2)}else{for(var o=r;o<a&&!(n[o]>t);o++);o=Math.min(o-1,a-2)}ht.lerp(e.position,i[o],i[o+1],(t-n[o])/(n[o+1]-n[o]));var s=i[o+1][0]-i[o][0],l=i[o+1][1]-i[o][1];e.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},Fe.inherits(TO,SO);var DO=TO,LO=Jh.extendShape({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(e,t){var i=t.segs,n=t.curveness;if(t.polyline)for(var a=0;a<i.length;){var r=i[a++];if(r>0){e.moveTo(i[a++],i[a++]);for(var o=1;o<r;o++)e.lineTo(i[a++],i[a++])}}else for(a=0;a<i.length;){var s=i[a++],l=i[a++],u=i[a++],h=i[a++];if(e.moveTo(s,l),n>0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;e.quadraticCurveTo(c,d,u,h)}else e.lineTo(u,h)}},findDataIndex:function(e,t){var i=this.shape,n=i.segs,a=i.curveness;if(i.polyline)for(var r=0,o=0;o<n.length;){var s=n[o++];if(s>0)for(var l=n[o++],u=n[o++],h=1;h<s;h++){var c=n[o++],d=n[o++];if(qs.containStroke(l,u,c,d))return r}r++}else for(r=0,o=0;o<n.length;){l=n[o++],u=n[o++],c=n[o++],d=n[o++];if(a>0){var p=(l+c)/2-(u-d)*a,f=(u+d)/2-(c-l)*a;if(Js.containStroke(l,u,p,f,c,d))return r}else if(qs.containStroke(l,u,c,d))return r;r++}return-1}});function PO(){this.group=new Jh.Group}var kO=PO.prototype;kO.isPersistent=function(){return!this._incremental},kO.updateData=function(e){this.group.removeAll();var t=new LO({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},kO.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new Fu({silent:!0})),this.group.add(this._incremental)):this._incremental=null},kO.incrementalUpdate=function(e,t){var i=new LO;i.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(i,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=e.start,this.group.add(i))},kO.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},kO._setCommon=function(e,t,i){var n=t.hostModel;e.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),e.useStyle(n.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var a=t.getVisual("color");a&&e.setStyle("stroke",a),e.setStyle("fill"),i||(e.seriesIndex=n.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>0&&(e.dataIndex=i+e.__startIndex)})))},kO._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var OO=PO,RO={seriesType:"lines",plan:lg(),reset:function(e){var t=e.coordinateSystem,i=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(a,r){var o=[];if(n){var s,l=a.end-a.start;if(i){for(var u=0,h=a.start;h<a.end;h++)u+=e.getLineCoordsCount(h);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var c=0,d=[];for(h=a.start;h<a.end;h++){var p=e.getLineCoords(h,o);i&&(s[c++]=p);for(var f=0;f<p;f++)d=t.dataToPoint(o[f],!1,d),s[c++]=d[0],s[c++]=d[1]}r.setLayout("linesPoints",s)}else for(h=a.start;h<a.end;h++){var g=r.getItemModel(h),m=(p=e.getLineCoords(h,o),[]);if(i)for(var v=0;v<p;v++)m.push(t.dataToPoint(o[v]));else{m[0]=t.dataToPoint(o[0]),m[1]=t.dataToPoint(o[1]);var y=g.get("lineStyle.curveness");+y&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*y,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*y])}r.setItemLayout(h,m)}}}}},EO=RO,NO=Vb.createClipPath;function zO(e){return e instanceof Array||(e=[e,e]),e}U_.extendChartView({type:"lines",init:function(){},render:function(e,t,i){var n=e.getData(),a=this._updateLineDraw(n,e),r=e.get("zlevel"),o=e.get("effect.trailLength"),s=i.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(r).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&o&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),a.updateData(n);var u=e.get("clip",!0)&&NO(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateLineDraw(n,e).incrementalPrepareUpdate(n),this._clearLayer(i),this._finished=!1},incrementalRender:function(e,t,i){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData(),a=e.pipelineContext;if(!this._finished||a.large||a.progressiveRender)return{update:!0};var r=EO.reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._lineDraw.updateLayout(),this._clearLayer(i)},_updateLineDraw:function(e,t){var i=this._lineDraw,n=this._showEffect(t),a=!!t.get("polyline"),r=t.pipelineContext.large;return i&&n===this._hasEffet&&a===this._isPolyline&&r===this._isLargeDraw||(i&&i.remove(),i=this._lineDraw=r?new OO:new lD(a?n?DO:AO:n?SO:iD),this._hasEffet=n,this._isPolyline=a,this._isLargeDraw=r,this.group.removeAll()),this.group.add(i.group),i},_showEffect:function(e){return!!e.get("effect.show")},_clearLayer:function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},dispose:function(){}});var BO="lineStyle.opacity".split("."),VO={seriesType:"lines",reset:function(e,t,i){var n=zO(e.get("symbol")),a=zO(e.get("symbolSize")),r=e.getData();return r.setVisual("fromSymbol",n&&n[0]),r.setVisual("toSymbol",n&&n[1]),r.setVisual("fromSymbolSize",a&&a[0]),r.setVisual("toSymbolSize",a&&a[1]),r.setVisual("opacity",e.get(BO)),{dataEach:r.hasItemOption?function(e,t){var i=e.getItemModel(t),n=zO(i.getShallow("symbol",!0)),a=zO(i.getShallow("symbolSize",!0)),r=i.get(BO);n[0]&&e.setItemVisual(t,"fromSymbol",n[0]),n[1]&&e.setItemVisual(t,"toSymbol",n[1]),a[0]&&e.setItemVisual(t,"fromSymbolSize",a[0]),a[1]&&e.setItemVisual(t,"toSymbolSize",a[1]),e.setItemVisual(t,"opacity",r)}:null}}};U_.registerLayout(EO),U_.registerVisual(VO),ng.extend({type:"series.heatmap",getInitialData:function(e,t){return hy(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var e=Sp.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});function GO(){var e=Fe.createCanvas();this.canvas=e,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}GO.prototype={update:function(e,t,i,n,a,r){var o=this._getBrush(),s=this._getGradient(e,a,"inRange"),l=this._getGradient(e,a,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=e.length;h.width=t,h.height=i;for(var p=0;p<d;++p){var f=e[p],g=f[0],m=f[1],v=n(f[2]);c.globalAlpha=v,c.drawImage(o,g-u,m-u)}if(!h.width||!h.height)return h;for(var y=c.getImageData(0,0,h.width,h.height),x=y.data,_=0,b=x.length,w=this.minOpacity,S=this.maxOpacity-w;_<b;){v=x[_+3]/256;var M=4*Math.floor(255*v);if(v>0){var I=r(v)?s:l;v>0&&(v=v*S+w),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var e=this._brushCanvas||(this._brushCanvas=Fe.createCanvas()),t=this.pointSize+this.blurSize,i=2*t;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),e},_getGradient:function(e,t,i){for(var n=this._gradientPixels,a=n[i]||(n[i]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,s=0;s<256;s++)t[i](s/255,!0,r),a[o++]=r[0],a[o++]=r[1],a[o++]=r[2],a[o++]=r[3];return a}};var FO=GO;U_.extendChartView({type:"heatmap",render:function(e,t,i){var n;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(i){i===e&&(n=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var a=e.coordinateSystem;"cartesian2d"===a.type||"calendar"===a.type?this._renderOnCartesianAndCalendar(e,i,0,e.getData().count()):function(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(a)&&this._renderOnGeo(a,e,n,i)},incrementalPrepareRender:function(e,t,i){this.group.removeAll()},incrementalRender:function(e,t,i,n){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,n,e.start,e.end,!0)},_renderOnCartesianAndCalendar:function(e,t,i,n,a){var r,o,s=e.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");r=l.getBandWidth(),o=u.getBandWidth()}for(var h=this.group,c=e.getData(),d="itemStyle",p="emphasis.itemStyle",f="label",g="emphasis.label",m=e.getModel(d).getItemStyle(["color"]),v=e.getModel(p).getItemStyle(),y=e.getModel(f),x=e.getModel(g),_=s.type,b="cartesian2d"===_?[c.mapDimension("x"),c.mapDimension("y"),c.mapDimension("value")]:[c.mapDimension("time"),c.mapDimension("value")],w=i;w<n;w++){var S;if("cartesian2d"===_){if(isNaN(c.get(b[2],w)))continue;var M=s.dataToPoint([c.get(b[0],w),c.get(b[1],w)]);S=new Jh.Rect({shape:{x:Math.floor(Math.round(M[0])-r/2),y:Math.floor(Math.round(M[1])-o/2),width:Math.ceil(r),height:Math.ceil(o)},style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}else{if(isNaN(c.get(b[1],w)))continue;S=new Jh.Rect({z2:1,shape:s.dataToRect([c.get(b[0],w)]).contentShape,style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}var I=c.getItemModel(w);c.hasItemOption&&(m=I.getModel(d).getItemStyle(["color"]),v=I.getModel(p).getItemStyle(),y=I.getModel(f),x=I.getModel(g));var A=e.getRawValue(w),T="-";A&&null!=A[2]&&(T=A[2]),Jh.setLabelStyle(m,v,y,x,{labelFetcher:e,labelDataIndex:w,defaultText:T,isRectText:!0}),S.setStyle(m),Jh.setHoverStyle(S,c.hasItemOption?v:Fe.extend({},v)),S.incremental=a,a&&(S.useHoverLayer=!0),h.add(S),c.setItemGraphicEl(w,S)}},_renderOnGeo:function(e,t,i,n){var a=i.targetVisuals.inRange,r=i.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new FO;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 h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,n.getWidth()),p=Math.min(l.height+l.y,n.getHeight()),f=d-h,g=p-c,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],v=o.mapArray(m,(function(t,i,n){var a=e.dataToPoint([t,i]);return a[0]-=h,a[1]-=c,a.push(n),a})),y=i.getExtent(),x="visualMap.continuous"===i.type?function(e,t){var i=e[1]-e[0];return t=[(t[0]-e[0])/i,(t[1]-e[0])/i],function(e){return e>=t[0]&&e<=t[1]}}(y,i.option.range):function(e,t,i){var n=e[1]-e[0],a=(t=Fe.map(t,(function(t){return{interval:[(t.interval[0]-e[0])/n,(t.interval[1]-e[0])/n]}}))).length,r=0;return function(e){for(var n=r;n<a;n++)if((o=t[n].interval)[0]<=e&&e<=o[1]){r=n;break}if(n===a)for(n=r-1;n>=0;n--){var o;if((o=t[n].interval)[0]<=e&&e<=o[1]){r=n;break}}return n>=0&&n<a&&i[n]}}(y,i.getPieceList(),i.option.selected);s.update(v,f,g,a.color.getNormalizer(),{inRange:a.color.getColorMapper(),outOfRange:r.color.getColorMapper()},x);var _=new Jh.Image({style:{width:f,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(_)},dispose:function(){}});var HO=PS.extend({type:"series.pictorialBar",dependencies:["grid"],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,hoverAnimation:!1},getInitialData:function(e){return e.stack=null,HO.superApply(this,"getInitialData",arguments)}}),WO=Hx.createSymbol,UO=Cc.parsePercent,jO=Cc.isNumeric,ZO=ES.setLabel,YO=["itemStyle","borderWidth"],XO=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],qO=new Jh.Circle;function $O(e,t,i,n){var a=e.getItemLayout(t),r=i.get("symbolRepeat"),o=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:t,layout:a,itemModel:i,symbolType:e.getItemVisual(t,"symbol")||"circle",color:e.getItemVisual(t,"color"),symbolClip:o,symbolRepeat:r,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};!function(e,t,i,n,a){var r,o=n.valueDim,s=e.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[o.wh]<=0);if(Fe.isArray(s)){var c=[KO(l,s[0])-u,KO(l,s[1])-u];c[1]<c[0]&&c.reverse(),r=c[h]}else r=null!=s?KO(l,s)-u:t?n.coordSysExtent[o.index][h]-u:i[o.wh];a.boundingLength=r,t&&(a.repeatCutLength=i[o.wh]);a.pxSign=r>0?1:r<0?-1:0}(i,r,a,n,c),function(e,t,i,n,a,r,o,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),p=e.getItemVisual(t,"symbolSize");Fe.isArray(p)?p=p.slice():(null==p&&(p="100%"),p=[p,p]);p[c.index]=UO(p[c.index],d),p[h.index]=UO(p[h.index],n?d:Math.abs(r)),u.symbolSize=p;var f=u.symbolScale=[p[0]/s,p[1]/s];f[h.index]*=(l.isHorizontal?-1:1)*o}(e,t,a,r,0,c.boundingLength,c.pxSign,u,n,c),function(e,t,i,n,a){var r=e.get(YO)||0;r&&(qO.attr({scale:t.slice(),rotation:i}),qO.updateTransform(),r/=qO.getLineScale(),r*=t[n.valueDim.index]);a.valueLineWidth=r}(i,c.symbolScale,l,n,c);var d=c.symbolSize,p=i.get("symbolOffset");return Fe.isArray(p)&&(p=[UO(p[0],d[0]),UO(p[1],d[1])]),function(e,t,i,n,a,r,o,s,l,u,h,c){var d=h.categoryDim,p=h.valueDim,f=c.pxSign,g=Math.max(t[p.index]+s,0),m=g;if(n){var v=Math.abs(l),y=Fe.retrieve(e.get("symbolMargin"),"15%")+"",x=!1;y.lastIndexOf("!")===y.length-1&&(x=!0,y=y.slice(0,y.length-1)),y=UO(y,t[p.index]);var _=Math.max(g+2*y,0),b=x?0:2*y,w=jO(n),S=w?n:pR((v+b)/_);_=g+2*(y=(v-S*g)/2/(x?S:S-1)),b=x?0:2*y,w||"fixed"===n||(S=u?pR((Math.abs(u)+b)/_):0),m=S*_-b,c.repeatTimes=S,c.symbolMargin=y}var M=f*(m/2),I=c.pathPosition=[];I[d.index]=i[d.wh]/2,I[p.index]="start"===o?M:"end"===o?l-M:l/2,r&&(I[0]+=r[0],I[1]+=r[1]);var A=c.bundlePosition=[];A[d.index]=i[d.xy],A[p.index]=i[p.xy];var T=c.barRectShape=Fe.extend({},i);T[p.wh]=f*Math.max(Math.abs(i[p.wh]),Math.abs(I[p.index]+M)),T[d.wh]=i[d.wh];var C=c.clipShape={};C[d.xy]=-i[d.xy],C[d.wh]=h.ecSize[d.wh],C[p.xy]=0,C[p.wh]=i[p.wh]}(i,d,a,r,0,p,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function KO(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function JO(e){var t=e.symbolPatternSize,i=WO(e.symbolType,-t/2,-t/2,t,t,e.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function QO(e,t,i,n){var a=e.__pictorialBundle,r=i.symbolSize,o=i.valueLineWidth,s=i.pathPosition,l=t.valueDim,u=i.repeatTimes||0,h=0,c=r[t.valueDim.index]+o+2*i.symbolMargin;for(hR(e,(function(e){e.__pictorialAnimationIndex=h,e.__pictorialRepeatTimes=u,h<u?cR(e,null,f(h),i,n):cR(e,null,{scale:[0,0]},i,n,(function(){a.remove(e)})),oR(e,i),h++}));h<u;h++){var d=JO(i);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,a.add(d);var p=f(h);cR(d,{position:p.position,scale:[0,0]},{scale:p.scale,rotation:p.rotation},i,n),d.on("mouseover",g).on("mouseout",m),oR(d,i)}function f(e){var t=s.slice(),n=i.pxSign,a=e;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(a=u-1-e),t[l.index]=c*(a-u/2+.5)+s[l.index],{position:t,scale:i.symbolScale.slice(),rotation:i.rotation}}function g(){hR(e,(function(e){e.trigger("emphasis")}))}function m(){hR(e,(function(e){e.trigger("normal")}))}}function eR(e,t,i,n){var a=e.__pictorialBundle,r=e.__pictorialMainPath;r?cR(r,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(r=e.__pictorialMainPath=JO(i),a.add(r),cR(r,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),r.on("mouseover",(function(){this.trigger("emphasis")})).on("mouseout",(function(){this.trigger("normal")}))),oR(r,i)}function tR(e,t,i){var n=Fe.extend({},t.barRectShape),a=e.__pictorialBarRect;a?cR(a,null,{shape:n},t,i):(a=e.__pictorialBarRect=new Jh.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(a))}function iR(e,t,i,n){if(i.symbolClip){var a=e.__pictorialClipPath,r=Fe.extend({},i.clipShape),o=t.valueDim,s=i.animationModel,l=i.dataIndex;if(a)Jh.updateProps(a,{shape:r},s,l);else{r[o.wh]=0,a=new Jh.Rect({shape:r}),e.__pictorialBundle.setClipPath(a),e.__pictorialClipPath=a;var u={};u[o.wh]=i.clipShape[o.wh],Jh[n?"updateProps":"initProps"](a,{shape:u},s,l)}}}function nR(e,t){var i=e.getItemModel(t);return i.getAnimationDelayParams=aR,i.isAnimationEnabled=rR,i}function aR(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function rR(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function oR(e,t){e.off("emphasis").off("normal");var i=t.symbolScale.slice();t.hoverAnimation&&e.on("emphasis",(function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")})).on("normal",(function(){this.animateTo({scale:i.slice()},400,"elasticOut")}))}function sR(e,t,i,n){var a=new Jh.Group,r=new Jh.Group;return a.add(r),a.__pictorialBundle=r,r.attr("position",i.bundlePosition.slice()),i.symbolRepeat?QO(a,t,i):eR(a,0,i),tR(a,i,n),iR(a,t,i,n),a.__pictorialShapeStr=uR(e,i),a.__pictorialSymbolMeta=i,a}function lR(e,t,i,n){var a=n.__pictorialBarRect;a&&(a.style.text=null);var r=[];hR(n,(function(e){r.push(e)})),n.__pictorialMainPath&&r.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),Fe.each(r,(function(e){Jh.updateProps(e,{scale:[0,0]},i,t,(function(){n.parent&&n.parent.remove(n)}))})),e.setItemGraphicEl(t,null)}function uR(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function hR(e,t,i){Fe.each(e.__pictorialBundle.children(),(function(n){n!==e.__pictorialBarRect&&t.call(i,n)}))}function cR(e,t,i,n,a,r){t&&e.attr(t),n.symbolClip&&!a?i&&e.attr(i):i&&Jh[a?"updateProps":"initProps"](e,i,n.animationModel,n.dataIndex,r)}function dR(e,t,i){var n=i.color,a=i.dataIndex,r=i.itemModel,o=r.getModel("itemStyle").getItemStyle(["color"]),s=r.getModel("emphasis.itemStyle").getItemStyle(),l=r.getShallow("cursor");hR(e,(function(e){e.setColor(n),e.setStyle(Fe.defaults({fill:n,opacity:i.opacity},o)),Jh.setHoverStyle(e,s),l&&(e.cursor=l),e.z2=i.z2}));var u={},h=t.valueDim.posDesc[+(i.boundingLength>0)],c=e.__pictorialBarRect;ZO(c.style,u,r,n,t.seriesModel,a,h),Jh.setHoverStyle(c,u)}function pR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}U_.extendChartView({type:"pictorialBar",render:function(e,t,i){var n=this.group,a=e.getData(),r=this._data,o=e.coordinateSystem,s=!!o.getBaseAxis().isHorizontal(),l=o.grid.getRect(),u={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:XO[+s],categoryDim:XO[1-s]};return a.diff(r).add((function(e){if(a.hasValue(e)){var t=nR(a,e),i=$O(a,e,t,u),r=sR(a,u,i);a.setItemGraphicEl(e,r),n.add(r),dR(r,u,i)}})).update((function(e,t){var i=r.getItemGraphicEl(t);if(a.hasValue(e)){var o=nR(a,e),s=$O(a,e,o,u),l=uR(a,s);i&&l!==i.__pictorialShapeStr&&(n.remove(i),a.setItemGraphicEl(e,null),i=null),i?function(e,t,i){var n=i.animationModel,a=i.dataIndex,r=e.__pictorialBundle;Jh.updateProps(r,{position:i.bundlePosition.slice()},n,a),i.symbolRepeat?QO(e,t,i,!0):eR(e,t,i,!0);tR(e,i,!0),iR(e,t,i,!0)}(i,u,s):i=sR(a,u,s,!0),a.setItemGraphicEl(e,i),i.__pictorialSymbolMeta=s,n.add(i),dR(i,u,s)}else n.remove(i)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&lR(r,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=a,this.group},dispose:Fe.noop,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl((function(t){lR(n,t.dataIndex,e,t)})):i.removeAll()}});var fR=Xy.layout;U_.registerLayout(Fe.curry(fR,"pictorialBar")),U_.registerVisual(ew("pictorialBar","roundRect"));var gR=function(e,t,i,n,a){A_.call(this,e,t,i),this.type=n||"value",this.position=a||"bottom",this.orient=null};gR.prototype={constructor:gR,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},pointToData:function(e,t){return this.coordinateSystem.pointToData(e,t)[0]},toGlobalCoord:null,toLocalCoord:null},Fe.inherits(gR,A_);var mR=gR,vR=ed.getLayoutRect,yR=Fe.each;function xR(e,t,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(e,t,i),this.model=e}xR.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:xR,_init:function(e,t,i){var n=this.dimension,a=new mR(n,Cx.createScaleByModel(e),[0,0],e.get("type"),e.get("position")),r="category"===a.type;a.onBand=r&&e.get("boundaryGap"),a.inverse=e.get("inverse"),a.orient=e.get("orient"),e.axis=a,a.model=e,a.coordinateSystem=this,this._axis=a},update:function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();yR(t.mapDimension(this.dimension,!0),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),Cx.niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},resize:function(e,t){this._rect=vR({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()},getRect:function(){return this._rect},_adjustAxis:function(){var e=this._rect,t=this._axis,i=t.isHorizontal(),n=i?[0,e.width]:[0,e.height],a=t.reverse?1:0;t.setExtent(n[a],n[1-a]),this._updateAxisTransform(t,i?e.x:e.y)},_updateAxisTransform:function(e,t){var i=e.getExtent(),n=i[0]+i[1],a=e.isHorizontal();e.toGlobalCoord=a?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord=a?function(e){return e-t}:function(e){return n-e+t}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(e){var t=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},pointToData:function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},dataToPoint:function(e){var t=this.getAxis(),i=this.getRect(),n=[],a="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),n[a]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-a]=0===a?i.y+i.height/2:i.x+i.width/2,n}};var _R=xR;Sp.register("single",{create:function(e,t){var i=[];return e.eachComponent("singleAxis",(function(n,a){var r=new _R(n,e,t);r.name="single_"+a,r.resize(n,t),n.coordinateSystem=r,i.push(r)})),e.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=i&&i.coordinateSystem}})),i},dimensions:_R.prototype.dimensions});var bR=function(e,t){t=t||{};var i=e.coordinateSystem,n=e.axis,a={},r=n.position,o=n.orient,s=i.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]}};a.position=["vertical"===o?u.vertical[r]:l[0],"horizontal"===o?u.horizontal[r]:l[3]],a.rotation=Math.PI/2*{horizontal:0,vertical:1}[o],a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],e.get("axisTick.inside")&&(a.tickDirection=-a.tickDirection),Fe.retrieve(t.labelInside,e.get("axisLabel.inside"))&&(a.labelDirection=-a.labelDirection);var h=t.rotate;return null==h&&(h=e.get("axisLabel.rotate")),a.labelRotation="top"===r?-h:h,a.z2=1,a},wR={layout:bR},SR=IS.rectCoordAxisBuildSplitArea,MR=IS.rectCoordAxisHandleRemove,IR=["axisLine","axisTickLabel","axisName"],AR=["splitArea","splitLine"],TR=bS.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var a=this.group;a.removeAll();var r=this._axisGroup;this._axisGroup=new Jh.Group;var o=wR.layout(e),s=new sS(e,o);Fe.each(IR,s.add,s),a.add(this._axisGroup),a.add(s.getGroup()),Fe.each(AR,(function(t){e.get(t+".show")&&this["_"+t](e)}),this),Jh.groupTransition(r,this._axisGroup,e),TR.superCall(this,"render",e,t,i,n)},remove:function(){MR(this)},_splitLine:function(e){var t=e.axis;if(!t.scale.isBlank()){var i=e.getModel("splitLine"),n=i.getModel("lineStyle"),a=n.get("width"),r=n.get("color");r=r instanceof Array?r:[r];for(var o=e.coordinateSystem.getRect(),s=t.isHorizontal(),l=[],u=0,h=t.getTicksCoords({tickModel:i}),c=[],d=[],p=0;p<h.length;++p){var f=t.toGlobalCoord(h[p].coord);s?(c[0]=f,c[1]=o.y,d[0]=f,d[1]=o.y+o.height):(c[0]=o.x,c[1]=f,d[0]=o.x+o.width,d[1]=f);var g=u++%r.length;l[g]=l[g]||[],l[g].push(new Jh.Line({subPixelOptimize:!0,shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:{lineWidth:a},silent:!0}))}for(p=0;p<l.length;++p)this.group.add(Jh.mergePath(l[p],{style:{stroke:r[p%r.length],lineDash:n.getLineDash(a),lineWidth:a},silent:!0}))}},_splitArea:function(e){SR(this,this._axisGroup,e,e)}}),CR=od.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}});Fe.merge(CR.prototype,Lx),_w("single",CR,(function(e,t){return t.type||(t.data?"category":"value")}),{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}}});var DR=function(e,t){var i,n=[],a=e.seriesIndex;if(null==a||!(i=t.getSeriesByIndex(a)))return{point:[]};var r=i.getData(),o=Ro.queryDataIndex(r,e);if(null==o||o<0||Fe.isArray(o))return{point:[]};var s=r.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)n=l.dataToPoint(r.getValues(Fe.map(l.dimensions,(function(e){return r.mapDimension(e)})),o,!0))||[];else if(s){var u=s.getBoundingRect().clone();u.applyTransform(s.transform),n=[u.x+u.width/2,u.y+u.height/2]}return{point:n,el:s}},LR=Ro.makeInner,PR=Fe.each,kR=Fe.curry,OR=LR();function RR(e,t,i,n,a){var r=e.axis;if(!r.scale.isBlank()&&r.containData(t))if(e.involveSeries){var o=function(e,t){var i=t.axis,n=i.dim,a=e,r=[],o=Number.MAX_VALUE,s=-1;return PR(t.seriesModels,(function(t,l){var u,h,c=t.getData().mapDimension(n,!0);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(c,e,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=t.getData().indicesOfNearest(c[0],e,"category"===i.type?.5:null)).length)return;u=t.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var p=e-u,f=Math.abs(p);f<=o&&((f<o||p>=0&&s<0)&&(o=f,s=p,a=u,r.length=0),PR(h,(function(e){r.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:r,snapToValue:a}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==a.seriesIndex&&Fe.extend(a,s[0]),!n&&e.snap&&r.containData(l)&&null!=l&&(t=l),i.showPointer(e,t,s,a),i.showTooltip(e,o,l)}else i.showPointer(e,t)}function ER(e,t,i,n){e[t.key]={value:i,payloadBatch:n}}function NR(e,t,i,n){var a=i.payloadBatch,r=t.axis,o=r.model,s=t.axisPointerModel;if(t.triggerTooltip&&a.length){var l=t.coordSys.model,u=mS.makeKey(l),h=e.map[u];h||(h=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:a.slice()})}}function zR(e){var t=e.axis.model,i={},n=i.axisDim=e.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=t.componentIndex,i.axisName=i[n+"AxisName"]=t.name,i.axisId=i[n+"AxisId"]=t.id,i}function BR(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var VR=function(e,t,i){var n=e.currTrigger,a=[e.x,e.y],r=e,o=e.dispatchAction||Fe.bind(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){BR(a)&&(a=DR({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},t).point);var l=BR(a),u=r.axesInfo,h=s.axesInfo,c="leave"===n||BR(a),d={},p={},f={list:[],map:{}},g={showPointer:kR(ER,p),showTooltip:kR(NR,f)};PR(s.coordSysMap,(function(e,t){var i=l||e.containPoint(a);PR(s.coordSysAxesInfo[t],(function(e,t){var n=e.axis,r=function(e,t){for(var i=0;i<(e||[]).length;i++){var n=e[i];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}(u,e);if(!c&&i&&(!u||r)){var o=r&&r.value;null!=o||l||(o=n.pointToData(a)),null!=o&&RR(e,o,g,!1,d)}}))}));var m={};return PR(h,(function(e,t){var i=e.linkGroup;i&&!p[t]&&PR(i.axesInfo,(function(t,n){var a=p[n];if(t!==e&&a){var r=a.value;i.mapper&&(r=e.axis.scale.parse(i.mapper(r,zR(t),zR(e)))),m[e.key]=r}}))})),PR(m,(function(e,t){RR(h[t],e,g,!0,d)})),function(e,t,i){var n=i.axesInfo=[];PR(t,(function(t,i){var a=t.axisPointerModel.option,r=e[i];r?(!t.useHandle&&(a.status="show"),a.value=r.value,a.seriesDataIndices=(r.payloadBatch||[]).slice()):!t.useHandle&&(a.status="hide"),"show"===a.status&&n.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:a.value})}))}(p,h,d),function(e,t,i,n){if(BR(t)||!e.list.length)return void n({type:"hideTip"});var a=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:e.list})}(f,a,e,o),function(e,t,i){var n=i.getZr(),a="axisPointerLastHighlights",r=OR(n)[a]||{},o=OR(n)[a]={};PR(e,(function(e,t){var i=e.axisPointerModel.option;"show"===i.status&&PR(i.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];Fe.each(r,(function(e,t){!o[t]&&l.push(e)})),Fe.each(o,(function(e,t){!r[t]&&s.push(e)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}};U_.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},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}}});var GR=(0,Ro.makeInner)(),FR=Fe.each;function HR(e,t,i){e.handler("leave",null,i)}function WR(e,t,i,n){t.handler(e,i,n)}var UR=function(e,t,i){if(!ae.node){var n=t.getZr();GR(n).records||(GR(n).records={}),function(e,t){if(GR(e).initialized)return;function i(i,n){e.on(i,(function(i){var a=function(e){var t={showTip:[],hideTip:[]},i=function(n){var a=t[n.type];a?a.push(n):(n.dispatchAction=i,e.dispatchAction(n))};return{dispatchAction:i,pendings:t}}(t);FR(GR(e).records,(function(e){e&&n(e,i,a.dispatchAction)})),function(e,t){var i,n=e.showTip.length,a=e.hideTip.length;n?i=e.showTip[n-1]:a&&(i=e.hideTip[a-1]);i&&(i.dispatchAction=null,t.dispatchAction(i))}(a.pendings,t)}))}GR(e).initialized=!0,i("click",Fe.curry(WR,"click")),i("mousemove",Fe.curry(WR,"mousemove")),i("globalout",HR)}(n,t),(GR(n).records[e]||(GR(n).records[e]={})).handler=i}},jR={register:UR,unregister:function(e,t){if(!ae.node){var i=t.getZr();(GR(i).records||{})[e]&&(GR(i).records[e]=null)}}},ZR=U_.extendComponentView({type:"axisPointer",render:function(e,t,i){var n=t.getComponent("tooltip"),a=e.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";jR.register("axisPointer",i,(function(e,t,i){"none"!==a&&("leave"===e||a.indexOf(e)>=0)&&i({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},remove:function(e,t){jR.unregister(t.getZr(),"axisPointer"),ZR.superApply(this._model,"remove",arguments)},dispose:function(e,t){jR.unregister("axisPointer",t),ZR.superApply(this._model,"dispose",arguments)}}),YR=(0,Ro.makeInner)(),XR=Fe.clone,qR=Fe.bind;function $R(){}function KR(e,t,i,n){JR(YR(i).lastProp,n)||(YR(i).lastProp=n,t?Jh.updateProps(i,n,e):(i.stopAnimation(),i.attr(n)))}function JR(e,t){if(Fe.isObject(e)&&Fe.isObject(t)){var i=!0;return Fe.each(t,(function(t,n){i=i&&JR(e[n],t)})),!!i}return e===t}function QR(e,t){e[t.get("label.show")?"show":"hide"]()}function eE(e){return{position:e.position.slice(),rotation:e.rotation||0}}function tE(e,t,i){var n=t.get("z"),a=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=n&&(e.z=n),null!=a&&(e.zlevel=a),e.silent=i)}))}$R.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(e,t,i,n){var a=t.get("value"),r=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,n||this._lastValue!==a||this._lastStatus!==r){this._lastValue=a,this._lastStatus=r;var o=this._group,s=this._handle;if(!r||"hide"===r)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,a,e,t,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(e,t);if(o){var c=Fe.curry(KR,t,h);this.updatePointerEl(o,l,c,t),this.updateLabelEl(o,l,c,t)}else o=this._group=new Jh.Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),i.getZr().add(o);tE(o,t,!0),this._renderHandle(a)}},remove:function(e){this.clear(e)},dispose:function(e){this.clear(e)},determineAnimation:function(e,t){var i=t.get("animation"),n=e.axis,a="category"===n.type,r=t.get("snap");if(!r&&!a)return!1;if("auto"===i||null==i){var o=this.animationThreshold;if(a&&n.getBandWidth()>o)return!0;if(r){var s=mS.getAxisInfo(e).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===i},makeElOption:function(e,t,i,n,a){},createPointerEl:function(e,t,i,n){var a=t.pointer;if(a){var r=YR(e).pointerEl=new Jh[a.type](XR(t.pointer));e.add(r)}},createLabelEl:function(e,t,i,n){if(t.label){var a=YR(e).labelEl=new Jh.Rect(XR(t.label));e.add(a),QR(a,n)}},updatePointerEl:function(e,t,i){var n=YR(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,n){var a=YR(e).labelEl;a&&(a.setStyle(t.label.style),i(a,{shape:t.label.shape,position:t.label.position}),QR(a,n))},_renderHandle:function(e){if(!this._dragging&&this.updateHandleTransform){var t,i=this._axisPointerModel,n=this._api.getZr(),a=this._handle,r=i.getModel("handle"),o=i.get("status");if(!r.get("show")||!o||"hide"===o)return a&&n.remove(a),void(this._handle=null);this._handle||(t=!0,a=this._handle=Jh.createIcon(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){zt.stop(e.event)},onmousedown:qR(this._onHandleDragMove,this,0,0),drift:qR(this._onHandleDragMove,this),ondragend:qR(this._onHandleDragEnd,this)}),n.add(a)),tE(a,i,!1);a.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");Fe.isArray(s)||(s=[s,s]),a.attr("scale",[s[0]/2,s[1]/2]),Ig.createOrUpdate(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){KR(this._axisPointerModel,!t&&this._moveAnimation,this._handle,eE(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(eE(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(eE(n)),YR(i).lastProp=null,this._doDispatchAxisPointer()}},_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}]})}},_onHandleDragEnd:function(e){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}}},$R.prototype.constructor=$R,Ho.enableClassExtend($R);var iE=$R;function nE(e,t,i,n,a){var r=aE(i.get("value"),t.axis,t.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),o=i.getModel("label"),s=Fc.normalizeCssArray(o.get("padding")||0),l=o.getFont(),u=Ha.getBoundingRect(r,l),h=a.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=a.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=a.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(e,t,i,n){var a=n.getWidth(),r=n.getHeight();e[0]=Math.min(e[0]+t,a)-t,e[1]=Math.min(e[1]+i,r)-i,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(h,c,d,n);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get("axisLine.lineStyle.color")),e.label={shape:{x:0,y:0,width:c,height:d,r:o.get("borderRadius")},position:h.slice(),style:{text:r,textFont:l,textFill:o.getTextColor(),textPosition:"inside",textPadding:s,fill:g,stroke:o.get("borderColor")||"transparent",lineWidth:o.get("borderWidth")||0,shadowBlur:o.get("shadowBlur"),shadowColor:o.get("shadowColor"),shadowOffsetX:o.get("shadowOffsetX"),shadowOffsetY:o.get("shadowOffsetY")},z2:10}}function aE(e,t,i,n,a){e=t.scale.parse(e);var r=t.scale.getLabel(e,{precision:a.precision}),o=a.formatter;if(o){var s={value:Cx.getAxisRawValue(t,e),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};Fe.each(n,(function(e){var t=i.getSeriesByIndex(e.seriesIndex),n=e.dataIndexInside,a=t&&t.getDataParams(n);a&&s.seriesData.push(a)})),Fe.isString(o)?r=o.replace("{value}",r):Fe.isFunction(o)&&(r=o(s))}return r}function rE(e,t,i){var n=ri.create();return ri.rotate(n,n,i.rotation),ri.translate(n,n,i.position),Jh.applyTransform([e.dataToCoord(t),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}var oE=function(e){var t,i=e.get("type"),n=e.getModel(i+"Style");return"line"===i?(t=n.getLineStyle()).fill=null:"shadow"===i&&((t=n.getAreaStyle()).stroke=null),t},sE={buildElStyle:oE,buildLabelElOption:nE,getValueLabel:aE,getTransformedPosition:rE,buildCartesianSingleLabelElOption:function(e,t,i,n,a,r){var o=sS.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=a.get("label.margin"),nE(t,n,a,r,{position:rE(n.axis,e,i),align:o.textAlign,verticalAlign:o.textVerticalAlign})},makeLineShape:function(e,t,i){return{x1:e[i=i||0],y1:e[1-i],x2:t[i],y2:t[1-i]}},makeRectShape:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}},makeSectorShape:function(e,t,i,n,a,r){return{cx:e,cy:t,r0:i,r:n,startAngle:a,endAngle:r,clockwise:!0}}},lE=iE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis,o=r.grid,s=n.get("type"),l=uE(o,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(t,!0));if(s&&"none"!==s){var h=sE.buildElStyle(n),c=hE[s](r,u,l);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=SS.layout(o.model,i);sE.buildCartesianSingleLabelElOption(t,e,d,i,n,a)},getHandleTransform:function(e,t,i){var n=SS.layout(t.axis.grid.model,t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:sE.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var a=i.axis,r=a.grid,o=a.getGlobalExtent(!0),s=uE(r,a).getOtherAxis(a).getGlobalExtent(),l="x"===a.dim?0:1,u=e.position;u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:e.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function uE(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var hE={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:sE.makeLineShape([t,i[0]],[t,i[1]],cE(e))}},shadow:function(e,t,i){var n=Math.max(1,e.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:sE.makeRectShape([t-n/2,i[0]],[n,a],cE(e))}}};function cE(e){return"x"===e.dim?0:1}bS.registerAxisPointerClass("CartesianAxisPointer",lE),U_.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Fe.isArray(t)&&(e.axisPointer.link=[t])}})),U_.registerProcessor(U_.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=mS.collect(e,t)})),U_.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},VR);var dE=["x","y"],pE=["width","height"],fE=iE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis,o=r.coordinateSystem,s=vE(o,1-mE(r)),l=o.dataToPoint(t)[0],u=n.get("type");if(u&&"none"!==u){var h=sE.buildElStyle(n),c=gE[u](r,l,s);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=wR.layout(i);sE.buildCartesianSingleLabelElOption(t,e,d,i,n,a)},getHandleTransform:function(e,t,i){var n=wR.layout(t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:sE.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var a=i.axis,r=a.coordinateSystem,o=mE(a),s=vE(r,o),l=e.position;l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=vE(r,1-o),h=(u[1]+u[0])/2,c=[h,h];return c[o]=l[o],{position:l,rotation:e.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),gE={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:sE.makeLineShape([t,i[0]],[t,i[1]],mE(e))}},shadow:function(e,t,i){var n=e.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:sE.makeRectShape([t-n/2,i[0]],[n,a],mE(e))}}};function mE(e){return e.isHorizontal()?0:1}function vE(e,t){var i=e.getRect();return[i[dE[t]],i[dE[t]]+i[pE[t]]]}bS.registerAxisPointerClass("SingleAxisPointer",fE),U_.extendComponentView({type:"single"});var yE=nv.getDimensionTypeByAxis,xE=Ro.groupData,_E=Fc.encodeHTML,bE=ng.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){bE.superApply(this,"init",arguments),this.legendVisualProvider=new hM(Fe.bind(this.getData,this),Fe.bind(this.getRawData,this))},fixData:function(e){var t=e.length,i=xE(e,(function(e){return e[2]})),n=[];i.buckets.each((function(e,t){n.push({name:t,dataList:e})}));for(var a=n.length,r=-1,o=-1,s=0;s<a;++s){var l=n[s].dataList.length;l>r&&(r=l,o=s)}for(var u=0;u<a;++u)if(u!==o)for(var h=n[u].name,c=0;c<r;++c){for(var d=n[o].dataList[c][0],p=n[u].dataList.length,f=-1,g=0;g<p;++g){if(n[u].dataList[g][0]===d){f=g;break}}-1===f&&(e[t]=[],e[t][0]=d,e[t][1]=0,e[t][2]=h,t++)}return e},getInitialData:function(e,t){for(var i=t.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0].get("type"),n=Fe.filter(e.data,(function(e){return void 0!==e[2]})),a=this.fixData(n||[]),r=[],o=this.nameMap=Fe.createHashMap(),s=0,l=0;l<a.length;++l)r.push(a[l][2]),o.get(a[l][2])||(o.set(a[l][2],s),s++);var u=Zv(a,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:yE(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),h=new Pv(u,this);return h.initData(a),h},getLayerSeries:function(){for(var e=this.getData(),t=e.count(),i=[],n=0;n<t;++n)i[n]=n;var a=e.mapDimension("single"),r=xE(i,(function(t){return e.get("name",t)})),o=[];return r.buckets.each((function(t,i){t.sort((function(t,i){return e.get(a,t)-e.get(a,i)})),o.push({name:i,indices:t})})),o},getAxisTooltipData:function(e,t,i){Fe.isArray(e)||(e=e?[e]:[]);for(var n,a=this.getData(),r=this.getLayerSeries(),o=[],s=r.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,h=-1,c=r[l].indices.length,d=0;d<c;++d){var p=a.get(e[0],r[l].indices[d]),f=Math.abs(p-t);f<=u&&(n=p,u=f,h=r[l].indices[d])}o.push(h)}return{dataIndices:o,nestestValue:n}},formatTooltip:function(e){var t=this.getData(),i=t.getName(e),n=t.get(t.mapDimension("value"),e);return(isNaN(n)||null==n)&&(n="-"),_E(i+" : "+n)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",color:"#000",fontSize:11},emphasis:{label:{show:!0}}}}),wE=Eb.Polygon,SE=Fe.bind,ME=Fe.extend;function IE(e,t,i){if(e.count())for(var n,a=t.coordinateSystem,r=t.getLayerSeries(),o=e.mapDimension("single"),s=e.mapDimension("value"),l=Fe.map(r,(function(t){return Fe.map(t.indices,(function(t){var i=a.dataToPoint(e.get(o,t));return i[1]=e.get(s,t),i}))})),u=function(e){for(var t=e.length,i=e[0].length,n=[],a=[],r=0,o={},s=0;s<i;++s){for(var l=0,u=0;l<t;++l)u+=e[l][s][1];u>r&&(r=u),n.push(u)}for(var h=0;h<i;++h)a[h]=(r-n[h])/2;r=0;for(var c=0;c<i;++c){var d=n[c]+a[c];d>r&&(r=d)}return o.y0=a,o.max=r,o}(l),h=u.y0,c=i/u.max,d=r.length,p=r[0].indices.length,f=0;f<p;++f){n=h[f]*c,e.setItemLayout(r[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:n,y:l[0][f][1]*c});for(var g=1;g<d;++g)n+=l[g-1][f][1]*c,e.setItemLayout(r[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:n,y:l[g][f][1]*c})}}U_.extendChartView({type:"themeRiver",init:function(){this._layers=[]},render:function(e,t,i){var n=e.getData(),a=this.group,r=e.getLayerSeries(),o=n.getLayout("layoutInfo"),s=o.rect,l=o.boundaryGap;function u(e){return e.name}a.attr("position",[0,s.y+l[0]]);var h=new Jm(this._layersSeries||[],r,u,u),c={};function d(t,i,o){var s=this._layers;if("remove"!==t){for(var l,u,h,d=[],p=[],f=r[i].indices,g=0;g<f.length;g++){var m=n.getItemLayout(f[g]),v=m.x,y=m.y0,x=m.y;d.push([v,y]),p.push([v,y+x]),l=n.getItemVisual(f[g],"color")}var _=n.getItemLayout(f[0]),b=n.getItemModel(f[g-1]),w=b.getModel("label"),S=w.get("margin");if("add"===t){var M=c[i]=new Jh.Group;u=new wE({shape:{points:d,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),h=new Jh.Text({style:{x:_.x-S,y:_.y0+_.y/2}}),M.add(u),M.add(h),a.add(M),u.setClipPath(function(e,t,i){var n=new Jh.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Jh.initProps(n,{shape:{width:e.width+20,height:e.height+20}},t,i),n}(u.getBoundingRect(),e,(function(){u.removeClipPath()})))}else{M=s[o];u=M.childAt(0),h=M.childAt(1),a.add(M),c[i]=M,Jh.updateProps(u,{shape:{points:d,stackedOnPoints:p}},e),Jh.updateProps(h,{style:{x:_.x-S,y:_.y0+_.y/2}},e)}var I=b.getModel("emphasis.itemStyle"),A=b.getModel("itemStyle");Jh.setTextStyle(h.style,w,{text:w.get("show")?e.getFormattedLabel(f[g-1],"normal")||n.getName(f[g-1]):null,textVerticalAlign:"middle"}),u.setStyle(ME({fill:l},A.getItemStyle(["color"]))),Jh.setHoverStyle(u,I.getItemStyle())}else a.remove(s[i])}h.add(SE(d,this,"add")).update(SE(d,this,"update")).remove(SE(d,this,"remove")).execute(),this._layersSeries=r,this._layers=c},dispose:function(){}});var AE=function(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.coordinateSystem,n={},a=i.getRect();n.rect=a;var r=e.get("boundaryGap"),o=i.getAxis();(n.boundaryGap=r,"horizontal"===o.orient)?(r[0]=Cc.parsePercent(r[0],a.height),r[1]=Cc.parsePercent(r[1],a.height),IE(t,e,a.height-r[0]-r[1])):(r[0]=Cc.parsePercent(r[0],a.width),r[1]=Cc.parsePercent(r[1],a.width),IE(t,e,a.width-r[0]-r[1]));t.setLayout("layoutInfo",n)}))},TE=Fe.createHashMap;var CE=function(e){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.getRawData(),n=e.get("color"),a=TE();t.each((function(e){a.set(t.getRawIndex(e),e)})),i.each((function(r){var o=i.getName(r),s=n[(e.nameMap.get(o)-1)%n.length];i.setItemVisual(r,"color",s);var l=a.get(r);null!=l&&t.setItemVisual(l,"color",s)}))}))};U_.registerLayout(AE),U_.registerVisual(CE),U_.registerProcessor(kM("themeRiver"));var DE=vT.wrapTreePathInfo;function LE(e){var t=0;Fe.each(e.children,(function(e){LE(e);var i=e.value;Fe.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;Fe.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),Fe.isArray(e.value)?e.value[0]=i:e.value=i}ng.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(e,t){var i={name:e.name,children:e.data};LE(i);var n=e.levels||[],a={};return a.levels=n,zA.createTree(i,this,a).data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(e){var t=ng.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=DE(i,this),t},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",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},highlight:{itemStyle:{opacity:1}},downplay:{itemStyle:{opacity:.5},label:{opacity:.6}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},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)}});var PE="none",kE="ancestor",OE="self";function RE(e,t,i){Jh.Group.call(this);var n=new Jh.Sector({z2:2});n.seriesIndex=t.seriesIndex;var a=new Jh.Text({z2:4,silent:e.getModel("label").get("silent")});function r(){a.ignore=a.hoverIgnore}function o(){a.ignore=a.normalIgnore}this.add(n),this.add(a),this.updateData(!0,e,"normal",t,i),this.on("emphasis",r).on("normal",o).on("mouseover",r).on("mouseout",o)}var EE=RE.prototype;EE.updateData=function(e,t,i,n,a){this.node=t,t.piece=this,n=n||this._seriesModel,a=a||this._ecModel;var r=this.childAt(0);r.dataIndex=t.dataIndex;var o=t.getModel(),s=t.getLayout(),l=Fe.extend({},s);l.label=null;var u=function(e,t,i){var n=e.getVisual("color"),a=e.getVisual("visualMeta");a&&0!==a.length||(n=null);var r=e.getModel("itemStyle").get("color");if(r)return r;if(n)return n;if(0===e.depth)return i.option.color[0];var o=i.option.color.length;r=i.option.color[function(e){var t=e;for(;t.depth>1;)t=t.parentNode;var i=e.getAncestors()[0];return Fe.indexOf(i.children,t)}(e)%o];return r}(t,0,a);!function(e,t,i){var n=t.getData();n.setItemVisual(e.dataIndex,"color",i)}(t,n,u);var h,c=o.getModel("itemStyle").getItemStyle();if("normal"===i)h=c;else{var d=o.getModel(i+".itemStyle").getItemStyle();h=Fe.merge(d,c)}h=Fe.defaults({lineJoin:"bevel",fill:h.fill||u},h),e?(r.setShape(l),r.shape.r=s.r0,Jh.updateProps(r,{shape:{r:s.r}},n,t.dataIndex),r.useStyle(h)):"object"==typeof h.fill&&h.fill.type||"object"==typeof r.style.fill&&r.style.fill.type?(Jh.updateProps(r,{shape:l},n),r.useStyle(h)):Jh.updateProps(r,{shape:l,style:h},n),this._updateLabel(n,u,i);var p=o.getShallow("cursor");if(p&&r.attr("cursor",p),e){var f=n.getShallow("highlightPolicy");this._initEvents(r,t,n,f)}this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel,Jh.setHoverStyle(this)},EE.onEmphasis=function(e){var t=this;this.node.hostTree.root.eachNode((function(i){var n,a,r;i.piece&&(t.node===i?i.piece.updateData(!1,i,"emphasis"):(n=i,a=t.node,(r=e)!==PE&&(r===OE?n===a:r===kE?n===a||n.isAncestorOf(a):n===a||n.isDescendantOf(a))?i.piece.childAt(0).trigger("highlight"):e!==PE&&i.piece.childAt(0).trigger("downplay")))}))},EE.onNormal=function(){this.node.hostTree.root.eachNode((function(e){e.piece&&e.piece.updateData(!1,e,"normal")}))},EE.onHighlight=function(){this.updateData(!1,this.node,"highlight")},EE.onDownplay=function(){this.updateData(!1,this.node,"downplay")},EE._updateLabel=function(e,t,i){var n=this.node.getModel(),a=n.getModel("label"),r="normal"===i||"emphasis"===i?a:n.getModel(i+".label"),o=n.getModel("emphasis.label"),s=Fe.retrieve(e.getFormattedLabel(this.node.dataIndex,i,null,null,"label"),this.node.name);!1===S("show")&&(s="");var l=this.node.getLayout(),u=r.get("minAngle");null==u&&(u=a.get("minAngle")),u=u/180*Math.PI;var h=l.endAngle-l.startAngle;null!=u&&Math.abs(h)<u&&(s="");var c=this.childAt(1);Jh.setLabelStyle(c.style,c.hoverStyle||{},a,o,{defaultText:r.getShallow("show")?s:null,autoColor:t,useInsideStyle:!0});var d,p=(l.startAngle+l.endAngle)/2,f=Math.cos(p),g=Math.sin(p),m=S("position"),v=S("distance")||0,y=S("align");"outside"===m?(d=l.r+v,y=p>Math.PI/2?"right":"left"):y&&"center"!==y?"left"===y?(d=l.r0+v,p>Math.PI/2&&(y="right")):"right"===y&&(d=l.r-v,p>Math.PI/2&&(y="left")):(d=(l.r+l.r0)/2,y="center"),c.attr("style",{text:s,textAlign:y,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=d*f+l.cx,_=d*g+l.cy;c.attr("position",[x,_]);var b=S("rotate"),w=0;function S(e){var t=r.get(e);return null==t?a.get(e):t}"radial"===b?(w=-p)<-Math.PI/2&&(w+=Math.PI):"tangential"===b?(w=Math.PI/2-p)>Math.PI/2?w-=Math.PI:w<-Math.PI/2&&(w+=Math.PI):"number"==typeof b&&(w=b*Math.PI/180),c.attr("rotation",w)},EE._initEvents=function(e,t,i,n){e.off("mouseover").off("mouseout").off("emphasis").off("normal");var a=this,r=function(){a.onEmphasis(n)},o=function(){a.onNormal()};i.isAnimationEnabled()&&e.on("mouseover",r).on("mouseout",o).on("emphasis",r).on("normal",o).on("downplay",(function(){a.onDownplay()})).on("highlight",(function(){a.onHighlight()}))},Fe.inherits(RE,Jh.Group);var NE=RE,zE=Fc.windowOpen;_g.extend({type:"sunburst",init:function(){},render:function(e,t,i,n){var a=this;this.seriesModel=e,this.api=i,this.ecModel=t;var r=e.getData(),o=r.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),h=[];s.eachNode((function(e){h.push(e)}));var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function a(e){return e.getId()}function s(a,s){!function(i,n){u||!i||i.getValue()||(i=null);if(i!==o&&n!==o)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",e,t),r.setItemGraphicEl(i.dataIndex,n.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(n);else if(i){var a=new NE(i,e,t);l.add(a),r.setItemGraphicEl(i.dataIndex,a)}}(null==a?null:i[a],null==s?null:n[s])}new Jm(n,i,a,a).add(s).update(s).remove(Fe.curry(s,null)).execute()}(h,c),function(i,n){if(n.depth>0){a.virtualPiece?a.virtualPiece.updateData(!1,i,"normal",e,t):(a.virtualPiece=new NE(i,e,t),l.add(a.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var r=function(e){a._rootToNode(n.parentNode)};n.piece._onclickEvent=r,a.virtualPiece.on("click",r)}else a.virtualPiece&&(l.remove(a.virtualPiece),a.virtualPiece=null)}(o,s),n&&n.highlight&&n.highlight.piece){var d=e.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(d)}else if(n&&n.unhighlight){var p=this.virtualPiece;!p&&o.children.length&&(p=o.children[0].piece),p&&p.onNormal()}this._initEvents(),this._oldChildren=h},dispose:function(){},_initEvents:function(){var e=this,t=function(t){var i=!1;e.seriesModel.getViewRoot().eachNode((function(n){if(!i&&n.piece&&n.piece.childAt(0)===t.target){var a=n.getModel().get("nodeClick");if("rootToNode"===a)e._rootToNode(n);else if("link"===a){var r=n.getModel(),o=r.get("link");if(o){var s=r.get("target",!0)||"_blank";zE(o,s)}}i=!0}}))};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,a=e[1]-i.cy,r=Math.sqrt(n*n+a*a);return r<=i.r&&r>=i.r0}}});var BE="sunburstRootToNode";U_.registerAction({type:BE,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=vT.retrieveTargetInfo(e,[BE],t);if(n){var a=t.getViewRoot();a&&(e.direction=vT.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var VE="sunburstHighlight";U_.registerAction({type:VE,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=vT.retrieveTargetInfo(e,[VE],t);n&&(e.highlight=n.node)}))}));U_.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){e.unhighlight=!0}))}));var GE=Cc.parsePercent,FE=Math.PI/180;function HE(e,t){var i=e.children||[];e.children=function(e,t){if("function"==typeof t)return e.sort(t);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}))}(i,t),i.length&&Fe.each(e.children,(function(e){HE(e,t)}))}var WE=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),n=e.get("radius");Fe.isArray(n)||(n=[0,n]),Fe.isArray(t)||(t=[t,t]);var a=i.getWidth(),r=i.getHeight(),o=Math.min(a,r),s=GE(t[0],a),l=GE(t[1],r),u=GE(n[0],o/2),h=GE(n[1],o/2),c=-e.get("startAngle")*FE,d=e.get("minAngle")*FE,p=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&HE(f,m);var v=0;Fe.each(f.children,(function(e){!isNaN(e.getValue())&&v++}));var y=f.getValue(),x=Math.PI/(y||v)*2,_=f.depth>0,b=f.height-(_?-1:1),w=(h-u)/(b||1),S=e.get("clockwise"),M=e.get("stillShowZeroSum"),I=S?1:-1,A=function(e,t){if(e){var i=t;if(e!==p){var n=e.getValue(),a=0===y&&M?x:n*x;a<d&&(a=d),i=t+I*a;var r=e.depth-g-(_?-1:1),h=u+w*r,c=u+w*(r+1),f=e.getModel();null!=f.get("r0")&&(h=GE(f.get("r0"),o/2)),null!=f.get("r")&&(c=GE(f.get("r"),o/2)),e.setLayout({angle:a,startAngle:t,endAngle:i,clockwise:S,cx:s,cy:l,r0:h,r:c})}if(e.children&&e.children.length){var m=0;Fe.each(e.children,(function(e){m+=A(e,t+m)}))}return i-t}};if(_){var T=u,C=u+w,D=2*Math.PI;p.setLayout({angle:D,startAngle:c,endAngle:c+D,clockwise:S,cx:s,cy:l,r0:T,r:C})}A(f,c)}))};function UE(e,t){return t=t||[0,0],Fe.map(["x","y"],(function(i,n){var a=this.getAxis(i),r=t[n],o=e[n]/2;return"category"===a.type?a.getBandWidth():Math.abs(a.dataToCoord(r-o)-a.dataToCoord(r+o))}),this)}U_.registerVisual(Fe.curry(bM,"sunburst")),U_.registerLayout(Fe.curry(WE,"sunburst")),U_.registerProcessor(Fe.curry(kM,"sunburst"));var jE=function(e){var t=e.grid.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:Fe.bind(UE,e)}}};function ZE(e,t){return t=t||[0,0],Fe.map([0,1],(function(i){var n=t[i],a=e[i]/2,r=[],o=[];return r[i]=n-a,o[i]=n+a,r[1-i]=o[1-i]=t[1-i],Math.abs(this.dataToPoint(r)[i]-this.dataToPoint(o)[i])}),this)}var YE=function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:Fe.bind(ZE,e)}}};function XE(e,t){var i=this.getAxis(),n=t instanceof Array?t[0]:t,a=(e instanceof Array?e[0]:e)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-a)-i.dataToCoord(n+a))}var qE=function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:Fe.bind(XE,e)}}};function $E(e,t){return Fe.map(["Radius","Angle"],(function(i,n){var a=this["get"+i+"Axis"](),r=t[n],o=e[n]/2,s="dataTo"+i,l="category"===a.type?a.getBandWidth():Math.abs(a[s](r-o)-a[s](r+o));return"Angle"===i&&(l=l*Math.PI/180),l}),this)}var KE=function(e){var t=e.getRadiusAxis(),i=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:Fe.bind((function(n){var a=t.dataToRadius(n[0]),r=i.dataToAngle(n[1]),o=e.coordToPoint([a,r]);return o.push(a,r*Math.PI/180),o})),size:Fe.bind($E,e)}}};var JE=function(e){var t=e.getRect(),i=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:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(t,i){return e.dataToPoint(t,i)}}}},QE=Y_.getDefaultLabel,eN=Xy.getLayoutOnAxis,tN=Vb.createClipPath,iN=Jh.CACHED_LABEL_STYLE_PROPERTIES,nN=["itemStyle"],aN=["emphasis","itemStyle"],rN=["label"],oN=["emphasis","label"],sN={cartesian2d:jE,geo:YE,singleAxis:qE,polar:KE,calendar:JE};function lN(e,t,i,n,a){null==i[e]||a||(t[e]=i[e],i[e]=n[e])}function uN(e,t,i,n){var a=e.get("renderItem"),r=e.coordinateSystem,o={};r&&(o=r.prepareCustoms?r.prepareCustoms():sN[r.type](r));var s,l,u,h,c,d=Fe.defaults({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(e,i){return null==i&&(i=s),t.get(t.getDimension(e||0),i)},style:function(i,n){null==n&&(n=s),g(n);var a=l.getModel(nN).getItemStyle();null!=c&&(a.fill=c);var r=t.getItemVisual(n,"opacity");null!=r&&(a.opacity=r);var o=i?gN(i,u):u;return Jh.setTextStyle(a,o,null,{autoColor:c,isRectText:!0}),a.text=o.getShallow("show")?Fe.retrieve2(e.getFormattedLabel(n,"normal"),QE(t,n)):null,i&&mN(a,i),a},styleEmphasis:function(i,n){null==n&&(n=s),g(n);var a=l.getModel(aN).getItemStyle(),r=i?gN(i,h):h;return Jh.setTextStyle(a,r,null,{isRectText:!0},!0),a.text=r.getShallow("show")?Fe.retrieve3(e.getFormattedLabel(n,"emphasis"),e.getFormattedLabel(n,"normal"),QE(t,n)):null,i&&mN(a,i),a},visual:function(e,i){return null==i&&(i=s),t.getItemVisual(i,e)},barLayout:function(e){if(r.getBaseAxis){var t=r.getBaseAxis();return eN(Fe.defaults({axis:t},e),n)}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(e){return Jh.getFont(e,i)}},o.api||{}),p={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:hN(e.getData())},f=!0;return function(e,i){return s=e,f=!0,a&&a(Fe.defaults({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:i?i.type:null},p),d)};function g(e){null==e&&(e=s),f&&(l=t.getItemModel(e),u=l.getModel(rN),h=l.getModel(oN),c=t.getItemVisual(e,"color"),f=!1)}}function hN(e){var t={};return Fe.each(e.dimensions,(function(i,n){var a=e.getDimensionInfo(i);if(!a.isExtraCoord){var r=a.coordDim;(t[r]=t[r]||[])[a.coordDimIndex]=n}})),t}function cN(e,t,i,n,a,r){return(e=dN(e,t,i,n,a,r,!0))&&r.setItemGraphicEl(t,e),e}function dN(e,t,i,n,a,r,o){var s,l=!i,u=(i=i||{}).type,h=i.shape,c=i.style;if(e&&(l||null!=u&&u!==e.__customGraphicType||"path"===u&&((s=h)&&(s.hasOwnProperty("pathData")||s.hasOwnProperty("d")))&&yN(h)!==e.__customPathData||"image"===u&&xN(c,"image")&&c.image!==e.__customImagePath||"text"===u&&xN(h,"text")&&c.text!==e.__customText)&&(a.remove(e),e=null),!l){var d=!e;return!e&&(e=function(e){var t,i=e.type;if("path"===i){var n=e.shape,a=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,r=yN(n);(t=Jh.makePath(r,null,a,n.layout||"center")).__customPathData=r}else if("image"===i)(t=new Jh.Image({})).__customImagePath=e.style.image;else if("text"===i)(t=new Jh.Text({})).__customText=e.style.text;else if("group"===i)t=new Jh.Group;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');t=new(Jh.getShapeClass(i))}return t.__customGraphicType=i,t.name=e.name,t}(i)),function(e,t,i,n,a,r,o){var s={},l=i.style||{};if(i.shape&&(s.shape=Fe.clone(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===e.type&&i.style){var u=s.style={};Fe.each(["x","y","width","height"],(function(t){lN(t,u,l,e.style,r)}))}"text"===e.type&&i.style&&(u=s.style={},Fe.each(["x","y"],(function(t){lN(t,u,l,e.style,r)})),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke));if("group"!==e.type&&(e.useStyle(l),r)){e.style.opacity=0;var h=l.opacity;null==h&&(h=1),Jh.initProps(e,{style:{opacity:h}},n,t)}r?e.attr(s):Jh.updateProps(e,s,n,t),i.hasOwnProperty("z2")&&e.attr("z2",i.z2||0),i.hasOwnProperty("silent")&&e.attr("silent",i.silent),i.hasOwnProperty("invisible")&&e.attr("invisible",i.invisible),i.hasOwnProperty("ignore")&&e.attr("ignore",i.ignore),i.hasOwnProperty("info")&&e.attr("info",i.info);var c=i.styleEmphasis;Jh.setElementHoverStyle(e,c),o&&Jh.setAsHighDownDispatcher(e,!1!==c)}(e,t,i,n,0,d,o),"group"===u&&function(e,t,i,n,a){var r=i.children,o=r?r.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(!o&&!l&&!u)return;if(l)return h={oldChildren:e.children()||[],newChildren:r||[],dataIndex:t,animatableModel:n,group:e,data:a},void new Jm(h.oldChildren,h.newChildren,pN,pN,h).add(fN).update(fN).remove(vN).execute();var h;u&&e.removeAll();for(var c=0;c<o;c++)r[c]&&dN(e.childAt(c),t,r[c],n,e,a)}(e,t,i,n,r),a.add(e),e}}function pN(e,t){var i=e&&e.name;return null!=i?i:"e\0\0"+t}function fN(e,t){var i=this.context,n=null!=e?i.newChildren[e]:null;dN(null!=t?i.oldChildren[t]:null,i.dataIndex,n,i.animatableModel,i.group,i.data)}function gN(e,t){var i=new pc({},t);return Fe.each(iN,(function(t,n){e.hasOwnProperty(t)&&(i.option[n]=e[t])})),i}function mN(e,t){for(var i in t)!t.hasOwnProperty(i)&&iN.hasOwnProperty(i)||(e[i]=t[i])}function vN(e){var t=this.context,i=t.oldChildren[e];i&&t.group.remove(i)}function yN(e){return e&&(e.pathData||e.d)}function xN(e,t){return e&&e.hasOwnProperty(t)}ng.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0,clip:!1},getInitialData:function(e,t){return hy(this.getSource(),this)},getDataParams:function(e,t,i){var n=ng.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),_g.extend({type:"custom",_data:null,render:function(e,t,i,n){var a=this._data,r=e.getData(),o=this.group,s=uN(e,r,t,i);r.diff(a).add((function(t){cN(null,t,s(t,n),e,o,r)})).update((function(t,i){cN(a.getItemGraphicEl(i),t,s(t,n),e,o,r)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&o.remove(t)})).execute();var l=e.get("clip",!0)?tN(e.coordinateSystem,!1,e):null;l?o.setClipPath(l):o.removeClipPath(),this._data=r},incrementalPrepareRender:function(e,t,i){this.group.removeAll(),this._data=null},incrementalRender:function(e,t,i,n,a){var r=t.getData(),o=uN(t,r,i,n);function s(e){e.isGroup||(e.incremental=!0,e.useHoverLayer=!0)}for(var l=e.start;l<e.end;l++){cN(null,l,o(l,a),t,this.group,r).traverse(s)}},dispose:Fe.noop,filterForExposedEvent:function(e,t,i,n){var a=t.element;if(null==a||i.name===a)return!0;for(;(i=i.parent)&&i!==this.group;)if(i.name===a)return!0;return!1}});var _N=Cc.parsePercent,bN=iy.isDimensionStacked;function wN(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function SN(e,t){return t.dim+e.model.componentIndex}var MN=function(e,t,i){var n={},a=function(e){var t={};Fe.each(e,(function(e,i){var n=e.getData(),a=e.coordinateSystem,r=a.getBaseAxis(),o=SN(a,r),s=r.getExtent(),l="category"===r.type?r.getBandWidth():Math.abs(s[1]-s[0])/n.count(),u=t[o]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=u.stacks;t[o]=u;var c=wN(e);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=_N(e.get("barWidth"),l),p=_N(e.get("barMaxWidth"),l),f=e.get("barGap"),g=e.get("barCategoryGap");d&&!h[c].width&&(d=Math.min(u.remainedWidth,d),h[c].width=d,u.remainedWidth-=d),p&&(h[c].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var i={};return Fe.each(t,(function(e,t){i[t]={};var n=e.stacks,a=e.bandWidth,r=_N(e.categoryGap,a),o=_N(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-r)/(l+(l-1)*o);u=Math.max(u,0),Fe.each(n,(function(e,t){var i=e.maxWidth;i&&i<u&&(i=Math.min(i,s),e.width&&(i=Math.min(i,e.width)),s-=i,e.width=i,l--)})),u=(s-r)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Fe.each(n,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Fe.each(n,(function(e,n){i[t][n]=i[t][n]||{offset:d,width:e.width},d+=e.width*(1+o)}))})),i}(Fe.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(),i=e.coordinateSystem,r=i.getBaseAxis(),o=SN(i,r),s=wN(e),l=a[o][s],u=l.offset,h=l.width,c=i.getOtherAxis(r),d=e.coordinateSystem.cx,p=e.coordinateSystem.cy,f=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;n[s]=n[s]||[];for(var m=t.mapDimension(c.dim),v=t.mapDimension(r.dim),y=bN(t,m),x="radius"!==r.dim||!e.get("roundCap",!0),_=c.getExtent()[0],b=0,w=t.count();b<w;b++){var S,M,I,A,T=t.get(m,b),C=t.get(v,b),D=T>=0?"p":"n",L=_;if(y&&(n[s][C]||(n[s][C]={p:_,n:_}),L=n[s][C][D]),"radius"===c.dim){var P=c.dataToRadius(T)-_,k=r.dataToAngle(C);Math.abs(P)<f&&(P=(P<0?-1:1)*f),S=L,M=L+P,A=(I=k-u)-h,y&&(n[s][C][D]=M)}else{var O=c.dataToAngle(T,x)-_,R=r.dataToRadius(C);Math.abs(O)<g&&(O=(O<0?-1:1)*g),M=(S=R+u)+h,I=L,A=L+O,y&&(n[s][C][D]=A)}t.setItemLayout(b,{cx:d,cy:p,r0:S,r:M,startAngle:-I*Math.PI/180,endAngle:-A*Math.PI/180})}}}),this)},IN=MN;function AN(e,t){A_.call(this,"radius",e,t),this.type="category"}AN.prototype={constructor:AN,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToRadius:A_.prototype.dataToCoord,radiusToData:A_.prototype.coordToData},Fe.inherits(AN,A_);var TN=AN,CN=(0,Ro.makeInner)();function DN(e,t){t=t||[0,360],A_.call(this,"angle",e,t),this.type="category"}DN.prototype={constructor:DN,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToAngle:A_.prototype.dataToCoord,angleToData:A_.prototype.coordToData,calculateCategoryInterval:function(){var e=this,t=e.getLabelModel(),i=e.scale,n=i.getExtent(),a=i.count();if(n[1]-n[0]<1)return 0;var r=n[0],o=e.dataToCoord(r+1)-e.dataToCoord(r),s=Math.abs(o),l=Ha.getBoundingRect(r,t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=CN(e.model),d=c.lastAutoInterval,p=c.lastTickCount;return null!=d&&null!=p&&Math.abs(d-h)<=1&&Math.abs(p-a)<=1&&d>h?h=d:(c.lastTickCount=a,c.lastAutoInterval=h),h}},Fe.inherits(DN,A_);var LN=DN,PN=function(e){this.name=e||"",this.cx=0,this.cy=0,this._radiusAxis=new TN,this._angleAxis=new LN,this._radiusAxis.polar=this._angleAxis.polar=this};PN.prototype={type:"polar",axisPointerEnabled:!0,constructor:PN,dimensions:["radius","angle"],model:null,containPoint:function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},containData:function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},getAxis:function(e){return this["_"+e+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},dataToPoint:function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},pointToData:function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},pointToCoord:function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),r=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);n.inverse?r=o-360:o=r+360;var s=Math.sqrt(t*t+i*i);t/=s,i/=s;for(var l=Math.atan2(-i,t)/Math.PI*180,u=l<r?1:-1;l<r||l>o;)l+=360*u;return[s,l]},coordToPoint:function(e){var t=e[0],i=e[1]/180*Math.PI;return[Math.cos(i)*t+this.cx,-Math.sin(i)*t+this.cy]},getArea:function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var i=e.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:e.inverse,contain:function(e,t){var i=e-this.cx,n=t-this.cy,a=i*i+n*n,r=this.r,o=this.r0;return a<=r*r&&a>=o*o}}}};var kN=PN,ON=od.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});Fe.merge(ON.prototype,Lx);var RN={splitNumber:5};function EN(e,t){return t.type||(t.data?"category":"value")}_w("angle",ON,EN,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),_w("radius",ON,EN,RN),U_.extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var NN=Cc.parsePercent,zN=Cx.createScaleByModel,BN=Cx.niceScaleExtent,VN=iy.getStackedDimension;function GN(e,t){var i=this,n=i.getAngleAxis(),a=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),a.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===i){var t=e.getData();Fe.each(t.mapDimension("radius",!0),(function(e){a.scale.unionExtentFromData(t,VN(t,e))})),Fe.each(t.mapDimension("angle",!0),(function(e){n.scale.unionExtentFromData(t,VN(t,e))}))}})),BN(n.scale,n.model),BN(a.scale,a.model),"category"===n.type&&!n.onBand){var r=n.getExtent(),o=360/n.scale.count();n.inverse?r[1]+=o:r[1]-=o,n.setExtent(r[0],r[1])}}function FN(e,t){if(e.type=t.get("type"),e.scale=zN(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),"angleAxis"===t.mainType){e.inverse^=t.get("clockwise");var i=t.get("startAngle");e.setExtent(i,i+(e.inverse?-360:360))}t.axis=e,e.model=t}var HN={dimensions:kN.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("polar",(function(e,n){var a=new kN(n);a.update=GN;var r=a.getRadiusAxis(),o=a.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");FN(r,s),FN(o,l),function(e,t,i){var n=t.get("center"),a=i.getWidth(),r=i.getHeight();e.cx=NN(n[0],a),e.cy=NN(n[1],r);var o=e.getRadiusAxis(),s=Math.min(a,r)/2,l=t.get("radius");null==l?l=[0,"100%"]:Fe.isArray(l)||(l=[0,l]),l=[NN(l[0],s),NN(l[1],s)],o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(a,e,t),i.push(a),e.coordinateSystem=a,a.model=e})),e.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}};Sp.register("polar",HN);var WN=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function UN(e,t,i){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],i]),a=e.coordToPoint([t[1],i]);return{x1:n[0],y1:n[1],x2:a[0],y2:a[1]}}function jN(e){return e.getRadiusAxis().inverse?0:1}function ZN(e){var t=e[0],i=e[e.length-1];t&&i&&Math.abs(Math.abs(t.coord-i.coord)-360)<1e-4&&e.pop()}bS.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,a=n.getRadiusAxis().getExtent(),r=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=Fe.map(i.getViewLabels(),(function(e){return(e=Fe.clone(e)).coord=i.dataToCoord(e.tickValue),e}));ZN(s),ZN(r),Fe.each(WN,(function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,r,o,a,s)}),this)}},_axisLine:function(e,t,i,n,a){var r,o=e.getModel("axisLine.lineStyle"),s=jN(t),l=s?0:1;(r=0===a[l]?new Jh.Circle({shape:{cx:t.cx,cy:t.cy,r:a[s]},style:o.getLineStyle(),z2:1,silent:!0}):new Jh.Ring({shape:{cx:t.cx,cy:t.cy,r:a[s],r0:a[l]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(r)},_axisTick:function(e,t,i,n,a){var r=e.getModel("axisTick"),o=(r.get("inside")?-1:1)*r.get("length"),s=a[jN(t)],l=Fe.map(i,(function(e){return new Jh.Line({shape:UN(t,[s,s+o],e.coord)})}));this.group.add(Jh.mergePath(l,{style:Fe.defaults(r.getModel("lineStyle").getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")})}))},_minorTick:function(e,t,i,n,a){if(n.length){for(var r=e.getModel("axisTick"),o=e.getModel("minorTick"),s=(r.get("inside")?-1:1)*o.get("length"),l=a[jN(t)],u=[],h=0;h<n.length;h++)for(var c=0;c<n[h].length;c++)u.push(new Jh.Line({shape:UN(t,[l,l+s],n[h][c].coord)}));this.group.add(Jh.mergePath(u,{style:Fe.defaults(o.getModel("lineStyle").getLineStyle(),Fe.defaults(r.getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")}))}))}},_axisLabel:function(e,t,i,n,a,r){var o=e.getCategories(!0),s=e.getModel("axisLabel"),l=s.get("margin"),u=e.get("triggerEvent");Fe.each(r,(function(i,n){var r=s,h=i.tickValue,c=a[jN(t)],d=t.coordToPoint([c+l,i.coord]),p=t.cx,f=t.cy,g=Math.abs(d[0]-p)/c<.3?"center":d[0]>p?"left":"right",m=Math.abs(d[1]-f)/c<.3?"middle":d[1]>f?"top":"bottom";o&&o[h]&&o[h].textStyle&&(r=new pc(o[h].textStyle,s,s.ecModel));var v=new Jh.Text({silent:sS.isLabelSilent(e)});this.group.add(v),Jh.setTextStyle(v.style,r,{x:d[0],y:d[1],textFill:r.getTextColor()||e.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:g,textVerticalAlign:m}),u&&(v.eventData=sS.makeAxisEventDataBase(e),v.eventData.targetType="axisLabel",v.eventData.value=i.rawLabel)}),this)},_splitLine:function(e,t,i,n,a){var r=e.getModel("splitLine").getModel("lineStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<i.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new Jh.Line({shape:UN(t,a,i[u].coord)}))}for(u=0;u<l.length;u++)this.group.add(Jh.mergePath(l[u],{style:Fe.defaults({stroke:o[u%o.length]},r.getLineStyle()),silent:!0,z:e.get("z")}))},_minorSplitLine:function(e,t,i,n,a){if(n.length){for(var r=e.getModel("minorSplitLine").getModel("lineStyle"),o=[],s=0;s<n.length;s++)for(var l=0;l<n[s].length;l++)o.push(new Jh.Line({shape:UN(t,a,n[s][l].coord)}));this.group.add(Jh.mergePath(o,{style:r.getLineStyle(),silent:!0,z:e.get("z")}))}},_splitArea:function(e,t,i,n,a){if(i.length){var r=e.getModel("splitArea").getModel("areaStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=Math.PI/180,h=-i[0].coord*u,c=Math.min(a[0],a[1]),d=Math.max(a[0],a[1]),p=e.get("clockwise"),f=1;f<i.length;f++){var g=s++%o.length;l[g]=l[g]||[],l[g].push(new Jh.Sector({shape:{cx:t.cx,cy:t.cy,r0:c,r:d,startAngle:h,endAngle:-i[f].coord*u,clockwise:p},silent:!0})),h=-i[f].coord*u}for(f=0;f<l.length;f++)this.group.add(Jh.mergePath(l[f],{style:Fe.defaults({fill:o[f%o.length]},r.getAreaStyle()),silent:!0}))}}});var YN=["axisLine","axisTickLabel","axisName"],XN=["splitLine","splitArea","minorSplitLine"];bS.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,a=n.getAngleAxis(),r=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=a.getExtent()[0],l=i.getExtent(),u=function(e,t,i){return{position:[e.cx,e.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(n,e,s),h=new sS(e,u);Fe.each(YN,h.add,h),this.group.add(h.getGroup()),Fe.each(XN,(function(t){e.get(t+".show")&&!i.scale.isBlank()&&this["_"+t](e,n,s,l,r,o)}),this)}},_splitLine:function(e,t,i,n,a){var r=e.getModel("splitLine").getModel("lineStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<a.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new Jh.Circle({shape:{cx:t.cx,cy:t.cy,r:a[u].coord}}))}for(u=0;u<l.length;u++)this.group.add(Jh.mergePath(l[u],{style:Fe.defaults({stroke:o[u%o.length],fill:null},r.getLineStyle()),silent:!0}))},_minorSplitLine:function(e,t,i,n,a,r){if(r.length){for(var o=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<r.length;l++)for(var u=0;u<r[l].length;u++)s.push(new Jh.Circle({shape:{cx:t.cx,cy:t.cy,r:r[l][u].coord}}));this.group.add(Jh.mergePath(s,{style:Fe.defaults({fill:null},o.getLineStyle()),silent:!0}))}},_splitArea:function(e,t,i,n,a){if(a.length){var r=e.getModel("splitArea").getModel("areaStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=a[0].coord,h=1;h<a.length;h++){var c=s++%o.length;l[c]=l[c]||[],l[c].push(new Jh.Sector({shape:{cx:t.cx,cy:t.cy,r0:u,r:a[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=a[h].coord}for(h=0;h<l.length;h++)this.group.add(Jh.mergePath(l[h],{style:Fe.defaults({fill:o[h%o.length]},r.getAreaStyle()),silent:!0}))}}});var qN=iE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis;"angle"===r.dim&&(this.animationThreshold=Math.PI/18);var o,s=r.polar,l=s.getOtherAxis(r).getExtent();o=r["dataTo"+Fc.capitalFirst(r.dim)](t);var u=n.get("type");if(u&&"none"!==u){var h=sE.buildElStyle(n),c=$N[u](r,s,o,l,h);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=function(e,t,i,n,a){var r=t.axis,o=r.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===r.dim){var d=ri.create();ri.rotate(d,d,s),ri.translate(d,d,[n.cx,n.cy]),l=Jh.applyTransform([o,-a],d);var p=t.getModel("axisLabel").get("rotate")||0,f=sS.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,h=f.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+a,o]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(t,i,0,s,n.get("label.margin"));sE.buildLabelElOption(e,i,n,a,d)}});var $N={line:function(e,t,i,n,a){return"angle"===e.dim?{type:"Line",shape:sE.makeLineShape(t.coordToPoint([n[0],i]),t.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:i}}},shadow:function(e,t,i,n,a){var r=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:sE.makeSectorShape(t.cx,t.cy,n[0],n[1],(-i-r/2)*o,(r/2-i)*o)}:{type:"Sector",shape:sE.makeSectorShape(t.cx,t.cy,i-r/2,i+r/2,0,2*Math.PI)}}};bS.registerAxisPointerClass("PolarAxisPointer",qN),U_.registerLayout(Fe.curry(IN,"bar")),U_.extendComponentView({type:"polar"});var KN=od.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(e){od.prototype.init.apply(this,arguments),Ro.defaultEmphasis(e,"label",["show"])},optionUpdated:function(){var e=this.option,t=this;e.regions=_A.getFilledRegions(e.regions,e.map,e.nameMap),this._optionModelMap=Fe.reduce(e.regions||[],(function(e,i){return i.name&&e.set(i.name,new pc(i,t)),e}),Fe.createHashMap()),this.updateSelectedMap(e.regions)},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)"}},regions:[]},getRegionModel:function(e){return this._optionModelMap.get(e)||new pc(null,this,this.ecModel)},getFormattedLabel:function(e,t){var i=this.getRegionModel(e).get("label"+("normal"===t?".":t+".")+"formatter"),n={name:e};return"function"==typeof i?(n.status=t,i(n)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e}});function JN(e,t){t.update="updateView",U_.registerAction(t,(function(t,i){var n={};return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name);var a=i.coordinateSystem;Fe.each(a.regions,(function(e){n[e.name]=i.isSelected(e.name)||!1}))})),{selected:n,name:t.name}}))}Fe.mixin(KN,uM),U_.extendComponentView({type:"geo",init:function(e,t){var i=new tA(t,!0);this._mapDraw=i,this.group.add(i.group)},render:function(e,t,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var a=this._mapDraw;e.get("show")?a.draw(e,t,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=e.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}}),JN("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),JN("select",{type:"geoSelect",event:"geoselected"}),JN("unSelect",{type:"geoUnSelect",event:"geounselected"});var QN=864e5;function ez(e,t,i){this._model=e}function tz(e,t,i,n){var a=i.calendarModel,r=i.seriesModel,o=a?a.coordinateSystem:r?r.coordinateSystem:null;return o===this?o[e](n):null}ez.prototype={constructor:ez,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(e){var t=(e=Cc.parseDate(e)).getFullYear(),i=e.getMonth()+1;i=i<10?"0"+i:i;var n=e.getDate();n=n<10?"0"+n:n;var a=e.getDay();return{y:t,m:i,d:n,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+n,date:e}},getNextNDay:function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},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 i=this._rangeInfo.weeks||1,n=["width","height"],a=this._model.get("cellSize").slice(),r=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[i,7]:[7,i];Fe.each([0,1],(function(e){u(a,e)&&(r[n[e]]=a[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=ed.getLayoutRect(r,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}Fe.each([0,1],(function(e){u(a,e)||(a[e]=l[n[e]]/o[e])})),this._sw=a[0],this._sh=a[1]},dataToPoint:function(e,t){Fe.isArray(e)&&(e=e[0]),null==t&&(t=!0);var i=this.getDateInfo(e),n=this._rangeInfo,a=i.formatedDate;if(t&&!(i.time>=n.start.time&&i.time<n.end.time+QN))return[NaN,NaN];var r=i.day,o=this._getRangeInfo([n.start.time,a]).nthWeek;return"vertical"===this._orient?[this._rect.x+r*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+r*this._sh+this._sh/2]},pointToData:function(e){var t=this.pointToDate(e);return t&&t.time},dataToRect:function(e,t){var i=this.dataToPoint(e,t);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,i=Math.floor((e[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,t-1,n):this._getDateByWeeksAndDay(t,i-1,n)},convertToPixel:Fe.curry(tz,"dataToPoint"),convertFromPixel:Fe.curry(tz,"pointToData"),_initRangeOption:function(){var e=this._model.get("range"),t=e;if(Fe.isArray(t)&&1===t.length&&(t=t[0]),/^\d{4}$/.test(t)&&(e=[t+"-01-01",t+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(t)){var i=this.getDateInfo(t),n=i.date;n.setMonth(n.getMonth()+1);var a=this.getNextNDay(n,-1);e=[i.formatedDate,a.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(t)&&(e=[t,t]);var r=this._getRangeInfo(e);return r.start.time>r.end.time&&e.reverse(),e},_getRangeInfo:function(e){var t;(e=[this.getDateInfo(e[0]),this.getDateInfo(e[1])])[0].time>e[1].time&&(t=!0,e.reverse());var i=Math.floor(e[1].time/QN)-Math.floor(e[0].time/QN)+1,n=new Date(e[0].time),a=n.getDate(),r=e[1].date.getDate();n.setDate(a+i-1);var o=n.getDate();if(o!==r)for(var s=n.getTime()-e[1].time>0?1:-1;(o=n.getDate())!==r&&(n.getTime()-e[1].time)*s>0;)i-=s,n.setDate(o-s);var l=Math.floor((i+e[0].day+6)/7),u=t?1-l:l-1;return t&&e.reverse(),{range:[e[0].formatedDate,e[1].formatedDate],start:e[0],end:e[1],allDay:i,weeks:l,nthWeek:u,fweek:e[0].day,lweek:e[1].day}},_getDateByWeeksAndDay:function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||0===e&&t<n.fweek||e===n.weeks&&t>n.lweek)return!1;var a=7*(e-1)-n.fweek+t,r=new Date(n.start.time);return r.setDate(n.start.d+a),this.getDateInfo(r)}},ez.dimensions=ez.prototype.dimensions,ez.getDimensionsInfo=ez.prototype.getDimensionsInfo,ez.create=function(e,t){var i=[];return e.eachComponent("calendar",(function(e){var t=new ez(e);i.push(t),e.coordinateSystem=t})),e.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},Sp.register("calendar",ez);var iz=ed.getLayoutParams,nz=ed.sizeCalculable,az=ed.mergeLayoutParam,rz=od.extend({type:"calendar",coordinateSystem:null,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}},init:function(e,t,i,n){var a=iz(e);rz.superApply(this,"init",arguments),oz(e,a)},mergeOption:function(e,t){rz.superApply(this,"mergeOption",arguments),oz(this.option,e)}});function oz(e,t){var i=e.cellSize;Fe.isArray(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var n=Fe.map([0,1],(function(e){return nz(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]}));az(e,t,{type:"box",ignoreSize:n})}var sz={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},lz={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};U_.extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(e,t,i){var n=this.group;n.removeAll();var a=e.coordinateSystem,r=a.getRangeInfo(),o=a.getOrient();this._renderDayRect(e,r,n),this._renderLines(e,r,o,n),this._renderYearText(e,r,o,n),this._renderMonthText(e,o,n),this._renderWeekText(e,r,o,n)},_renderDayRect:function(e,t,i){for(var n=e.coordinateSystem,a=e.getModel("itemStyle").getItemStyle(),r=n.getCellWidth(),o=n.getCellHeight(),s=t.start.time;s<=t.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new Jh.Rect({shape:{x:l[0],y:l[1],width:r,height:o},cursor:"default",style:a});i.add(u)}},_renderLines:function(e,t,i,n){var a=this,r=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,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function d(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var l=a._getLinePointsOfOneWeek(e,t,i);a._tlpoints.push(l[0]),a._blpoints.push(l[l.length-1]),s&&a._drawSplitline(l,o,n)}d(r.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,l,i),o,n),s&&this._drawSplitline(a._getEdgesPoints(a._blpoints,l,i),o,n)},_getEdgesPoints:function(e,t,i){var n=[e[0].slice(),e[e.length-1].slice()],a="horizontal"===i?0:1;return n[0][a]=n[0][a]-t/2,n[1][a]=n[1][a]+t/2,n},_drawSplitline:function(e,t,i){var n=new Jh.Polyline({z2:20,shape:{points:e},style:t});i.add(n)},_getLinePointsOfOneWeek:function(e,t,i){var n=e.coordinateSystem;t=n.getDateInfo(t);for(var a=[],r=0;r<7;r++){var o=n.getNextNDay(t.time,r),s=n.dataToRect([o.time],!1);a[2*o.day]=s.tl,a[2*o.day+1]=s["horizontal"===i?"bl":"tr"]}return a},_formatterLabel:function(e,t){return"string"==typeof e&&e?Fc.formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},_yearTextPositionControl:function(e,t,i,n,a){t=t.slice();var r=["center","bottom"];"bottom"===n?(t[1]+=a,r=["center","top"]):"left"===n?t[0]-=a:"right"===n?(t[0]+=a,r=["center","top"]):t[1]-=a;var o=0;return"left"!==n&&"right"!==n||(o=Math.PI/2),{rotation:o,position:t,style:{textAlign:r[0],textVerticalAlign:r[1]}}},_renderYearText:function(e,t,i,n){var a=e.getModel("yearLabel");if(a.get("show")){var r=a.get("margin"),o=a.get("position");o||(o="horizontal"!==i?"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,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var p=a.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new Jh.Text({z2:30});Jh.setTextStyle(m.style,a,{text:g}),m.attr(this._yearTextPositionControl(m,c[o],i,o,r)),n.add(m)}},_monthTextPositionControl:function(e,t,i,n,a){var r="left",o="top",s=e[0],l=e[1];return"horizontal"===i?(l+=a,t&&(r="center"),"start"===n&&(o="bottom")):(s+=a,t&&(o="middle"),"start"===n&&(r="right")),{x:s,y:l,textAlign:r,textVerticalAlign:o}},_renderMonthText:function(e,t,i){var n=e.getModel("monthLabel");if(n.get("show")){var a=n.get("nameMap"),r=n.get("margin"),o=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];Fe.isString(a)&&(a=sz[a.toUpperCase()]||[]);var u="start"===o?0:1,h="horizontal"===t?0:1;r="start"===o?-r:r;for(var c="center"===s,d=0;d<l[u].length-1;d++){var p=l[u][d].slice(),f=this._firstDayOfMonth[d];if(c){var g=this._firstDayPoints[d];p[h]=(g[h]+l[0][d+1][h])/2}var m=n.get("formatter"),v=a[+f.m-1],y={yyyy:f.y,yy:(f.y+"").slice(2),MM:f.m,M:+f.m,nameMap:v},x=this._formatterLabel(m,y),_=new Jh.Text({z2:30});Fe.extend(Jh.setTextStyle(_.style,n,{text:x}),this._monthTextPositionControl(p,c,t,o,r)),i.add(_)}}},_weekTextPositionControl:function(e,t,i,n,a){var r="center",o="middle",s=e[0],l=e[1],u="start"===i;return"horizontal"===t?(s=s+n+(u?1:-1)*a[0]/2,r=u?"right":"left"):(l=l+n+(u?1:-1)*a[1]/2,o=u?"bottom":"top"),{x:s,y:l,textAlign:r,textVerticalAlign:o}},_renderWeekText:function(e,t,i,n){var a=e.getModel("dayLabel");if(a.get("show")){var r=e.coordinateSystem,o=a.get("position"),s=a.get("nameMap"),l=a.get("margin"),u=r.getFirstDayOfWeek();Fe.isString(s)&&(s=lz[s.toUpperCase()]||[]);var h=r.getNextNDay(t.end.time,7-t.lweek).time,c=[r.getCellWidth(),r.getCellHeight()];l=Cc.parsePercent(l,c["horizontal"===i?0:1]),"start"===o&&(h=r.getNextNDay(t.start.time,-(7+t.fweek)).time,l=-l);for(var d=0;d<7;d++){var p,f=r.getNextNDay(h,d),g=r.dataToRect([f.time],!1).center;p=Math.abs((d+u)%7);var m=new Jh.Text({z2:30});Fe.extend(Jh.setTextStyle(m.style,a,{text:s[p]}),this._weekTextPositionControl(g,i,o,l,c)),n.add(m)}}}});var uz=Cc.parsePercent,hz={path:null,compoundPath:null,group:Jh.Group,image:Jh.Image,text:Jh.Text};U_.registerPreprocessor((function(e){var t=e.graphic;Fe.isArray(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}));var cz=U_.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(e){var t=this.option.elements;this.option.elements=null,cz.superApply(this,"mergeOption",arguments),this.option.elements=t},optionUpdated:function(e,t){var i=this.option,n=(t?i:e).elements,a=i.elements=t?[]:i.elements,r=[];this._flatten(n,r);var o=Ro.mappingToExists(a,r);Ro.makeIdAndName(o);var s=this._elOptionsToUpdate=[];Fe.each(o,(function(e,t){var i=e.option;i&&(s.push(i),function(e,t){var i=e.exist;if(t.id=e.keyInfo.id,!t.type&&i&&(t.type=i.type),null==t.parentId){var n=t.parentOption;n?t.parentId=n.id:i&&(t.parentId=i.parentId)}t.parentOption=null}(e,i),function(e,t,i){var n=Fe.extend({},i),a=e[t],r=i.$action||"merge";"merge"===r?a?(Fe.merge(a,n,!0),ed.mergeLayoutParam(a,n,{ignoreSize:!0}),ed.copyLayoutParams(i,a)):e[t]=n:"replace"===r?e[t]=n:"remove"===r&&a&&(e[t]=null)}(a,t,i),function(e,t){if(!e)return;e.hv=t.hv=[fz(t,["left","right"]),fz(t,["top","bottom"])],"group"===e.type&&(null==e.width&&(e.width=t.width=0),null==e.height&&(e.height=t.height=0))}(a[t],i))}),this);for(var l=a.length-1;l>=0;l--)null==a[l]?a.splice(l,1):delete a[l].$action},_flatten:function(e,t,i){Fe.each(e,(function(e){if(e){i&&(e.parentOption=i),t.push(e);var n=e.children;"group"===e.type&&n&&this._flatten(n,t,e),delete e.children}}),this)},useElOptionsToUpdate:function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e}});function dz(e,t,i,n){var a=i.type,r=new(hz.hasOwnProperty(a)?hz[a]:Jh.getShapeClass(a))(i);t.add(r),n.set(e,r),r.__ecGraphicId=e}function pz(e,t){var i=e&&e.parent;i&&("group"===e.type&&e.traverse((function(e){pz(e,t)})),t.removeKey(e.__ecGraphicId),i.remove(e))}function fz(e,t){var i;return Fe.each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)})),i}U_.extendComponentView({type:"graphic",init:function(e,t){this._elMap=Fe.createHashMap(),this._lastGraphicModel},render:function(e,t,i){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,i)},_updateElements:function(e){var t=e.useElOptionsToUpdate();if(t){var i=this._elMap,n=this.group;Fe.each(t,(function(t){var a=t.$action,r=t.id,o=i.get(r),s=t.parentId,l=null!=s?i.get(s):n,u=t.style;"text"===t.type&&u&&(t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=function(e){return e=Fe.extend({},e),Fe.each(["id","parentId","$action","hv","bounding"].concat(ed.LOCATION_PARAMS),(function(t){delete e[t]})),e}(t);a&&"merge"!==a?"replace"===a?(pz(o,i),dz(r,l,h,i)):"remove"===a&&pz(o,i):o?o.attr(h):dz(r,l,h,i);var c=i.get(r);c&&(c.__ecGraphicWidthOption=t.width,c.__ecGraphicHeightOption=t.height,function(e,t){var i=e.eventData;e.silent||e.ignore||i||(i=e.eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name});i&&(i.info=e.info)}(c,e))}))}},_relocate:function(e,t){for(var i=e.option.elements,n=this.group,a=this._elMap,r=t.getWidth(),o=t.getHeight(),s=0;s<i.length;s++){var l=i[s];if((h=a.get(l.id))&&h.isGroup){var u=(c=h.parent)===n;h.__ecGraphicWidth=uz(h.__ecGraphicWidthOption,u?r:c.__ecGraphicWidth)||0,h.__ecGraphicHeight=uz(h.__ecGraphicHeightOption,u?o:c.__ecGraphicHeight)||0}}for(s=i.length-1;s>=0;s--){var h;l=i[s];if(h=a.get(l.id)){var c,d=(c=h.parent)===n?{width:r,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight};ed.positionElement(h,l,d,null,{hv:l.hv,boundingMode:l.bounding})}}},_clear:function(){var e=this._elMap;e.each((function(t){pz(t,e)})),this._elMap=Fe.createHashMap()},dispose:function(){this._clear()}});var gz={};var mz={register:function(e,t){gz[e]=t},get:function(e){return gz[e]}},vz=U_.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){vz.superApply(this,"optionUpdated",arguments),Fe.each(this.option.feature,(function(e,t){var i=mz.get(t);i&&Fe.merge(e,i.defaultOption)}))},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}}}),yz=ed.getLayoutRect,xz=ed.box,_z=ed.positionElement;var bz=function(e,t){var i=Fc.normalizeCssArray(t.get("padding")),n=t.getItemStyle(["color","opacity"]);return n.fill=t.get("backgroundColor"),e=new Jh.Rect({shape:{x:e.x-i[3],y:e.y-i[0],width:e.width+i[1]+i[3],height:e.height+i[0]+i[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1})},wz={layout:function(e,t,i){var n=t.getBoxLayoutParams(),a=t.get("padding"),r={width:i.getWidth(),height:i.getHeight()},o=yz(n,r,a);xz(t.get("orient"),e,t.get("itemGap"),o.width,o.height),_z(e,n,r,a)},makeBackground:bz};U_.extendComponentView({type:"toolbox",render:function(e,t,i,n){var a=this.group;if(a.removeAll(),e.get("show")){var r=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];Fe.each(o,(function(e,t){l.push(t)})),new Jm(this._featureNames||[],l).add(u).update(u).remove(Fe.curry(u,null)).execute(),this._featureNames=l,wz.layout(a,e,i),a.add(wz.makeBackground(a.getBoundingRect(),e)),a.eachChild((function(e){var t=e.__title,n=e.hoverStyle;if(n&&t){var o=Ha.getBoundingRect(t,Ha.makeFont(n)),s=e.position[0]+a.position[0],l=!1;e.position[1]+a.position[1]+r+o.height>i.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:r+8;s+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):s-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}}))}function u(u,h){var c,d=l[u],p=l[h],f=o[d],g=new pc(f,e,e.ecModel);if(n&&null!=n.newTitle&&n.featureName===d&&(f.title=n.newTitle),d&&!p){if(function(e){return 0===e.indexOf("my")}(d))c={model:g,onclick:g.option.onclick,featureName:d};else{var m=mz.get(d);if(!m)return;c=new m(g,t,i)}s[d]=c}else{if(!(c=s[p]))return;c.model=g,c.ecModel=t,c.api=i}d||!p?g.get("show")&&!c.unusable?(!function(n,o,s){var l=n.getModel("iconStyle"),u=n.getModel("emphasis.iconStyle"),h=o.getIcons?o.getIcons():n.get("icon"),c=n.get("title")||{};if("string"==typeof h){var d=h,p=c;c={},(h={})[s]=d,c[s]=p}var f=n.iconPaths={};Fe.each(h,(function(s,h){var d=Jh.createIcon(s,{},{x:-r/2,y:-r/2,width:r,height:r});d.setStyle(l.getItemStyle()),d.hoverStyle=u.getItemStyle(),d.setStyle({text:c[h],textAlign:u.get("textAlign"),textBorderRadius:u.get("textBorderRadius"),textPadding:u.get("textPadding"),textFill:null});var p=e.getModel("tooltip");p&&p.get("show")&&d.attr("tooltip",Fe.extend({content:c[h],formatter:p.get("formatter",!0)||function(){return c[h]},formatterParams:{componentType:"toolbox",name:h,title:c[h],$vars:["name","title"]},position:p.get("position",!0)||"bottom"},p.option)),Jh.setHoverStyle(d),e.get("showTitle")&&(d.__title=c[h],d.on("mouseover",(function(){var t=u.getItemStyle(),i="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({textFill:u.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:u.get("textBackgroundColor"),textPosition:u.get("textPosition")||i})})).on("mouseout",(function(){d.setStyle({textFill:null,textBackgroundColor:null})}))),d.trigger(n.get("iconStatus."+h)||"normal"),a.add(d),d.on("click",Fe.bind(o.onclick,o,t,i,h)),f[h]=d}))}(g,c,d),g.setIconStatus=function(e,t){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[e]=t,n[e]&&n[e].trigger(t)},c.render&&c.render(g,t,i,n)):c.remove&&c.remove(t,i):c.dispose&&c.dispose(t,i)}},updateView:function(e,t,i,n){Fe.each(this._features,(function(e){e.updateView&&e.updateView(e.model,t,i,n)}))},remove:function(e,t){Fe.each(this._features,(function(i){i.remove&&i.remove(e,t)})),this.group.removeAll()},dispose:function(e,t){Fe.each(this._features,(function(i){i.dispose&&i.dispose(e,t)}))}});var Sz=Dg.toolbox.saveAsImage;function Mz(e){this.model=e}Mz.defaultOption={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:Sz.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:Sz.lang.slice()},Mz.prototype.unusable=!ae.canvasSupported,Mz.prototype.onclick=function(e,t){var i=this.model,n=i.get("name")||e.get("title.0.text")||"echarts",a="svg"===t.getZr().painter.getType()?"svg":i.get("type",!0)||"png",r=t.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||ae.browser.ie||ae.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(r.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+a)}else{var h=i.get("lang"),c='<body style="margin:0;"><img src="'+r+'" style="max-width:100%;" title="'+(h&&h[0]||"")+'" /></body>';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+a,d.target="_blank",d.href=r;var p=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});d.dispatchEvent(p)}},mz.register("saveAsImage",Mz);var Iz=Dg.toolbox.magicType,Az="__ec_magicType_stack__";function Tz(e){this.model=e}Tz.defaultOption={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:Fe.clone(Iz.title),option:{},seriesIndex:{}};var Cz=Tz.prototype;Cz.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return Fe.each(e.get("type"),(function(e){t[e]&&(i[e]=t[e])})),i};var Dz={line:function(e,t,i,n){if("bar"===e)return Fe.merge({id:t,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(e,t,i,n){if("line"===e)return Fe.merge({id:t,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(e,t,i,n){var a=i.get("stack")===Az;if("line"===e||"bar"===e)return n.setIconStatus("stack",a?"normal":"emphasis"),Fe.merge({id:t,stack:a?"":Az},n.get("option.stack")||{},!0)}},Lz=[["line","bar"],["stack"]];Cz.onclick=function(e,t,i){var n=this.model,a=n.get("seriesIndex."+i);if(Dz[i]){var r,o={series:[]};if(Fe.each(Lz,(function(e){Fe.indexOf(e,i)>=0&&Fe.each(e,(function(e){n.setIconStatus(e,"normal")}))})),n.setIconStatus(i,"emphasis"),e.eachComponent({mainType:"series",query:null==a?null:{seriesIndex:a}},(function(t){var a=t.subType,r=t.id,s=Dz[i](a,r,t,n);s&&(Fe.defaults(s,t.option),o.series.push(s));var l=t.coordinateSystem;if(l&&"cartesian2d"===l.type&&("line"===i||"bar"===i)){var u=l.getAxesByScale("ordinal")[0];if(u){var h=u.dim+"Axis",c=e.queryComponents({mainType:h,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;o[h]=o[h]||[];for(var d=0;d<=c;d++)o[h][c]=o[h][c]||{};o[h][c].boundaryGap="bar"===i}}})),"stack"===i)r=o.series&&o.series[0]&&o.series[0].stack===Az?Fe.merge({stack:Iz.title.tiled},Iz.title):Fe.clone(Iz.title);t.dispatchAction({type:"changeMagicType",currentType:i,newOption:o,newTitle:r,featureName:"magicType"})}},U_.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),mz.register("magicType",Tz);var Pz=Dg.toolbox.dataView,kz=new Array(60).join("-"),Oz="\t";function Rz(e){return Fe.map(e,(function(e){var t=e.getRawData(),i=[e.name],n=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,a=arguments[e-1],r=t.getName(a),o=0;o<e-1;o++)n[o]=arguments[o];i.push((r?r+Oz:"")+n.join(Oz))})),i.join("\n")})).join("\n\n"+kz+"\n\n")}function Ez(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var Nz=new RegExp("[\t]+","g");function zz(e,t){var i=e.split(new RegExp("\n*"+kz+"\n*","g")),n={series:[]};return Fe.each(i,(function(e,i){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(Oz)>=0)return!0}(e)){var a=function(e){for(var t=e.split(/\n+/g),i=Ez(t.shift()).split(Nz),n=[],a=Fe.map(i,(function(e){return{name:e,data:[]}})),r=0;r<t.length;r++){var o=Ez(t[r]).split(Nz);n.push(o.shift());for(var s=0;s<o.length;s++)a[s]&&(a[s].data[r]=o[s])}return{series:a,categories:n}}(e),r=t[i],o=r.axisDim+"Axis";r&&(n[o]=n[o]||[],n[o][r.axisIndex]={data:a.categories},n.series=n.series.concat(a.series))}else{a=function(e){for(var t=e.split(/\n+/g),i=Ez(t.shift()),n=[],a=0;a<t.length;a++){var r,o=Ez(t[a]).split(Nz),s="",l=!1;isNaN(o[0])?(l=!0,s=o[0],o=o.slice(1),n[a]={name:s,value:[]},r=n[a].value):r=n[a]=[];for(var u=0;u<o.length;u++)r.push(+o[u]);1===r.length&&(l?n[a].value=r[0]:n[a]=r[0])}return{name:i,data:n}}(e);n.series.push(a)}})),n}function Bz(e){this._dom=null,this.model=e}function Vz(e,t){return Fe.map(e,(function(e,i){var n=t&&t[i];return Fe.isObject(n)&&!Fe.isArray(n)?(Fe.isObject(e)&&!Fe.isArray(e)&&(e=e.value),Fe.defaults({value:e},n)):e}))}Bz.defaultOption={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:Fe.clone(Pz.title),lang:Fe.clone(Pz.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},Bz.prototype.onclick=function(e,t){var i=t.getDom(),n=this.model;this._dom&&i.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=n.get("backgroundColor")||"#fff";var r=document.createElement("h4"),o=n.get("lang")||[];r.innerHTML=o[0]||n.get("title"),r.style.cssText="margin: 10px 20px;",r.style.color=n.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="display:block;width:100%;overflow:auto;";var u=n.get("optionToContent"),h=n.get("contentToOption"),c=function(e){var t,i,n=function(e){var t={},i=[],n=[];return e.eachRawSeries((function(e){var a=e.coordinateSystem;if(!a||"cartesian2d"!==a.type&&"polar"!==a.type)i.push(e);else{var r=a.getBaseAxis();if("category"===r.type){var o=r.dim+"_"+r.index;t[o]||(t[o]={categoryAxis:r,valueAxis:a.getOtherAxis(r),series:[]},n.push({axisDim:r.dim,axisIndex:r.index})),t[o].series.push(e)}else i.push(e)}})),{seriesGroupByCategoryAxis:t,other:i,meta:n}}(e);return{value:Fe.filter([(t=n.seriesGroupByCategoryAxis,i=[],Fe.each(t,(function(e,t){var n=e.categoryAxis,a=e.valueAxis.dim,r=[" "].concat(Fe.map(e.series,(function(e){return e.name}))),o=[n.model.getCategories()];Fe.each(e.series,(function(e){o.push(e.getRawData().mapArray(a,(function(e){return e})))}));for(var s=[r.join(Oz)],l=0;l<o[0].length;l++){for(var u=[],h=0;h<o.length;h++)u.push(o[h][l]);s.push(u.join(Oz))}i.push(s.join("\n"))})),i.join("\n\n"+kz+"\n\n")),Rz(n.other)],(function(e){return e.replace(/[\n\t\s]/g,"")})).join("\n\n"+kz+"\n\n"),meta:n.meta}}(e);if("function"==typeof u){var d=u(t.getOption());"string"==typeof d?s.innerHTML=d:Fe.isDom(d)&&s.appendChild(d)}else s.appendChild(l),l.readOnly=n.get("readOnly"),l.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",l.style.color=n.get("textColor"),l.style.borderColor=n.get("textareaBorderColor"),l.style.backgroundColor=n.get("textareaColor"),l.value=c.value;var p=c.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"),v=document.createElement("div");g+=";background-color:"+n.get("buttonColor"),g+=";color:"+n.get("buttonTextColor");var y=this;function x(){i.removeChild(a),y._dom=null}zt.addEventListener(m,"click",x),zt.addEventListener(v,"click",(function(){var e;try{e="function"==typeof h?h(s,t.getOption()):zz(l.value,p)}catch(e){throw x(),new Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),x()})),m.innerHTML=o[1],v.innerHTML=o[2],v.style.cssText=g,m.style.cssText=g,!n.get("readOnly")&&f.appendChild(v),f.appendChild(m),a.appendChild(r),a.appendChild(s),a.appendChild(f),s.style.height=i.clientHeight-80+"px",i.appendChild(a),this._dom=a},Bz.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},Bz.prototype.dispose=function(e,t){this.remove(e,t)},mz.register("dataView",Bz),U_.registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var i=[];Fe.each(e.newOption.series,(function(e){var n=t.getSeriesByName(e.name)[0];if(n){var a=n.get("data");i.push({name:e.name,data:Vz(e.data,a)})}else i.push(Fe.extend({type:"scatter"},e))})),t.mergeOption(Fe.defaults({series:i},e.newOption))}));var Gz=Fe.each,Fz=Fe.indexOf,Hz=Fe.curry,Wz=["dataToPoint","pointToData"],Uz=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function jz(e,t,i){var n=this._targetInfoList=[],a={},r=Xz(t,e);Gz(qz,(function(e,t){(!i||!i.include||Fz(i.include,t)>=0)&&e(r,n,a)}))}var Zz=jz.prototype;function Yz(e){return e[0]>e[1]&&e.reverse(),e}function Xz(e,t){return Ro.parseFinder(e,t,{includeMainTypes:Uz})}Zz.setOutputRanges=function(e,t){this.matchOutputRanges(e,t,(function(e,t,i){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var n=Jz[e.brushType](0,i,t);e.__rangeOffset={offset:eB[e.brushType](n.values,e.range,[1,1]),xyMinMax:n.xyMinMax}}}))},Zz.matchOutputRanges=function(e,t,i){Gz(e,(function(e){var n=this.findTargetInfo(e,t);n&&!0!==n&&Fe.each(n.coordSyses,(function(n){var a=Jz[e.brushType](1,n,e.range);i(e,a.values,n,t)}))}),this)},Zz.setInputRanges=function(e,t){Gz(e,(function(e){var i,n,a,r,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=Jz[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?eB[e.brushType](l.values,u.offset,(i=l.xyMinMax,n=u.xyMinMax,a=iB(i),r=iB(n),o=[a[0]/r[0],a[1]/r[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},Zz.makePanelOpts=function(e,t){return Fe.map(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t&&t(i),clipPath:PP.makeRectPanelClipPath(n),isTargetByCursor:PP.makeRectIsTargetByCursor(n,e,i.coordSysModel),getLinearBrushOtherExtent:PP.makeLinearBrushOtherExtent(n)}}))},Zz.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return!0===n||n&&Fz(n.coordSyses,t.coordinateSystem)>=0},Zz.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=Xz(t,e),a=0;a<i.length;a++){var r=i[a],o=e.panelId;if(o){if(r.panelId===o)return r}else for(a=0;a<$z.length;a++)if($z[a](n,r))return r}return!0};var qz={grid:function(e,t){var i=e.xAxisModels,n=e.yAxisModels,a=e.gridModels,r=Fe.createHashMap(),o={},s={};(i||n||a)&&(Gz(i,(function(e){var t=e.axis.grid.model;r.set(t.id,t),o[t.id]=!0})),Gz(n,(function(e){var t=e.axis.grid.model;r.set(t.id,t),s[t.id]=!0})),Gz(a,(function(e){r.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),r.each((function(e){var a=e.coordinateSystem,r=[];Gz(a.getCartesians(),(function(e,t){(Fz(i,e.getAxis("x").model)>=0||Fz(n,e.getAxis("y").model)>=0)&&r.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:r[0],coordSyses:r,getPanelRect:Kz.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){Gz(e.geoModels,(function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:Kz.geo})}))}},$z=[function(e,t){var i=e.xAxisModel,n=e.yAxisModel,a=e.gridModel;return!a&&i&&(a=i.axis.grid.model),!a&&n&&(a=n.axis.grid.model),a&&a===t.gridModel},function(e,t){var i=e.geoModel;return i&&i===t.geoModel}],Kz={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Jh.getTransform(e)),t}},Jz={lineX:Hz(Qz,0),lineY:Hz(Qz,1),rect:function(e,t,i){var n=t[Wz[e]]([i[0][0],i[1][0]]),a=t[Wz[e]]([i[0][1],i[1][1]]),r=[Yz([n[0],a[0]]),Yz([n[1],a[1]])];return{values:r,xyMinMax:r}},polygon:function(e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:Fe.map(i,(function(i){var a=t[Wz[e]](i);return n[0][0]=Math.min(n[0][0],a[0]),n[1][0]=Math.min(n[1][0],a[1]),n[0][1]=Math.max(n[0][1],a[0]),n[1][1]=Math.max(n[1][1],a[1]),a})),xyMinMax:n}}};function Qz(e,t,i,n){var a=i.getAxis(["x","y"][e]),r=Yz(Fe.map([0,1],(function(e){return t?a.coordToData(a.toLocalCoord(n[e])):a.toGlobalCoord(a.dataToCoord(n[e]))}))),o=[];return o[e]=r,o[1-e]=[NaN,NaN],{values:r,xyMinMax:o}}var eB={lineX:Hz(tB,0),lineY:Hz(tB,1),rect:function(e,t,i){return[[e[0][0]-i[0]*t[0][0],e[0][1]-i[0]*t[0][1]],[e[1][0]-i[1]*t[1][0],e[1][1]-i[1]*t[1][1]]]},polygon:function(e,t,i){return Fe.map(e,(function(e,n){return[e[0]-i[0]*t[n][0],e[1]-i[1]*t[n][1]]}))}};function tB(e,t,i,n){return[t[0]-n[e]*i[0],t[1]-n[e]*i[1]]}function iB(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var nB=jz,aB=Fe.each,rB="\0_ec_hist_store";function oB(e){var t=e[rB];return t||(t=e[rB]=[{}]),t}var sB=function(e,t){var i=oB(e);aB(t,(function(t,n){for(var a=i.length-1;a>=0;a--){if(i[a][n])break}if(a<0){var r=e.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(r){var o=r.getPercentRange();i[0][n]={dataZoomId:n,start:o[0],end:o[1]}}}})),i.push(t)},lB=function(e){var t=oB(e),i=t[t.length-1];t.length>1&&t.pop();var n={};return aB(i,(function(e,i){for(var a=t.length-1;a>=0;a--){if(e=t[a][i]){n[i]=e;break}}})),n},uB={push:sB,pop:lB,clear:function(e){e[rB]=null},count:function(e){return oB(e).length}};od.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var hB=["cartesian2d","polar","singleAxis"];function cB(e,t){e=e.slice();var i=Fe.map(e,Fc.capitalFirst);t=(t||[]).slice();var n=Fe.map(t,Fc.capitalFirst);return function(a,r){Fe.each(e,(function(e,o){for(var s={name:e,capital:i[o]},l=0;l<t.length;l++)s[t[l]]=e+n[l];a.call(r,s)}))}}var dB=cB(["x","y","z","radius","angle","single"],["axisIndex","axis","index","id"]);var pB={isCoordSupported:function(e){return Fe.indexOf(hB,e)>=0},createNameEach:cB,eachAxisDim:dB,createLinkedNodesFinder:function(e,t,i){return function(a){var r,o={nodes:[],records:{}};if(t((function(e){o.records[e.name]={}})),!a)return o;n(a,o);do{r=!1,e(s)}while(r);function s(e){!function(e,t){return Fe.indexOf(t.nodes,e)>=0}(e,o)&&function(e,n){var a=!1;return t((function(t){Fe.each(i(e,t)||[],(function(e){n.records[t.name][e]&&(a=!0)}))})),a}(e,o)&&(n(e,o),r=!0)}return o};function n(e,n){n.nodes.push(e),t((function(t){Fe.each(i(e,t)||[],(function(e){n.records[t.name][e]=!0}))}))}}},fB=Fe.each,gB=Cc.asc,mB=function(e,t,i,n){this._dimName=e,this._axisIndex=t,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i};function vB(e,t){var i=e.getAxisModel(),n=e._percentWindow,a=e._valueWindow;if(n){var r=Cc.getPixelPrecision(a,[0,500]);r=Math.min(r,20);var o=t||0===n[0]&&100===n[1];i.setRange(o?null:+a[0].toFixed(r),o?null:+a[1].toFixed(r))}}mB.prototype={constructor:mB,hostedBy:function(e){return this._dataZoomModel===e},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var e=[],t=this.ecModel;return t.eachSeries((function(i){if(pB.isCoordSupported(i.get("coordinateSystem"))){var n=this._dimName,a=t.queryComponents({mainType:n+"Axis",index:i.get(n+"AxisIndex"),id:i.get(n+"AxisId")})[0];this._axisIndex===(a&&a.componentIndex)&&e.push(i)}}),this),e},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var e,t,i,n=this._dimName,a=this.ecModel,r=this.getAxisModel();return"x"===n||"y"===n?(t="gridIndex",e="x"===n?"y":"x"):(t="polarIndex",e="angle"===n?"radius":"angle"),a.eachComponent(e+"Axis",(function(e){(e.get(t)||0)===(r.get(t)||0)&&(i=e)})),i},getMinMaxSpan:function(){return Fe.clone(this._minMaxSpan)},calculateDataWindow:function(e){var t,i=this._dataExtent,n=this.getAxisModel().axis.scale,a=this._dataZoomModel.getRangePropMode(),r=[0,100],o=[],s=[];fB(["start","end"],(function(l,u){var h=e[l],c=e[l+"Value"];"percent"===a[u]?(null==h&&(h=r[u]),c=n.parse(Cc.linearMap(h,r,i))):(t=!0,c=null==c?i[u]:n.parse(c),h=Cc.linearMap(c,i,r)),s[u]=c,o[u]=h})),gB(s),gB(o);var l=this._minMaxSpan;function u(e,t,i,a,r){var o=r?"Span":"ValueSpan";IL(0,e,i,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=Cc.linearMap(e[s],i,a,!0),r&&(t[s]=n.parse(t[s]))}return t?u(s,o,i,r,!1):u(o,s,r,i,!0),{valueWindow:s,percentWindow:o}},reset:function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,i){var n=[1/0,-1/0];fB(i,(function(e){var i=e.getData();i&&fB(i.mapDimension(t,!0),(function(e){var t=i.getApproximateExtent(e);t[0]<n[0]&&(n[0]=t[0]),t[1]>n[1]&&(n[1]=t[1])}))})),n[1]<n[0]&&(n=[NaN,NaN]);return function(e,t){var i=e.getAxisModel(),n=i.getMin(!0),a="category"===i.get("type"),r=a&&i.getCategories().length;null!=n&&"dataMin"!==n&&"function"!=typeof n?t[0]=n:a&&(t[0]=r>0?0:NaN);var o=i.getMax(!0);null!=o&&"dataMax"!==o&&"function"!=typeof o?t[1]=o:a&&(t[1]=r>0?r-1:NaN);i.get("scale",!0)||(t[0]>0&&(t[0]=0),t[1]<0&&(t[1]=0))}(e,n),n}(this,this._dimName,t),function(e){var t=e._minMaxSpan={},i=e._dataZoomModel,n=e._dataExtent;fB(["min","max"],(function(a){var r=i.get(a+"Span"),o=i.get(a+"ValueSpan");null!=o&&(o=e.getAxisModel().axis.scale.parse(o)),null!=o?r=Cc.linearMap(n[0]+o,n,[0,100],!0):null!=r&&(o=Cc.linearMap(r,[0,100],n,!0)-n[0]),t[a+"Span"]=r,t[a+"ValueSpan"]=o}))}(this);var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,vB(this)}},restore:function(e){e===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,vB(this,!0))},filterData:function(e,t){if(e===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),a=e.get("filterMode"),r=this._valueWindow;"none"!==a&&fB(n,(function(e){var t=e.getData(),n=t.mapDimension(i,!0);n.length&&("weakFilter"===a?t.filterSelf((function(e){for(var i,a,o,s=0;s<n.length;s++){var l=t.get(n[s],e),u=!isNaN(l),h=l<r[0],c=l>r[1];if(u&&!h&&!c)return!0;u&&(o=!0),h&&(i=!0),c&&(a=!0)}return o&&i&&a})):fB(n,(function(i){if("empty"===a)e.setData(t=t.map(i,(function(e){return function(e){return e>=r[0]&&e<=r[1]}(e)?e:NaN})));else{var n={};n[i]=r,t.selectRange(n)}})),fB(n,(function(e){t.setApproximateExtent(r,e)})))}))}}};var yB=mB,xB=Fe.each,_B=pB.eachAxisDim,bB=U_.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(e,t,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=wB(e);this.settledOption=n,this.mergeDefaultAndTheme(e,i),this.doInit(n)},mergeOption:function(e){var t=wB(e);Fe.merge(this.option,e,!0),Fe.merge(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var t=this.option;ae.canvasSupported||(t.realtime=!1),this._setDefaultThrottle(e),SB(this,e);var i=this.settledOption;xB([["start","startValue"],["end","endValue"]],(function(e,n){"value"===this._rangePropMode[n]&&(t[e[0]]=i[e[0]]=null)}),this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var e=this._axisProxies;this.eachTargetAxis((function(t,i,n,a){var r=this.dependentModels[t.axis][i],o=r.__dzAxisProxy||(r.__dzAxisProxy=new yB(t.name,i,this,a));e[t.name+"_"+i]=o}),this)},_resetTarget:function(){var e=this.option,t=this._judgeAutoMode();_B((function(t){var i=t.axisIndex;e[i]=Ro.normalizeToArray(e[i])}),this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,t=!1;_B((function(i){null!=e[i.axisIndex]&&(t=!0)}),this);var i=e.orient;return null==i&&t?"orient":t?void 0:(null==i&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var e=!0,t=this.get("orient",!0),i=this.option,n=this.dependentModels;if(e){var a="vertical"===t?"y":"x";n[a+"Axis"].length?(i[a+"AxisIndex"]=[0],e=!1):xB(n.singleAxis,(function(n){e&&n.get("orient",!0)===t&&(i.singleAxisIndex=[n.componentIndex],e=!1)}))}e&&_B((function(t){if(e){var n=[],a=this.dependentModels[t.axis];if(a.length&&!n.length)for(var r=0,o=a.length;r<o;r++)"category"===a[r].get("type")&&n.push(r);i[t.axisIndex]=n,n.length&&(e=!1)}}),this),e&&this.ecModel.eachSeries((function(e){this._isSeriesHasAllAxesTypeOf(e,"value")&&_B((function(t){var n=i[t.axisIndex],a=e.get(t.axisIndex),r=e.get(t.axisId);a=e.ecModel.queryComponents({mainType:t.axis,index:a,id:r})[0].componentIndex,Fe.indexOf(n,a)<0&&n.push(a)}))}),this)},_autoSetOrient:function(){var e;this.eachTargetAxis((function(t){!e&&(e=t.name)}),this),this.option.orient="y"===e?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(e,t){var i=!0;return _B((function(n){var a=e.get(n.axisIndex),r=this.dependentModels[n.axis][a];r&&r.get("type")===t||(i=!1)}),this),i},_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}},getFirstTargetAxisModel:function(){var e;return _B((function(t){if(null==e){var i=this.get(t.axisIndex);i.length&&(e=this.dependentModels[t.axis][i[0]])}}),this),e},eachTargetAxis:function(e,t){var i=this.ecModel;_B((function(n){xB(this.get(n.axisIndex),(function(a){e.call(t,n,a,this,i)}),this)}),this)},getAxisProxy:function(e,t){return this._axisProxies[e+"_"+t]},getAxisModel:function(e,t){var i=this.getAxisProxy(e,t);return i&&i.getAxisModel()},setRawRange:function(e){var t=this.option,i=this.settledOption;xB([["start","startValue"],["end","endValue"]],(function(n){null==e[n[0]]&&null==e[n[1]]||(t[n[0]]=i[n[0]]=e[n[0]],t[n[1]]=i[n[1]]=e[n[1]])}),this),SB(this,e)},setCalculatedRange:function(e){var t=this.option;xB(["start","startValue","end","endValue"],(function(i){t[i]=e[i]}))},getPercentRange:function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},getValueRange:function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(e){if(e)return e.__dzAxisProxy;var t=this._axisProxies;for(var i in t)if(t.hasOwnProperty(i)&&t[i].hostedBy(this))return t[i];for(var i in t)if(t.hasOwnProperty(i)&&!t[i].hostedBy(this))return t[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});function wB(e){var t={};return xB(["start","end","startValue","endValue","throttle"],(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}function SB(e,t){var i=e._rangePropMode,n=e.get("rangeMode");xB([["start","startValue"],["end","endValue"]],(function(e,a){var r=null!=t[e[0]],o=null!=t[e[1]];r&&!o?i[a]="percent":!r&&o?i[a]="value":n?i[a]=n[a]:r&&(i[a]="percent")}))}var MB=bB,IB=og.extend({type:"dataZoom",render:function(e,t,i,n){this.dataZoomModel=e,this.ecModel=t,this.api=i},getTargetCoordInfo:function(){var e=this.dataZoomModel,t=this.ecModel,i={};return e.eachTargetAxis((function(e,n){var a=t.getComponent(e.axis,n);if(a){var r=a.getCoordSysModel();r&&function(e,t,i,n){for(var a,r=0;r<i.length;r++)if(i[r].model===e){a=i[r];break}a||i.push(a={model:e,axisModels:[],coordIndex:n});a.axisModels.push(t)}(r,a,i[r.mainType]||(i[r.mainType]=[]),r.componentIndex)}}),this),i}}),AB=IB;MB.extend({type:"dataZoom.select"}),AB.extend({type:"dataZoom.select"});var TB=Fe.createHashMap,CB=Fe.each;U_.registerProcessor({getTargetSeries:function(e){var t=TB();return e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){var a=n.getAxisProxy(e.name,i);CB(a.getTargetSeriesModels(),(function(e){t.set(e.uid,e)}))}))})),t},modifyOutputEnd:!0,overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).reset(n,t)})),e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).filterData(n,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy(),i=t.getDataPercentWindow(),n=t.getDataValueWindow();e.setCalculatedRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]})}))}}),U_.registerAction("dataZoom",(function(e,t){var i=pB.createLinkedNodesFinder(Fe.bind(t.eachComponent,t,"dataZoom"),pB.eachAxisDim,(function(e,t){return e.get(t.axisIndex)})),n=[];t.eachComponent({mainType:"dataZoom",query:e},(function(e,t){n.push.apply(n,i(e).nodes)})),Fe.each(n,(function(t,i){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var DB=Dg.toolbox.dataZoom,LB=Fe.each;function PB(e,t,i){(this._brushController=new TP(i.getZr())).on("brush",Fe.bind(this._onBrush,this)).mount(),this._isZoomActive}PB.defaultOption={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:Fe.clone(DB.title)};var kB=PB.prototype;kB.render=function(e,t,i,n){this.model=e,this.ecModel=t,this.api=i,function(e,t,i,n,a){var r=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(r="dataZoomSelect"===n.key&&n.dataZoomSelectActive);i._isZoomActive=r,e.setIconStatus("zoom",r?"emphasis":"normal");var o=new nB(RB(e.option),t,{include:["grid"]});i._brushController.setPanels(o.makePanelOpts(a,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}))).enableBrush(!!r&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}(e,t,this,n,i),function(e,t){e.setIconStatus("back",uB.count(t)>1?"emphasis":"normal")}(e,t)},kB.onclick=function(e,t,i){OB[i].call(this)},kB.remove=function(e,t){this._brushController.unmount()},kB.dispose=function(e,t){this._brushController.dispose()};var OB={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(uB.pop(this.ecModel))}};function RB(e){var t={};return Fe.each(["xAxisIndex","yAxisIndex"],(function(i){t[i]=e[i],null==t[i]&&(t[i]="all"),(!1===t[i]||"none"===t[i])&&(t[i]=[])})),t}kB._onBrush=function(e,t){if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new nB(RB(this.model.option),n,{include:["grid"]}).matchOutputRanges(e,n,(function(e,t,i){if("cartesian2d"===i.type){var n=e.brushType;"rect"===n?(a("x",i,t[0]),a("y",i,t[1])):a({lineX:"x",lineY:"y"}[n],i,t)}})),uB.push(n,i),this._dispatchZoomAction(i)}function a(e,t,a){var r=t.getAxis(e),o=r.model,s=function(e,t,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},(function(i){i.getAxisModel(e,t.componentIndex)&&(n=i)})),n}(e,o,n),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(a=IL(0,a.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:a[0],endValue:a[1]})}},kB._dispatchZoomAction=function(e){var t=[];LB(e,(function(e,i){t.push(Fe.clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},mz.register("dataZoom",PB),U_.registerPreprocessor((function(e){if(e){var t=e.dataZoom||(e.dataZoom=[]);Fe.isArray(t)||(e.dataZoom=t=[t]);var i=e.toolbox;if(i&&(Fe.isArray(i)&&(i=i[0]),i&&i.feature)){var n=i.feature.dataZoom;a("xAxis",n),a("yAxis",n)}}function a(i,n){if(n){var a=i+"Index",r=n[a];null==r||"all"===r||Fe.isArray(r)||(r=!1===r||"none"===r?[]:[r]),function(t,i){var n=e[t];Fe.isArray(n)||(n=n?[n]:[]);LB(n,i)}(i,(function(e,o){if(null==r||"all"===r||-1!==Fe.indexOf(r,o)){var s={type:"select",$fromToolbox:!0,filterMode:n.filterMode||"filter",id:"\0_ec_\0toolbox-dataZoom_"+i+o};s[a]=o,t.push(s)}}))}}}));var EB=Dg.toolbox.restore;function NB(e){this.model=e}NB.defaultOption={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:EB.title},NB.prototype.onclick=function(e,t,i){uB.clear(e),t.dispatchAction({type:"restore",from:this.uid})},mz.register("restore",NB),U_.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")})),U_.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var zB=Fe.each,BB=Fc.toCamelCase,VB=["","-webkit-","-moz-","-o-"];function GB(e){var t,i,n,a=[],r=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.getModel("textStyle"),l=e.get("padding");return r&&a.push((n="left "+(t=r)+"s "+(i="cubic-bezier(0.23, 1, 0.32, 1)")+",top "+t+"s "+i,Fe.map(VB,(function(e){return e+"transition:"+n})).join(";"))),o&&(ae.canvasSupported?a.push("background-Color:"+o):(a.push("background-Color:#"+Zi.toHex(o)),a.push("filter:alpha(opacity=70)"))),zB(["width","color","radius"],(function(t){var i="border-"+t,n=BB(i),r=e.get(n);null!=r&&a.push(i+":"+r+("color"===t?"":"px"))})),a.push(function(e){var t=[],i=e.get("fontSize"),n=e.getTextColor();return n&&t.push("color:"+n),t.push("font:"+e.getFont()),i&&t.push("line-height:"+Math.round(3*i/2)+"px"),zB(["decoration","align"],(function(i){var n=e.get(i);n&&t.push("text-"+i+":"+n)})),t.join(";")}(s)),null!=l&&a.push("padding:"+Fc.normalizeCssArray(l).join("px ")+"px"),a.join(";")+";"}function FB(e,t,i,n,a){var r=t&&t.painter;if(i){var o=r&&r.getViewportRoot();o&&Tt.transformLocalCoord(e,o,document.body,n,a)}else{e[0]=n,e[1]=a;var s=r&&r.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}}function HB(e,t,i){if(ae.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=t.getZr(),r=this._appendToBody=i&&i.appendToBody;this._styleCoord=[0,0],FB(this._styleCoord,a,r,t.getWidth()/2,t.getHeight()/2),r?document.body.appendChild(n):e.appendChild(n),this._container=e,this._show=!1,this._hideTimeout;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=a.handler,i=a.painter.getViewportRoot();zt.normalizeEvent(i,e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}HB.prototype={constructor:HB,_enterable:!0,update:function(){var e=this._container,t=e.currentStyle||document.defaultView.getComputedStyle(e),i=e.style;"absolute"!==i.position&&"absolute"!==t.position&&(i.position="relative")},show:function(e){clearTimeout(this._hideTimeout);var t=this.el,i=this._styleCoord;t.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+GB(e)+";left:"+i[0]+"px;top:"+i[1]+"px;"+(e.get("extraCssText")||""),t.style.display=t.innerHTML?"block":"none",t.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(e){this.el.innerHTML=null==e?"":e},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el;return[e.clientWidth,e.clientHeight]},moveTo:function(e,t){var i=this._styleCoord;FB(i,this._zr,this._appendToBody,e,t);var n=this.el.style;n.left=i[0]+"px",n.top=i[1]+"px"},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Fe.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){this.el.parentNode.removeChild(this.el)},getOuterSize:function(){var e=this.el.clientWidth,t=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(this.el);i&&(e+=parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),t+=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:e,height:t}}};var WB=HB;function UB(e){this._zr=e.getZr(),this._show=!1,this._hideTimeout}UB.prototype={constructor:UB,_enterable:!0,update:function(){},show:function(e){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(e,t,i){this.el&&this._zr.remove(this.el);for(var n={},a=e,r="{marker",o=a.indexOf(r);o>=0;){var s=a.indexOf("|}"),l=a.substr(o+7,s-o-7);l.indexOf("sub")>-1?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:t[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:t[l]},o=(a=a.substr(s+1)).indexOf("{marker")}this.el=new Fl({style:{rich:n,text:e,textLineHeight:20,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding")},z:i.get("z")}),this._zr.add(this.el);var u=this;this.el.on("mouseover",(function(){u._enterable&&(clearTimeout(u._hideTimeout),u._show=!0),u._inContent=!0})),this.el.on("mouseout",(function(){u._enterable&&u._show&&u.hideLater(u._hideDelay),u._inContent=!1}))},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el.getBoundingRect();return[e.width,e.height]},moveTo:function(e,t){this.el&&this.el.attr("position",[e,t])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Fe.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var e=this.getSize();return{width:e[0],height:e[1]}}};var jB=UB,ZB=Ro.getTooltipRenderMode,YB=Fe.bind,XB=Fe.each,qB=Cc.parsePercent,$B=new Jh.Rect({shape:{x:-1,y:-1,width:2,height:2}});function KB(e){for(var t=e.pop();e.length;){var i=e.pop();i&&(pc.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),t=new pc(i,t,t.ecModel))}return t}function JB(e,t){return e.dispatchAction||Fe.bind(t.dispatchAction,t)}function QB(e){return"center"===e||"middle"===e}U_.extendComponentView({type:"tooltip",init:function(e,t){if(!ae.node){var i,n=e.getComponent("tooltip"),a=n.get("renderMode");this._renderMode=ZB(a),"html"===this._renderMode?(i=new WB(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)}),this._newLine="<br/>"):(i=new jB(t),this._newLine="\n"),this._tooltipContent=i}},render:function(e,t,i){if(!ae.node){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=e.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var e=this._tooltipModel.get("triggerOn");jR.register("itemTooltip",this._api,YB((function(t,i,n){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(i,n):"leave"===t&&this._hide(n))}),this))},_keepShow:function(){var e=this._tooltipModel,t=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&n.manuallyShowTip(e,t,i,{x:n._lastX,y:n._lastY})}))}},manuallyShowTip:function(e,t,i,n){if(n.from!==this.uid&&!ae.node){var a=JB(n,i);this._ticket="";var r=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var o=$B;o.position=[n.x,n.y],o.update(),o.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:o},a)}else if(r)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},a);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(e,t,i,n))return;var s=DR(n,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el},a)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},a))}},manuallyHideTip:function(e,t,i,n){var a=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(JB(n,i))},_manuallyAxisShowTip:function(e,t,i,n){var a=n.seriesIndex,r=n.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=a&&null!=r&&null!=o){var s=t.getSeriesByIndex(a);if(s)if("axis"===(e=KB([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model,e])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:r,position:n.position}),!0}},_tryShow:function(e,t){var i=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var n=e.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,e):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,i,t)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,i,t)):(this._lastDataByCoordSys=null,this._hide(t))}},_showOrMove:function(e,t){var i=e.get("showDelay");t=Fe.bind(t,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(t,i):t()},_showAxisTooltip:function(e,t){var i=this._ecModel,n=this._tooltipModel,a=[t.offsetX,t.offsetY],r=[],o=[],s=KB([t.tooltipOption,n]),l=this._renderMode,u=this._newLine,h={};XB(e,(function(e){XB(e.dataByAxis,(function(e){var t=i.getComponent(e.axisDim+"Axis",e.axisIndex),n=e.value,a=[];if(t&&null!=n){var s=sE.getValueLabel(n,t.axis,i,e.seriesDataIndices,e.valueLabelOpt);Fe.each(e.seriesDataIndices,(function(r){var u=i.getSeriesByIndex(r.seriesIndex),c=r.dataIndexInside,d=u&&u.getDataParams(c);if(d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=Cx.getAxisRawValue(t.axis,n),d.axisValueLabel=s,d){o.push(d);var p,f=u.formatTooltip(c,!0,null,l);if(Fe.isObject(f)){p=f.html;var g=f.markers;Fe.merge(h,g)}else p=f;a.push(p)}}));var c=s;"html"!==l?r.push(a.join(u)):r.push((c?Fc.encodeHTML(c)+u:"")+a.join(u))}}))}),this),r.reverse(),r=r.join(this._newLine+this._newLine);var c=t.position;this._showOrMove(s,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(s,c,a[0],a[1],this._tooltipContent,o):this._showTooltipContent(s,r,o,Math.random(),a[0],a[1],c,void 0,h)}))},_showSeriesItemTooltip:function(e,t,i){var n=this._ecModel,a=t.seriesIndex,r=n.getSeriesByIndex(a),o=t.dataModel||r,s=t.dataIndex,l=t.dataType,u=o.getData(l),h=KB([u.getItemModel(s),o,r&&(r.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,p,f=o.getDataParams(s,l),g=o.formatTooltip(s,!1,l,this._renderMode);Fe.isObject(g)?(d=g.html,p=g.markers):(d=g,p=null);var m="item_"+o.name+"_"+s;this._showOrMove(h,(function(){this._showTooltipContent(h,d,f,m,e.offsetX,e.offsetY,e.position,e.target,p)})),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:a,from:this.uid})}},_showComponentItemTooltip:function(e,t,i){var n=t.tooltip;if("string"==typeof n){n={content:n,formatter:n}}var a=new pc(n,this._tooltipModel,this._ecModel),r=a.get("content"),o=Math.random();this._showOrMove(a,(function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t)})),i({type:"showTip",from:this.uid})},_showTooltipContent:function(e,t,i,n,a,r,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,h=e.get("formatter");o=o||e.get("position");var c=t;if(h&&"string"==typeof h)c=Fc.formatTpl(h,i,!0);else if("function"==typeof h){var d=YB((function(t,n){t===this._ticket&&(u.setContent(n,l,e),this._updatePosition(e,o,a,r,u,i,s))}),this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,e),u.show(e),this._updatePosition(e,o,a,r,u,i,s)}},_updatePosition:function(e,t,i,n,a,r,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=a.getSize(),h=e.get("align"),c=e.get("verticalAlign"),d=o&&o.getBoundingRect().clone();if(o&&d.applyTransform(o.transform),"function"==typeof t&&(t=t([i,n],r,a.el,d,{viewSize:[s,l],contentSize:u.slice()})),Fe.isArray(t))i=qB(t[0],s),n=qB(t[1],l);else if(Fe.isObject(t)){t.width=u[0],t.height=u[1];var p=ed.getLayoutRect(t,{width:s,height:l});i=p.x,n=p.y,h=null,c=null}else if("string"==typeof t&&o){var f=function(e,t,i){var n=i[0],a=i[1],r=5,o=0,s=0,l=t.width,u=t.height;switch(e){case"inside":o=t.x+l/2-n/2,s=t.y+u/2-a/2;break;case"top":o=t.x+l/2-n/2,s=t.y-a-r;break;case"bottom":o=t.x+l/2-n/2,s=t.y+u+r;break;case"left":o=t.x-n-r,s=t.y+u/2-a/2;break;case"right":o=t.x+l+r,s=t.y+u/2-a/2}return[o,s]}(t,d,u);i=f[0],n=f[1]}else{f=function(e,t,i,n,a,r,o){var s=i.getOuterSize(),l=s.width,u=s.height;null!=r&&(e+l+r>n?e-=l+r:e+=r);null!=o&&(t+u+o>a?t-=u+o:t+=o);return[e,t]}(i,n,a,s,l,h?null:20,c?null:20);i=f[0],n=f[1]}if(h&&(i-=QB(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=QB(c)?u[1]/2:"bottom"===c?u[1]:0),e.get("confine")){f=function(e,t,i,n,a){var r=i.getOuterSize(),o=r.width,s=r.height;return e=Math.min(e+o,n)-o,t=Math.min(t+s,a)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(i,n,a,s,l);i=f[0],n=f[1]}a.moveTo(i,n)},_updateContentNotChangedOnAxis:function(e){var t=this._lastDataByCoordSys,i=!!t&&t.length===e.length;return i&&XB(t,(function(t,n){var a=t.dataByAxis||{},r=(e[n]||{}).dataByAxis||[];(i&=a.length===r.length)&&XB(a,(function(e,t){var n=r[t]||{},a=e.seriesDataIndices||[],o=n.seriesDataIndices||[];(i&=e.value===n.value&&e.axisType===n.axisType&&e.axisId===n.axisId&&a.length===o.length)&&XB(a,(function(e,t){var n=o[t];i&=e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}))}))})),this._lastDataByCoordSys=e,!!i},_hide:function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},dispose:function(e,t){ae.node||(this._tooltipContent.dispose(),jR.unregister("itemTooltip",t))}}),U_.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),U_.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var eV=["rect","polygon","keep","clear"];var tV=function(e,t){var i=e&&e.brush;if(Fe.isArray(i)||(i=i?[i]:[]),i.length){var n=[];Fe.each(i,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(n=n.concat(t))}));var a=e&&e.toolbox;Fe.isArray(a)&&(a=a[0]),a||(a={feature:{}},e.toolbox=[a]);var r=a.feature||(a.feature={}),o=r.brush||(r.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),function(e){var t={};Fe.each(e,(function(e){t[e]=1})),e.length=0,Fe.each(t,(function(t,i){e.push(i)}))}(s),t&&!s.length&&s.push.apply(s,eV)}},iV=Fe.each;function nV(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}var aV=function(e,t,i){var n;Fe.each(i,(function(e){t.hasOwnProperty(e)&&nV(t[e])&&(n=!0)})),n&&Fe.each(i,(function(i){t.hasOwnProperty(i)&&nV(t[i])?e[i]=Fe.clone(t[i]):delete e[i]}))},rV=function(e,t,i,n,a,r){var o,s={};function l(e){return i.getItemVisual(o,e)}function u(e,t){i.setItemVisual(o,e,t)}function h(e,h){o=null==r?e:h;var c=i.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var d=n.call(a,e),p=t[d],f=s[d],g=0,m=f.length;g<m;g++){var v=f[g];p[v]&&p[v].applyVisual(e,l,u)}}Fe.each(e,(function(e){var i=lC.prepareVisualTypes(t[e]);s[e]=i})),null==r?i.each(h):i.each([r],h)},oV=function(e,t,i,n){var a={};return Fe.each(e,(function(e){var i=lC.prepareVisualTypes(t[e]);a[e]=i})),{progress:function(e,r){function o(e){return r.getItemVisual(l,e)}function s(e,t){r.setItemVisual(l,e,t)}var l;for(null!=n&&(n=r.getDimension(n));null!=(l=e.next());){var u=r.getRawDataItem(l);if(!u||!1!==u.visualMap)for(var h=null!=n?r.get(n,l,!0):l,c=i(h),d=t[c],p=a[c],f=0,g=p.length;f<g;f++){var m=p[f];d[m]&&d[m].applyVisual(h,o,s)}}}}},sV={createVisualMappings:function(e,t,i){var n={};return iV(t,(function(t){var a,r=n[t]=((a=function(){}).prototype.__hidden=a.prototype,new a);iV(e[t],(function(e,n){if(lC.isValidType(n)){var a={type:n,visual:e};i&&i(a,t),r[n]=new lC(a),"opacity"===n&&((a=Fe.clone(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new lC(a))}}))})),n},replaceVisualOption:aV,applyVisual:rV,incrementalApplyVisual:oV},lV=Jh.linePolygonIntersect,uV={lineX:hV(0),lineY:hV(1),rect:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])},rect:function(e,t,i){return e&&i.boundingRect.intersect(e)}},polygon:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])&&Jx.contain(i.range,e[0],e[1])},rect:function(e,t,i){var n=i.range;if(!e||n.length<=1)return!1;var a=e.x,r=e.y,o=e.width,s=e.height,l=n[0];return!!(Jx.contain(n,a,r)||Jx.contain(n,a+o,r)||Jx.contain(n,a,r+s)||Jx.contain(n,a+o,r+s)||On.create(e).contain(l[0],l[1])||lV(a,r,a+o,r,n)||lV(a,r,a,r+s,n)||lV(a+o,r,a+o,r+s,n)||lV(a,r+s,a+o,r+s,n))||void 0}}};function hV(e){var t=["x","y"],i=["width","height"];return{point:function(t,i,n){if(t){var a=n.range;return cV(t[e],a)}},rect:function(n,a,r){if(n){var o=r.range,s=[n[t[e]],n[t[e]]+n[i[e]]];return s[1]<s[0]&&s.reverse(),cV(s[0],o)||cV(s[1],o)||cV(o[0],s)||cV(o[1],s)}}}}function cV(e,t){return t[0]<=e&&e<=t[1]}var dV=uV,pV=["inBrush","outOfBrush"],fV="__ecBrushSelect",gV="__ecInBrushSelectEvent",mV=U_.PRIORITY.VISUAL.BRUSH;function vV(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new nB(t.option,e)).setInputRanges(t.areas,e)}))}function yV(e,t){if(!e.isDisposed()){var i=e.getZr();i[gV]=!0,e.dispatchAction({type:"brushSelect",batch:t}),i[gV]=!1}}function xV(e,t,i,n){for(var a=0,r=t.length;a<r;a++){var o=t[a];if(e[o.brushType](n,i,o.selectors,o))return!0}}function _V(e){var t=e.brushSelector;if(Fe.isString(t)){var i=[];return Fe.each(dV,(function(e,n){i[n]=function(i,n,a,r){var o=n.getItemLayout(i);return e[t](o,a,r)}})),i}if(Fe.isFunction(t)){var n={};return Fe.each(dV,(function(e,i){n[i]=t})),n}return t}U_.registerLayout(mV,(function(e,t,i){e.eachComponent({mainType:"brush"},(function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1})})),vV(e)})),U_.registerVisual(mV,(function(e,t,i){var n,a,r=[];e.eachComponent({mainType:"brush"},(function(t,i){var o={brushId:t.id,brushIndex:i,brushName:t.name,areas:Fe.clone(t.areas),selected:[]};r.push(o);var s=t.option,l=s.brushLink,u=[],h=[],c=[],d=0;i||(n=s.throttleType,a=s.throttleDelay);var p=Fe.map(t.areas,(function(e){return function(e){var t=e.selectors={};return Fe.each(dV[e.brushType],(function(i,n){t[n]=function(n){return i(n,t,e)}})),e}(Fe.defaults({boundingRect:bV[e.brushType](e)},e))})),f=sV.createVisualMappings(t.option,pV,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||u[e]}function m(e){return!!e.length}Fe.isArray(l)&&Fe.each(l,(function(e){u[e]=1})),e.eachSeries((function(i,n){var a=c[n]=[];"parallel"===i.subType?function(e,t){var i=e.coordinateSystem;d|=i.hasAxisBrushed(),g(t)&&i.eachActiveState(e.getData(),(function(e,t){"active"===e&&(h[t]=1)}))}(i,n):function(i,n,a){var r=_V(i);if(!r||function(e,t){var i=e.option.seriesIndex;return null!=i&&"all"!==i&&(Fe.isArray(i)?Fe.indexOf(i,t)<0:t!==i)}(t,n))return;if(Fe.each(p,(function(n){r[n.brushType]&&t.brushTargetManager.controlSeries(n,i,e)&&a.push(n),d|=m(a)})),g(n)&&m(a)){var o=i.getData();o.each((function(e){xV(r,a,o,e)&&(h[e]=1)}))}}(i,n,a)})),e.eachSeries((function(e,t){var i={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};o.selected.push(i);var n=_V(e),a=c[t],r=e.getData(),s=g(t)?function(e){return h[e]?(i.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(e){return xV(n,a,r,e)?(i.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(t)?d:m(a))&&sV.applyVisual(pV,f,r,s)}))})),function(e,t,i,n,a){if(!a)return;var r=e.getZr();if(r[gV])return;r[fV]||(r[fV]=yV);var o=Ig.createOrUpdate(r,fV,i,t);o(e,n)}(t,n,a,r,i)}));var bV={lineX:Fe.noop,lineY:Fe.noop,rect:function(e){return wV(e.range)},polygon:function(e){for(var t,i=e.range,n=0,a=i.length;n<a;n++){t=t||[[1/0,-1/0],[1/0,-1/0]];var r=i[n];r[0]<t[0][0]&&(t[0][0]=r[0]),r[0]>t[0][1]&&(t[0][1]=r[0]),r[1]<t[1][0]&&(t[1][0]=r[1]),r[1]>t[1][1]&&(t[1][1]=r[1])}return t&&wV(t)}};function wV(e){return new On(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var SV={layoutCovers:vV},MV=["#ddd"];function IV(e,t){return Fe.merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new pc(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}U_.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(e,t){var i=this.option;!t&&sV.replaceVisualOption(i,e,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:MV},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(e){e&&(this.areas=Fe.map(e,(function(e){return IV(this.option,e)}),this))},setBrushOption:function(e){this.brushOption=IV(this.option,e),this.brushType=this.brushOption.brushType}});var AV=SV.layoutCovers;function TV(e,t,i,n){(!n||n.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}U_.extendComponentView({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new TP(t.getZr())).on("brush",Fe.bind(this._onBrush,this)).mount()},render:function(e){return this.model=e,TV.apply(this,arguments)},updateTransform:function(e,t){return AV(t),TV.apply(this,arguments)},updateView:TV,dispose:function(){this._brushController.dispose()},_onBrush:function(e,t){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(e,this.ecModel),(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:Fe.clone(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:Fe.clone(e),$from:i})}}),U_.registerAction({type:"brush",event:"brush"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),U_.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),U_.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var CV=Dg.toolbox.brush;function DV(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}DV.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],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:Fe.clone(CV.title)};var LV=DV.prototype;LV.render=LV.updateView=function(e,t,i){var n,a,r;t.eachComponent({mainType:"brush"},(function(e){n=e.brushType,a=e.brushOption.brushMode||"single",r|=e.areas.length})),this._brushType=n,this._brushMode=a,Fe.each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===a:"clear"===t?r:t===n)?"emphasis":"normal")}))},LV.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return Fe.each(e.get("type",!0),(function(e){t[e]&&(i[e]=t[e])})),i},LV.onclick=function(e,t,i){var n=this._brushType,a=this._brushMode;"clear"===i?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===a?"single":"multiple":a}})},mz.register("brush",DV),U_.registerPreprocessor(tV);var PV=ed.getLayoutRect,kV=Fc.windowOpen;function OV(e){var t=e.itemStyle||(e.itemStyle={}),i=t.emphasis||(t.emphasis={}),n=e.label||e.label||{},a=n.normal||(n.normal={}),r={normal:1,emphasis:1};Fe.each(n,(function(e,t){r[t]||RV(a,t)||(a[t]=e)})),i.label&&!RV(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function RV(e,t){return e.hasOwnProperty(t)}U_.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},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:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),U_.extendComponentView({type:"title",render:function(e,t,i){if(this.group.removeAll(),e.get("show")){var n=this.group,a=e.getModel("textStyle"),r=e.getModel("subtextStyle"),o=e.get("textAlign"),s=Fe.retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new Jh.Text({style:Jh.setTextStyle({},a,{text:e.get("text"),textFill:a.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=e.get("subtext"),c=new Jh.Text({style:Jh.setTextStyle({},r,{text:h,textFill:r.getTextColor(),y:u.height+e.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",(function(){kV(d,"_"+e.get("target"))})),p&&c.on("click",(function(){kV(d,"_"+e.get("subtarget"))})),l.eventData=c.eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=PV(m,{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?v.x+=v.width:"center"===o&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:o,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var x=v.margin,_=e.getItemStyle(["color","opacity"]);_.fill=e.get("backgroundColor");var b=new Jh.Rect({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:e.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});n.add(b)}}});var EV=function(e){var t=e&&e.timeline;Fe.isArray(t)||(t=t?[t]:[]),Fe.each(t,(function(e){e&&function(e){var t=e.type,i={number:"value",time:"time"};i[t]&&(e.axisType=i[t],delete e.type);if(OV(e),RV(e,"controlPosition")){var n=e.controlStyle||(e.controlStyle={});RV(n,"position")||(n.position=e.controlPosition),"none"!==n.position||RV(n,"show")||(n.show=!1,delete n.position),delete e.controlPosition}Fe.each(e.data||[],(function(e){Fe.isObject(e)&&!Fe.isArray(e)&&(!RV(e,"value")&&RV(e,"name")&&(e.value=e.name),OV(e))}))}(e)}))};od.registerSubTypeDefaulter("timeline",(function(){return"slider"})),U_.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var i=t.getComponent("timeline");return i&&null!=e.currentIndex&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),t.resetOption("timeline"),Fe.defaults({currentIndex:i.option.currentIndex},e)})),U_.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)}));var NV=od.extend({type:"timeline",layoutMode:"box",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:[]},init:function(e,t,i){this._data,this._names,this.mergeDefaultAndTheme(e,i),this._initData()},mergeOption:function(e){NV.superApply(this,"mergeOption",arguments),this._initData()},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},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(e){this.option.autoPlay=!!e},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var e=this.option,t=e.data||[],i=e.axisType,n=this._names=[];if("category"===i){var a=[];Fe.each(t,(function(e,t){var i,r=Ro.getDataItemValue(e);Fe.isObject(e)?(i=Fe.clone(e)).value=t:i=t,a.push(i),Fe.isString(r)||null!=r&&!isNaN(r)||(r=""),n.push(r+"")})),t=a}var r={category:"ordinal",time:"time"}[i]||"number";(this._data=new Pv([{name:"value",type:r}],this)).initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}}),zV=NV.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,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:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});Fe.mixin(zV,Pf);var BV=og.extend({type:"timeline"}),VV=function(e,t,i,n){A_.call(this,e,t,i),this.type=n||"value",this.model=null};VV.prototype={constructor:VV,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},Fe.inherits(VV,A_);var GV=VV,FV=Hx.createSymbol,HV=Fc.encodeHTML,WV=Fe.bind,UV=Fe.each,jV=Math.PI;function ZV(e,t,i,n,a,r){var o=t.get("color");if(a)a.setColor(o),i.add(a),r&&r.onUpdate(a);else{var s=e.get("symbol");(a=FV(s,-1,-1,2,2,o)).setStyle("strokeNoScale",!0),i.add(a),r&&r.onCreate(a)}var l=t.getItemStyle(["color","symbol","symbolSize"]);a.setStyle(l),n=Fe.merge({rectHover:!0,z2:100},n,!0);var u=e.get("symbolSize");(u=u instanceof Array?u.slice():[+u,+u])[0]/=2,u[1]/=2,n.scale=u;var h=e.get("symbolOffset");if(h){var c=n.position=n.position||[0,0];c[0]+=Cc.parsePercent(h[0],u[0]),c[1]+=Cc.parsePercent(h[1],u[1])}var d=e.get("symbolRotate");return n.rotation=(d||0)*Math.PI/180||0,a.attr(n),a.updateTransform(),a}function YV(e,t,i,n,a){if(!e.dragging){var r=n.getModel("checkpointStyle"),o=i.dataToCoord(n.getData().get(["value"],t));a||!r.get("animation",!0)?e.attr({position:[o,0]}):(e.stopAnimation(!0),e.animateTo({position:[o,0]},r.get("animationDuration",!0),r.get("animationEasing",!0)))}}BV.extend({type:"timeline.slider",init:function(e,t){this.api=t,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var a=this._layout(e,i),r=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),s=this._axis=this._createAxis(a,e);e.formatTooltip=function(e){return HV(s.scale.getLabel(e))},UV(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](a,r,s,e)}),this),this._renderAxisLabel(a,o,s,e),this._position(a,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(e,t){var i=e.get("label.position"),n=e.get("orient"),a=function(e,t){return ed.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t);null==i||"auto"===i?i="horizontal"===n?a.y+a.height/2<t.getHeight()/2?"-":"+":a.x+a.width/2<t.getWidth()/2?"+":"-":isNaN(i)&&(i={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[n][i]);var r,o,s,l,u={horizontal:"center",vertical:i>=0||"+"===i?"left":"right"},h={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:jV/2},d="vertical"===n?a.height:a.width,p=e.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,v=g+m,y=e.get("label.rotate")||0;y=y*jV/180;var x=p.get("position",!0),_=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,M=d;return"left"===x||"bottom"===x?(_&&(r=[0,0],S+=v),b&&(o=[S,0],S+=v),w&&(s=[M-g,0],M-=v)):(_&&(r=[M-g,0],M-=v),b&&(o=[0,0],S+=v),w&&(s=[M-g,0],M-=v)),l=[S,M],e.get("inverse")&&l.reverse(),{viewRect:a,mainLength:d,orient:n,rotation:c[n],labelRotation:y,labelPosOpt:i,labelAlign:e.get("label.align")||u[n],labelBaseline:e.get("label.verticalAlign")||e.get("label.baseline")||h[n],playPosition:r,prevBtnPosition:o,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(e,t){var i=this._mainGroup,n=this._labelGroup,a=e.viewRect;if("vertical"===e.orient){var r=ri.create(),o=a.x,s=a.y+a.height;ri.translate(r,r,[-o,-s]),ri.rotate(r,r,-jV/2),ri.translate(r,r,[o,s]),(a=a.clone()).applyTransform(r)}var l=m(a),u=m(i.getBoundingRect()),h=m(n.getBoundingRect()),c=i.position,d=n.position;d[0]=c[0]=l[0][0];var p,f=e.labelPosOpt;isNaN(f)?(v(c,u,l,1,p="+"===f?0:1),v(d,h,l,1,1-p)):(v(c,u,l,1,p=f>=0?0:1),d[1]=c[1]+f);function g(e){var t=e.position;e.origin=[l[0][0]-t[0],l[1][0]-t[1]]}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,i,n,a){e[n]+=i[n][a]-t[n][a]}i.attr("position",c),n.attr("position",d),i.rotation=n.rotation=e.rotation,g(i),g(n)},_createAxis:function(e,t){var i=t.getData(),n=t.get("axisType"),a=Cx.createScaleByModel(t,n);a.getTicks=function(){return i.mapArray(["value"],(function(e){return e}))};var r=i.getDataExtent("value");a.setExtent(r[0],r[1]),a.niceTicks();var o=new GV("value",a,e.axisExtent,n);return o.model=t,o},_createGroup:function(e){var t=this["_"+e]=new Jh.Group;return this.group.add(t),t},_renderAxisLine:function(e,t,i,n){var a=i.getExtent();n.get("lineStyle.show")&&t.add(new Jh.Line({shape:{x1:a[0],y1:0,x2:a[1],y2:0},style:Fe.extend({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(e,t,i,n){var a=n.getData(),r=i.scale.getTicks();UV(r,(function(e){var r=i.dataToCoord(e),o=a.getItemModel(e),s=o.getModel("itemStyle"),l=o.getModel("emphasis.itemStyle"),u={position:[r,0],onclick:WV(this._changeTimeline,this,e)},h=ZV(o,s,t,u);Jh.setHoverStyle(h,l.getItemStyle()),o.get("tooltip")?(h.dataIndex=e,h.dataModel=n):h.dataIndex=h.dataModel=null}),this)},_renderAxisLabel:function(e,t,i,n){if(i.getLabelModel().get("show")){var a=n.getData(),r=i.getViewLabels();UV(r,(function(n){var r=n.tickValue,o=a.getItemModel(r),s=o.getModel("label"),l=o.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new Jh.Text({position:[u,0],rotation:e.labelRotation-e.rotation,onclick:WV(this._changeTimeline,this,r),silent:!1});Jh.setTextStyle(h.style,s,{text:n.formattedLabel,textAlign:e.labelAlign,textVerticalAlign:e.labelBaseline}),t.add(h),Jh.setHoverStyle(h,Jh.setTextStyle({},l))}),this)}},_renderControl:function(e,t,i,n){var a=e.controlSize,r=e.rotation,o=n.getModel("controlStyle").getItemStyle(),s=n.getModel("emphasis.controlStyle").getItemStyle(),l=[0,-a/2,a,a],u=n.getPlayState(),h=n.get("inverse",!0);function c(e,i,u,h){if(e){var c=function(e,t,i,n){var a=Jh.makePath(e.get(t).replace(/^path:\/\//,""),Fe.clone(n||{}),new On(i[0],i[1],i[2],i[3]),"center");return a}(n,i,l,{position:e,origin:[a/2,0],rotation:h?-r:0,rectHover:!0,style:o,onclick:u});t.add(c),Jh.setHoverStyle(c,s)}}c(e.nextBtnPosition,"controlStyle.nextIcon",WV(this._changeTimeline,this,h?"-":"+")),c(e.prevBtnPosition,"controlStyle.prevIcon",WV(this._changeTimeline,this,h?"+":"-")),c(e.playPosition,"controlStyle."+(u?"stopIcon":"playIcon"),WV(this._handlePlayClick,this,!u),!0)},_renderCurrentPointer:function(e,t,i,n){var a=n.getData(),r=n.getCurrentIndex(),o=a.getItemModel(r).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=WV(s._handlePointerDrag,s),e.ondragend=WV(s._handlePointerDragend,s),YV(e,r,i,n,!0)},onUpdate:function(e){YV(e,r,i,n)}};this._currentPointer=ZV(o,o,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},_handlePointerDrag:function(e,t,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},_pointerChangeTimeline:function(e,t){var i=this._toAxisCoord(e)[0],n=this._axis,a=Cc.asc(n.getExtent().slice());i>a[1]&&(i=a[1]),i<a[0]&&(i=a[0]),this._currentPointer.position[0]=i,this._currentPointer.dirty();var r=this._findNearestTick(i),o=this.model;(t||r!==o.getCurrentIndex()&&o.get("realtime"))&&this._changeTimeline(r)},_doPlayStop:function(){this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(WV((function(){var e=this.model;this._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this),this.model.get("playInterval")))},_toAxisCoord:function(e){var t=this._mainGroup.getLocalTransform();return Jh.applyTransform(e,t,!0)},_findNearestTick:function(e){var t,i=this.model.getData(),n=1/0,a=this._axis;return i.each(["value"],(function(i,r){var o=a.dataToCoord(i),s=Math.abs(o-e);s<n&&(n=s,t=r)})),t},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_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})}}),U_.registerPreprocessor(EV);var XV=Fc.addCommas,qV=Fc.encodeHTML;function $V(e){Ro.defaultEmphasis(e,"label",["show"])}var KV=U_.extendComponentModel({type:"marker",dependencies:["series","grid","polar","geo"],init:function(e,t,i){this.mergeDefaultAndTheme(e,i),this._mergeOption(e,i,!1,!0)},isAnimationEnabled:function(){if(ae.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},mergeOption:function(e,t){this._mergeOption(e,t,!1,!1)},_mergeOption:function(e,t,i,n){var a=this.constructor,r=this.mainType+"Model";i||t.eachSeries((function(e){var i=e.get(this.mainType,!0),o=e[r];i&&i.data?(o?o._mergeOption(i,t,!0):(n&&$V(i),Fe.each(i.data,(function(e){e instanceof Array?($V(e[0]),$V(e[1])):$V(e)})),o=new a(i,this,t),Fe.extend(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),e[r]=o):e[r]=null}),this)},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=Fe.isArray(i)?Fe.map(i,XV).join(", "):XV(i),a=t.getName(e),r=qV(this.name);return(null!=i||a)&&(r+="<br />"),a&&(r+=qV(a),null!=i&&(r+=" : ")),null!=i&&(r+=qV(n)),r},getData:function(){return this._data},setData:function(e){this._data=e}});Fe.mixin(KV,Pf);var JV=KV;JV.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var QV=iy.isDimensionStacked,eG=Fe.indexOf;function tG(e,t,i,n,a,r){var o=[],s=QV(t,n)?t.getCalculationInfo("stackResultDimension"):n,l=rG(t,s,e),u=t.indicesOfNearest(s,l)[0];o[a]=t.get(i,u),o[r]=t.get(s,u);var h=t.get(n,u),c=Cc.getPrecision(t.get(n,u));return(c=Math.min(c,20))>=0&&(o[r]=+o[r].toFixed(c)),[o,h]}var iG=Fe.curry,nG={min:iG(tG,"min"),max:iG(tG,"max"),average:iG(tG,"average")};function aG(e,t,i,n){var a={};return null!=e.valueIndex||null!=e.valueDim?(a.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,a.valueAxis=i.getAxis(function(e,t){var i=e.getData(),n=i.dimensions;t=i.getDimension(t);for(var a=0;a<n.length;a++){var r=i.getDimensionInfo(n[a]);if(r.name===t)return r.coordDim}}(n,a.valueDataDim)),a.baseAxis=i.getOtherAxis(a.valueAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim)):(a.baseAxis=n.getBaseAxis(),a.valueAxis=i.getOtherAxis(a.baseAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim),a.valueDataDim=t.mapDimension(a.valueAxis.dim)),a}function rG(e,t,i){if("average"===i){var n=0,a=0;return e.each(t,(function(e,t){isNaN(e)||(n+=e,a++)})),n/a}return"median"===i?e.getMedian(t):e.getDataExtent(t,!0)["max"===i?1:0]}var oG=function(e,t){var i=e.getData(),n=e.coordinateSystem;if(t&&!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!Fe.isArray(t.coord)&&n){var a=n.dimensions,r=aG(t,i,n,e);if((t=Fe.clone(t)).type&&nG[t.type]&&r.baseAxis&&r.valueAxis){var o=eG(a,r.baseAxis.dim),s=eG(a,r.valueAxis.dim),l=nG[t.type](i,r.baseDataDim,r.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],h=0;h<2;h++)nG[u[h]]&&(u[h]=rG(i,i.mapDimension(a[h]),u[h]));t.coord=u}}return t},sG={dataTransform:oG,getAxisInfo:aG,dataFilter:function(e,t){return!(e&&e.containData&&t.coord&&!function(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}(t))||e.containData(t.coord)},dimValueGetter:function(e,t,i,n){return n<2?e.coord&&e.coord[n]:e.value},numCalculate:rG},lG=U_.extendComponentView({type:"marker",init:function(){this.markerGroupMap=Fe.createHashMap()},render:function(e,t,i){var n=this.markerGroupMap;n.each((function(e){e.__keep=!1}));var a=this.type+"Model";t.eachSeries((function(e){var n=e[a];n&&this.renderSeries(e,n,t,i)}),this),n.each((function(e){!e.__keep&&this.group.remove(e.group)}),this)},renderSeries:function(){}});function uG(e,t,i){var n=t.coordinateSystem;e.each((function(a){var r,o=e.getItemModel(a),s=Cc.parsePercent(o.get("x"),i.getWidth()),l=Cc.parsePercent(o.get("y"),i.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)r=t.getMarkerPosition(e.getValues(e.dimensions,a));else if(n){var u=e.get(n.dimensions[0],a),h=e.get(n.dimensions[1],a);r=n.dataToPoint([u,h])}}else r=[s,l];isNaN(s)||(r[0]=s),isNaN(l)||(r[1]=l),e.setItemLayout(a,r)}))}lG.extend({type:"markPoint",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markPointModel;t&&(uG(t.getData(),e,i),this.markerGroupMap.get(e.id).updateLayout(t))}),this)},renderSeries:function(e,t,i,n){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new fb),u=function(e,t,i){var n;n=e?Fe.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return Fe.defaults({name:e},i)})):[{name:"value",type:"float"}];var a=new Pv(n,i),r=Fe.map(i.get("data"),Fe.curry(sG.dataTransform,t));e&&(r=Fe.filter(r,Fe.curry(sG.dataFilter,e)));return a.initData(r,null,e?sG.dimValueGetter:function(e){return e.value}),a}(a,e,t);t.setData(u),uG(t.getData(),e,n),u.each((function(e){var i=u.getItemModel(e),n=i.getShallow("symbol"),a=i.getShallow("symbolSize"),r=Fe.isFunction(n),s=Fe.isFunction(a);if(r||s){var l=t.getRawValue(e),h=t.getDataParams(e);r&&(n=n(l,h)),s&&(a=a(l,h))}u.setItemVisual(e,{symbol:n,symbolSize:a,color:i.get("itemStyle.color")||o.getVisual("color")})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),U_.registerPreprocessor((function(e){e.markPoint=e.markPoint||{}})),JV.extend({type:"markLine",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"}});var hG=iy.getStackedDimension,cG=function(e,t,i,n){var a=e.getData(),r=n.type;if(!Fe.isArray(n)&&("min"===r||"max"===r||"average"===r||"median"===r||null!=n.xAxis||null!=n.yAxis)){var o,s;if(null!=n.yAxis||null!=n.xAxis)o=t.getAxis(null!=n.yAxis?"y":"x"),s=Fe.retrieve(n.yAxis,n.xAxis);else{var l=sG.getAxisInfo(n,a,t,e);o=l.valueAxis;var u=hG(a,l.valueDataDim);s=sG.numCalculate(a,u,r)}var h="x"===o.dim?0:1,c=1-h,d=Fe.clone(n),p={};d.type=null,d.coord=[],p.coord=[],d.coord[c]=-1/0,p.coord[c]=1/0;var f=i.get("precision");f>=0&&"number"==typeof s&&(s=+s.toFixed(Math.min(f,20))),d.coord[h]=p.coord[h]=s,n=[d,p,{type:r,valueIndex:n.valueIndex,value:s}]}return(n=[sG.dataTransform(e,n[0]),sG.dataTransform(e,n[1]),Fe.extend({},n[2])])[2].type=n[2].type||"",Fe.merge(n[2],n[0]),Fe.merge(n[2],n[1]),n};function dG(e){return!isNaN(e)&&!isFinite(e)}function pG(e,t,i,n){var a=1-e,r=n.dimensions[e];return dG(t[a])&&dG(i[a])&&t[e]===i[e]&&n.getAxis(r).containData(t[e])}function fG(e,t){if("cartesian2d"===e.type){var i=t[0].coord,n=t[1].coord;if(i&&n&&(pG(1,i,n,e)||pG(0,i,n,e)))return!0}return sG.dataFilter(e,t[0])&&sG.dataFilter(e,t[1])}function gG(e,t,i,n,a){var r,o=n.coordinateSystem,s=e.getItemModel(t),l=Cc.parsePercent(s.get("x"),a.getWidth()),u=Cc.parsePercent(s.get("y"),a.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)r=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var h=o.dimensions,c=e.get(h[0],t),d=e.get(h[1],t);r=o.dataToPoint([c,d])}if("cartesian2d"===o.type){var p=o.getAxis("x"),f=o.getAxis("y");h=o.dimensions;dG(e.get(h[0],t))?r[0]=p.toGlobalCoord(p.getExtent()[i?0:1]):dG(e.get(h[1],t))&&(r[1]=f.toGlobalCoord(f.getExtent()[i?0:1]))}isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];e.setItemLayout(t,r)}lG.extend({type:"markLine",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markLineModel;if(t){var n=t.getData(),a=t.__from,r=t.__to;a.each((function(t){gG(a,t,!0,e,i),gG(r,t,!1,e,i)})),n.each((function(e){n.setItemLayout(e,[a.getItemLayout(e),r.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},renderSeries:function(e,t,i,n){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new lD);this.group.add(l.group);var u=function(e,t,i){var n;n=e?Fe.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return Fe.defaults({name:e},i)})):[{name:"value",type:"float"}];var a=new Pv(n,i),r=new Pv(n,i),o=new Pv([],i),s=Fe.map(i.get("data"),Fe.curry(cG,t,e,i));e&&(s=Fe.filter(s,Fe.curry(fG,e)));var l=e?sG.dimValueGetter:function(e){return e.value};return a.initData(Fe.map(s,(function(e){return e[0]})),null,l),r.initData(Fe.map(s,(function(e){return e[1]})),null,l),o.initData(Fe.map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:a,to:r,line:o}}(a,e,t),h=u.from,c=u.to,d=u.line;t.__from=h,t.__to=c,t.setData(d);var p=t.get("symbol"),f=t.get("symbolSize");function g(t,i,a){var r=t.getItemModel(i);gG(t,i,a,e,n),t.setItemVisual(i,{symbolSize:r.get("symbolSize")||f[a?0:1],symbol:r.get("symbol",!0)||p[a?0:1],color:r.get("itemStyle.color")||o.getVisual("color")})}Fe.isArray(p)||(p=[p,p]),"number"==typeof f&&(f=[f,f]),u.from.each((function(e){g(h,e,!0),g(c,e,!1)})),d.each((function(e){var t=d.getItemModel(e).get("lineStyle.color");d.setItemVisual(e,{color:t||h.getItemVisual(e,"color")}),d.setItemLayout(e,[h.getItemLayout(e),c.getItemLayout(e)]),d.setItemVisual(e,{fromSymbolSize:h.getItemVisual(e,"symbolSize"),fromSymbol:h.getItemVisual(e,"symbol"),toSymbolSize:c.getItemVisual(e,"symbolSize"),toSymbol:c.getItemVisual(e,"symbol")})})),l.updateData(d),u.line.eachItemGraphicEl((function(e,i){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),U_.registerPreprocessor((function(e){e.markLine=e.markLine||{}})),JV.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var mG=function(e,t,i,n){var a=sG.dataTransform(e,n[0]),r=sG.dataTransform(e,n[1]),o=Fe.retrieve,s=a.coord,l=r.coord;s[0]=o(s[0],-1/0),s[1]=o(s[1],-1/0),l[0]=o(l[0],1/0),l[1]=o(l[1],1/0);var u=Fe.mergeAll([{},a,r]);return u.coord=[a.coord,r.coord],u.x0=a.x,u.y0=a.y,u.x1=r.x,u.y1=r.y,u};function vG(e){return!isNaN(e)&&!isFinite(e)}function yG(e,t,i,n){var a=1-e;return vG(t[a])&&vG(i[a])}function xG(e,t){var i=t.coord[0],n=t.coord[1];return!("cartesian2d"!==e.type||!i||!n||!yG(1,i,n)&&!yG(0,i,n))||(sG.dataFilter(e,{coord:i,x:t.x0,y:t.y0})||sG.dataFilter(e,{coord:n,x:t.x1,y:t.y1}))}function _G(e,t,i,n,a){var r,o=n.coordinateSystem,s=e.getItemModel(t),l=Cc.parsePercent(s.get(i[0]),a.getWidth()),u=Cc.parsePercent(s.get(i[1]),a.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)r=n.getMarkerPosition(e.getValues(i,t));else{var h=[p=e.get(i[0],t),f=e.get(i[1],t)];o.clampData&&o.clampData(h,h),r=o.dataToPoint(h,!0)}if("cartesian2d"===o.type){var c=o.getAxis("x"),d=o.getAxis("y"),p=e.get(i[0],t),f=e.get(i[1],t);vG(p)?r[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):vG(f)&&(r[1]=d.toGlobalCoord(d.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];return r}var bG=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];lG.extend({type:"markArea",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markAreaModel;if(t){var n=t.getData();n.each((function(t){var a=Fe.map(bG,(function(a){return _G(n,t,a,e,i)}));n.setItemLayout(t,a),n.getItemGraphicEl(t).setShape("points",a)}))}}),this)},renderSeries:function(e,t,i,n){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,{group:new Jh.Group});this.group.add(l.group),l.__keep=!0;var u=function(e,t,i){var n,a,r=["x0","y0","x1","y1"];e?(n=Fe.map(e&&e.dimensions,(function(e){var i=t.getData(),n=i.getDimensionInfo(i.mapDimension(e))||{};return Fe.defaults({name:e},n)})),a=new Pv(Fe.map(r,(function(e,t){return{name:e,type:n[t%2].type}})),i)):a=new Pv(n=[{name:"value",type:"float"}],i);var o=Fe.map(i.get("data"),Fe.curry(mG,t,e,i));e&&(o=Fe.filter(o,Fe.curry(xG,e)));var s=e?function(e,t,i,n){return e.coord[Math.floor(n/2)][n%2]}:function(e){return e.value};return a.initData(o,null,s),a.hasItemOption=!0,a}(a,e,t);t.setData(u),u.each((function(t){u.setItemLayout(t,Fe.map(bG,(function(i){return _G(u,t,i,e,n)}))),u.setItemVisual(t,{color:o.getVisual("color")})})),u.diff(l.__data).add((function(e){var t=new Jh.Polygon({shape:{points:u.getItemLayout(e)}});u.setItemGraphicEl(e,t),l.group.add(t)})).update((function(e,i){var n=l.__data.getItemGraphicEl(i);Jh.updateProps(n,{shape:{points:u.getItemLayout(e)}},t,e),l.group.add(n),u.setItemGraphicEl(e,n)})).remove((function(e){var t=l.__data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,i){var n=u.getItemModel(i),a=n.getModel("label"),r=n.getModel("emphasis.label"),o=u.getItemVisual(i,"color");e.useStyle(Fe.defaults(n.getModel("itemStyle").getItemStyle(),{fill:Zi.modifyAlpha(o,.4),stroke:o})),e.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),Jh.setLabelStyle(e.style,e.hoverStyle,a,r,{labelFetcher:t,labelDataIndex:i,defaultText:u.getName(i)||"",isRectText:!0,autoColor:o}),Jh.setHoverStyle(e,{}),e.dataModel=t})),l.__data=u,l.group.silent=t.get("silent")||e.get("silent")}}),U_.registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var wG=Ro.isNameSpecified,SG=Dg.legend.selector,MG={all:{type:"all",title:Fe.clone(SG.all)},inverse:{type:"inverse",title:Fe.clone(SG.inverse)}},IG=U_.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(e,t,i){this.mergeDefaultAndTheme(e,i),e.selected=e.selected||{},this._updateSelector(e)},mergeOption:function(e){IG.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),Fe.isArray(t)&&Fe.each(t,(function(e,i){Fe.isString(e)&&(e={type:e}),t[i]=Fe.merge(e,MG[e.type])}))},optionUpdated:function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,i=0;i<e.length;i++){var n=e[i].get("name");if(this.isSelected(n)){this.select(n),t=!0;break}}!t&&this.select(e[0].get("name"))}},_updateData:function(e){var t=[],i=[];e.eachRawSeries((function(n){var a,r=n.name;if(i.push(r),n.legendVisualProvider){var o=n.legendVisualProvider.getAllNames();e.isSeriesFiltered(n)||(i=i.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&wG(n)&&t.push(n.name)})),this._availableNames=i;var n=this.get("data")||t,a=Fe.map(n,(function(e){return"string"!=typeof e&&"number"!=typeof e||(e={name:e}),new pc(e,this,this.ecModel)}),this);this._data=a},getData:function(){return this._data},select:function(e){var t=this.option.selected;if("single"===this.get("selectedMode")){var i=this._data;Fe.each(i,(function(e){t[e.get("name")]=!1}))}t[e]=!0},unSelect:function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},toggleSelected:function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},allSelect:function(){var e=this._data,t=this.option.selected;Fe.each(e,(function(e){t[e.get("name",!0)]=!0}))},inverseSelect:function(){var e=this._data,t=this.option.selected;Fe.each(e,(function(e){var i=e.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]}))},isSelected:function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&Fe.indexOf(this._availableNames,e)>=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},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}}}),AG=IG;function TG(e,t,i){var n,a={},r="toggleSelected"===e;return i.eachComponent("legend",(function(i){r&&null!=n?i[n?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?i[e]():(i[e](t.name),n=i.isSelected(t.name));var o=i.getData();Fe.each(o,(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var n=i.isSelected(t);a.hasOwnProperty(t)?a[t]=a[t]&&n:a[t]=n}}))})),"allSelect"===e||"inverseSelect"===e?{selected:a}:{name:t.name,selected:a}}U_.registerAction("legendToggleSelect","legendselectchanged",Fe.curry(TG,"toggleSelected")),U_.registerAction("legendAllSelect","legendselectall",Fe.curry(TG,"allSelect")),U_.registerAction("legendInverseSelect","legendinverseselect",Fe.curry(TG,"inverseSelect")),U_.registerAction("legendSelect","legendselected",Fe.curry(TG,"select")),U_.registerAction("legendUnSelect","legendunselected",Fe.curry(TG,"unSelect"));var CG=Hx.createSymbol,DG=wz.makeBackground,LG=Fe.curry,PG=Fe.each,kG=Jh.Group,OG=U_.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new kG),this._backgroundEl,this.group.add(this._selectorGroup=new kG),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(e,t,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var a=e.get("align"),r=e.get("orient");a&&"auto"!==a||(a="right"===e.get("left")&&"vertical"===r?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===r?"end":"start"),this.renderInner(a,e,t,i,o,r,s);var l=e.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},h=e.get("padding"),c=ed.getLayoutRect(l,u,h),d=this.layoutInner(e,a,c,n,o,s),p=ed.getLayoutRect(Fe.defaults({width:d.width,height:d.height},l),u,h);this.group.attr("position",[p.x-d.x,p.y-d.y]),this.group.add(this._backgroundEl=DG(d,e))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(e,t,i,n,a,r,o){var s=this.getContentGroup(),l=Fe.createHashMap(),u=t.get("selectedMode"),h=[];i.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),PG(t.getData(),(function(a,r){var o=a.get("name");if(this.newlineDisabled||""!==o&&"\n"!==o){var c=i.getSeriesByName(o)[0];if(!l.get(o))if(c){var d=c.getData(),p=d.getVisual("color"),f=d.getVisual("borderColor");"function"==typeof p&&(p=p(c.getDataParams(0))),"function"==typeof f&&(f=f(c.getDataParams(0)));var g=d.getVisual("legendSymbol")||"roundRect",m=d.getVisual("symbol");this._createItem(o,r,a,t,g,m,e,p,f,u).on("click",LG(EG,o,null,n,h)).on("mouseover",LG(NG,c.name,null,n,h)).on("mouseout",LG(zG,c.name,null,n,h)),l.set(o,!0)}else i.eachRawSeries((function(i){if(!l.get(o)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(o))return;var c=s.indexOfName(o),d=s.getItemVisual(c,"color"),p=s.getItemVisual(c,"borderColor");this._createItem(o,r,a,t,"roundRect",null,e,d,p,u).on("click",LG(EG,null,o,n,h)).on("mouseover",LG(NG,null,o,n,h)).on("mouseout",LG(zG,null,o,n,h)),l.set(o,!0)}}),this)}else s.add(new kG({newline:!0}))}),this),a&&this._createSelector(a,t,n,r,o)},_createSelector:function(e,t,i,n,a){var r=this.getSelectorGroup();PG(e,(function(e){!function(e){var n=e.type,a=new Jh.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});r.add(a);var o=t.getModel("selectorLabel"),s=t.getModel("emphasis.selectorLabel");Jh.setLabelStyle(a.style,a.hoverStyle={},o,s,{defaultText:e.title,isRectText:!1}),Jh.setHoverStyle(a)}(e)}))},_createItem:function(e,t,i,n,a,r,o,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),p=n.get("inactiveBorderColor"),f=n.get("symbolKeepAspect"),g=n.getModel("itemStyle"),m=n.isSelected(e),v=new kG,y=i.getModel("textStyle"),x=i.get("icon"),_=i.getModel("tooltip"),b=_.parentModel,w=CG(a=x||a,0,0,h,c,m?s:d,null==f||f);if(v.add(RG(w,a,g,l,p,m)),!x&&r&&(r!==a||"none"===r)){var S=.8*c;"none"===r&&(r="circle");var M=CG(r,(h-S)/2,(c-S)/2,S,S,m?s:d,null==f||f);v.add(RG(M,r,g,l,p,m))}var I="left"===o?h+5:-5,A=o,T=n.get("formatter"),C=e;"string"==typeof T&&T?C=T.replace("{name}",null!=e?e:""):"function"==typeof T&&(C=T(e)),v.add(new Jh.Text({style:Jh.setTextStyle({},y,{text:C,x:I,y:c/2,textFill:m?y.getTextColor():d,textAlign:A,textVerticalAlign:"middle"})}));var D=new Jh.Rect({shape:v.getBoundingRect(),invisible:!0,tooltip:_.get("show")?Fe.extend({content:e,formatter:b.get("formatter",!0)||function(){return e},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:e,$vars:["name"]}},_.option):null});return v.add(D),v.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(v),Jh.setHoverStyle(v),v.__legendDataIndex=t,v},layoutInner:function(e,t,i,n,a,r){var o=this.getContentGroup(),s=this.getSelectorGroup();ed.box(e.get("orient"),o,e.get("itemGap"),i.width,i.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(a){ed.box("horizontal",s,e.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.attr("position",c),o.attr("position",u);var v={x:0,y:0};return v[f]=l[f]+d+h[f],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-p]),v}return o.attr("position",u),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function RG(e,t,i,n,a,r){var o;return"line"!==t&&t.indexOf("empty")<0?(o=i.getItemStyle(),e.style.stroke=n,r||(o.stroke=a)):o=i.getItemStyle(["borderWidth","borderColor"]),e.setStyle(o)}function EG(e,t,i,n){zG(e,t,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),NG(e,t,i,n)}function NG(e,t,i,n){var a=i.getZr().storage.getDisplayList()[0];a&&a.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:n})}function zG(e,t,i,n){var a=i.getZr().storage.getDisplayList()[0];a&&a.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:n})}var BG=OG;var VG=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var i=0;i<t.length;i++)if(!t[i].isSelected(e.name))return!1;return!0}))};U_.registerProcessor(U_.PRIORITY.PROCESSOR.SERIES_FILTER,VG),od.registerSubTypeDefaulter("legend",(function(){return"plain"}));var GG=ed.mergeLayoutParam,FG=ed.getLayoutParams,HG=AG.extend({type:"legend.scroll",setScrollDataIndex:function(e){this.option.scrollDataIndex=e},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},init:function(e,t,i,n){var a=FG(e);HG.superCall(this,"init",e,t,i,n),WG(this,e,a)},mergeOption:function(e,t){HG.superCall(this,"mergeOption",e,t),WG(this,this.option,e)}});function WG(e,t,i){var n=[1,1];n[e.getOrient().index]=0,GG(t,i,{type:"box",ignoreSize:n})}var UG=Jh.Group,jG=["width","height"],ZG=["x","y"],YG=BG.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){YG.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new UG),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new UG),this._showController},resetInner:function(){YG.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(e,t,i,n,a,r,o){var s=this;YG.superCall(this,"renderInner",e,t,i,n,a,r,o);var l=this._controllerGroup,u=t.get("pageIconSize",!0);Fe.isArray(u)||(u=[u,u]),c("pagePrev",0);var h=t.getModel("pageTextStyle");function c(e,i){var a=e+"DataIndex",r=Jh.createIcon(t.get("pageIcons",!0)[t.getOrient().name][i],{onclick:Fe.bind(s._pageGo,s,a,t,n)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});r.name=e,l.add(r)}l.add(new Jh.Text({name:"pageText",style:{textFill:h.getTextColor(),font:h.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),c("pageNext",1)},layoutInner:function(e,t,i,n,a,r){var o=this.getSelectorGroup(),s=e.getOrient().index,l=jG[s],u=ZG[s],h=jG[1-s],c=ZG[1-s];a&&ed.box("horizontal",o,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=o.getBoundingRect(),f=[-p.x,-p.y],g=Fe.clone(i);a&&(g[l]=i[l]-p[l]-d);var m=this._layoutContentAndController(e,n,g,s,l,h,c);if(a){if("end"===r)f[s]+=m[l]+d;else{var v=p[l]+d;f[s]-=v,m[u]-=v}m[l]+=p[l]+d,f[1-s]+=m[c]+m[h]/2-p[h]/2,m[h]=Math.max(m[h],p[h]),m[c]=Math.min(m[c],p[c]+f[1-s]),o.attr("position",f)}return m},_layoutContentAndController:function(e,t,i,n,a,r,o){var s=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;ed.box(e.get("orient"),s,e.get("itemGap"),n?i.width:null,n?null:i.height),ed.box("horizontal",u,e.get("pageButtonItemGap",!0));var h=s.getBoundingRect(),c=u.getBoundingRect(),d=this._showController=h[a]>i[a],p=[-h.x,-h.y];t||(p[n]=s.position[n]);var f=[0,0],g=[-c.x,-c.y],m=Fe.retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?g[n]+=i[a]-c[a]:f[n]+=c[a]+m);g[1-n]+=h[r]/2-c[r]/2,s.attr("position",p),l.attr("position",f),u.attr("position",g);var v={x:0,y:0};if(v[a]=d?i[a]:h[a],v[r]=Math.max(h[r],c[r]),v[o]=Math.min(0,c[o]+g[1-n]),l.__rectSize=i[a],d){var y={x:0,y:0};y[a]=Math.max(i[a]-c[a]-m,0),y[r]=v[r],l.setClipPath(new Jh.Rect({shape:y})),l.__rectSize=y[a]}else u.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&Jh.updateProps(s,{position:x.contentPosition},!!d&&e),this._updatePageInfoView(e,x),v},_pageGo:function(e,t,i){var n=this._getPageInfo(t)[e];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:t.id})},_updatePageInfoView:function(e,t){var i=this._controllerGroup;Fe.each(["pagePrev","pageNext"],(function(n){var a=null!=t[n+"DataIndex"],r=i.childOfName(n);r&&(r.setStyle("fill",a?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),r.cursor=a?"pointer":"default")}));var n=i.childOfName("pageText"),a=e.get("pageFormatter"),r=t.pageIndex,o=null!=r?r+1:0,s=t.pageCount;n&&a&&n.setStyle("text",Fe.isString(a)?a.replace("{current}",o).replace("{total}",s):a({current:o,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,a=e.getOrient().index,r=jG[a],o=ZG[a],s=this._findTargetItemIndex(t),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[a]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=h;++f)(!(v=y(l[f]))&&m.e>g.s+n||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(f=s-1,g=p,m=p,v=null;f>=-1;--f)(v=y(l[f]))&&x(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),i=t[o]+e.position[a];return{s:i,e:i+t[r],i:e.__legendDataIndex}}}function x(e,t){return e.e>=t&&e.s<=t+n}},_findTargetItemIndex:function(e){return this._showController?(this.getContentGroup().eachChild((function(n,a){var r=n.__legendDataIndex;null==i&&null!=r&&(i=a),r===e&&(t=a)})),null!=t?t:i):0;var t,i}});U_.registerAction("legendScroll","legendscroll",(function(e,t){var i=e.scrollDataIndex;null!=i&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(i)}))})),MB.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var XG=Jh.Rect,qG=Cc.linearMap,$G=Cc.asc,KG=Fe.bind,JG=Fe.each,QG="horizontal",eF="vertical",tF=["line","bar","candlestick","scatter"],iF=AB.extend({type:"dataZoom.slider",init:function(e,t){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=t},render:function(e,t,i,n){iF.superApply(this,"render",arguments),Ig.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=e.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){iF.superApply(this,"remove",arguments),Ig.clear(this,"_dispatchZoomAction")},dispose:function(){iF.superApply(this,"dispose",arguments),Ig.clear(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new Jh.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},_resetLocation:function(){var e=this.dataZoomModel,t=this.api,i=this._findCoordRect(),n={width:t.getWidth(),height:t.getHeight()},a=this._orient===QG?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},r=ed.getLayoutParams(e.option);Fe.each(["right","top","width","height"],(function(e){"ph"===r[e]&&(r[e]=a[e])}));var o=ed.getLayoutRect(r,n,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],this._orient===eF&&this._size.reverse()},_positionGroup:function(){var e=this.group,t=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),a=n&&n.get("inverse"),r=this._displayables.barGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;r.attr(i!==QG||a?i===QG&&a?{scale:o?[-1,1]:[-1,-1]}:i!==eF||a?{scale:o?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:o?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:o?[1,1]:[1,-1]});var s=e.getBoundingRect([r]);e.attr("position",[t.x-s.x,t.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var e=this.dataZoomModel,t=this._size,i=this._displayables.barGroup;i.add(new XG({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new XG({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:Fe.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(e){var t=this._size,i=e.series,n=i.getRawData(),a=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=a){var r=n.getDataExtent(a),o=.3*(r[1]-r[0]);r=[r[0]-o,r[1]+o];var s,l=[0,t[1]],u=[0,t[0]],h=[[t[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),p=0,f=Math.round(n.count()/t[0]);n.each([a],(function(e,t){if(f>0&&t%f)p+=d;else{var i=null==e||isNaN(e)||""===e,n=i?0:qG(e,r,l,!0);i&&!s&&t?(h.push([h[h.length-1][0],0]),c.push([c[c.length-1][0],0])):!i&&s&&(h.push([p,0]),c.push([p,0])),h.push([p,n]),c.push([p,n]),p+=d,s=i}}));var g=this.dataZoomModel;this._displayables.barGroup.add(new Jh.Polygon({shape:{points:h},style:Fe.defaults({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new Jh.Polyline({shape:{points:c},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var i,n=this.ecModel;return e.eachTargetAxis((function(a,r){var o=e.getAxisProxy(a.name,r).getTargetSeriesModels();Fe.each(o,(function(e){if(!(i||!0!==t&&Fe.indexOf(tF,e.get("type"))<0)){var o,s=n.getComponent(a.axis,r).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(a.name),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),i={thisAxis:s,series:e,thisDim:a.name,otherDim:l,otherAxisInverse:o}}}),this)}),this),i}},_renderHandle:function(){var e=this._displayables,t=e.handles=[],i=e.handleLabels=[],n=this._displayables.barGroup,a=this._size,r=this.dataZoomModel;n.add(e.filler=new XG({draggable:!0,cursor:nF(this._orient),drift:KG(this._onDragMove,this,"all"),ondragstart:KG(this._showDataInfo,this,!0),ondragend:KG(this._onDragEnd,this),onmouseover:KG(this._showDataInfo,this,!0),onmouseout:KG(this._showDataInfo,this,!1),style:{fill:r.get("fillerColor"),textPosition:"inside"}})),n.add(new XG({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1]},style:{stroke:r.get("dataBackgroundColor")||r.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),JG([0,1],(function(e){var a=Jh.createIcon(r.get("handleIcon"),{cursor:nF(this._orient),draggable:!0,drift:KG(this._onDragMove,this,e),ondragend:KG(this._onDragEnd,this),onmouseover:KG(this._showDataInfo,this,!0),onmouseout:KG(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),o=a.getBoundingRect();this._handleHeight=Cc.parsePercent(r.get("handleSize"),this._size[1]),this._handleWidth=o.width/o.height*this._handleHeight,a.setStyle(r.getModel("handleStyle").getItemStyle());var s=r.get("handleColor");null!=s&&(a.style.fill=s),n.add(t[e]=a);var l=r.textStyleModel;this.group.add(i[e]=new Jh.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))}),this)},_resetInterval:function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[qG(e[0],[0,100],t,!0),qG(e[1],[0,100],t,!0)]},_updateInterval:function(e,t){var i=this.dataZoomModel,n=this._handleEnds,a=this._getViewExtent(),r=i.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];IL(t,n,a,i.get("zoomLock")?"all":e,null!=r.minSpan?qG(r.minSpan,o,a,!0):null,null!=r.maxSpan?qG(r.maxSpan,o,a,!0):null);var s=this._range,l=this._range=$G([qG(n[0],a,o,!0),qG(n[1],a,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(e){var t=this._displayables,i=this._handleEnds,n=$G(i.slice()),a=this._size;JG([0,1],(function(e){var n=t.handles[e],r=this._handleHeight;n.attr({scale:[r/2,r/2],position:[i[e],a[1]/2-r/2]})}),this),t.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:a[1]}),this._updateDataInfo(e)},_updateDataInfo:function(e){var t=this.dataZoomModel,i=this._displayables,n=i.handleLabels,a=this._orient,r=["",""];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();r=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var h=$G(this._handleEnds.slice());function c(e){var t=Jh.getTransform(i.handles[e].parent,this.group),o=Jh.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=Jh.applyTransform([h[e]+(0===e?-s:s),this._size[1]/2],t);n[e].setStyle({x:l[0],y:l[1],textVerticalAlign:a===QG?"middle":o,textAlign:a===QG?o:"center",text:r[e]})}c.call(this,0),c.call(this,1)},_formatLabel:function(e,t){var i=this.dataZoomModel,n=i.get("labelFormatter"),a=i.get("labelPrecision");null!=a&&"auto"!==a||(a=t.getPixelPrecision());var r=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel(Math.round(e)):e.toFixed(Math.min(a,20));return Fe.isFunction(n)?n(e,r):Fe.isString(n)?n.replace("{value}",r):r},_showDataInfo:function(e){e=this._dragging||e;var t=this._displayables.handleLabels;t[0].attr("invisible",!e),t[1].attr("invisible",!e)},_onDragMove:function(e,t,i,n){this._dragging=!0,zt.stop(n.event);var a=this._displayables.barGroup.getLocalTransform(),r=Jh.applyTransform([t,i],a,!0),o=this._updateInterval(e,r[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),o&&s&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(e){var t=this._size,i=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(i[0]<0||i[0]>t[0]||i[1]<0||i[1]>t[1])){var n=this._handleEnds,a=(n[0]+n[1])/2,r=this._updateInterval("all",i[0]-a);this._updateView(),r&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:e[0],end:e[1]})},_findCoordRect:function(){var e;if(JG(this.getTargetCoordInfo(),(function(t){if(!e&&t.length){var i=t[0].model.coordinateSystem;e=i.getRect&&i.getRect()}})),!e){var t=this.api.getWidth(),i=this.api.getHeight();e={x:.2*t,y:.2*i,width:.6*t,height:.6*i}}return e}});function nF(e){return"vertical"===e?"ns-resize":"ew-resize"}MB.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var aF="\0_ec_dataZoom_roams";function rF(e){var t=e.getZr();return t[aF]||(t[aF]={})}function oF(e){Fe.each(e,(function(t,i){t.count||(t.controller.dispose(),delete e[i])}))}function sF(e,t){e.dispatchAction({type:"dataZoom",batch:t})}var lF=function(e,t){var i=rF(e),n=t.dataZoomId,a=t.coordId;Fe.each(i,(function(e,i){var r=e.dataZoomInfos;r[n]&&Fe.indexOf(t.allCoordIds,a)<0&&(delete r[n],e.count--)})),oF(i);var r=i[a];r||((r=i[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(e,t){var i=new UI(e.getZr());return Fe.each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(i){var n=[];Fe.each(t.dataZoomInfos,(function(a){if(i.isAvailableBehavior(a.dataZoomModel.option)){var r=(a.getRange||{})[e],o=r&&r(t.controller,i);!a.dataZoomModel.get("disabled",!0)&&o&&n.push({dataZoomId:a.dataZoomId,start:o[0],end:o[1]})}})),n.length&&t.dispatchAction(n)}))})),i}(e,r),r.dispatchAction=Fe.curry(sF,e)),!r.dataZoomInfos[n]&&r.count++,r.dataZoomInfos[n]=t;var o,s,l,u,h,c=(o=r.dataZoomInfos,l="type_",u={type_true:2,type_move:1,type_false:0,type_undefined:-1},h=!0,Fe.each(o,(function(e){var t=e.dataZoomModel,i=!t.get("disabled",!0)&&(!t.get("zoomLock",!0)||"move");u[l+i]>u[l+s]&&(s=i),h&=t.get("preventDefaultMouseMove",!0)})),{controlType:s,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!h}});r.controller.enable(c.controlType,c.opt),r.controller.setPointerChecker(t.containsPoint),Ig.createOrUpdate(r,"dispatchAction",t.dataZoomModel.get("throttle",!0),"fixRate")},uF={register:lF,unregister:function(e,t){var i=rF(e);Fe.each(i,(function(e){e.controller.dispose();var i=e.dataZoomInfos;i[t]&&(delete i[t],e.count--)})),oF(i)},generateCoordId:function(e){return e.type+"\0_"+e.id}},hF=Fe.bind,cF=AB.extend({type:"dataZoom.inside",init:function(e,t){this._range},render:function(e,t,i,n){cF.superApply(this,"render",arguments),this._range=e.getPercentRange(),Fe.each(this.getTargetCoordInfo(),(function(t,n){var a=Fe.map(t,(function(e){return uF.generateCoordId(e.model)}));Fe.each(t,(function(t){var r=t.model,o={};Fe.each(["pan","zoom","scrollMove"],(function(e){o[e]=hF(dF[e],this,t,n)}),this),uF.register(i,{coordId:uF.generateCoordId(r),allCoordIds:a,containsPoint:function(e,t,i){return r.coordinateSystem.containPoint([t,i])},dataZoomId:e.id,dataZoomModel:e,getRange:o})}),this)}),this)},dispose:function(){uF.unregister(this.api,this.dataZoomModel.id),cF.superApply(this,"dispose",arguments),this._range=null}}),dF={zoom:function(e,t,i,n){var a=this._range,r=a.slice(),o=e.axisModels[0];if(o){var s=fF[t](null,[n.originX,n.originY],o,i,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(r[1]-r[0])+r[0],u=Math.max(1/n.scale,0);r[0]=(r[0]-l)*u+l,r[1]=(r[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return IL(0,r,[0,100],0,h.minSpan,h.maxSpan),this._range=r,a[0]!==r[0]||a[1]!==r[1]?r:void 0}},pan:pF((function(e,t,i,n,a,r){var o=fF[n]([r.oldX,r.oldY],[r.newX,r.newY],t,a,i);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:pF((function(e,t,i,n,a,r){return fF[n]([0,0],[r.scrollDelta,r.scrollDelta],t,a,i).signal*(e[1]-e[0])*r.scrollDelta}))};function pF(e){return function(t,i,n,a){var r=this._range,o=r.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,i,n,a);return IL(l,o,[0,100],"all"),this._range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}}}var fF={grid:function(e,t,i,n,a){var r=i.axis,o={},s=a.model.coordinateSystem.getRect();return e=e||[0,0],"x"===r.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=r.inverse?-1:1),o},polar:function(e,t,i,n,a){var r=i.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===i.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=r.inverse?-1:1),o},singleAxis:function(e,t,i,n,a){var r=i.axis,o=a.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===r.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=r.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=r.inverse?-1:1),s}},gF=Fe.each;function mF(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var vF=function(e){var t=e&&e.visualMap;Fe.isArray(t)||(t=t?[t]:[]),gF(t,(function(e){if(e){mF(e,"splitList")&&!mF(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&Fe.isArray(t)&&gF(t,(function(e){Fe.isObject(e)&&(mF(e,"start")&&!mF(e,"min")&&(e.min=e.start),mF(e,"end")&&!mF(e,"max")&&(e.max=e.end))}))}}))};od.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var yF=U_.PRIORITY.VISUAL.COMPONENT;function xF(e,t,i,n){for(var a=t.targetVisuals[n],r=lC.prepareVisualTypes(a),o={color:e.getData().getVisual("color")},s=0,l=r.length;s<l;s++){var u=r[s],h=a["opacity"===u?"__alphaForOpacity":u];h&&h.applyVisual(i,c,d)}return o.color;function c(e){return o[e]}function d(e,t){o[e]=t}}U_.registerVisual(yF,{createOnAllSeries:!0,reset:function(e,t){var i=[];return t.eachComponent("visualMap",(function(t){var n=e.pipelineContext;!t.isTargetSeries(e)||n&&n.large||i.push(sV.incrementalApplyVisual(t.stateList,t.targetVisuals,Fe.bind(t.getValueState,t),t.getDataDimension(e.getData())))})),i}}),U_.registerVisual(yF,{createOnAllSeries:!0,reset:function(e,t){var i=e.getData(),n=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var a=t.getVisualMeta(Fe.bind(xF,null,e,t))||{stops:[],outerColors:[]},r=t.getDataDimension(i),o=i.getDimensionInfo(r);null!=o&&(a.dimension=o.index,n.push(a))}})),e.getData().setVisual("visualMeta",n)}});var _F={get:function(e,t,i){var n=Fe.clone((bF[e]||{})[t]);return i&&Fe.isArray(n)?n[n.length-1]:n}},bF={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]}},wF=_F,SF=lC.mapVisual,MF=lC.eachVisual,IF=Fe.isArray,AF=Fe.each,TF=Cc.asc,CF=Cc.linearMap,DF=Fe.noop,LF=U_.extendComponentModel({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,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,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(e,t,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(e,i)},optionUpdated:function(e,t){var i=this.option;ae.canvasSupported||(i.realtime=!1),!t&&sV.replaceVisualOption(i,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(e){var t=this.stateList;e=Fe.bind(e,this),this.controllerVisuals=sV.createVisualMappings(this.option.controller,t,e),this.targetVisuals=sV.createVisualMappings(this.option.target,t,e)},getTargetSeriesIndices:function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,i){t.push(i)})):t=Ro.normalizeToArray(e),t},eachTargetSeries:function(e,t){Fe.each(this.getTargetSeriesIndices(),(function(i){e.call(t,this.ecModel.getSeriesByIndex(i))}),this)},isTargetSeries:function(e){var t=!1;return this.eachTargetSeries((function(i){i===e&&(t=!0)})),t},formatValueText:function(e,t,i){var n,a,r=this.option,o=r.precision,s=this.dataBound,l=r.formatter;return i=i||["<",">"],Fe.isArray(e)&&(e=e.slice(),n=!0),a=t?e:n?[u(e[0]),u(e[1])]:u(e),Fe.isString(l)?l.replace("{value}",n?a[0]:a).replace("{value2}",n?a[1]:a):Fe.isFunction(l)?n?l(e[0],e[1]):l(e):n?e[0]===s[0]?i[0]+" "+a[1]:e[1]===s[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a;function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},resetExtent:function(){var e=this.option,t=TF([e.min,e.max]);this._dataExtent=t},getDataDimension:function(e){var t=this.option.dimension,i=e.dimensions;if(null!=t||i.length){if(null!=t)return e.getDimension(t);for(var n=e.dimensions,a=n.length-1;a>=0;a--){var r=n[a];if(!e.getDimensionInfo(r).isCalculationCoord)return r}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var e=this.ecModel,t=this.option,i={inRange:t.inRange,outOfRange:t.outOfRange},n=t.target||(t.target={}),a=t.controller||(t.controller={});Fe.merge(n,i),Fe.merge(a,i);var r=this.isCategory();function o(i){IF(t.color)&&!i.inRange&&(i.inRange={color:t.color.slice().reverse()}),i.inRange=i.inRange||{color:e.get("gradientColor")},AF(this.stateList,(function(e){var t=i[e];if(Fe.isString(t)){var n=wF.get(t,"active",r);n?(i[e]={},i[e][t]=n):delete i[e]}}),this)}o.call(this,n),o.call(this,a),function(e,t,i){var n=e[t],a=e[i];n&&!a&&(a=e[i]={},AF(n,(function(e,t){if(lC.isValidType(t)){var i=wF.get(t,"inactive",r);null!=i&&(a[t]=i,"color"!==t||a.hasOwnProperty("opacity")||a.hasOwnProperty("colorAlpha")||(a.opacity=[0,0]))}})))}.call(this,n,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,i=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,n=this.get("inactiveColor");AF(this.stateList,(function(a){var o=this.itemSize,s=e[a];s||(s=e[a]={color:r?n:[n]}),null==s.symbol&&(s.symbol=t&&Fe.clone(t)||(r?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&Fe.clone(i)||(r?o[0]:[o[0],o[0]])),s.symbol=SF(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;MF(l,(function(e){e>u&&(u=e)})),s.symbolSize=SF(l,(function(e){return CF(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,a)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:DF,getValueState:DF,getVisualMeta:DF}),PF=LF,kF=[20,140],OF=PF.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(e,t){OF.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},resetItemSize:function(){OF.superApply(this,"resetItemSize",arguments);var e=this.itemSize;"horizontal"===this._orient&&e.reverse(),(null==e[0]||isNaN(e[0]))&&(e[0]=kF[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=kF[1])},_resetRange:function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):Fe.isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},completeVisualOption:function(){PF.prototype.completeVisualOption.apply(this,arguments),Fe.each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=0)}),this)},setSelected:function(e){this.option.range=e.slice(),this._resetRange()},getSelected:function(){var e=this.getExtent(),t=Cc.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},getValueState:function(e){var t=this.option.range,i=this.getExtent();return(t[0]<=i[0]||t[0]<=e)&&(t[1]>=i[1]||e<=t[1])?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){e[0]<=t&&t<=e[1]&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getVisualMeta:function(e){var t=RF(this,"outOfRange",this.getExtent()),i=RF(this,"inRange",this.option.range.slice()),n=[];function a(t,i){n.push({value:t,color:e(t,i)})}for(var r=0,o=0,s=i.length,l=t.length;o<l&&(!i.length||t[o]<=i[0]);o++)t[o]<i[r]&&a(t[o],"outOfRange");for(var u=1;r<s;r++,u=0)u&&n.length&&a(i[r],"outOfRange"),a(i[r],"inRange");for(u=1;o<l;o++)(!i.length||i[i.length-1]<t[o])&&(u&&(n.length&&a(n[n.length-1].value,"outOfRange"),u=0),a(t[o],"outOfRange"));var h=n.length;return{stops:n,outerColors:[h?n[0].color:"transparent",h?n[h-1].color:"transparent"]}}});function RF(e,t,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,a=i[0],r=[],o=0;o<=200&&a<i[1];o++)r.push(a),a+=n;return r.push(i[1]),r}var EF=U_.extendComponentView({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(e,t){this.ecModel=e,this.api=t,this.visualMapModel},render:function(e,t,i,n){this.visualMapModel=e,!1!==e.get("show")?this.doRender.apply(this,arguments):this.group.removeAll()},renderBackground:function(e){var t=this.visualMapModel,i=Fc.normalizeCssArray(t.get("padding")||0),n=e.getBoundingRect();e.add(new Jh.Rect({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},getControllerVisual:function(e,t,i){var n=(i=i||{}).forceState,a=this.visualMapModel,r={};if("symbol"===t&&(r.symbol=a.get("itemSymbol")),"color"===t){var o=a.get("contentColor");r.color=o}function s(e){return r[e]}function l(e,t){r[e]=t}var u=a.controllerVisuals[n||a.getValueState(e)],h=lC.prepareVisualTypes(u);return Fe.each(h,(function(n){var a=u[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",a=u.__alphaForOpacity),lC.dependsOn(n,t)&&a&&a.applyVisual(e,s,l)})),r[t]},positionGroup:function(e){var t=this.visualMapModel,i=this.api;ed.positionElement(e,t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:Fe.noop}),NF=EF,zF=ed.getLayoutRect;var BF=function(e,t,i){var n=e.option,a=n.align;if(null!=a&&"auto"!==a)return a;for(var r={width:t.getWidth(),height:t.getHeight()},o="horizontal"===n.orient?1:0,s=[["left","right","width"],["top","bottom","height"]],l=s[o],u=[0,null,10],h={},c=0;c<3;c++)h[s[1-o][c]]=u[c],h[l[c]]=2===c?i[0]:n[l[c]];var d=[["x","width",3],["y","height",0]][o],p=zF(h,r,n.padding);return l[(p.margin[d[2]]||0)+p[d[0]]+.5*p[d[1]]<.5*r[d[1]]?0:1]},VF={getItemAlign:BF,makeHighDownBatch:function(e,t){return Fe.each(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}},GF=Cc.linearMap,FF=Fe.each,HF=Math.min,WF=Math.max,UF=NF.extend({type:"visualMap.continuous",init:function(){UF.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(e,t,i,n){n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},_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 i=e.get("text");this._renderEndsText(t,i,0),this._renderEndsText(t,i,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},_renderEndsText:function(e,t,i){if(t){var n=t[1-i];n=null!=n?n+"":"";var a=this.visualMapModel,r=a.get("textGap"),o=a.itemSize,s=this._shapes.barGroup,l=this._applyTransform([o[0]/2,0===i?-r:o[1]+r],s),u=this._applyTransform(0===i?"bottom":"top",s),h=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new Jh.Text({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===h?"middle":u,textAlign:"horizontal"===h?u:"center",text:n,textFont:c.getFont(),textFill:c.getTextColor()}}))}},_renderBar:function(e){var t=this.visualMapModel,i=this._shapes,n=t.itemSize,a=this._orient,r=this._useHandle,o=VF.getItemAlign(t,this.api,n),s=i.barGroup=this._createBarGroup(o);s.add(i.outOfRange=jF()),s.add(i.inRange=jF(null,r?YF(this._orient):null,Fe.bind(this._dragHandle,this,"all",!1),Fe.bind(this._dragHandle,this,"all",!0)));var l=t.textStyleModel.getTextRect("国"),u=WF(l.width,l.height);r&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(s,0,n,u,a,o),this._createHandle(s,1,n,u,a,o)),this._createIndicator(s,n,u,a),e.add(s)},_createHandle:function(e,t,i,n,a){var r=Fe.bind(this._dragHandle,this,t,!1),o=Fe.bind(this._dragHandle,this,t,!0),s=jF(function(e,t){return 0===e?[[0,0],[t,0],[t,-t]]:[[0,0],[t,0],[t,t]]}(t,n),YF(this._orient),r,o);s.position[0]=i[0],e.add(s);var l=this.visualMapModel.textStyleModel,u=new Jh.Text({draggable:!0,drift:r,onmousemove:function(e){zt.stop(e.event)},ondragend:o,style:{x:0,y:0,text:"",textFont:l.getFont(),textFill:l.getTextColor()}});this.group.add(u);var h=["horizontal"===a?n/2:1.5*n,"horizontal"===a?0===t?-1.5*n:1.5*n:0===t?-n/2:n/2],c=this._shapes;c.handleThumbs[t]=s,c.handleLabelPoints[t]=h,c.handleLabels[t]=u},_createIndicator:function(e,t,i,n){var a=jF([[0,0]],"move");a.position[0]=t[0],a.attr({invisible:!0,silent:!0}),e.add(a);var r=this.visualMapModel.textStyleModel,o=new Jh.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:r.getFont(),textFill:r.getTextColor()}});this.group.add(o);var s=["horizontal"===n?i/2:9,0],l=this._shapes;l.indicator=a,l.indicatorLabel=o,l.indicatorLabelPoint=s},_dragHandle:function(e,t,i,n){if(this._useHandle){if(this._dragging=!t,!t){var a=this._applyTransform([i,n],this._shapes.barGroup,!0);this._updateInterval(e,a[1]),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():ZF(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},_resetInterval:function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),i=e.getExtent(),n=[0,e.itemSize[1]];this._handleEnds=[GF(t[0],i,n,!0),GF(t[1],i,n,!0)]},_updateInterval:function(e,t){t=t||0;var i=this.visualMapModel,n=this._handleEnds,a=[0,i.itemSize[1]];IL(t,n,a,e,0);var r=i.getExtent();this._dataInterval=[GF(n[0],a,r,!0),GF(n[1],a,r,!0)]},_updateView:function(e){var t=this.visualMapModel,i=t.getExtent(),n=this._shapes,a=[0,t.itemSize[1]],r=e?a:this._handleEnds,o=this._createBarVisual(this._dataInterval,i,r,"inRange"),s=this._createBarVisual(i,i,a,"outOfRange");n.inRange.setStyle({fill:o.barColor,opacity:o.opacity}).setShape("points",o.barPoints),n.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(r,o)},_createBarVisual:function(e,t,i,n){var a={forceState:n,convertOpacityToAlpha:!0},r=this._makeColorGradient(e,a),o=[this.getControllerVisual(e[0],"symbolSize",a),this.getControllerVisual(e[1],"symbolSize",a)],s=this._createBarPoints(i,o);return{barColor:new Eu(0,0,0,1,r),barPoints:s,handlesColor:[r[0].color,r[r.length-1].color]}},_makeColorGradient:function(e,t){var i=[],n=(e[1]-e[0])/100;i.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var a=1;a<100;a++){var r=e[0]+n*a;if(r>e[1])break;i.push({color:this.getControllerVisual(r,"color",t),offset:a/100})}return i.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),i},_createBarPoints:function(e,t){var i=this.visualMapModel.itemSize;return[[i[0]-t[0],e[0]],[i[0],e[0]],[i[0],e[1]],[i[0]-t[1],e[1]]]},_createBarGroup:function(e){var t=this._orient,i=this.visualMapModel.get("inverse");return new Jh.Group("horizontal"!==t||i?"horizontal"===t&&i?{scale:"bottom"===e?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==t||i?{scale:"left"===e?[1,1]:[-1,1]}:{scale:"left"===e?[1,-1]:[-1,-1]}:{scale:"bottom"===e?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(e,t){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,a=i.handleThumbs,r=i.handleLabels;FF([0,1],(function(o){var s=a[o];s.setStyle("fill",t.handlesColor[o]),s.position[1]=e[o];var l=Jh.applyTransform(i.handleLabelPoints[o],Jh.getTransform(s,this.group));r[o].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[o]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===o?"bottom":"top":"left",i.barGroup)})}),this)}},_showIndicator:function(e,t,i,n){var a=this.visualMapModel,r=a.getExtent(),o=a.itemSize,s=[0,o[1]],l=GF(e,r,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(e,t,i,n){return e?[[0,-HF(t,WF(i,0))],[6,0],[0,HF(t,WF(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,o[1]));var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=Jh.applyTransform(u.indicatorLabelPoint,Jh.getTransform(h,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var f=this._applyTransform("left",u.barGroup),g=this._orient;p.setStyle({text:(i||"")+a.formatValueText(t),textVerticalAlign:"horizontal"===g?f:"middle",textAlign:"horizontal"===g?"center":f,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var e=this;this._shapes.barGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var i=e.visualMapModel.itemSize,n=e._applyTransform([t.offsetX,t.offsetY],e._shapes.barGroup,!0,!0);n[1]=HF(WF(0,n[1]),i[1]),e._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},_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()},_doHoverLinkToSeries:function(e,t){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var a=[0,n[1]],r=i.getExtent();e=HF(WF(a[0],e),a[1]);var o=function(e,t,i){var n=6,a=e.get("hoverLinkDataSize");a&&(n=GF(a,t,i,!0)/2);return n}(i,r,a),s=[e-o,e+o],l=GF(e,a,r,!0),u=[GF(s[0],a,r,!0),GF(s[1],a,r,!0)];s[0]<a[0]&&(u[0]=-1/0),s[1]>a[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 h=this._hoverLinkDataIndices,c=[];(t||ZF(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=Ro.compressBatches(h,c);this._dispatchHighDown("downplay",VF.makeHighDownBatch(d[0],i)),this._dispatchHighDown("highlight",VF.makeHighDownBatch(d[1],i))}},_hoverLinkFromSeriesMouseOver:function(e){var t=e.target,i=this.visualMapModel;if(t&&null!=t.dataIndex){var n=this.ecModel.getSeriesByIndex(t.seriesIndex);if(i.isTargetSeries(n)){var a=n.getData(t.dataType),r=a.get(i.getDataDimension(a),t.dataIndex,!0);isNaN(r)||this._showIndicator(r,r)}}},_hideIndicator:function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",VF.makeHighDownBatch(e,this.visualMapModel)),e.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},_applyTransform:function(e,t,i,n){var a=Jh.getTransform(t,n?null:this.group);return Jh[Fe.isArray(e)?"applyTransform":"transformDirection"](e,a,i)},_dispatchHighDown:function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function jF(e,t,i,n){return new Jh.Polygon({shape:{points:e},draggable:!!i,cursor:t,drift:i,onmousemove:function(e){zt.stop(e.event)},ondragend:n})}function ZF(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function YF(e){return"vertical"===e?"ns-resize":"ew-resize"}U_.registerAction({type:"selectDataRange",event:"dataRangeSelected",update:"update"},(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),U_.registerPreprocessor(vF);var XF=Cc.reformIntervals,qF=PF.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(e,t){qF.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();$F[this._mode].call(this),this._resetSelected(e,t);var n=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=Fe.clone(n)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=Fe.map(this._pieceList,(function(e){e=Fe.clone(e);return"inRange"!==t&&(e.visual=null),e})))}))},completeVisualOption:function(){var e=this.option,t={},i=lC.listVisualTypes(),n=this.isCategory();function a(e,t,i){return e&&e[t]&&(Fe.isObject(e[t])?e[t].hasOwnProperty(i):e[t]===i)}Fe.each(e.pieces,(function(e){Fe.each(i,(function(i){e.hasOwnProperty(i)&&(t[i]=1)}))})),Fe.each(t,(function(t,i){var r=0;Fe.each(this.stateList,(function(t){r|=a(e,t,i)||a(e.target,t,i)}),this),!r&&Fe.each(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=wF.get(i,"inRange"===t?"active":"inactive",n)}))}),this),PF.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(e,t){var i=this.option,n=this._pieceList,a=(t?i:e).selected||{};if(i.selected=a,Fe.each(n,(function(e,t){var i=this.getSelectedMapKey(e);a.hasOwnProperty(i)||(a[i]=!0)}),this),"single"===i.selectedMode){var r=!1;Fe.each(n,(function(e,t){var i=this.getSelectedMapKey(e);a[i]&&(r?a[i]=!1:r=!0)}),this)}},getSelectedMapKey:function(e){return"categories"===this._mode?e.value+"":e.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(e){this.option.selected=Fe.clone(e)},getValueState:function(e){var t=lC.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){lC.findPieceIndex(t,this._pieceList)===e&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getRepresentValue:function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var i=e.interval||[];t=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return t},getVisualMeta:function(e){if(!this.isCategory()){var t=[],i=[],n=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var o=-1/0;return Fe.each(a,(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:i}}function s(a,r){var o=n.getRepresentValue({interval:a});r||(r=n.getValueState(o));var s=e(o,r);a[0]===-1/0?i[0]=s:a[1]===1/0?i[1]=s:t.push({value:a[0],color:s},{value:a[1],color:s})}}}),$F={splitNumber:function(){var e=this.option,t=this._pieceList,i=Math.min(e.precision,20),n=this.getExtent(),a=e.splitNumber;a=Math.max(parseInt(a,10),1),e.splitNumber=a;for(var r=(n[1]-n[0])/a;+r.toFixed(i)!==r&&i<5;)i++;e.precision=i,r=+r.toFixed(i),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o<a;s+=r,o++){var l=o===a-1?n[1]:s+r;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[n[1],1/0],close:[0,0]}),XF(t),Fe.each(t,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(){var e=this.option;Fe.each(e.categories,(function(e){this._pieceList.push({text:this.formatValueText(e,!0),value:e})}),this),KF(e,this._pieceList)},pieces:function(){var e=this.option,t=this._pieceList;Fe.each(e.pieces,(function(e,i){Fe.isObject(e)||(e={value:e});var n={text:"",index:i};if(null!=e.label&&(n.text=e.label),e.hasOwnProperty("value")){var a=n.value=e.value;n.interval=[a,a],n.close=[1,1]}else{for(var r=n.interval=[],o=n.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],h=0;h<2;h++){for(var c=[["gte","gt","min"],["lte","lt","max"]][h],d=0;d<3&&null==r[h];d++)r[h]=e[c[d]],o[h]=s[d],u[h]=2===d;null==r[h]&&(r[h]=l[h])}u[0]&&r[1]===1/0&&(o[0]=0),u[1]&&r[0]===-1/0&&(o[1]=0),r[0]===r[1]&&o[0]&&o[1]&&(n.value=r[0])}n.visual=lC.retrieveVisuals(e),t.push(n)}),this),KF(e,t),XF(t),Fe.each(t,(function(e){var t=e.close,i=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,i)}),this)}};function KF(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}var JF=Hx.createSymbol;NF.extend({type:"visualMap.piecewise",doRender:function(){var e=this.group;e.removeAll();var t=this.visualMapModel,i=t.get("textGap"),n=t.textStyleModel,a=n.getFont(),r=n.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,h=Fe.retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,h,o),Fe.each(l.viewPieceList,(function(n){var l=n.piece,u=new Jh.Group;u.onclick=Fe.bind(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=t.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new Jh.Text({style:{x:"right"===o?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:o,textFont:a,textFill:r,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,h,o),ed.box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},_enableHoverLink:function(e,t){function i(e){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:e,batch:VF.makeHighDownBatch(i.findTargetDataIndices(t),i)})}e.on("mouseover",Fe.bind(i,this,"highlight")).on("mouseout",Fe.bind(i,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return VF.getItemAlign(e,this.api,e.itemSize);var i=t.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(e,t,i,n,a){if(t){var r=new Jh.Group,o=this.visualMapModel.textStyleModel;r.add(new Jh.Text({style:{x:n?"right"===a?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?a:"center",text:t,textFont:o.getFont(),textFill:o.getTextColor()}})),e.add(r)}},_getViewData:function(){var e=this.visualMapModel,t=Fe.map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),i=e.get("text"),n=e.get("orient"),a=e.get("inverse");return("horizontal"===n?a:!a)?t.reverse():i&&(i=i.slice().reverse()),{viewPieceList:t,endsText:i}},_createItemSymbol:function(e,t,i){e.add(JF(this.getControllerVisual(t,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(t,"color")))},_onItemClick:function(e){var t=this.visualMapModel,i=t.option,n=Fe.clone(i.selected),a=t.getSelectedMapKey(e);"single"===i.selectedMode?(n[a]=!0,Fe.each(n,(function(e,t){n[t]=t===a}))):n[a]=!n[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}}),U_.registerPreprocessor(vF);var QF,eH="urn:schemas-microsoft-com:vml",tH="undefined"==typeof window?null:window,iH=!1,nH=tH&&tH.document;if(nH&&!ae.canvasSupported)try{!nH.namespaces.zrvml&&nH.namespaces.add("zrvml",eH),QF=function(e){return nH.createElement("<zrvml:"+e+' class="zrvml">')}}catch(e){QF=function(e){return nH.createElement("<"+e+' xmlns="'+eH+'" class="zrvml">')}}var aH={doc:nH,createNode:function(e){return QF(e)},initVML:function(){if(!iH&&nH){iH=!0;var e=nH.styleSheets;e.length<31?nH.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}}},rH=ht.applyTransform,oH=Xs.CMD,sH=Math.round,lH=Math.sqrt,uH=Math.abs,hH=Math.cos,cH=Math.sin,dH=Math.max;if(!ae.canvasSupported){var pH=",",fH="progid:DXImageTransform.Microsoft",gH=21600,mH=gH/2,vH=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=gH+","+gH,e.coordorigin="0,0"},yH=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},xH=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},_H=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},bH=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},wH=xr.parsePercent,SH=function(e,t,i){var n=Zi.parse(t);i=+i,isNaN(i)&&(i=1),n&&(e.color=yH(n[0],n[1],n[2]),e.opacity=i*n[3])},MH=function(e){var t=Zi.parse(e);return[yH(t[0],t[1],t[2]),t[3]]},IH=function(e,t,i,n){var a="fill"===t,r=e.getElementsByTagName(t)[0];null!=i[t]&&"none"!==i[t]&&(a||!a&&i.lineWidth)?(e[a?"filled":"stroked"]="true",i[t]instanceof Ou&&_H(e,r),r||(r=aH.createNode(t)),a?function(e,t,i){var n=t.fill;if(null!=n)if(n instanceof Ou){var a,r=0,o=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){a="gradient";var d=i.transform,p=[n.x*h,n.y*c],f=[n.x2*h,n.y2*c];d&&(rH(p,p,d),rH(f,f,d));var g=f[0]-p[0],m=f[1]-p[1];(r=180*Math.atan2(g,m)/Math.PI)<0&&(r+=360),r<1e-6&&(r=0)}else{a="gradientradial",p=[n.x*h,n.y*c],d=i.transform;var v=i.scale,y=h,x=c;o=[(p[0]-u.x)/y,(p[1]-u.y)/x],d&&rH(p,p,d),y/=v[0]*gH,x/=v[1]*gH;var _=dH(y,x);s=0/_,l=2*n.r/_-s}var b=n.colorStops.slice();b.sort((function(e,t){return e.offset-t.offset}));for(var w=b.length,S=[],M=[],I=0;I<w;I++){var A=b[I],T=MH(A.color);M.push(A.offset*l+s+" "+T[0]),0!==I&&I!==w-1||S.push(T)}if(w>=2){var C=S[0][0],D=S[1][0],L=S[0][1]*t.opacity,P=S[1][1]*t.opacity;e.type=a,e.method="none",e.focus="100%",e.angle=r,e.color=C,e.color2=D,e.colors=M.join(","),e.opacity=P,e.opacity2=L}"radial"===a&&(e.focusposition=o.join(","))}else SH(e,n,t.opacity)}(r,i,n):function(e,t){t.lineDash&&(e.dashstyle=t.lineDash.join(" ")),null==t.stroke||t.stroke instanceof Ou||SH(e,t.stroke,t.opacity)}(r,i),xH(e,r)):(e[a?"filled":"stroked"]="false",_H(e,r))},AH=[[],[],[]];xl.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=aH.createNode("shape"),vH(i),this._vmlEl=i),IH(i,"fill",t,this),IH(i,"stroke",t,this);var n=this.transform,a=null!=n,r=i.getElementsByTagName("stroke")[0];if(r){var o=t.lineWidth;if(a&&!t.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];o*=lH(uH(s))}r.weight=o+"px"}var l=this.path||(this.path=new Xs);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(e,t){var i,n,a,r,o,s,l=oH.M,u=oH.C,h=oH.L,c=oH.A,d=oH.Q,p=[],f=e.data,g=e.len();for(r=0;r<g;){switch(n="",i=0,a=f[r++]){case l:n=" m ",i=1,o=f[r++],s=f[r++],AH[0][0]=o,AH[0][1]=s;break;case h:n=" l ",i=1,o=f[r++],s=f[r++],AH[0][0]=o,AH[0][1]=s;break;case d:case u:n=" c ",i=3;var m,v,y=f[r++],x=f[r++],_=f[r++],b=f[r++];a===d?(m=_,v=b,_=(_+2*y)/3,b=(b+2*x)/3,y=(o+2*y)/3,x=(s+2*x)/3):(m=f[r++],v=f[r++]),AH[0][0]=y,AH[0][1]=x,AH[1][0]=_,AH[1][1]=b,AH[2][0]=m,AH[2][1]=v,o=m,s=v;break;case c:var w=0,S=0,M=1,I=1,A=0;t&&(w=t[4],S=t[5],M=lH(t[0]*t[0]+t[1]*t[1]),I=lH(t[2]*t[2]+t[3]*t[3]),A=Math.atan2(-t[1]/I,t[0]/M));var T=f[r++],C=f[r++],D=f[r++],L=f[r++],P=f[r++]+A,k=f[r++]+P+A;r++;var O=f[r++],R=T+hH(P)*D,E=C+cH(P)*L,N=(y=T+hH(k)*D,x=C+cH(k)*L,O?" wa ":" at ");Math.abs(R-y)<1e-4&&(Math.abs(k-P)>.01?O&&(R+=270/gH):Math.abs(E-C)<1e-4?O&&R<T||!O&&R>T?x-=270/gH:x+=270/gH:O&&E<C||!O&&E>C?y+=270/gH:y-=270/gH),p.push(N,sH(((T-D)*M+w)*gH-mH),pH,sH(((C-L)*I+S)*gH-mH),pH,sH(((T+D)*M+w)*gH-mH),pH,sH(((C+L)*I+S)*gH-mH),pH,sH((R*M+w)*gH-mH),pH,sH((E*I+S)*gH-mH),pH,sH((y*M+w)*gH-mH),pH,sH((x*I+S)*gH-mH)),o=y,s=x;break;case oH.R:var z=AH[0],B=AH[1];z[0]=f[r++],z[1]=f[r++],B[0]=z[0]+f[r++],B[1]=z[1]+f[r++],t&&(rH(z,z,t),rH(B,B,t)),z[0]=sH(z[0]*gH-mH),B[0]=sH(B[0]*gH-mH),z[1]=sH(z[1]*gH-mH),B[1]=sH(B[1]*gH-mH),p.push(" m ",z[0],pH,z[1]," l ",B[0],pH,z[1]," l ",B[0],pH,B[1]," l ",z[0],pH,B[1]);break;case oH.Z:p.push(" x ")}if(i>0){p.push(n);for(var V=0;V<i;V++){var G=AH[V];t&&rH(G,G,t),p.push(sH(G[0]*gH-mH),pH,sH(G[1]*gH-mH),V<i-1?pH:"")}}}return p.join("")}(l,this.transform),i.style.zIndex=bH(this.zlevel,this.z,this.z2),xH(e,i),null!=t.text?this.drawRectText(e,this.getBoundingRect()):this.removeRectText(e)},xl.prototype.onRemove=function(e){_H(e,this._vmlEl),this.removeRectText(e)},xl.prototype.onAdd=function(e){xH(e,this._vmlEl),this.appendRectText(e)};Tr.prototype.brushVML=function(e){var t,i,n,a=this.style,r=a.image;if("object"==typeof(n=r)&&n.tagName&&"IMG"===n.tagName.toUpperCase()){var o=r.src;if(o===this._imageSrc)t=this._imageWidth,i=this._imageHeight;else{var s=r.runtimeStyle,l=s.width,u=s.height;s.width="auto",s.height="auto",t=r.width,i=r.height,s.width=l,s.height=u,this._imageSrc=o,this._imageWidth=t,this._imageHeight=i}r=o}else r===this._imageSrc&&(t=this._imageWidth,i=this._imageHeight);if(r){var h=a.x||0,c=a.y||0,d=a.width,p=a.height,f=a.sWidth,g=a.sHeight,m=a.sx||0,v=a.sy||0,y=f&&g,x=this._vmlEl;x||(x=aH.doc.createElement("div"),vH(x),this._vmlEl=x);var _,b=x.style,w=!1,S=1,M=1;if(this.transform&&(_=this.transform,S=lH(_[0]*_[0]+_[1]*_[1]),M=lH(_[2]*_[2]+_[3]*_[3]),w=_[1]||_[2]),w){var I=[h,c],A=[h+d,c],T=[h,c+p],C=[h+d,c+p];rH(I,I,_),rH(A,A,_),rH(T,T,_),rH(C,C,_);var D=dH(I[0],A[0],T[0],C[0]),L=dH(I[1],A[1],T[1],C[1]),P=[];P.push("M11=",_[0]/S,pH,"M12=",_[2]/M,pH,"M21=",_[1]/S,pH,"M22=",_[3]/M,pH,"Dx=",sH(h*S+_[4]),pH,"Dy=",sH(c*M+_[5])),b.padding="0 "+sH(D)+"px "+sH(L)+"px 0",b.filter=fH+".Matrix("+P.join("")+", SizingMethod=clip)"}else _&&(h=h*S+_[4],c=c*M+_[5]),b.filter="",b.left=sH(h)+"px",b.top=sH(c)+"px";var k=this._imageEl,O=this._cropEl;k||(k=aH.doc.createElement("div"),this._imageEl=k);var R=k.style;if(y){if(t&&i)R.width=sH(S*t*d/f)+"px",R.height=sH(M*i*p/g)+"px";else{var E=new Image,N=this;E.onload=function(){E.onload=null,t=E.width,i=E.height,R.width=sH(S*t*d/f)+"px",R.height=sH(M*i*p/g)+"px",N._imageWidth=t,N._imageHeight=i,N._imageSrc=r},E.src=r}O||((O=aH.doc.createElement("div")).style.overflow="hidden",this._cropEl=O);var z=O.style;z.width=sH((d+m*d/f)*S),z.height=sH((p+v*p/g)*M),z.filter=fH+".Matrix(Dx="+-m*d/f*S+",Dy="+-v*p/g*M+")",O.parentNode||x.appendChild(O),k.parentNode!==O&&O.appendChild(k)}else R.width=sH(S*d)+"px",R.height=sH(M*p)+"px",x.appendChild(k),O&&O.parentNode&&(x.removeChild(O),this._cropEl=null);var B="",V=a.opacity;V<1&&(B+=".Alpha(opacity="+sH(100*V)+") "),B+=fH+".AlphaImageLoader(src="+r+", SizingMethod=scale)",R.filter=B,x.style.zIndex=bH(this.zlevel,this.z,this.z2),xH(e,x),null!=a.text&&this.drawRectText(e,this.getBoundingRect())}},Tr.prototype.onRemove=function(e){_H(e,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(e)},Tr.prototype.onAdd=function(e){xH(e,this._vmlEl),this.appendRectText(e)};var TH,CH="normal",DH={},LH=0,PH=document.createElement("div");Ha.$override("measureText",(function(e,t){var i=aH.doc;TH||((TH=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",aH.doc.body.appendChild(TH));try{TH.style.font=t}catch(e){}return TH.innerHTML="",TH.appendChild(i.createTextNode(e)),{width:TH.offsetWidth}}));for(var kH=new On,OH=function(e,t,i,n){var a=this.style;this.__dirty&&xr.normalizeTextStyle(a,!0);var r=a.text;if(null!=r&&(r+=""),r){if(a.rich){var o=Ha.parseRichText(r,a);r=[];for(var s=0;s<o.lines.length;s++){for(var l=o.lines[s].tokens,u=[],h=0;h<l.length;h++)u.push(l[h].text);r.push(u.join(""))}r=r.join("\n")}var c,d,p=a.textAlign,f=a.textVerticalAlign,g=function(e){var t=DH[e];if(!t){LH>100&&(LH=0,DH={});var i,n=PH.style;try{n.font=e,i=n.fontFamily.split(",")[0]}catch(e){}t={style:n.fontStyle||CH,variant:n.fontVariant||CH,weight:n.fontWeight||CH,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},DH[e]=t,LH++}return t}(a.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||Ha.getBoundingRect(r,m,p,f,a.textPadding,a.textLineHeight);var v=this.transform;if(v&&!n&&(kH.copy(t),kH.applyTransform(v),t=kH),n)c=t.x,d=t.y;else{var y=a.textPosition;if(y instanceof Array)c=t.x+wH(y[0],t.width),d=t.y+wH(y[1],t.height),p=p||"left";else{var x=this.calculateTextPosition?this.calculateTextPosition({},a,t):Ha.calculateTextPosition({},a,t);c=x.x,d=x.y,p=p||x.textAlign,f=f||x.textVerticalAlign}}c=Ha.adjustTextX(c,i.width,p),d=Ha.adjustTextY(d,i.height,f),d+=i.height/2;var _,b,w,S=aH.createNode,M=this._textVmlEl;M?b=(_=(w=M.firstChild).nextSibling).nextSibling:(M=S("line"),_=S("path"),b=S("textpath"),w=S("skew"),b.style["v-text-align"]="left",vH(M),_.textpathok=!0,b.on=!0,M.from="0 0",M.to="1000 0.05",xH(M,w),xH(M,_),xH(M,b),this._textVmlEl=M);var I=[c,d],A=M.style;v&&n?(rH(I,I,v),w.on=!0,w.matrix=v[0].toFixed(3)+pH+v[2].toFixed(3)+pH+v[1].toFixed(3)+pH+v[3].toFixed(3)+",0,0",w.offset=(sH(I[0])||0)+","+(sH(I[1])||0),w.origin="0 0",A.left="0px",A.top="0px"):(w.on=!1,A.left=sH(c)+"px",A.top=sH(d)+"px"),b.string=String(r).replace(/&/g,"&amp;").replace(/"/g,"&quot;");try{b.style.font=m}catch(e){}IH(M,"fill",{fill:a.textFill,opacity:a.opacity},this),IH(M,"stroke",{stroke:a.textStroke,opacity:a.opacity,lineDash:a.lineDash||null},this),M.style.zIndex=bH(this.zlevel,this.z,this.z2),xH(e,M)}},RH=function(e){_H(e,this._textVmlEl),this._textVmlEl=null},EH=function(e){xH(e,this._textVmlEl)},NH=[Sr,Ir,Tr,xl,Fl],zH=0;zH<NH.length;zH++){var BH=NH[zH].prototype;BH.drawRectText=OH,BH.removeRectText=RH,BH.appendRectText=EH}Fl.prototype.brushVML=function(e){var t=this.style;null!=t.text?this.drawRectText(e,{x:t.x||0,y:t.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(e)},Fl.prototype.onRemove=function(e){this.removeRectText(e)},Fl.prototype.onAdd=function(e){this.appendRectText(e)}}var VH=Fe.each;function GH(e){return parseInt(e,10)}function FH(e,t){aH.initVML(),this.root=e,this.storage=t;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",e.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var a=t.delFromStorage,r=t.addToStorage;t.delFromStorage=function(e){a.call(t,e),e&&e.onRemove&&e.onRemove(n)},t.addToStorage=function(e){e.onAdd&&e.onAdd(n),r.call(t,e)},this._firstPaint=!0}FH.prototype={constructor:FH,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0,!0);this._paintList(e)},_paintList:function(e){for(var t=this._vmlRoot,i=0;i<e.length;i++){var n=e[i];n.invisible||n.ignore?(n.__alreadyNotVisible||n.onRemove(t),n.__alreadyNotVisible=!0):(n.__alreadyNotVisible&&n.onAdd(t),n.__alreadyNotVisible=!1,n.__dirty&&(n.beforeBrush&&n.beforeBrush(),(n.brushVML||n.brush).call(n,t),n.afterBrush&&n.afterBrush())),n.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(t),this._firstPaint=!1)},resize:function(e,t){e=null==e?this._getWidth():e,t=null==t?this._getHeight():t;if(this._width!==e||this._height!==t){this._width=e,this._height=t;var i=this._vmlViewport.style;i.width=e+"px",i.height=t+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var e=this.root,t=e.currentStyle;return(e.clientWidth||GH(t.width))-GH(t.paddingLeft)-GH(t.paddingRight)|0},_getHeight:function(){var e=this.root,t=e.currentStyle;return(e.clientHeight||GH(t.height))-GH(t.paddingTop)-GH(t.paddingBottom)|0}},VH(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(e){FH.prototype[e]=function(){}}));var HH=FH;(0,xo.registerPainter)("vml",HH);var WH={createElement:function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}},UH=WH.createElement,jH=Xs.CMD,ZH=Array.prototype.join,YH="none",XH=Math.round,qH=Math.sin,$H=Math.cos,KH=Math.PI,JH=2*Math.PI,QH=180/KH,eW=1e-4;function tW(e){return XH(1e4*e)/1e4}function iW(e){return e<eW&&e>-1e-4}function nW(e,t){t&&aW(e,"transform","matrix("+ZH.call(t,",")+")")}function aW(e,t,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&e.setAttribute(t,i)}function rW(e,t,i,n){if(function(e,t){var i=t?e.textFill:e.fill;return null!=i&&i!==YH}(t,i)){var a=i?t.textFill:t.fill;aW(e,"fill",a="transparent"===a?YH:a),aW(e,"fill-opacity",null!=t.fillOpacity?t.fillOpacity*t.opacity:t.opacity)}else aW(e,"fill",YH);if(function(e,t){var i=t?e.textStroke:e.stroke;return null!=i&&i!==YH}(t,i)){var r=i?t.textStroke:t.stroke;aW(e,"stroke",r="transparent"===r?YH:r),aW(e,"stroke-width",(i?t.textStrokeWidth:t.lineWidth)/(!i&&t.strokeNoScale?n.getLineScale():1)),aW(e,"paint-order",i?"stroke":"fill"),aW(e,"stroke-opacity",null!=t.strokeOpacity?t.strokeOpacity:t.opacity),t.lineDash?(aW(e,"stroke-dasharray",t.lineDash.join(",")),aW(e,"stroke-dashoffset",XH(t.lineDashOffset||0))):aW(e,"stroke-dasharray",""),t.lineCap&&aW(e,"stroke-linecap",t.lineCap),t.lineJoin&&aW(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&aW(e,"stroke-miterlimit",t.miterLimit)}else aW(e,"stroke",YH)}var oW={};oW.brush=function(e){var t=e.style,i=e.__svgEl;i||(i=UH("path"),e.__svgEl=i),e.path||e.createPathProxy();var n=e.path;if(e.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,e.buildPath(n,e.shape),e.__dirtyPath=!1;var a=function(e){for(var t=[],i=e.data,n=e.len(),a=0;a<n;){var r="",o=0;switch(i[a++]){case jH.M:r="M",o=2;break;case jH.L:r="L",o=2;break;case jH.Q:r="Q",o=4;break;case jH.C:r="C",o=6;break;case jH.A:var s=i[a++],l=i[a++],u=i[a++],h=i[a++],c=i[a++],d=i[a++],p=i[a++],f=i[a++],g=Math.abs(d),m=iW(g-JH)||(f?d>=JH:-d>=JH),v=d>0?d%JH:d%JH+JH,y=!1;y=!!m||!iW(g)&&v>=KH==!!f;var x=tW(s+u*$H(c)),_=tW(l+h*qH(c));m&&(d=f?JH-1e-4:1e-4-JH,y=!0,9===a&&t.push("M",x,_));var b=tW(s+u*$H(c+d)),w=tW(l+h*qH(c+d));t.push("A",tW(u),tW(h),XH(p*QH),+y,+f,b,w);break;case jH.Z:r="Z";break;case jH.R:b=tW(i[a++]),w=tW(i[a++]);var S=tW(i[a++]),M=tW(i[a++]);t.push("M",b,w,"L",b+S,w,"L",b+S,w+M,"L",b,w+M,"L",b,w)}r&&t.push(r);for(var I=0;I<o;I++)t.push(tW(i[a++]))}return t.join(" ")}(n);a.indexOf("NaN")<0&&aW(i,"d",a)}rW(i,t,!1,e),nW(i,e.transform),null!=t.text?pW(e,e.getBoundingRect()):gW(e)};var sW={brush:function(e){var t=e.style,i=t.image;i instanceof HTMLImageElement&&(i=i.src);if(i){var n=t.x||0,a=t.y||0,r=t.width,o=t.height,s=e.__svgEl;s||(s=UH("image"),e.__svgEl=s),i!==e.__imageSrc&&(!function(e,t,i){e.setAttributeNS("http://www.w3.org/1999/xlink",t,i)}(s,"href",i),e.__imageSrc=i),aW(s,"width",r),aW(s,"height",o),aW(s,"x",n),aW(s,"y",a),nW(s,e.transform),null!=t.text?pW(e,e.getBoundingRect()):gW(e)}}},lW={},uW=new On,hW={},cW=[],dW={left:"start",right:"end",center:"middle",middle:"middle"},pW=function(e,t){var i=e.style,n=e.transform,a=e instanceof Fl||i.transformText;e.__dirty&&xr.normalizeTextStyle(i,!0);var r=i.text;if(null!=r&&(r+=""),xr.needDrawText(r,i)){null==r&&(r=""),!a&&n&&(uW.copy(t),uW.applyTransform(n),t=uW);var o=e.__textSvgEl;o||(o=UH("text"),e.__textSvgEl=o);var s=o.style,l=i.font||Ha.DEFAULT_FONT,u=o.__computedFont;l!==o.__styleFont&&(s.font=o.__styleFont=l,u=o.__computedFont=s.font);var h=i.textPadding,c=i.textLineHeight,d=e.__textCotentBlock;d&&!e.__dirtyText||(d=e.__textCotentBlock=Ha.parsePlainText(r,u,h,c,i.truncate));var p=d.outerHeight,f=d.lineHeight;xr.getBoxPosition(hW,e,i,t);var g=hW.baseX,m=hW.baseY,v=hW.textAlign||"left",y=hW.textVerticalAlign;!function(e,t,i,n,a,r,o){ri.identity(cW),t&&i&&ri.copy(cW,i);var s=n.textRotation;if(a&&s){var l=n.textOrigin;"center"===l?(r=a.width/2+a.x,o=a.height/2+a.y):l&&(r=l[0]+a.x,o=l[1]+a.y),cW[4]-=r,cW[5]-=o,ri.rotate(cW,cW,s),cW[4]+=r,cW[5]+=o}nW(e,cW)}(o,a,n,i,t,g,m);var x=g,_=Ha.adjustTextY(m,p,y);h&&(x=function(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}(g,v,h),_+=h[0]),_+=f/2,rW(o,i,!0,e);var b=d.canCacheByTextString,w=e.__tspanList||(e.__tspanList=[]),S=w.length;if(b&&e.__canCacheByTextString&&e.__text===r){if(e.__dirtyText&&S)for(var M=0;M<S;++M)fW(w[M],v,x,_+M*f)}else{e.__text=r,e.__canCacheByTextString=b;var I=d.lines,A=I.length;for(M=0;M<A;M++){var T=w[M],C=I[M];T?T.__zrText!==C&&(T.innerHTML="",T.appendChild(document.createTextNode(C))):(T=w[M]=UH("tspan"),o.appendChild(T),T.appendChild(document.createTextNode(C))),fW(T,v,x,_+M*f)}if(S>A){for(;M<S;M++)o.removeChild(w[M]);w.length=A}}}};function fW(e,t,i,n){aW(e,"dominant-baseline","middle"),aW(e,"text-anchor",dW[t]),aW(e,"x",i),aW(e,"y",n)}function gW(e){e&&e.__textSvgEl&&(e.__textSvgEl.parentNode&&e.__textSvgEl.parentNode.removeChild(e.__textSvgEl),e.__textSvgEl=null,e.__tspanList=[],e.__text=null)}lW.drawRectText=pW,lW.brush=function(e){null!=e.style.text?pW(e,!1):gW(e)};var mW={path:oW,image:sW,text:lW};function vW(){}function yW(e,t,i,n){for(var a=0,r=t.length,o=0,s=0;a<r;a++){var l=t[a];if(l.removed){for(u=[],h=s;h<s+l.count;h++)u.push(h);l.indices=u,s+=l.count}else{for(var u=[],h=o;h<o+l.count;h++)u.push(h);l.indices=u,o+=l.count,l.added||(s+=l.count)}}return t}function xW(e){return{newPos:e.newPos,components:e.components.slice(0)}}vW.prototype={diff:function(e,t,i){i||(i=function(e,t){return e===t}),this.equals=i;var n=this;e=e.slice();var a=(t=t.slice()).length,r=e.length,o=1,s=a+r,l=[{newPos:-1,components:[]}],u=this.extractCommon(l[0],t,e,0);if(l[0].newPos+1>=a&&u+1>=r){for(var h=[],c=0;c<t.length;c++)h.push(c);return[{indices:h,count:t.length}]}function d(){for(var i=-1*o;i<=o;i+=2){var s,u=l[i-1],h=l[i+1],c=(h?h.newPos:0)-i;u&&(l[i-1]=void 0);var d=u&&u.newPos+1<a,p=h&&0<=c&&c<r;if(d||p){if(!d||p&&u.newPos<h.newPos?(s=xW(h),n.pushComponent(s.components,void 0,!0)):((s=u).newPos++,n.pushComponent(s.components,!0,void 0)),c=n.extractCommon(s,t,e,i),s.newPos+1>=a&&c+1>=r)return yW(n,s.components);l[i]=s}else l[i]=void 0}o++}for(;o<=s;){var p=d();if(p)return p}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var a=t.length,r=i.length,o=e.newPos,s=o-n,l=0;o+1<a&&s+1<r&&this.equals(t[o+1],i[s+1]);)o++,s++,l++;return l&&e.components.push({count:l}),e.newPos=o,s},tokenize:function(e){return e.slice()},join:function(e){return e.slice()}};var _W=new vW;var bW=function(e,t,i){return _W.diff(e,t,i)},wW=WH.createElement,SW=mW.path,MW=mW.image,IW=mW.text;function AW(e,t,i,n,a){this._zrId=e,this._svgRoot=t,this._tagNames="string"==typeof i?[i]:i,this._markLabel=n,this._domName=a||"_dom",this.nextId=0}AW.prototype.createElement=wW,AW.prototype.getDefs=function(e){var t=this._svgRoot,i=this._svgRoot.getElementsByTagName("defs");return 0===i.length?e?((i=t.insertBefore(this.createElement("defs"),t.firstChild)).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):null:i[0]},AW.prototype.update=function(e,t){if(e){var i=this.getDefs(!1);if(e[this._domName]&&i.contains(e[this._domName]))"function"==typeof t&&t(e);else{var n=this.add(e);n&&(e[this._domName]=n)}}},AW.prototype.addDom=function(e){this.getDefs(!0).appendChild(e)},AW.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},AW.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return Fe.each(this._tagNames,(function(i){var n=e.getElementsByTagName(i);t=t.concat([].slice.call(n))})),t},AW.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;Fe.each(e,(function(e){e[t._markLabel]="0"}))},AW.prototype.markUsed=function(e){e&&(e[this._markLabel]="1")},AW.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;Fe.each(t,(function(t){"1"!==t[i._markLabel]&&e.removeChild(t)}))}},AW.prototype.getSvgProxy=function(e){return e instanceof xl?SW:e instanceof Tr?MW:e instanceof Fl?IW:SW},AW.prototype.getTextSvgElement=function(e){return e.__textSvgEl},AW.prototype.getSvgElement=function(e){return e.__svgEl};var TW=AW;function CW(e,t){TW.call(this,e,t,["linearGradient","radialGradient"],"__gradient_in_use__")}Fe.inherits(CW,TW),CW.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var i=this;Fe.each(["fill","stroke"],(function(n){if(t.style[n]&&("linear"===t.style[n].type||"radial"===t.style[n].type)){var a,r=t.style[n],o=i.getDefs(!0);r._dom?(a=r._dom,o.contains(r._dom)||i.addDom(a)):a=i.add(r),i.markUsed(t);var s=a.getAttribute("id");e.setAttribute(n,"url(#"+s+")")}}))}},CW.prototype.add=function(e){var t;if("linear"===e.type)t=this.createElement("linearGradient");else{if("radial"!==e.type)return 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},CW.prototype.update=function(e){var t=this;TW.prototype.update.call(this,e,(function(){var i=e.type,n=e._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?t.updateDom(e,e._dom):(t.removeDom(e),t.add(e))}))},CW.prototype.updateDom=function(e,t){if("linear"===e.type)t.setAttribute("x1",e.x),t.setAttribute("y1",e.y),t.setAttribute("x2",e.x2),t.setAttribute("y2",e.y2);else{if("radial"!==e.type)return;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 i=e.colorStops,n=0,a=i.length;n<a;++n){var r=this.createElement("stop");r.setAttribute("offset",100*i[n].offset+"%");var o=i[n].color;if(o.indexOf(!1)){var s=Zi.parse(o)[3],l=Zi.toHex(o);r.setAttribute("stop-color","#"+l),r.setAttribute("stop-opacity",s)}else r.setAttribute("stop-color",i[n].color);t.appendChild(r)}e._dom=t},CW.prototype.markUsed=function(e){if(e.style){var t=e.style.fill;t&&t._dom&&TW.prototype.markUsed.call(this,t._dom),(t=e.style.stroke)&&t._dom&&TW.prototype.markUsed.call(this,t._dom)}};var DW=CW;function LW(e,t){TW.call(this,e,t,"clipPath","__clippath_in_use__")}Fe.inherits(LW,TW),LW.prototype.update=function(e){var t=this.getSvgElement(e);t&&this.updateDom(t,e.__clipPaths,!1);var i=this.getTextSvgElement(e);i&&this.updateDom(i,e.__clipPaths,!0),this.markUsed(e)},LW.prototype.updateDom=function(e,t,i){if(t&&t.length>0){var n,a,r=this.getDefs(!0),o=t[0],s=i?"_textDom":"_dom";o[s]?(a=o[s].getAttribute("id"),n=o[s],r.contains(n)||r.appendChild(n)):(a="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",a),r.appendChild(n),o[s]=n);var l=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var u=Array.prototype.slice.call(o.transform);ri.mul(o.transform,o.parent.invTransform,o.transform),l.brush(o),o.transform=u}else l.brush(o);var h=this.getSvgElement(o);n.innerHTML="",n.appendChild(h.cloneNode()),e.setAttribute("clip-path","url(#"+a+")"),t.length>1&&this.updateDom(n,t.slice(1),i)}else e&&e.setAttribute("clip-path","none")},LW.prototype.markUsed=function(e){var t=this;e.__clipPaths&&Fe.each(e.__clipPaths,(function(e){e._dom&&TW.prototype.markUsed.call(t,e._dom),e._textDom&&TW.prototype.markUsed.call(t,e._textDom)}))};var PW=LW;function kW(e,t){TW.call(this,e,t,["filter"],"__filter_in_use__","_shadowDom")}function OW(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY||e.textShadowBlur||e.textShadowOffsetX||e.textShadowOffsetY)}Fe.inherits(kW,TW),kW.prototype.addWithoutUpdate=function(e,t){if(t&&OW(t.style)){var i;if(t._shadowDom)i=t._shadowDom,this.getDefs(!0).contains(t._shadowDom)||this.addDom(i);else i=this.add(t);this.markUsed(t);var n=i.getAttribute("id");e.style.filter="url(#"+n+")"}},kW.prototype.add=function(e){var t=this.createElement("filter");return e._shadowDomId=e._shadowDomId||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-shadow-"+e._shadowDomId),this.updateDom(e,t),this.addDom(t),t},kW.prototype.update=function(e,t){if(OW(t.style)){var i=this;TW.prototype.update.call(this,t,(function(){i.updateDom(t,t._shadowDom)}))}else this.remove(e,t)},kW.prototype.remove=function(e,t){null!=t._shadowDomId&&(this.removeDom(e),e.style.filter="")},kW.prototype.updateDom=function(e,t){var i=t.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,a,r,o,s=e.style,l=e.scale&&e.scale[0]||1,u=e.scale&&e.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,a=s.shadowOffsetY||0,r=s.shadowBlur,o=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(t,s);n=s.textShadowOffsetX||0,a=s.textShadowOffsetY||0,r=s.textShadowBlur,o=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",a/u),i.setAttribute("flood-color",o);var h=r/2/l+" "+r/2/u;i.setAttribute("stdDeviation",h),t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width",Math.ceil(r/2*200)+"%"),t.setAttribute("height",Math.ceil(r/2*200)+"%"),t.appendChild(i),e._shadowDom=t},kW.prototype.markUsed=function(e){e._shadowDom&&TW.prototype.markUsed.call(this,e._shadowDom)};var RW=kW,EW=WH.createElement,NW=mW.path,zW=mW.image,BW=mW.text;function VW(e){return parseInt(e,10)}function GW(e,t){return t&&e&&t.parentNode!==e}function FW(e,t,i){if(GW(e,t)&&i){var n=i.nextSibling;n?e.insertBefore(t,n):e.appendChild(t)}}function HW(e,t){if(GW(e,t)){var i=e.firstChild;i?e.insertBefore(t,i):e.appendChild(t)}}function WW(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function UW(e){return e.__textSvgEl}function jW(e){return e.__svgEl}var ZW=function(e,t,i,n){this.root=e,this.storage=t,this._opts=i=Fe.extend({},i||{});var a=EW("svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),a.setAttribute("baseProfile","full"),a.style.cssText="user-select:none;position:absolute;left:0;top:0;";var r=EW("g");a.appendChild(r);var o=EW("g");a.appendChild(o),this.gradientManager=new DW(n,o),this.clipPathManager=new PW(n,o),this.shadowManager=new RW(n,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=a,this._svgRoot=o,this._backgroundRoot=r,this._viewport=s,e.appendChild(s),s.appendChild(a),this.resize(i.width,i.height),this._visibleList=[]};ZW.prototype={constructor:ZW,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},setBackgroundColor:function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=EW("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},_paintList:function(e){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var t,i,n=this._svgRoot,a=this._visibleList,r=e.length,o=[];for(t=0;t<r;t++){var s=e[t],l=(i=s)instanceof xl?NW:i instanceof Tr?zW:i instanceof Fl?BW:NW,u=jW(s)||UW(s);s.invisible||(s.__dirty&&(l&&l.brush(s),this.clipPathManager.update(s),s.style&&(this.gradientManager.update(s.style.fill),this.gradientManager.update(s.style.stroke),this.shadowManager.update(u,s)),s.__dirty=!1),o.push(s))}var h,c=bW(a,o);for(t=0;t<c.length;t++){if((f=c[t]).removed)for(var d=0;d<f.count;d++){u=jW(s=a[f.indices[d]]);var p=UW(s);WW(n,u),WW(n,p)}}for(t=0;t<c.length;t++){var f;if((f=c[t]).added)for(d=0;d<f.count;d++){u=jW(s=o[f.indices[d]]),p=UW(s);h?FW(n,u,h):HW(n,u),u?FW(n,p,u):h?FW(n,p,h):HW(n,p),FW(n,p,u),h=p||u||h,this.gradientManager.addWithoutUpdate(u||p,s),this.shadowManager.addWithoutUpdate(u||p,s),this.clipPathManager.markUsed(s)}else if(!f.removed)for(d=0;d<f.count;d++){u=jW(s=o[f.indices[d]]),p=UW(s),u=jW(s),p=UW(s);this.gradientManager.markUsed(s),this.gradientManager.addWithoutUpdate(u||p,s),this.shadowManager.markUsed(s),this.shadowManager.addWithoutUpdate(u||p,s),this.clipPathManager.markUsed(s),p&&FW(n,p,u),h=u||p||h}}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=o},_getDefs:function(e){var t,i=this._svgDom;return 0===(t=i.getElementsByTagName("defs")).length?e?((t=i.insertBefore(EW("defs"),i.firstChild)).contains||(t.contains=function(e){var i=t.children;if(!i)return!1;for(var n=i.length-1;n>=0;--n)if(i[n]===e)return!0;return!1}),t):null:t[0]},resize:function(e,t){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var a=i.style;a.width=e+"px",a.height=t+"px";var r=this._svgDom;r.setAttribute("width",e),r.setAttribute("height",t)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],r=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||VW(s[i])||VW(o.style[i]))-(VW(s[a])||0)-(VW(s[r])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/></g,">\n\r<"))}},Fe.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(e){ZW.prototype[e]=function(){}}));var YW=ZW;(0,xo.registerPainter)("svg",YW);var XW=f(g((function(e,t){!function(){for(var e in U_){if(null==U_||!U_.hasOwnProperty(e)||"default"===e||"__esModule"===e)return;t[e]=U_[e]}}(),function(){for(var e in W_){if(null==W_||!W_.hasOwnProperty(e)||"default"===e||"__esModule"===e)return;t[e]=W_[e]}}()})));U_.extendSeriesModel({type:"series.liquidFill",visualColorAccessPath:"textStyle.normal.color",optionUpdated:function(){var e=this.option;e.gridSize=Math.max(Math.floor(e.gridSize),4)},getInitialData:function(e,t){var i=jv(["value"],e.data),n=new U_.List(i,this);return n.initData(e.data),n},defaultOption:{color:["#294D99","#156ACF","#1598ED","#45BDFF"],center:["50%","50%"],radius:"50%",amplitude:"8%",waveLength:"80%",phase:"auto",period:"auto",direction:"right",shape:"circle",waveAnimation:!0,animationEasing:"linear",animationEasingUpdate:"linear",animationDuration:2e3,animationDurationUpdate:1e3,outline:{show:!0,borderDistance:8,itemStyle:{color:"none",borderColor:"#294D99",borderWidth:8,shadowBlur:20,shadowColor:"rgba(0, 0, 0, 0.25)"}},backgroundStyle:{color:"#E3F7FF"},itemStyle:{opacity:.95,shadowBlur:50,shadowColor:"rgba(0, 0, 0, 0.4)"},label:{show:!0,color:"#294D99",insideColor:"#fff",fontSize:50,fontWeight:"bold",align:"center",baseline:"middle",position:"inside"},emphasis:{itemStyle:{opacity:.8}}}});var qW=U_.graphic.extendShape({type:"ec-liquid-fill",shape:{waveLength:0,radius:0,radiusY:0,cx:0,cy:0,waterLevel:0,amplitude:0,phase:0,inverse:!1},buildPath:function(e,t){null==t.radiusY&&(t.radiusY=t.radius);for(var i=Math.max(2*Math.ceil(2*t.radius/t.waveLength*4),8);t.phase<2*-Math.PI;)t.phase+=2*Math.PI;for(;t.phase>0;)t.phase-=2*Math.PI;var n=t.phase/Math.PI/2*t.waveLength,a=t.cx-t.radius+n-2*t.radius;e.moveTo(a,t.waterLevel);for(var r=0,o=0;o<i;++o){var s=o%4,l=$W(o*t.waveLength/4,s,t.waveLength,t.amplitude);e.bezierCurveTo(l[0][0]+a,-l[0][1]+t.waterLevel,l[1][0]+a,-l[1][1]+t.waterLevel,l[2][0]+a,-l[2][1]+t.waterLevel),o===i-1&&(r=l[2][0])}t.inverse?(e.lineTo(r+a,t.cy-t.radiusY),e.lineTo(a,t.cy-t.radiusY),e.lineTo(a,t.waterLevel)):(e.lineTo(r+a,t.cy+t.radiusY),e.lineTo(a,t.cy+t.radiusY),e.lineTo(a,t.waterLevel)),e.closePath()}});function $W(e,t,i,n){return 0===t?[[e+.5*i/Math.PI/2,n/2],[e+.5*i/Math.PI,n],[e+i/4,n]]:1===t?[[e+.5*i/Math.PI/2*(Math.PI-2),n],[e+.5*i/Math.PI/2*(Math.PI-1),n/2],[e+i/4,0]]:2===t?[[e+.5*i/Math.PI/2,-n/2],[e+.5*i/Math.PI,-n],[e+i/4,-n]]:[[e+.5*i/Math.PI/2*(Math.PI-2),-n],[e+.5*i/Math.PI/2*(Math.PI-1),-n/2],[e+i/4,0]]}var KW=U_.number.parsePercent;U_.extendChartView({type:"liquidFill",render:function(e,t,i){var n=this.group;n.removeAll();var a=e.getData(),r=a.getItemModel(0),o=r.get("center"),s=r.get("radius"),l=i.getWidth(),u=i.getHeight(),h=Math.min(l,u),c=0,d=0,p=e.get("outline.show");p&&(c=e.get("outline.borderDistance"),d=KW(e.get("outline.itemStyle.borderWidth"),h));var f,g,m,v=KW(o[0],l),y=KW(o[1],u),x=!1,_=e.get("shape");("container"===_?(x=!0,g=[(f=[l/2,u/2])[0]-d/2,f[1]-d/2],m=[KW(c,l),KW(c,u)],s=[Math.max(g[0]-m[0],0),Math.max(g[1]-m[1],0)]):(g=(f=KW(s,h)/2)-d/2,m=KW(c,h),s=Math.max(g-m,0)),p)&&(T().style.lineWidth=d,n.add(T()));var b=x?0:v-s,w=x?0:y-s,S=null;n.add(function(){var t=A(s);t.setStyle(e.getModel("backgroundStyle").getItemStyle()),t.style.fill=null,t.z2=5;var i=A(s);i.setStyle(e.getModel("backgroundStyle").getItemStyle()),i.style.stroke=null;var n=new U_.graphic.Group;return n.add(t),n.add(i),n}());var M=this._data,I=[];function A(e,t){if(_){if(0===_.indexOf("path://")){var i=U_.graphic.makePath(_.slice(7),{}),n=i.getBoundingRect(),a=n.width,r=n.height;a>r?(r*=2*e/a,a=2*e):(a*=2*e/r,r=2*e);var o=t?0:v-a/2,s=t?0:y-r/2;return i=U_.graphic.makePath(_.slice(7),{},new U_.graphic.BoundingRect(o,s,a,r)),t&&(i.position=[-a/2,-r/2]),i}if(x){var l=t?-e[0]:v-e[0],u=t?-e[1]:y-e[1];return Hx.createSymbol("rect",l,u,2*e[0],2*e[1])}l=t?-e:v-e,u=t?-e:y-e;return"pin"===_?u+=e:"arrow"===_&&(u-=e),Hx.createSymbol(_,l,u,2*e,2*e)}return new U_.graphic.Circle({shape:{cx:t?0:v,cy:t?0:y,r:e}})}function T(){var t=A(f);return t.style.fill=null,t.setStyle(e.getModel("outline.itemStyle").getItemStyle()),t}function C(t,i,n){var r=x?s[0]:s,o=x?u/2:s,l=a.getItemModel(t),h=l.getModel("itemStyle"),c=l.get("phase"),d=KW(l.get("amplitude"),2*o),p=KW(l.get("waveLength"),2*r),f=o-a.get("value",t)*o*2;c=n?n.shape.phase:"auto"===c?t*Math.PI/4:c;var g=h.getItemStyle();if(!g.fill){var m=e.get("color"),_=t%m.length;g.fill=m[_]}var b=new qW({shape:{waveLength:p,radius:r,radiusY:o,cx:2*r,cy:0,waterLevel:f,amplitude:d,phase:c,inverse:i},style:g,position:[v,y]});b.shape._waterLevel=f;var w=l.getModel("emphasis.itemStyle").getItemStyle();w.lineWidth=0,U_.graphic.setHoverStyle(b,w);var S=A(s,!0);return S.setStyle({fill:"white"}),b.setClipPath(S),b}function D(e,t,i){var n=a.getItemModel(e),r=n.get("period"),o=n.get("direction"),s=a.get("value",e),l=n.get("phase");l=i?i.shape.phase:"auto"===l?e*Math.PI/4:l;var u=0;u="auto"===r?function(t){var i=a.count();return 0===i?t:t*(.2+(i-e)/i*.8)}(5e3):"function"==typeof r?r(s,e):r;var h=0;"right"===o||null==o?h=Math.PI:"left"===o?h=-Math.PI:"none"===o?h=0:console.error("Illegal direction value for liquid fill."),"none"!==o&&n.get("waveAnimation")&&t.animate("shape",!0).when(0,{phase:l}).when(u/2,{phase:h+l}).when(u,{phase:2*h+l}).during((function(){S&&S.dirty(!0)})).start()}a.diff(M).add((function(t){var i=C(t,!1),r=i.shape.waterLevel;i.shape.waterLevel=x?u/2:s,U_.graphic.initProps(i,{shape:{waterLevel:r}},e),i.z2=2,D(t,i,null),n.add(i),a.setItemGraphicEl(t,i),I.push(i)})).update((function(t,i){for(var r=M.getItemGraphicEl(i),o=C(t,!1,r),s={},l=["amplitude","cx","cy","phase","radius","radiusY","waterLevel","waveLength"],h=0;h<l.length;++h){var c=l[h];o.shape.hasOwnProperty(c)&&(s[c]=o.shape[c])}var d={},p=["fill","opacity","shadowBlur","shadowColor"];for(h=0;h<p.length;++h){c=p[h];o.style.hasOwnProperty(c)&&(d[c]=o.style[c])}x&&(s.radiusY=u/2),U_.graphic.updateProps(r,{shape:s},e),r.useStyle(d),r.position=o.position,r.setClipPath(o.clipPath),r.shape.inverse=o.inverse,D(t,r,r),n.add(r),a.setItemGraphicEl(t,r),I.push(r)})).remove((function(e){var t=M.getItemGraphicEl(e);n.remove(t)})).execute(),r.get("label.show")&&n.add(function(t){var i=r.getModel("label");function n(){var t=e.getFormattedLabel(0,"normal"),i=100*a.get("value",0),n=a.getName(0)||e.name;return isNaN(i)||(n=i.toFixed(0)+"%"),null==t?n:t}var o={z2:10,shape:{x:b,y:w,width:2*(x?s[0]:s),height:2*(x?s[1]:s)},style:{fill:"transparent",text:n(),textAlign:i.get("align"),textVerticalAlign:i.get("baseline")},silent:!0},l=new U_.graphic.Rect(o),u=i.get("color");U_.graphic.setText(l.style,i,u);var h=new U_.graphic.Rect(o),c=i.get("insideColor");U_.graphic.setText(h.style,i,c),h.style.textFill=c;var d=new U_.graphic.Group;d.add(l),d.add(h);var p=A(s,!0);return S=new U_.graphic.CompoundPath({shape:{paths:t},position:[v,y]}),S.setClipPath(p),h.setClipPath(S),d}(I)),this._data=a},dispose:function(){}}),U_.registerVisual(U_.util.curry(bM,"liquidFill"));let JW=class extends s.Component{constructor(e){super(e),this.chartRef=s.createRef(),this.padding="7vh 2vh 2vh",this.startColor="#0096ff",this.endColor="#00d8ff",this.state={data:0,ratio:0},this.renderChart=()=>{const e={title:{text:`${parseInt((100*this.state.ratio).toFixed(0))}{a|%}`,textStyle:{fontSize:14,lineHeight:14,color:"#cde0ff",rich:{a:{fontSize:10,verticalAlign:"bottom"}}},subtext:`${this.state.data}{a|人}`,subtextStyle:{fontSize:18,lineHeight:18,color:"#cde0ff",rich:{a:{fontSize:12,verticalAlign:"bottom"}}},left:"center",top:"18%"},series:[{type:"liquidFill",radius:"90%",center:["50%","50%"],data:Array.from({length:3}).fill(this.state.ratio),backgroundStyle:{color:"transparent"},outline:{borderDistance:2,itemStyle:{borderWidth:2,borderColor:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:this.startColor},{offset:1,color:this.endColor}],globalCoord:!1}}},itemStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:1,color:this.startColor},{offset:0,color:this.endColor}],globalCoord:!1}},label:{normal:{formatter:""}}}]};this.chart.setOption(e,{notMerge:!0})},i.reaction((()=>e.gpui.params.padding),(e=>{this.padding=e||"7vh 2vh 2vh"}),{fireImmediately:!0}),i.reaction((()=>({startColor:e.gpui.params.startColor,endColor:e.gpui.params.endColor})),(({startColor:e,endColor:t})=>{this.startColor=e||"#0096ff",this.endColor=t||"#00d8ff"}),{fireImmediately:!0})}componentDidMount(){this.chart=this.chart||XW.init(this.chartRef.current),window.addEventListener("resize",(()=>{this.chart.resize()})),i.reaction((()=>this.props.gpui.params),(({equipment_base_url:e,name:t,key:i,lims_gpui_headers:n})=>u(this,void 0,void 0,(function*(){if(console.log(this.props.gpui.params),e&&t){try{const t=new v({baseURL:e,headers:n}),a=yield t.call({method:"gpui/user/stat"}),r=yield t.call({method:"gpui/training/getStat"}),o=yield t.call({method:"gpui/equipment/getStat"});switch(i){case"trainingTotal":this.setState({data:r.totalCount,ratio:1});break;case"trainingPassRate":this.setState({data:r.passCount,ratio:r.passCount/r.totalCount});break;case"autoOptRate":this.setState({data:r.passCount,ratio:r.passCount/a.inner});break;case"equipmentAuxRate":this.setState({data:o.inchargeCount,ratio:o.inchargeEqs/o.totalCount})}}catch(e){console.error(e)}this.renderChart()}}))),{fireImmediately:!0})}render(){return s.createElement("div",{className:"g__index",style:{padding:this.padding}},s.createElement("div",{className:h},s.createElement("div",{ref:this.chartRef,className:c}),s.createElement("div",{className:d},this.props.gpui.params.name)))}};return l([i.observable],JW.prototype,"padding",void 0),l([i.observable],JW.prototype,"startColor",void 0),l([i.observable],JW.prototype,"endColor",void 0),JW=l([function(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),te&&e.$$typeof===te)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(ee&&e.$$typeof===ee){var i=e.render;if("function"!=typeof i)throw new Error("render property of ForwardRef was not a function");return t.forwardRef((function(){var e=arguments;return t.createElement(P,null,(function(){return i.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(t.Component,e)?q(e):D(e)}],JW),JW}));
