!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).zrender={})}(this,function(t){"use strict";var e=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},h=new function(){this.browser=new e,this.node=!1,this.wxa=!1,this.worker=!1,this.canvasSupported=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(h.wxa=!0,h.canvasSupported=!0,h.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(h.worker=!0,h.canvasSupported=!0):"undefined"==typeof navigator?(h.node=!0,h.canvasSupported=!0,h.svgSupported=!0):function(t,e){var i=e.browser,r=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);r&&(i.firefox=!0,i.version=r[1]);n&&(i.ie=!0,i.version=n[1]);o&&(i.edge=!0,i.version=o[1],i.newEdge=18<+o[1].split(".")[0]);a&&(i.weChat=!0);e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!i.ie&&!i.edge,e.pointerEventsSupported="onpointerdown"in window&&(i.edge||i.ie&&11<=+i.version),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(i.ie&&"transition"in s||i.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||i.ie&&9<=+i.version}(navigator.userAgent,h);var s={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},l={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},u=Object.prototype.toString,i=Array.prototype,a=i.forEach,p=i.filter,n=i.slice,c=i.map,r=function(){}.constructor,o=r?r.prototype:null,f={};var d=2311;function y(){return d++}function g(){for(var t=[],e=0;e>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[h]+":0",n[l]+":0",r[1-h]+":auto",n[1-l]+":auto",""].join("!important;"),t.appendChild(a),i.push(a)}return i}(e,o),o,n);if(a)return a(t,i,r),1}}function At(t){return"CANVAS"===t.nodeName.toUpperCase()}var Mt="undefined"!=typeof window&&!!window.addEventListener,Dt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Lt=[];function zt(t,e,i,r){return i=i||{},r||!h.canvasSupported?Rt(t,e,i):h.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):Rt(t,e,i),i}function Rt(t,e,i){if(h.domSupported&&t.getBoundingClientRect){var r=e.clientX,n=e.clientY;if(At(t)){var o=t.getBoundingClientRect();return i.zrX=r-o.left,void(i.zrY=n-o.top)}if(Pt(Lt,t,r,n))return i.zrX=Lt[0],void(i.zrY=Lt[1])}i.zrX=i.zrY=0}function Ot(t){return t||window.event}function It(t,e,i){if(null!=(e=Ot(e)).zrX)return e;var r,n,o=e.type;o&&0<=o.indexOf("touch")?(r="touchend"!==o?e.targetTouches[0]:e.changedTouches[0])&&zt(t,r,e,i):(zt(t,e,e,i),n=function(t){var e=t.wheelDelta;if(e)return e;var i=t.deltaX,r=t.deltaY;return null!=i&&null!=r?3*(0!==r?Math.abs(r):Math.abs(i))*(0r.getWidth()||i<0||i>r.getHeight()}k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){Zt.prototype[a]=function(t){var e,i,r=t.zrX,n=t.zrY,o=Qt(this,r,n);if("mouseup"===a&&o||(i=(e=this.findHover(r,n)).target),"mousedown"===a)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===a)this._upEl=i;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4>>1])<0?h=o:s=1+o;var l=r-s;switch(l){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>>1);0>>1);o(t,e[i+u])<0?h=u:a=u+1}return h}function ne(d,y){var a,s,g=Jt,h=0,v=(d.length,[]);function e(t){var e=a[t],i=s[t],r=a[t+1],n=s[t+1];s[t]=i+n,t===h-3&&(a[t+1]=a[t+2],s[t+1]=s[t+2]),h--;var o=re(d[r],d,e,i,0,y);e+=o,0!=(i-=o)&&0!==(n=ie(d[e+i-1],d,r,n,n-1,y))&&(i<=n?function(t,e,i,r){var n=0;for(n=0;ns[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(n);do{(o=te(t,i,r,e))=this._maxSize&&0>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,5===o?parseInt(r.slice(4),16)/15:1),Re(t,e),e):void Me(e,0,0,0,1):7===o||9===o?0<=(n=parseInt(r.slice(1,7),16))&&n<=16777215?(Me(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(r.slice(7),16)/255:1),Re(t,e),e):void Me(e,0,0,0,1):void 0;var a=r.indexOf("("),s=r.indexOf(")");if(-1!==a&&s+1===o){var h=r.substr(0,a),l=r.substr(a+1,s-(a+1)).split(","),u=1;switch(h){case"rgba":if(4!==l.length)return 3===l.length?Me(e,+l[0],+l[1],+l[2],1):Me(e,0,0,0,1);u=Ce(l.pop());case"rgb":return 3!==l.length?void Me(e,0,0,0,1):(Me(e,Te(l[0]),Te(l[1]),Te(l[2]),u),Re(t,e),e);case"hsla":return 4!==l.length?void Me(e,0,0,0,1):(l[3]=Ce(l[3]),Ie(l,e),Re(t,e),e);case"hsl":return 3!==l.length?void Me(e,0,0,0,1):(Ie(l,e),Re(t,e),e);default:return}}Me(e,0,0,0,1)}}function Ie(t,e){var i=(parseFloat(t[0])%360+360)%360/360,r=Ce(t[1]),n=Ce(t[2]),o=n<=.5?n*(r+1):n+r-n*r,a=2*n-o;return Me(e=e||[],ke(255*Pe(a,o,i+1/3)),ke(255*Pe(a,o,i)),ke(255*Pe(a,o,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Fe(t){var e=Oe(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Be(t,e,i){if(e&&e.length&&0<=t&&t<=1){i=i||[];var r=t*(e.length-1),n=Math.floor(r),o=Math.ceil(r),a=e[n],s=e[o],h=r-n;return i[0]=ke(Ae(a[0],s[0],h)),i[1]=ke(Ae(a[1],s[1],h)),i[2]=ke(Ae(a[2],s[2],h)),i[3]=Se(Ae(a[3],s[3],h)),i}}function Ee(t,e,i){if(e&&e.length&&0<=t&&t<=1){var r=t*(e.length-1),n=Math.floor(r),o=Math.ceil(r),a=Oe(e[n]),s=Oe(e[o]),h=r-n,l=He([ke(Ae(a[0],s[0],h)),ke(Ae(a[1],s[1],h)),ke(Ae(a[2],s[2],h)),Se(Ae(a[3],s[3],h))],"rgba");return i?{color:l,leftIndex:n,rightIndex:o,value:r}:l}}function He(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function Ne(t,e){var i=Oe(t);return i?(.299*i[0]+.587*i[1]+.114*i[2])*i[3]/255+(1-i[3])*e:0}var We=Object.freeze({__proto__:null,parse:Oe,lift:function(t,e){var i=Oe(t);if(i){for(var r=0;r<3;r++)i[r]=e<0?i[r]*(1-e)|0:(255-i[r])*e+i[r]|0,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var i,r=this.keyframes,n=r.length;if(this.interpolable)if(D(e)){var o,a=D((i=e)&&i[0])?2:1;if(0e);l++);l=Math.min(l-1,o-2)}var u,p,c,f,d,y,g,v,_,m,x=n[l+1],w=n[l];w&&x&&(this._lastFrame=l,this._lastFramePercent=e,0!=(u=x.percent-w.percent)&&(p=(e-w.percent)/u,c=i?this._additiveValue:h?$e:t[a],(0=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},ar.prototype.clone=function(){return new ar(this.x,this.y,this.width,this.height)},ar.prototype.copy=function(t){ar.copy(this,t)},ar.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},ar.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},ar.prototype.isZero=function(){return 0===this.width||0===this.height},ar.create=function(t){return new ar(t.x,t.y,t.width,t.height)},ar.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},ar.applyTransform=function(t,e,i){if(i){if(i[1]<1e-5&&-1e-5this._sleepAfterStill&&this.animation.stop())},Ir.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Ir.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Ir.prototype.addHover=function(t){},Ir.prototype.removeHover=function(t){},Ir.prototype.clearHover=function(){},Ir.prototype.refreshHover=function(){this._needsRefreshHover=!0},Ir.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},Ir.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Ir.prototype.clearAnimation=function(){this.animation.clear()},Ir.prototype.getWidth=function(){return this.painter.getWidth()},Ir.prototype.getHeight=function(){return this.painter.getHeight()},Ir.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Ir.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Ir.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Ir.prototype.on=function(t,e,i){return this.handler.on(t,e,i),this},Ir.prototype.off=function(t,e){this.handler.off(t,e)},Ir.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Ir.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;ethis._ux||n>this._uy;return this.addData(Tn.L,t,e),this._ctx&&o&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),o?(this._xi=t,this._yi=e,this._pendingPtDist=0):(i=r*r+n*n)>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=i),this},qn.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this.addData(Tn.C,t,e,i,r,n,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,i,r,n,o):this._ctx.bezierCurveTo(t,e,i,r,n,o)),this._xi=n,this._yi=o,this},qn.prototype.quadraticCurveTo=function(t,e,i,r){return this.addData(Tn.Q,t,e,i,r),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,i,r):this._ctx.quadraticCurveTo(t,e,i,r)),this._xi=i,this._yi=r,this},qn.prototype.arc=function(t,e,i,r,n,o){Wn[0]=r,Wn[1]=n,Un(Wn,o),r=Wn[0];var a=(n=Wn[1])-r;return this.addData(Tn.A,t,e,i,i,r,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,r,n,o),this._xi=On(n)*i+t,this._yi=In(n)*i+e,this},qn.prototype.arcTo=function(t,e,i,r,n){return this._ctx&&this._ctx.arcTo(t,e,i,r,n),this},qn.prototype.rect=function(t,e,i,r){return this._ctx&&this._ctx.rect(t,e,i,r),this.addData(Tn.R,t,e,i,r),this},qn.prototype.closePath=function(){this._drawPendingPt(),this.addData(Tn.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},qn.prototype.fill=function(t){t&&t.fill(),this.toStatic()},qn.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},qn.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,i=0;il.length&&(this._expandData(),l=this.data);for(var u=0;ui||Bn(g)>r||p===e-1)&&(d=Math.sqrt(M*M+g*g),n=y,o=m);break;case Tn.C:var v=t[p++],_=t[p++],y=t[p++],m=t[p++],x=t[p++],w=t[p++],d=function(t,e,i,r,n,o,a,s,h){for(var l=t,u=e,p=0,c=1/h,f=1;f<=h;f++){var d=f*c,y=an(t,i,n,a,d),g=an(e,r,o,s,d),v=y-l,_=g-u;p+=Math.sqrt(v*v+_*_),l=y,u=g}return p}(n,o,v,_,y,m,x,w,10),n=x,o=w;break;case Tn.Q:d=function(t,e,i,r,n,o,a){for(var s=t,h=e,l=0,u=1/a,p=1;p<=a;p++){var c=p*u,f=un(t,i,n,c),d=un(e,r,o,c),y=f-s,g=d-h;l+=Math.sqrt(y*y+g*g),s=f,h=d}return l}(n,o,v=t[p++],_=t[p++],y=t[p++],m=t[p++],10),n=y,o=m;break;case Tn.A:var b=t[p++],k=t[p++],S=t[p++],T=t[p++],C=t[p++],P=t[p++],A=P+C;p+=1,t[p++],f&&(a=On(C)*S+b,s=In(C)*T+k),d=Rn(S,T)*zn(Hn,Math.abs(P)),n=On(A)*S+b,o=In(A)*T+k;break;case Tn.R:a=n=t[p++],s=o=t[p++],d=2*t[p++]+2*t[p++];break;case Tn.Z:var M=a-n,g=s-o;d=Math.sqrt(M*M+g*g),n=a,o=s}0<=d&&(l+=h[u++]=d)}return this._pathLen=l},qn.prototype.rebuildPath=function(t,e){var i,r,n,o,a,s,h,l,u,p,c=this.data,f=this._ux,d=this._uy,y=this._len,g=e<1,v=0,_=0,m=0;if(!g||(this._pathSegLen||this._calculateLength(),h=this._pathSegLen,l=e*this._pathLen))t:for(var x=0;x=ro[r=0]+t&&a<=ro[1]+t?p:0}nMath.PI/2&&d<1.5*Math.PI&&(p=-p),c+=p))}return c}(v,_,x,w,w+b,k,C,n);u=Math.cos(w+b)*m+v,p=Math.sin(w+b)*x+_;break;case to.R:c=u=s[d++],f=p=s[d++];if(S=c+s[d++],T=f+s[d++],i){if(Gn(c,f,S,f,e,r,n)||Gn(S,f,S,T,e,r,n)||Gn(S,T,c,T,e,r,n)||Gn(c,T,c,f,e,r,n))return!0}else l+=Jn(S,f,S,T,r,n),l+=Jn(c,T,c,f,r,n);break;case to.Z:if(i){if(Gn(u,p,c,f,e,r,n))return!0}else l+=Jn(u,p,c,f,r,n);u=c,p=f}}return i||(o=p,a=f,Math.abs(o-a)=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,i,r){for(var n=0,o=0,a=t.length;oo){0r.width&&(o=e.split("\n"),y=!0),r.accumWidth=l):(u=js(e,d,r.width,r.breakAll,r.accumWidth),r.accumWidth=u.accumWidth+h,a=u.linesWidths,o=u.lines)):o=e.split("\n");for(var g=0;gr.len()&&(l=c}}for(var o,a=this.__startIndex;an[0]){for(h=0;ht);h++);s=r[n[h]]}n.splice(h+1,0,t),(r[t]=e).virtual||(s?(i=s.dom).nextSibling?a.insertBefore(e.dom,i.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else g("Layer of zlevel "+t+" is not valid")},Bl.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,r=0;r=p&&c<=e+1){for(var i=[],r=0;r=p&&c<=o+1)return function(t){for(var e=0,i=t.length,r=0,n=0;e\n\r<"))},Fu);function Fu(t,e,i,r){this.type="svg",this.refreshHover=Bu("refreshHover"),this.pathToImage=Bu("pathToImage"),this.configLayer=Bu("configLayer"),this.root=t,this.storage=e,this._opts=i=m({},i||{});var n=El("svg");n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.setAttribute("version","1.1"),n.setAttribute("baseProfile","full"),n.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=El("g");n.appendChild(o);var a=El("g");n.appendChild(a),this._gradientManager=new fu(r,a),this._patternManager=new xu(r,a),this._clipPathManager=new Su(r,a),this._shadowManager=new Pu(r,a);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=n,this._svgRoot=a,this._backgroundRoot=o,this._viewport=s,t.appendChild(s),s.appendChild(n),this.resize(i.width,i.height),this._visibleList=[]}function Bu(t){return function(){g('In SVG mode painter not support method "'+t+'"')}}Fr("canvas",Fl),Fr("svg",Iu),t.Arc=ah,t.ArcShape=oh,t.BezierCurve=ch,t.BezierCurveShape=lh,t.BoundingRect=or,t.Circle=Yo,t.CircleShape=Uo,t.CompoundPath=Cs,t.Droplet=gh,t.DropletShape=yh,t.Element=kr,t.Ellipse=ea,t.EllipseShape=ta,t.Group=Mr,t.Heart=xh,t.HeartShape=mh,t.Image=No,t.IncrementalDisplayable=Ds,t.Isogon=Ph,t.IsogonShape=Ch,t.Line=aa,t.LineShape=oa,t.LinearGradient=wa,t.OrientedBoundingRect=nl,t.Path=fo,t.Pattern=Jh,t.Point=Zi,t.Polygon=ca,t.PolygonShape=pa,t.Polyline=ga,t.PolylineShape=ya,t.RadialGradient=Sa,t.Rect=Qo,t.RectShape=Zo,t.Ring=Lh,t.RingShape=Dh,t.Rose=Eh,t.RoseShape=Bh,t.Sector=cs,t.SectorShape=ps,t.Star=jh,t.StarShape=Yh,t.TSpan=Ma,t.Text=Zs,t.Trochoid=Qh,t.TrochoidShape=Kh,t.color=We,t.dispose=function(t){t.dispose()},t.disposeAll=function(){for(var t in Rr)Rr.hasOwnProperty(t)&&Rr[t].dispose();Rr={}},t.getInstance=function(t){return Rr[t]},t.init=function(t,e){var i=new Or(y(),t,e);return Rr[i.id]=i},t.matrix=Hi,t.morphPath=function(t,e,i){var r,n;if(!t||!e)return e;t.path||t.createPathProxy(),(r=t.path).beginPath(),t.buildPath(r,t.shape),e.path||e.createPathProxy(),(n=e.path)===r&&(n=new jn(!1)),n.beginPath(),Ss(e)?e.__oldBuildPath(n,e.shape):e.buildPath(n,e.shape);var o=ms(vs(r),vs(n)),a=ws(o[0],o[1],10,Math.PI);!function(t,e,i){if(Ss(t))return ks(t,e,i);var r=t;r.__oldBuildPath=r.buildPath,r.buildPath=bs,ks(r,e,i)}(e,a,0);var s=i&&i.done,h=i&&i.aborted,l=i&&i.during;return e.animateTo({__morphT:1},x({during:function(t){e.dirtyShape(),l&&l(t)},done:function(){var t;Ss(t=e)&&(t.buildPath=t.__oldBuildPath,t.__oldBuildPath=t.__morphingData=null),e.createPathProxy(),e.dirtyShape(),s&&s()},aborted:function(){h&&h()}},i)),e},t.parseSVG=function(t,e){return(new Ia).parse(t,e)},t.path=Fo,t.registerPainter=Fr,t.showDebugDirtyRect=function(t,n){n=n||{};var e=t.painter;if(!e.getLayers)throw new Error("Debug dirty rect can only been used on canvas renderer.");if(e.isSingleCanvas())throw new Error("Debug dirty rect can only been used on zrender inited with container.");var o=document.createElement("div");o.style.cssText="\nposition:absolute;\nleft:0;\ntop:0;\nright:0;\nbottom:0;\npointer-events:none;\n",o.className="ec-debug-dirty-rect-container";var a=[],i=t.dom;i.appendChild(o),"static"===getComputedStyle(i).position&&(i.style.position="relative"),t.on("rendered",function(){if(e.getLayers){var r=0;e.eachBuiltinLayer(function(t){if(t.debugGetPaintRects)for(var e=t.debugGetPaintRects(),i=0;i