UNPKG

echarts

Version:

A powerful charting and visualization library for browser

22 lines (19 loc) 321 kB
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";var e=2311,n=function(){return e++},m="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(t){var e={},n=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);n&&(e.firefox=!0,e.version=n[1]);i&&(e.ie=!0,e.version=i[1]);r&&(e.edge=!0,e.version=r[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},l={"[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},h=Object.prototype.toString,i=Array.prototype,o=i.forEach,u=i.filter,r=i.slice,c=i.map,d=i.reduce,a={};function b(t){if(null==t||"object"!=typeof t)return t;var e=t,n=h.call(t);if("[object Array]"===n){if(!q(t)){e=[];for(var i=0,r=t.length;i<r;i++)e[i]=b(t[i])}}else if(l[n]){if(!q(t)){var a=t.constructor;if(t.constructor.from)e=a.from(t);else{e=new a(t.length);for(i=0,r=t.length;i<r;i++)e[i]=b(t[i])}}}else if(!s[n]&&!q(t)&&!B(t))for(var o in e={},t)t.hasOwnProperty(o)&&(e[o]=b(t[o]));return e}function f(t,e,n){if(!O(e)||!O(t))return n?b(e):t;for(var i in e)if(e.hasOwnProperty(i)){var r=t[i],a=e[i];!O(a)||!O(r)||L(a)||L(r)||B(a)||B(r)||E(a)||E(r)||q(a)||q(r)?!n&&i in t||(t[i]=b(e[i])):f(r,a,n)}return t}function S(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function k(t,e,n){for(var i in e)e.hasOwnProperty(i)&&(n?null!=e[i]:null==t[i])&&(t[i]=e[i]);return t}function p(){return a.createCanvas()}var g;function v(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n}return-1}function y(t,e){var n=t.prototype;function i(){}for(var r in i.prototype=e.prototype,t.prototype=new i,n)n.hasOwnProperty(r)&&(t.prototype[r]=n[r]);(t.prototype.constructor=t).superClass=e}function _(t,e,n){k(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,n)}function P(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function D(t,e,n){if(t&&e)if(t.forEach&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length)for(var i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(n,t[a],a,t)}function A(t,e,n){if(t&&e){if(t.map&&t.map===c)return t.map(e,n);for(var i=[],r=0,a=t.length;r<a;r++)i.push(e.call(n,t[r],r,t));return i}}function M(t,e,n,i){if(t&&e){if(t.reduce&&t.reduce===d)return t.reduce(e,n,i);for(var r=0,a=t.length;r<a;r++)n=e.call(i,n,t[r],r,t);return n}}function x(t,e,n){if(t&&e){if(t.filter&&t.filter===u)return t.filter(e,n);for(var i=[],r=0,a=t.length;r<a;r++)e.call(n,t[r],r,t)&&i.push(t[r]);return i}}function w(t,e){var n=r.call(arguments,2);return function(){return t.apply(e,n.concat(r.call(arguments)))}}function I(t){var e=r.call(arguments,1);return function(){return t.apply(this,e.concat(r.call(arguments)))}}function L(t){return"[object Array]"===h.call(t)}function T(t){return"function"==typeof t}function C(t){return"[object String]"===h.call(t)}function O(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function E(t){return!!s[h.call(t)]}function N(t){return!!l[h.call(t)]}function B(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function z(t){return t!=t}function R(){for(var t=0,e=arguments.length;t<e;t++)if(null!=arguments[t])return arguments[t]}function F(t,e){return null!=t?t:e}function V(t,e,n){return null!=t?t:null!=e?e:n}function W(){return Function.call.apply(r,arguments)}function H(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function G(t,e){if(!t)throw new Error(e)}function X(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}a.createCanvas=function(){return document.createElement("canvas")};var Y="__ec_primitive__";function U(t){t[Y]=!0}function q(t){return t[Y]}function j(t){var n=L(t);this.data={};var i=this;function e(t,e){n?i.set(t,e):i.set(e,t)}t instanceof j?t.each(e):t&&D(t,e)}function Z(t){return new j(t)}function $(){}j.prototype={constructor:j,get:function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},set:function(t,e){return this.data[t]=e},each:function(t,e){for(var n in void 0!==e&&(t=w(t,e)),this.data)this.data.hasOwnProperty(n)&&t(this.data[n],n)},removeKey:function(t){delete this.data[t]}};var K="undefined"==typeof Float32Array?Array:Float32Array;function Q(t,e){var n=new K(2);return null==t&&(t=0),null==e&&(e=0),n[0]=t,n[1]=e,n}function J(t){var e=new K(2);return e[0]=t[0],e[1]=t[1],e}function tt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function et(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function nt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function it(t,e){var n=function(t){return Math.sqrt(function(t){return t[0]*t[0]+t[1]*t[1]}(t))}(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t}function rt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var at=rt;var ot=function(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])};function st(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function lt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ht(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ut(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function ct(t,e){return{target:t,topTarget:e&&e.topTarget}}ut.prototype={constructor:ut,_dragStart:function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent;e&&((this._draggingTarget=e).dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(ct(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var n=t.offsetX,i=t.offsetY,r=n-this._x,a=i-this._y;this._x=n,this._y=i,e.drift(r,a,t),this.dispatchToElement(ct(e,t),"drag",t.event);var o=this.findHover(n,i,e).target,s=this._dropTarget;e!==(this._dropTarget=o)&&(s&&o!==s&&this.dispatchToElement(ct(s,t),"dragleave",t.event),o&&o!==s&&this.dispatchToElement(ct(o,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(ct(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(ct(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}};var dt=Array.prototype.slice,ft=function(t){this._$handlers={},this._$eventProcessor=t};function pt(t,e,n,i,r,a){var o=t._$handlers;if("function"==typeof n&&(r=i,i=n,n=null),!i||!e)return t;n=function(t,e){var n=t._$eventProcessor;return null!=e&&n&&n.normalizeQuery&&(e=n.normalizeQuery(e)),e}(t,n),o[e]||(o[e]=[]);for(var s=0;s<o[e].length;s++)if(o[e][s].h===i)return t;var l={h:i,one:a,query:n,ctx:r||t,callAtLast:i.zrEventfulCallAtLast},h=o[e].length-1,u=o[e][h];return u&&u.callAtLast?o[e].splice(h,0,l):o[e].push(l),t}ft.prototype={constructor:ft,one:function(t,e,n,i){return pt(this,t,e,n,i,!0)},on:function(t,e,n,i){return pt(this,t,e,n,i,!1)},isSilent:function(t){var e=this._$handlers;return!e[t]||!e[t].length},off:function(t,e){var n=this._$handlers;if(!t)return this._$handlers={},this;if(e){if(n[t]){for(var i=[],r=0,a=n[t].length;r<a;r++)n[t][r].h!==e&&i.push(n[t][r]);n[t]=i}n[t]&&0===n[t].length&&delete n[t]}else delete n[t];return this},trigger:function(t){var e=this._$handlers[t],n=this._$eventProcessor;if(e){var i=arguments,r=i.length;3<r&&(i=dt.call(i,1));for(var a=e.length,o=0;o<a;){var s=e[o];if(n&&n.filter&&null!=s.query&&!n.filter(t,s.query))o++;else{switch(r){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,i[1]);break;case 3:s.h.call(s.ctx,i[1],i[2]);break;default:s.h.apply(s.ctx,i)}s.one?(e.splice(o,1),a--):o++}}}return n&&n.afterTrigger&&n.afterTrigger(t),this},triggerWithContext:function(t){var e=this._$handlers[t],n=this._$eventProcessor;if(e){var i=arguments,r=i.length;4<r&&(i=dt.call(i,1,i.length-1));for(var a=i[i.length-1],o=e.length,s=0;s<o;){var l=e[s];if(n&&n.filter&&null!=l.query&&!n.filter(t,l.query))s++;else{switch(r){case 1:l.h.call(a);break;case 2:l.h.call(a,i[1]);break;case 3:l.h.call(a,i[1],i[2]);break;default:l.h.apply(a,i)}l.one?(e.splice(s,1),o--):s++}}}return n&&n.afterTrigger&&n.afterTrigger(t),this}};var gt=Math.log(2);function vt(t,e,n,i,r,a){var o=i+"-"+r,s=t.length;if(a.hasOwnProperty(o))return a[o];if(1===e){var l=Math.round(Math.log((1<<s)-1&~r)/gt);return t[n][l]}for(var h=i|1<<n,u=n+1;i&1<<u;)u++;for(var c=0,d=0,f=0;d<s;d++){var p=1<<d;p&r||(c+=(f%2?-1:1)*t[n][d]*vt(t,e-1,u,h,r|p,a),f++)}return a[o]=c}function mt(t,e){var n=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],i={},r=vt(n,8,0,0,0,i);if(0!==r){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)null==a[s]&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*vt(n,7,0===o?1:0,1<<o,1<<s,i)/r*e[o];return function(t,e,n){var i=e*a[6]+n*a[7]+1;t[0]=(e*a[0]+n*a[1]+a[2])/i,t[1]=(e*a[3]+n*a[4]+a[5])/i}}}var yt="___zrEVENTSAVED";function _t(t,e,n,i,r){if(e.getBoundingClientRect&&m.domSupported&&!xt(e)){var a=e[yt]||(e[yt]={}),o=function(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],a=e.srcCoords,o=!0,s=[],l=[],h=0;h<4;h++){var u=t[h].getBoundingClientRect(),c=2*h,d=u.left,f=u.top;s.push(d,f),o=o&&a&&d===a[c]&&f===a[1+c],l.push(t[h].offsetLeft,t[h].offsetTop)}return o&&r?r:(e.srcCoords=s,e[i]=n?mt(l,s):mt(s,l))}(function(t,e){var n=e.markers;if(n)return n;n=e.markers=[];for(var i=["left","right"],r=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,h=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[h]+":0",i[1-l]+":auto",r[1-h]+":auto",""].join("!important;"),t.appendChild(o),n.push(o)}return n}(e,a),a,r);if(o)return o(t,n,i),!0}return!1}function xt(t){return"CANVAS"===t.nodeName.toUpperCase()}var wt="undefined"!=typeof window&&!!window.addEventListener,bt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,St=[];function Mt(t,e,n,i){return n=n||{},i||!m.canvasSupported?It(t,e,n):m.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):It(t,e,n),n}function It(t,e,n){if(m.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(xt(t)){var a=t.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=r-a.top)}if(_t(St,t,i,r))return n.zrX=St[0],void(n.zrY=St[1])}n.zrX=n.zrY=0}function Tt(t){return t||window.event}function Ct(t,e,n){if(null!=(e=Tt(e)).zrX)return e;var i=e.type;if(i&&0<=i.indexOf("touch")){var r="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];r&&Mt(t,r,e,n)}else Mt(t,e,e,n),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&bt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function kt(){this._track=[]}var Dt=wt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function At(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}kt.prototype={constructor:kt,recognize:function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},a=0,o=i.length;a<o;a++){var s=i[a],l=Mt(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},_recognize:function(t){for(var e in Lt)if(Lt.hasOwnProperty(e)){var n=Lt[e](this._track,t);if(n)return n}}};var Lt={pinch:function(t,e){var n=t.length;if(n){var i=(t[n-1]||{}).points,r=(t[n-2]||{}).points||i;if(r&&1<r.length&&i&&1<i.length){var a=At(i)/At(r);isFinite(a)||(a=1),e.pinchScale=a;var o=function(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},Pt="silent";function Ot(){Dt(this.event)}function Et(){}Et.prototype.dispose=function(){};function Nt(t,e,n,i){ft.call(this),this.storage=t,this.painter=e,this.painterRoot=i,n=n||new Et,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,ut.call(this),this.setHandlerProxy(n)}var Bt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"];function zt(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var i,r=t;r;){if(r.clipPath&&!r.clipPath.contain(e,n))return!1;r.silent&&(i=!0),r=r.parent}return!i||Pt}return!1}function Rt(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}Nt.prototype={constructor:Nt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(D(Bt,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,n=t.zrY,i=Rt(this,e,n),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=i?{x:e,y:n}:this.findHover(e,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(o,"mousemove",t),s&&s!==a&&this.dispatchToElement(o,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,n=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&(n||this.trigger("globalout",{type:"globalout",event:t}))},resize:function(t){this._hovered={}},dispatch:function(t,e){var n=this[t];n&&n.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,a=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Ot}}(e,t,n);i&&(i[r]&&(a.cancelBubble=i[r].call(i,a)),i.trigger(e,a),i=i.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[r]&&t[r].call(t,a),t.trigger&&t.trigger(e,a)}))}},findHover:function(t,e,n){for(var i=this.storage.getDisplayList(),r={x:t,y:e},a=i.length-1;0<=a;a--){var o;if(i[a]!==n&&!i[a].ignore&&(o=zt(i[a],t,e))&&(r.topTarget||(r.topTarget=i[a]),o!==Pt)){r.target=i[a];break}}return r},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new kt);var n=this._gestureMgr;"start"===e&&n.clear();var i=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&n.clear(),i){var r=i.type;t.gestureEvent=r,this.dispatchToElement({target:i.target},r,i.event)}}},D(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(o){Nt.prototype[o]=function(t){var e,n,i=t.zrX,r=t.zrY,a=Rt(this,i,r);if("mouseup"===o&&a||(n=(e=this.findHover(i,r)).target),"mousedown"===o)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===o)this._upEl=n;else if("click"===o){if(this._downEl!==this._upEl||!this._downPoint||4<at(this._downPoint,[t.zrX,t.zrY]))return;this._downPoint=null}this.dispatchToElement(e,o,t)}}),_(Nt,ft),_(Nt,ut);var Ft="undefined"==typeof Float32Array?Array:Float32Array;function Vt(){var t=new Ft(6);return Wt(t),t}function Wt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Ht(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t}function Gt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Xt(t,e,n){var i=e[0],r=e[2],a=e[4],o=e[1],s=e[3],l=e[5],h=Math.sin(n),u=Math.cos(n);return t[0]=i*u+o*h,t[1]=-i*h+o*u,t[2]=r*u+s*h,t[3]=-r*h+u*s,t[4]=u*a+h*l,t[5]=u*l-h*a,t}function Yt(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function Ut(t,e){var n=e[0],i=e[2],r=e[4],a=e[1],o=e[3],s=e[5],l=n*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-o*r)*l,t[5]=(a*r-n*s)*l,t):null}var qt=Wt;function jt(t){return 5e-5<t||t<-5e-5}var Zt=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},$t=Zt.prototype;$t.transform=null,$t.needLocalTransform=function(){return jt(this.rotation)||jt(this.position[0])||jt(this.position[1])||jt(this.scale[0]-1)||jt(this.scale[1]-1)};var Kt=[];$t.updateTransform=function(){var t=this.parent,e=t&&t.transform,n=this.needLocalTransform(),i=this.transform;if(n||e){i=i||Vt(),n?this.getLocalTransform(i):qt(i),e&&(n?Ht(i,t.transform,i):function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(i,t.transform)),this.transform=i;var r=this.globalScaleRatio;if(null!=r&&1!==r){this.getGlobalScale(Kt);var a=Kt[0]<0?-1:1,o=Kt[1]<0?-1:1,s=((Kt[0]-a)*r+a)/Kt[0]||0,l=((Kt[1]-o)*r+o)/Kt[1]||0;i[0]*=s,i[1]*=s,i[2]*=l,i[3]*=l}this.invTransform=this.invTransform||Vt(),Ut(this.invTransform,i)}else i&&qt(i)},$t.getLocalTransform=function(t){return Zt.getLocalTransform(this,t)},$t.setTransform=function(t){var e=this.transform,n=t.dpr||1;e?t.setTransform(n*e[0],n*e[1],n*e[2],n*e[3],n*e[4],n*e[5]):t.setTransform(n,0,0,n,0,0)},$t.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var Qt=[],Jt=Vt();$t.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=this.position,r=this.scale;jt(e-1)&&(e=Math.sqrt(e)),jt(n-1)&&(n=Math.sqrt(n)),t[0]<0&&(e=-e),t[3]<0&&(n=-n),i[0]=t[4],i[1]=t[5],r[0]=e,r[1]=n,this.rotation=Math.atan2(-t[1]/n,t[0]/e)}},$t.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Ht(Qt,t.invTransform,e),e=Qt);var n=this.origin;n&&(n[0]||n[1])&&(Jt[4]=n[0],Jt[5]=n[1],Ht(Qt,e,Jt),Qt[4]-=n[0],Qt[5]-=n[1],e=Qt),this.setLocalTransform(e)}},$t.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1])):(t[0]=1,t[1]=1),t},$t.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&st(n,n,i),n},$t.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&st(n,n,i),n},Zt.getLocalTransform=function(t,e){qt(e=e||[]);var n=t.origin,i=t.scale||[1,1],r=t.rotation||0,a=t.position||[0,0];return n&&(e[4]-=n[0],e[5]-=n[1]),Yt(e,e,i),r&&Xt(e,e,r),n&&(e[4]+=n[0],e[5]+=n[1]),e[4]+=a[0],e[5]+=a[1],e};var te={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(e=!n||n<1?(n=1,.1):.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){return t*t*(2.70158*t-1.70158)},backOut:function(t){return--t*t*(2.70158*t+1.70158)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)},bounceIn:function(t){return 1-te.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*te.bounceIn(2*t):.5*te.bounceOut(2*t-1)+.5}};function ee(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}ee.prototype={constructor:ee,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var n=(t-this._startTime-this._pausedTime)/this._life;if(!(n<0)){n=Math.min(n,1);var i=this.easing,r="string"==typeof i?te[i]:i,a="function"==typeof r?r(n):n;return this.fire("frame",a),1===n?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};function ne(){this.head=null,this.tail=null,this._len=0}var ie=ne.prototype;ie.insert=function(t){var e=new ae(t);return this.insertEntry(e),e},ie.insertEntry=function(t){this.head?((this.tail.next=t).prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},ie.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},ie.len=function(){return this._len},ie.clear=function(){this.head=this.tail=null,this._len=0};function re(t){this._list=new ne,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null}var ae=function(t){this.value=t,this.next,this.prev},oe=re.prototype;oe.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&0<a){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=e:o=new ae(e),o.key=t,n.insertEntry(o),i[t]=o}return r},oe.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},oe.clear=function(){this._list.clear(),this._map={}};var se={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 le(t){return(t=Math.round(t))<0?0:255<t?255:t}function he(t){return t<0?0:1<t?1:t}function ue(t){return t.length&&"%"===t.charAt(t.length-1)?le(parseFloat(t)/100*255):le(parseInt(t,10))}function ce(t){return t.length&&"%"===t.charAt(t.length-1)?he(parseFloat(t)/100):he(parseFloat(t))}function de(t,e,n){return n<0?n+=1:1<n&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function fe(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function pe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var ge=new re(20),ve=null;function me(t,e){ve&&pe(ve,e),ve=ge.put(t,ve||e.slice())}function ye(t,e){if(t){e=e||[];var n=ge.get(t);if(n)return pe(e,n);var i,r=(t+="").replace(/ /g,"").toLowerCase();if(r in se)return pe(e,se[r]),me(t,e),e;if("#"===r.charAt(0))return 4===r.length?0<=(i=parseInt(r.substr(1),16))&&i<=4095?(fe(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),me(t,e),e):void fe(e,0,0,0,1):7===r.length?0<=(i=parseInt(r.substr(1),16))&&i<=16777215?(fe(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),me(t,e),e):void fe(e,0,0,0,1):void 0;var a=r.indexOf("("),o=r.indexOf(")");if(-1!==a&&o+1===r.length){var s=r.substr(0,a),l=r.substr(a+1,o-(a+1)).split(","),h=1;switch(s){case"rgba":if(4!==l.length)return void fe(e,0,0,0,1);h=ce(l.pop());case"rgb":return 3!==l.length?void fe(e,0,0,0,1):(fe(e,ue(l[0]),ue(l[1]),ue(l[2]),h),me(t,e),e);case"hsla":return 4!==l.length?void fe(e,0,0,0,1):(l[3]=ce(l[3]),_e(l,e),me(t,e),e);case"hsl":return 3!==l.length?void fe(e,0,0,0,1):(_e(l,e),me(t,e),e);default:return}}fe(e,0,0,0,1)}}function _e(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=ce(t[1]),r=ce(t[2]),a=r<=.5?r*(i+1):r+i-r*i,o=2*r-a;return fe(e=e||[],le(255*de(o,a,n+1/3)),le(255*de(o,a,n)),le(255*de(o,a,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function xe(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}var we=Array.prototype.slice;function be(t,e){return t[e]}function Se(t,e,n){t[e]=n}function Me(t,e,n){return(e-t)*n+t}function Ie(t,e,n){return.5<n?e:t}function Te(t,e,n,i,r){var a=t.length;if(1===r)for(var o=0;o<a;o++)i[o]=Me(t[o],e[o],n);else{var s=a&&t[0].length;for(o=0;o<a;o++)for(var l=0;l<s;l++)i[o][l]=Me(t[o][l],e[o][l],n)}}function Ce(t,e,n){var i=t.length,r=e.length;if(i!==r)if(r<i)t.length=r;else for(var a=i;a<r;a++)t.push(1===n?e[a]:we.call(e[a]));var o=t[0]&&t[0].length;for(a=0;a<t.length;a++)if(1===n)isNaN(t[a])&&(t[a]=e[a]);else for(var s=0;s<o;s++)isNaN(t[a][s])&&(t[a][s]=e[a][s])}function ke(t,e,n){if(t===e)return!0;var i=t.length;if(i!==e.length)return!1;if(1===n){for(var r=0;r<i;r++)if(t[r]!==e[r])return!1}else{var a=t[0].length;for(r=0;r<i;r++)for(var o=0;o<a;o++)if(t[r][o]!==e[r][o])return!1}return!0}function De(t,e,n,i,r,a,o,s,l){var h=t.length;if(1===l)for(var u=0;u<h;u++)s[u]=Ae(t[u],e[u],n[u],i[u],r,a,o);else{var c=t[0].length;for(u=0;u<h;u++)for(var d=0;d<c;d++)s[u][d]=Ae(t[u][d],e[u][d],n[u][d],i[u][d],r,a,o)}}function Ae(t,e,n,i,r,a,o){var s=.5*(n-t),l=.5*(i-e);return(2*(e-n)+s+l)*o+(-3*(e-n)-2*s-l)*a+s*r+e}function Le(t){if(P(t)){var e=t.length;if(P(t[0])){for(var n=[],i=0;i<e;i++)n.push(we.call(t[i]));return n}return we.call(t)}return t}function Pe(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function Oe(t,e,n,i,a,r){var o=t._getter,s=t._setter,l="spline"===e,h=i.length;if(h){var u,c=P(i[0].value),d=!1,f=!1,p=c?function(t){var e=t[t.length-1].value;return P(e&&e[0])?2:1}(i):0;i.sort(function(t,e){return t.time-e.time}),u=i[h-1].time;for(var g=[],v=[],m=i[0].value,y=!0,_=0;_<h;_++){g.push(i[_].time/u);var x=i[_].value;if(c&&ke(x,m,p)||!c&&x===m||(y=!1),"string"==typeof(m=x)){var w=ye(x);w?(x=w,d=!0):f=!0}v.push(x)}if(r||!y){var b=v[h-1];for(_=0;_<h-1;_++)c?Ce(v[_],b,p):!isNaN(v[_])||isNaN(b)||f||d||(v[_]=b);c&&Ce(o(t._target,a),b,p);var S,M,I,T,C,k=0,D=0;if(d)var A=[0,0,0,0];var L=new ee({target:t._target,life:u,loop:t._loop,delay:t._delay,onframe:function(t,e){var n;if(e<0)n=0;else if(e<D){for(n=Math.min(k+1,h-1);0<=n&&!(g[n]<=e);n--);n=Math.min(n,h-2)}else{for(n=k;n<h&&!(g[n]>e);n++);n=Math.min(n-1,h-2)}D=e;var i=g[(k=n)+1]-g[n];if(0!=i)if(S=(e-g[n])/i,l)if(I=v[n],M=v[0===n?n:n-1],T=v[h-2<n?h-1:n+1],C=v[h-3<n?h-1:n+2],c)De(M,I,T,C,S,S*S,S*S*S,o(t,a),p);else{if(d)r=De(M,I,T,C,S,S*S,S*S*S,A,1),r=Pe(A);else{if(f)return Ie(I,T,S);r=Ae(M,I,T,C,S,S*S,S*S*S)}s(t,a,r)}else if(c)Te(v[n],v[n+1],S,o(t,a),p);else{var r;if(d)Te(v[n],v[n+1],S,A,1),r=Pe(A);else{if(f)return Ie(v[n],v[n+1],S);r=Me(v[n],v[n+1],S)}s(t,a,r)}},ondestroy:n});return e&&"spline"!==e&&(L.easing=e),L}}}function Ee(t,e,n,i){this._tracks={},this._target=t,this._loop=e||!1,this._getter=n||be,this._setter=i||Se,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]}Ee.prototype={when:function(t,e){var n=this._tracks;for(var i in e)if(e.hasOwnProperty(i)){if(!n[i]){n[i]=[];var r=this._getter(this._target,i);if(null==r)continue;0!==t&&n[i].push({time:0,value:Le(r)})}n[i].push({time:t,value:e[i]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].pause();this._paused=!0},resume:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var t=this._doneList,e=t.length,n=0;n<e;n++)t[n].call(this)},start:function(t,e){function n(){--a||r._doneCallback()}var i,r=this,a=0;for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=Oe(this,t,n,this._tracks[o],o,e);s&&(this._clipList.push(s),a++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(t,e){l(t,e);for(var n=0;n<r._onframeList.length;n++)r._onframeList[n](t,e)}}return a||this._doneCallback(),this},stop:function(t){for(var e=this._clipList,n=this.animation,i=0;i<e.length;i++){var r=e[i];t&&r.onframe(this._target,1),n&&n.removeClip(r)}e.length=0},delay:function(t){return this._delay=t,this},done:function(t){return t&&this._doneList.push(t),this},getClips:function(){return this._clipList}};var Ne=1;"undefined"!=typeof window&&(Ne=Math.max(window.devicePixelRatio||1,1));var Be=Ne,ze=function(){};function Re(){this.animators=[]}var Fe=ze;function Ve(t,e,n,i,r,a,o,s){C(i)?(a=r,r=i,i=0):T(r)?(a=r,r="linear",i=0):T(i)?(a=i,i=0):n=T(n)?(a=n,500):n||500,t.stopAnimation(),function t(e,n,i,r,a,o,s){var l={};var h=0;for(var u in r)r.hasOwnProperty(u)&&(null!=i[u]?O(r[u])&&!P(r[u])?t(e,n?n+"."+u:u,i[u],r[u],a,o,s):(s?(l[u]=i[u],We(e,n,u,r[u])):l[u]=r[u],h++):null==r[u]||s||We(e,n,u,r[u]));0<h&&e.animate(n,!1).when(null==a?500:a,l).delay(o||0)}(t,"",t,e,n,i,s);var l=t.animators.slice(),h=l.length;function u(){--h||a&&a()}h||a&&a();for(var c=0;c<l.length;c++)l[c].done(u).start(r,o)}function We(t,e,n,i){if(e){var r={};r[e]={},r[e][n]=i,t.attr(r)}else t.attr(n,i)}Re.prototype={constructor:Re,animate:function(t,e){var n,i=!1,r=this,a=this.__zr;if(t){var o=t.split("."),s=r;i="shape"===o[0];for(var l=0,h=o.length;l<h;l++)s=s&&s[o[l]];s&&(n=s)}else n=r;if(n){var u=r.animators,c=new Ee(n,e);return c.during(function(t){r.dirty(i)}).done(function(){u.splice(v(u,c),1)}),u.push(c),a&&a.animation.addAnimator(c),c}Fe('Property "'+t+'" is not existed in element '+r.id)},stopAnimation:function(t){for(var e=this.animators,n=e.length,i=0;i<n;i++)e[i].stop(t);return e.length=0,this},animateTo:function(t,e,n,i,r,a){Ve(this,t,e,n,i,r,a)},animateFrom:function(t,e,n,i,r,a){Ve(this,t,e,n,i,r,a,!0)}};var He=function(t){Zt.call(this,t),ft.call(this,t),Re.call(this,t),this.id=t.id||n()};He.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var n=this.transform;(n=n||(this.transform=[1,0,0,1,0,0]))[4]+=t,n[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var n=this[t];(n=n||(this[t]=[]))[0]=e[0],n[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(O(t))for(var n in t)t.hasOwnProperty(n)&&this.attrKV(n,t[n]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),(this.clipPath=t).__zr=e,(t.__clipTarget=this).dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.addAnimator(e[n]);this.clipPath&&this.clipPath.addSelfToZr(t)},removeSelfFromZr:function(t){this.__zr=null;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.removeAnimator(e[n]);this.clipPath&&this.clipPath.removeSelfFromZr(t)}},_(He,Re),_(He,Zt),_(He,ft);var Ge,Xe,Ye,Ue,qe=st,je=Math.min,Ze=Math.max;function $e(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}$e.prototype={constructor:$e,union:function(t){var e=je(t.x,this.x),n=je(t.y,this.y);this.width=Ze(t.x+t.width,this.x+this.width)-e,this.height=Ze(t.y+t.height,this.y+this.height)-n,this.x=e,this.y=n},applyTransform:(Ge=[],Xe=[],Ye=[],Ue=[],function(t){if(t){Ge[0]=Ye[0]=this.x,Ge[1]=Ue[1]=this.y,Xe[0]=Ue[0]=this.x+this.width,Xe[1]=Ye[1]=this.y+this.height,qe(Ge,Ge,t),qe(Xe,Xe,t),qe(Ye,Ye,t),qe(Ue,Ue,t),this.x=je(Ge[0],Xe[0],Ye[0],Ue[0]),this.y=je(Ge[1],Xe[1],Ye[1],Ue[1]);var e=Ze(Ge[0],Xe[0],Ye[0],Ue[0]),n=Ze(Ge[1],Xe[1],Ye[1],Ue[1]);this.width=e-this.x,this.height=n-this.y}}),calculateTransform:function(t){var e=t.width/this.width,n=t.height/this.height,i=Vt();return Gt(i,i,[-this.x,-this.y]),Yt(i,i,[e,n]),Gt(i,i,[t.x,t.y]),i},intersect:function(t){if(!t)return!1;t instanceof $e||(t=$e.create(t));var e=this,n=e.x,i=e.x+e.width,r=e.y,a=e.y+e.height,o=t.x,s=t.x+t.width,l=t.y,h=t.y+t.height;return!(i<o||s<n||a<l||h<r)},contain:function(t,e){var n=this;return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},clone:function(){return new $e(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},$e.create=function(t){return new $e(t.x,t.y,t.width,t.height)};var Ke=function(t){for(var e in t=t||{},He.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Ke.prototype={constructor:Ke,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,n=0;n<e.length;n++)if(e[n].name===t)return e[n]},childCount:function(){return this._children.length},add:function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},addBefore:function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var n=this._children,i=n.indexOf(e);0<=i&&(n.splice(i,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t);var e=(t.parent=this).__storage,n=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof Ke&&t.addChildrenToStorage(e)),n&&n.refresh()},remove:function(t){var e=this.__zr,n=this.__storage,i=this._children,r=v(i,t);return r<0||(i.splice(r,1),t.parent=null,n&&(n.delFromStorage(t),t instanceof Ke&&t.delChildrenFromStorage(n)),e&&e.refresh()),this},removeAll:function(){var t,e,n=this._children,i=this.__storage;for(e=0;e<n.length;e++)t=n[e],i&&(i.delFromStorage(t),t instanceof Ke&&t.delChildrenFromStorage(i)),t.parent=null;return n.length=0,this},eachChild:function(t,e){for(var n=this._children,i=0;i<n.length;i++){var r=n[i];t.call(e,r,i)}return this},traverse:function(t,e){for(var n=0;n<this._children.length;n++){var i=this._children[n];t.call(e,i),"group"===i.type&&i.traverse(t,e)}return this},addChildrenToStorage:function(t){for(var e=0;e<this._children.length;e++){var n=this._children[e];t.addToStorage(n),n instanceof Ke&&n.addChildrenToStorage(t)}},delChildrenFromStorage:function(t){for(var e=0;e<this._children.length;e++){var n=this._children[e];t.delFromStorage(n),n instanceof Ke&&n.delChildrenFromStorage(t)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(t){for(var e=null,n=new $e(0,0,0,0),i=t||this._children,r=[],a=0;a<i.length;a++){var o=i[a];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(r);l?(n.copy(s),n.applyTransform(l),(e=e||n.clone()).union(n)):(e=e||s.clone()).union(s)}}return e||n}},y(Ke,He);var Qe=32,Je=7;function tn(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r<n&&i(t[r],t[r-1])<0;)r++;!function(t,e,n){n--;for(;e<n;){var i=t[e];t[e++]=t[n],t[n--]=i}}(t,e,r)}else for(;r<n&&0<=i(t[r],t[r-1]);)r++;return r-e}function en(t,e,n,i,r){for(i===e&&i++;i<n;i++){for(var a,o=t[i],s=e,l=i;s<l;)r(o,t[a=s+l>>>1])<0?l=a:s=1+a;var h=i-s;switch(h){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0<h;)t[s+h]=t[s+h-1],h--}t[s]=o}}function nn(t,e,n,i,r,a){var o=0,s=0,l=1;if(0<a(t,e[n+r])){for(s=i-r;l<s&&0<a(t,e[n+r+l]);)(l=1+((o=l)<<1))<=0&&(l=s);s<l&&(l=s),o+=r,l+=r}else{for(s=r+1;l<s&&a(t,e[n+r-l])<=0;)(l=1+((o=l)<<1))<=0&&(l=s);s<l&&(l=s);var h=o;o=r-l,l=r-h}for(o++;o<l;){var u=o+(l-o>>>1);0<a(t,e[n+u])?o=u+1:l=u}return l}function rn(t,e,n,i,r,a){var o=0,s=0,l=1;if(a(t,e[n+r])<0){for(s=r+1;l<s&&a(t,e[n+r-l])<0;)(l=1+((o=l)<<1))<=0&&(l=s);s<l&&(l=s);var h=o;o=r-l,l=r-h}else{for(s=i-r;l<s&&0<=a(t,e[n+r+l]);)(l=1+((o=l)<<1))<=0&&(l=s);s<l&&(l=s),o+=r,l+=r}for(o++;o<l;){var u=o+(l-o>>>1);a(t,e[n+u])<0?l=u:o=u+1}return l}function an(p,g){var o,s,v=Je,l=0,m=[];function e(t){var e=o[t],n=s[t],i=o[t+1],r=s[t+1];s[t]=n+r,t===l-3&&(o[t+1]=o[t+2],s[t+1]=s[t+2]),l--;var a=rn(p[i],p,e,n,0,g);e+=a,0!==(n-=a)&&0!==(r=nn(p[e+n-1],p,i,r,r-1,g))&&(n<=r?function(t,e,n,i){var r=0;for(r=0;r<e;r++)m[r]=p[t+r];var a=0,o=n,s=t;if(p[s++]=p[o++],0==--i){for(r=0;r<e;r++)p[s+r]=m[a+r];return}if(1===e){for(r=0;r<i;r++)p[s+r]=p[o+r];return p[s+i]=m[a]}var l,h,u,c=v;for(;;){h=l=0,u=!1;do{if(g(p[o],m[a])<0){if(p[s++]=p[o++],h++,(l=0)==--i){u=!0;break}}else if(p[s++]=m[a++],l++,h=0,1==--e){u=!0;break}}while((l|h)<c);if(u)break;do{if(0!==(l=rn(p[o],m,a,e,0,g))){for(r=0;r<l;r++)p[s+r]=m[a+r];if(s+=l,a+=l,(e-=l)<=1){u=!0;break}}if(p[s++]=p[o++],0==--i){u=!0;break}if(0!==(h=nn(m[a],p,o,i,0,g))){for(r=0;r<h;r++)p[s+r]=p[o+r];if(s+=h,o+=h,0===(i-=h)){u=!0;break}}if(p[s++]=m[a++],1==--e){u=!0;break}c--}while(Je<=l||Je<=h);if(u)break;c<0&&(c=0),c+=2}if((v=c)<1&&(v=1),1===e){for(r=0;r<i;r++)p[s+r]=p[o+r];p[s+i]=m[a]}else{if(0===e)throw new Error;for(r=0;r<e;r++)p[s+r]=m[a+r]}}(e,n,i,r):function(t,e,n,i){var r=0;for(r=0;r<i;r++)m[r]=p[n+r];var a=t+e-1,o=i-1,s=n+i-1,l=0,h=0;if(p[s--]=p[a--],0==--e){for(l=s-(i-1),r=0;r<i;r++)p[l+r]=m[r];return}if(1===i){for(h=(s-=e)+1,l=(a-=e)+1,r=e-1;0<=r;r--)p[h+r]=p[l+r];return p[s]=m[o]}var u=v;for(;;){var c=0,d=0,f=!1;do{if(g(m[o],p[a])<0){if(p[s--]=p[a--],c++,(d=0)==--e){f=!0;break}}else if(p[s--]=m[o--],d++,c=0,1==--i){f=!0;break}}while((c|d)<u);if(f)break;do{if(0!==(c=e-rn(m[o],p,t,e,e-1,g))){for(e-=c,h=(s-=c)+1,l=(a-=c)+1,r=c-1;0<=r;r--)p[h+r]=p[l+r];if(0===e){f=!0;break}}if(p[s--]=m[o--],1==--i){f=!0;break}if(0!==(d=i-nn(p[a],m,0,i,i-1,g))){for(i-=d,h=(s-=d)+1,l=(o-=d)+1,r=0;r<d;r++)p[h+r]=m[l+r];if(i<=1){f=!0;break}}if(p[s--]=p[a--],0==--e){f=!0;break}u--}while(Je<=c||Je<=d);if(f)break;u<0&&(u=0),u+=2}(v=u)<1&&(v=1);if(1===i){for(h=(s-=e)+1,l=(a-=e)+1,r=e-1;0<=r;r--)p[h+r]=p[l+r];p[s]=m[o]}else{if(0===i)throw new Error;for(l=s-(i-1),r=0;r<i;r++)p[l+r]=m[r]}}(e,n,i,r))}o=[],s=[],this.mergeRuns=function(){for(;1<l;){var t=l-2;if(1<=t&&s[t-1]<=s[t]+s[t+1]||2<=t&&s[t-2]<=s[t]+s[t-1])s[t-1]<s[t+1]&&t--;else if(s[t]>s[t+1])break;e(t)}},this.forceMergeRuns=function(){for(;1<l;){var t=l-2;0<t&&s[t-1]<s[t+1]&&t--,e(t)}},this.pushRun=function(t,e){o[l]=t,s[l]=e,l+=1}}function on(t,e,n,i){n=n||0;var r=(i=i||t.length)-n;if(!(r<2)){var a=0;if(r<Qe)en(t,n,i,n+(a=tn(t,n,i,e)),e);else{var o=new an(t,e),s=function(t){for(var e=0;Qe<=t;)e|=1&t,t>>=1;return t+e}(r);do{if((a=tn(t,n,i,e))<s){var l=r;s<l&&(l=s),en(t,n,n+l,n+a,e),a=l}o.pushRun(n,a),o.mergeRuns(),r-=a,n+=a}while(0!==r);o.forceMergeRuns()}}}function sn(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function ln(){this._roots=[],this._displayList=[],this._displayListLen=0}ln.prototype={constructor:ln,traverse:function(t,e){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(t,e)},getDisplayList:function(t,e){return e=e||!1,t&&this.updateDisplayList(e),this._displayList},updateDisplayList:function(t){this._displayListLen=0;for(var e=this._roots,n=this._displayList,i=0,r=e.length;i<r;i++)this._updateAndAddDisplayable(e[i],null,t);n.length=this._displayListLen,m.canvasSupported&&on(n,sn)},_updateAndAddDisplayable:function(t,e,n){if(!t.ignore||n){t.beforeUpdate(),t.__dirty&&t.update(),t.afterUpdate();var i=t.clipPath;if(i){e=e?e.slice():[];for(var r=i,a=t;r;)r.parent=a,r.updateTransform(),e.push(r),r=(a=r).clipPath}if(t.isGroup){for(var o=t._children,s=0;s<o.length;s++){var l=o[s];t.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,e,n)}t.__dirty=!1}else t.__clipPaths=e,this._displayList[this._displayListLen++]=t}},addRoot:function(t){t.__storage!==this&&(t instanceof Ke&&t.addChildrenToStorage(this),this.addToStorage(t),this._roots.push(t))},delRoot:function(t){if(null==t){for(var e=0;e<this._roots.length;e++){var n=this._roots[e];n instanceof Ke&&n.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(t instanceof Array){e=0;for(var i=t.length;e<i;e++)this.delRoot(t[e])}else{var r=v(this._roots,t);0<=r&&(this.delFromStorage(t),this._roots.splice(r,1),t instanceof Ke&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:sn};var hn={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},un=function(t,e,n){return hn.hasOwnProperty(e)?n*t.dpr:n},cn={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},dn=9,fn=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],pn=function(t){this.extendFrom(t,!1)};function gn(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,a=null==e.y?0:e.y,o=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,r=r*n.width+n.x,a=a*n.height+n.y,o=o*n.height+n.y),i=isNaN(i)?0:i,r=isNaN(r)?1:r,a=isNaN(a)?0:a,o=isNaN(o)?0:o,t.createLinearGradient(i,a,r,o)}function vn(t,e,n){var i=n.width,r=n.height,a=Math.min(i,r),o=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(o=o*i+n.x,s=s*r+n.y,l*=a),t.createRadialGradient(o,s,0,o,s,l)}pn.prototype={constructor:pn,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(t,e,n){var i=this,r=n&&n.style,a=!r||t.__attrCachedBy!==cn.STYLE_BIND;t.__attrCachedBy=cn.STYLE_BIND;for(var o=0;o<fn.length;o++){var s=fn[o],l=s[0];!a&&i[l]===r[l]||(t[l]=un(t,l,i[l]||s[1]))}if(!a&&i.fill===r.fill||(t.fillStyle=i.fill),!a&&i.stroke===r.stroke||(t.strokeStyle=i.stroke),!a&&i.opacity===r.opacity||(t.globalAlpha=null==i.opacity?1:i.opacity),!a&&i.blend===r.blend||(t.globalCompositeOperation=i.blend||"source-over"),this.hasStroke()){var h=i.lineWidth;t.lineWidth=h/(this.strokeNoScale&&e&&e.getLineScale?e.getLineScale():1)}},hasFill:function(){var t=this.fill;return null!=t&&"none"!==t},hasStroke:function(){var t=this.stroke;return null!=t&&"none"!==t&&0<this.lineWidth},extendFrom:function(t,e){if(t)for(var n in t)!t.hasOwnProperty(n)||!0!==e&&(!1===e?this.hasOwnProperty(n):null==t[n])||(this[n]=t[n])},set:function(t,e){"string"==typeof t?