p[1]||h[1]=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(B.a),Da=i("BCbg"),Ia=o.h,Aa=o.k,Pa=s.Group;function Ea(t,e,i,n){Ra(t,e,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),Na(t,e,i,n)}function La(t){for(var e,i=t.getZr().storage.getDisplayList(),n=0,r=i.length;n0?2:0),Aa(t,function(i,n){"inherit"===t[n]&&(t[n]=e[n])})}var c=e.getModel("itemStyle"),l=c.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",u=c.getShallow("decal");l.decal=u&&"inherit"!==u?Object(Da.a)(u,o):n.decal,"inherit"===l.fill&&(l.fill=n[r]);"inherit"===l.stroke&&(l.stroke=n[h]);"inherit"===l.opacity&&(l.opacity=("fill"===r?n:i).opacity);s(l,n);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,i),"auto"===l.fill&&(l.fill=n.fill),"auto"===l.stroke&&(l.stroke=n.fill),"auto"===p.stroke&&(p.stroke=n.fill),!a){var f=e.get("inactiveBorderWidth"),v=l[h];l.lineWidth="auto"===f?n.lineWidth>0&&v?2:0:l.lineWidth,l.fill=e.get("inactiveColor"),l.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:l,lineStyle:p}}(h=b||h||"roundRect",n,c,l,p,g,d),x=new Pa,_=n.getModel("textStyle");if(!o.w(t.getLegendIcon)||b&&"inherit"!==b){var w="inherit"===b&&t.getData().getVisual("symbol")?"inherit"===m?t.getData().getVisual("symbolRotate"):m:0;x.add(function(t){var e=t.icon||"roundRect",i=Object(kr.a)(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);i.setStyle(t.itemStyle),i.rotation=(t.iconRotate||0)*Math.PI/180,i.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2);return i}({itemWidth:f,itemHeight:v,icon:h,iconRotate:w,itemStyle:M.itemStyle,lineStyle:M.lineStyle,symbolKeepAspect:y}))}else x.add(t.getLegendIcon({itemWidth:f,itemHeight:v,icon:h,iconRotate:m,itemStyle:M.itemStyle,lineStyle:M.lineStyle,symbolKeepAspect:y}));var z="left"===a?f+5:-5,S=a,C=r.get("formatter"),k=e;o.C(C)&&C?k=C.replace("{name}",null!=e?e:""):o.w(C)&&(k=C(e));var T=n.get("inactiveColor");x.add(new s.Text({style:Object(O.c)(_,{text:k,x:z,y:v/2,fill:g?_.getTextColor():T,align:S,verticalAlign:"middle"})}));var j=new s.Rect({shape:x.getBoundingRect(),invisible:!0}),D=n.getModel("tooltip");return D.get("show")&&s.setTooltipConfig({el:j,componentModel:r,itemName:e,itemTooltipOption:D.option}),x.add(j),x.eachChild(function(t){t.silent=!0}),j.silent=!u,this.getContentGroup().add(x),Object(xi.o)(x),x.__legendDataIndex=i,x},e.prototype.layoutInner=function(t,e,i,n,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();he.b(t.get("orient"),o,t.get("itemGap"),i.width,i.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),r){he.b("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),u=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",v=0===p?"height":"width",g=0===p?"y":"x";"end"===a?u[p]+=c[f]+d:l[p]+=h[f]+d,u[1-p]+=c[v]/2-h[v]/2,s.x=u[0],s.y=u[1],o.x=l[0],o.y=l[1];var m={x:0,y:0};return m[f]=c[f]+d+h[f],m[v]=Math.max(c[v],h[v]),m[g]=Math.min(0,h[g]+u[1-p]),m}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(X.a);function Ba(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var i=0;ii[r],g=[-p.x,-p.y];e||(g[n]=h[l]);var m=[0,0],y=[-f.x,-f.y],b=o.P(t.get("pageButtonGap",!0),t.get("itemGap",!0));v&&("end"===t.get("pageButtonPosition",!0)?y[n]+=i[r]-f[r]:m[n]+=f[r]+b);y[1-n]+=p[a]/2-f[a]/2,h.setPosition(g),u.setPosition(m),d.setPosition(y);var M={x:0,y:0};if(M[r]=v?i[r]:p[r],M[a]=Math.max(p[a],f[a]),M[c]=Math.min(0,f[c]+y[1-n]),u.__rectSize=i[r],v){var x={x:0,y:0};x[r]=Math.max(i[r]-f[r]-b,0),x[a]=M[a],u.setClipPath(new s.Rect({shape:x})),u.__rectSize=x[r]}else d.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var _=this._getPageInfo(t);return null!=_.pageIndex&&s.updateProps(h,{x:_.contentPosition[0],y:_.contentPosition[1]},v?t:null),this._updatePageInfoView(t,_),M},e.prototype._pageGo=function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var i=this._controllerGroup;o.k(["pagePrev","pageNext"],function(n){var r=null!=e[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")});var n=i.childOfName("pageText"),r=t.get("pageFormatter"),a=e.pageIndex,s=null!=a?a+1:0,c=e.pageCount;n&&r&&n.setStyle("text",o.C(r)?r.replace("{current}",null==s?"":s+"").replace("{total}",null==c?"":c+""):r({current:s,total:c}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,r=t.getOrient().index,a=qa[r],o=Ya[r],s=this._findTargetItemIndex(e),c=i.children(),l=c[s],h=c.length,u=h?1:0,d={contentPosition:[i.x,i.y],pageCount:u,pageIndex:u-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return d;var p=y(l);d.contentPosition[r]=-p.s;for(var f=s+1,v=p,g=p,m=null;f<=h;++f)(!(m=y(c[f]))&&g.e>v.s+n||m&&!b(m,v.s))&&(v=g.i>v.i?g:m)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=v.i),++d.pageCount),g=m;for(f=s-1,v=p,g=p,m=null;f>=-1;--f)(m=y(c[f]))&&b(g,m.s)||!(v.i=e&&t.s<=e+n}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild(function(n,r){var a=n.__legendDataIndex;null==i&&null!=a&&(i=r),a===t&&(e=r)}),null!=e?e:i):0;var e,i},e.type="legend.scroll",e}($a);function Xa(t){Object(ot.a)(Fa),t.registerComponentModel(Wa),t.registerComponentView(Ua),function(t){t.registerAction("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})})}(t)}function Ka(t){Object(ot.a)(Fa),Object(ot.a)(Xa)}var Za=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Object(a.a)(e,t),e.type="dataZoom.inside",e.defaultOption=Object(zi.d)(ni.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(ni),Ja=i("5Mek"),Qa=Object(u.o)();function to(t,e){if(e){t.removeKey(e.model.uid);var i=e.controller;i&&i.dispose()}}function eo(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function io(t,e,i,n){return t.coordinateSystem.containPoint([i,n])}function no(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(t,e){var i=Qa(e),n=i.coordSysRecordMap||(i.coordSysRecordMap=Object(o.f)());n.each(function(t){t.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(t){var i=ti(t);Object(o.k)(i.infoList,function(i){var r=i.model.uid,a=n.get(r)||n.set(r,function(t,e){var i={model:e,containsPoint:Object(o.h)(io,e),dispatchAction:Object(o.h)(eo,t),dataZoomInfoMap:null,controller:null},n=i.controller=new Ja.a(t.getZr());return Object(o.k)(["pan","zoom","scrollMove"],function(t){n.on(t,function(e){var n=[];i.dataZoomInfoMap.each(function(r){if(e.isAvailableBehavior(r.model.option)){var a=(r.getRange||{})[t],o=a&&a(r.dzReferCoordSysInfo,i.model.mainType,i.controller,e);!r.model.get("disabled",!0)&&o&&n.push({dataZoomId:r.model.id,start:o[0],end:o[1]})}}),n.length&&i.dispatchAction(n)})}),i}(e,i.model));(a.dataZoomInfoMap||(a.dataZoomInfoMap=Object(o.f)())).set(t.uid,{dzReferCoordSysInfo:i,model:t,getRange:null})})}),n.each(function(t){var e,i=t.controller,r=t.dataZoomInfoMap;if(r){var a=r.keys()[0];null!=a&&(e=r.get(a))}if(e){var o=function(t){var e,i={type_true:2,type_move:1,type_false:0,type_undefined:-1},n=!0;return t.each(function(t){var r=t.model,a=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i["type_"+a]>i["type_"+e]&&(e=a),n=n&&r.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}(r);i.enable(o.controlType,o.opt),i.setPointerChecker(t.containsPoint),h.b(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else to(n,t)})})}var ro=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return Object(a.a)(e,t),e.prototype.render=function(e,i,n){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),function(t,e,i){Qa(t).coordSysRecordMap.each(function(t){var n=t.dataZoomInfoMap.get(e.uid);n&&(n.getRange=i)})}(n,e,{pan:Object(o.c)(ao.pan,this),zoom:Object(o.c)(ao.zoom,this),scrollMove:Object(o.c)(ao.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var i=Qa(t).coordSysRecordMap,n=i.keys(),r=0;r0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/n.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return Object(si.a)(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:oo(function(t,e,i,n,r,a){var o=so[n]([a.oldX,a.oldY],[a.newX,a.newY],e,r,i);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:oo(function(t,e,i,n,r,a){return so[n]([0,0],[a.scrollDelta,a.scrollDelta],e,r,i).signal*(t[1]-t[0])*a.scrollDelta})};function oo(t){return function(e,i,n,r){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var c=t(o,s,e,i,n,r);return Object(si.a)(c,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}}var so={grid:function(t,e,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===a.dim?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(t,e,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(o.pixel=e[0]-t[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,i,n,r){var a=i.axis,o=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===a.orient?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},co=ro;function lo(t){fi(t),t.registerComponentModel(Za),t.registerComponentView(co),no(t)}var ho=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Object(a.a)(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Object(zi.d)(ni.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(ni),uo=s.Rect,po="horizontal",fo=5,vo=["line","bar","candlestick","scatter"],go={easing:"cubicOut",duration:100,delay:0};function mo(t){return"vertical"===t?"ns-resize":"ew-resize"}var yo=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._displayables={},i}return Object(a.a)(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=Object(o.c)(this._onBrush,this),this._onBrushEnd=Object(o.c)(this._onBrushEnd,this)},e.prototype.render=function(e,i,n,r){if(t.prototype.render.apply(this,arguments),h.b(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){h.a(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new s.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,i=t.get("brushSelect")?7:0,n=this._findCoordRect(),r={width:e.getWidth(),height:e.getHeight()},a=this._orient===po?{right:r.width-n.x-n.width,top:r.height-30-7-i,width:n.width,height:30}:{right:7,top:n.y,width:30,height:n.height},s=he.f(t.option);Object(o.k)(["right","top","width","height"],function(t){"ph"===s[t]&&(s[t]=a[t])});var c=he.g(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],"vertical"===this._orient&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),r=n&&n.get("inverse"),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==po||r?i===po&&r?{scaleY:o?1:-1,scaleX:-1}:"vertical"!==i||r?{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?1:-1,scaleX:1});var s=t.getBoundingRect([a]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.sliderGroup,n=t.get("brushSelect");i.add(new uo({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new uo({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:Object(o.c)(this._onClickPanel,this)}),a=this.api.getZr();n?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",a.on("mousemove",this._onBrush),a.on("mouseup",this._onBrushEnd)):(a.off("mousemove",this._onBrush),a.off("mouseup",this._onBrushEnd)),i.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,i=this._shadowSize||[],n=t.series,r=n.getRawData(),a=n.getShadowDim?n.getShadowDim():t.otherDim;if(null!=a){var o=this._shadowPolygonPts,c=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||e[0]!==i[0]||e[1]!==i[1]){var l=r.getDataExtent(a),h=.3*(l[1]-l[0]);l=[l[0]-h,l[1]+h];var u,d=[0,e[1]],p=[0,e[0]],f=[[e[0],0],[0,0]],v=[],g=p[1]/(r.count()-1),m=0,y=Math.round(r.count()/e[0]);r.each([a],function(t,e){if(y>0&&e%y)m+=g;else{var i=null==t||isNaN(t)||""===t,n=i?0:Object(St.k)(t,l,d,!0);i&&!u&&e?(f.push([f[f.length-1][0],0]),v.push([v[v.length-1][0],0])):!i&&u&&(f.push([m,0]),v.push([m,0])),f.push([m,n]),v.push([m,n]),m+=g,u=i}}),o=this._shadowPolygonPts=f,c=this._shadowPolylinePts=v}this._shadowData=r,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var b=this.dataZoomModel,M=0;M<3;M++){var x=_(1===M);this._displayables.sliderGroup.add(x),this._displayables.dataShadowSegs.push(x)}}}function _(t){var e=b.getModel(t?"selectedDataBackground":"dataBackground"),i=new s.Group,n=new s.Polygon({shape:{points:o},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new s.Polyline({shape:{points:c},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return i.add(n),i.add(r),i}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var i,n=this.ecModel;return t.eachTargetAxis(function(r,a){var s=t.getAxisProxy(r,a).getTargetSeriesModels();Object(o.k)(s,function(t){if(!(i||!0!==e&&Object(o.r)(vo,t.get("type"))<0)){var s,c=n.getComponent(Je(r),a).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r],h=t.coordinateSystem;null!=l&&h.getOtherAxis&&(s=h.getOtherAxis(c).inverse),l=t.getData().mapDimension(l),i={thisAxis:c,series:t,thisDim:r,otherDim:l,otherAxisInverse:s}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,i=e.handles=[null,null],n=e.handleLabels=[null,null],r=this._displayables.sliderGroup,a=this._size,c=this.dataZoomModel,l=this.api,h=c.get("borderRadius")||0,u=c.get("brushSelect"),d=e.filler=new uo({silent:u,style:{fill:c.get("fillerColor")},textConfig:{position:"inside"}});r.add(d),r.add(new uo({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:h},style:{stroke:c.get("dataBackgroundColor")||c.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),Object(o.k)([0,1],function(e){var a=c.get("handleIcon");!kr.d[a]&&a.indexOf("path://")<0&&a.indexOf("image://")<0&&(a="path://"+a);var l=Object(kr.a)(a,-1,0,2,2,null,!0);l.attr({cursor:mo(this._orient),draggable:!0,drift:Object(o.c)(this._onDragMove,this,e),ondragend:Object(o.c)(this._onDragEnd,this),onmouseover:Object(o.c)(this._showDataInfo,this,!0),onmouseout:Object(o.c)(this._showDataInfo,this,!1),z2:5});var h=l.getBoundingRect(),u=c.get("handleSize");this._handleHeight=Object(St.o)(u,this._size[1]),this._handleWidth=h.width/h.height*this._handleHeight,l.setStyle(c.getModel("handleStyle").getItemStyle()),l.style.strokeNoScale=!0,l.rectHover=!0,l.ensureState("emphasis").style=c.getModel(["emphasis","handleStyle"]).getItemStyle(),Object(xi.o)(l);var d=c.get("handleColor");null!=d&&(l.style.fill=d),r.add(i[e]=l);var p=c.getModel("textStyle");t.add(n[e]=new s.Text({silent:!0,invisible:!0,style:Object(O.c)(p,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:p.getTextColor(),font:p.getFont()}),z2:10}))},this);var p=d;if(u){var f=Object(St.o)(c.get("moveHandleSize"),a[1]),v=e.moveHandle=new s.Rect({style:c.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),g=.8*f,m=e.moveHandleIcon=Object(kr.a)(c.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);m.silent=!0,m.y=a[1]+f/2-.5,v.ensureState("emphasis").style=c.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(a[1]/2,Math.max(f,10));(p=e.moveZone=new s.Rect({invisible:!0,shape:{y:a[1]-y,height:f+y}})).on("mouseover",function(){l.enterEmphasis(v)}).on("mouseout",function(){l.leaveEmphasis(v)}),r.add(v),r.add(m),r.add(p)}p.attr({draggable:!0,cursor:mo(this._orient),drift:Object(o.c)(this._onDragMove,this,"all"),ondragstart:Object(o.c)(this._showDataInfo,this,!0),ondragend:Object(o.c)(this._onDragEnd,this),onmouseover:Object(o.c)(this._showDataInfo,this,!0),onmouseout:Object(o.c)(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Object(St.k)(t[0],[0,100],e,!0),Object(St.k)(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var i=this.dataZoomModel,n=this._handleEnds,r=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];Object(si.a)(e,n,r,i.get("zoomLock")?"all":t,null!=a.minSpan?Object(St.k)(a.minSpan,o,r,!0):null,null!=a.maxSpan?Object(St.k)(a.maxSpan,o,r,!0):null);var s=this._range,c=this._range=Object(St.c)([Object(St.k)(n[0],r,o,!0),Object(St.k)(n[1],r,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},e.prototype._updateView=function(t){var e=this._displayables,i=this._handleEnds,n=Object(St.c)(i.slice()),r=this._size;Object(o.k)([0,1],function(t){var n=e.handles[t],a=this._handleHeight;n.attr({scaleX:a/2,scaleY:a/2,x:i[t]+(t?-1:1),y:r[1]/2-a/2})},this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:r[1]});var a={x:n[0],width:n[1]-n[0]};e.moveHandle&&(e.moveHandle.setShape(a),e.moveZone.setShape(a),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",a.x+a.width/2));for(var c=e.dataShadowSegs,l=[0,n[0],n[1],r[0]],h=0;he[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,r=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-r);this._updateView(),a&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,i=t.offsetY;this._brushStart=new s.Point(e,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var i=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(i.width)<5)){var n=this._getViewExtent(),r=[0,100];this._range=Object(St.c)([Object(St.k)(i.x,n,r,!0),Object(St.k)(i.x+i.width,n,r,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(l.g(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var i=this._displayables,n=this.dataZoomModel,r=i.brushRect;r||(r=i.brushRect=new uo({silent:!0,style:n.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(r)),r.attr("ignore",!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(t,e),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),r.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?go:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=ti(this.dataZoomModel).infoList;if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var n=this.api.getWidth(),r=this.api.getHeight();t={x:.2*n,y:.2*r,width:.6*n,height:.6*r}}return t},e.type="dataZoom.slider",e}(ai);function bo(t){t.registerComponentModel(ho),t.registerComponentView(yo),fi(t)}function Mo(t){Object(ot.a)(lo),Object(ot.a)(bo)}var xo={get:function(t,e,i){var n=o.d((_o[t]||{})[e]);return i&&o.t(n)?n[n.length-1]:n}},_o={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]}},wo=xo,zo=Un.a.mapVisual,Oo=Un.a.eachVisual,So=o.t,Co=o.k,ko=St.c,To=St.k,jo=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.stateList=["inRange","outOfRange"],i.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],i.layoutMode={type:"box",ignoreSize:!0},i.dataBound=[-1/0,1/0],i.targetVisuals={},i.controllerVisuals={},i}return Object(a.a)(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,e){var i=this.option;!e&&Qn(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=o.c(t,this),this.controllerVisuals=Jn(this.option.controller,e,t),this.targetVisuals=Jn(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,i){e.push(i)}):e=u.r(t),e},e.prototype.eachTargetSeries=function(t,e){o.k(this.getTargetSeriesIndices(),function(i){var n=this.ecModel.getSeriesByIndex(i);n&&t.call(e,n)},this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries(function(i){i===t&&(e=!0)}),e},e.prototype.formatValueText=function(t,e,i){var n,r=this.option,a=r.precision,s=this.dataBound,c=r.formatter;i=i||["<",">"],o.t(t)&&(t=t.slice(),n=!0);var l=e?t:n?[h(t[0]),h(t[1])]:h(t);return o.C(c)?c.replace("{value}",n?l[0]:l).replace("{value2}",n?l[1]:l):o.w(c)?n?c(t[0],t[1]):c(t):n?t[0]===s[0]?i[0]+" "+l[1]:t[1]===s[1]?i[1]+" "+l[0]:l[0]+" - "+l[1]:l;function h(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(a,20))}},e.prototype.resetExtent=function(){var t=this.option,e=ko([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var i=t.dimensions,n=i.length-1;n>=0;n--){var r=i[n],a=t.getDimensionInfo(r);if(!a.isCalculationCoord)return a.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),r=e.controller||(e.controller={});o.I(n,i),o.I(r,i);var a=this.isCategory();function s(i){So(e.color)&&!i.inRange&&(i.inRange={color:e.color.slice().reverse()}),i.inRange=i.inRange||{color:t.get("gradientColor")}}s.call(this,n),s.call(this,r),function(t,e,i){var n=t[e],r=t[i];n&&!r&&(r=t[i]={},Co(n,function(t,e){if(Un.a.isValidType(e)){var i=wo.get(e,"inactive",a);null!=i&&(r[e]=i,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}}))}.call(this,n,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,i=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,n=this.get("inactiveColor"),r=this.getItemSymbol()||"roundRect";Co(this.stateList,function(s){var c=this.itemSize,l=t[s];l||(l=t[s]={color:a?n:[n]}),null==l.symbol&&(l.symbol=e&&o.d(e)||(a?r:[r])),null==l.symbolSize&&(l.symbolSize=i&&o.d(i)||(a?c[0]:[c[0],c[0]])),l.symbol=zo(l.symbol,function(t){return"none"===t?r:t});var h=l.symbolSize;if(null!=h){var u=-1/0;Oo(h,function(t){t>u&&(u=t)}),l.symbolSize=zo(h,function(t){return To(t,[0,u],[0,c[0]],!0)})}},this)}.call(this,r)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(B.a),Do=[20,140];function Io(t,e,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,r=i[0],a=[],o=0;o<=200&&re[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),o.k(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=St.c((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],r=i.getData();r.each(this.getDataDimensionIndex(r),function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},e.prototype.getVisualMeta=function(t){var e=Io(this,"outOfRange",this.getExtent()),i=Io(this,"inRange",this.option.range.slice()),n=[];function r(e,i){n.push({value:e,color:t(e,i)})}for(var a=0,o=0,s=i.length,c=e.length;ot[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:r/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},e.prototype._createBarPoints=function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new s.Group("horizontal"!==e||i?"horizontal"===e&&i?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||i?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,r=i.handleThumbs,a=i.handleLabels,o=n.itemSize,c=n.getExtent();Vo([0,1],function(l){var h=r[l];h.setStyle("fill",e.handlesColor[l]),h.y=t[l];var u=Bo(t[l],[0,o[1]],c,!0),d=this.getControllerVisual(u,"symbolSize");h.scaleX=h.scaleY=d/o[0],h.x=o[0]-d/2;var p=s.applyTransform(i.handleLabelPoints[l],s.getTransform(h,this.group));a[l].setStyle({x:p[0],y:p[1],text:n.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,e,i,n){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,c=[0,o[1]],l=this._shapes,h=l.indicator;if(h){h.attr("invisible",!1);var u=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),d=this.getControllerVisual(t,"symbolSize"),p=Bo(t,a,c,!0),f=o[0]-d/2,v={x:h.x,y:h.y};h.y=p,h.x=f;var g=s.applyTransform(l.indicatorLabelPoint,s.getTransform(h,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),b="horizontal"===this._orient;m.setStyle({text:(i||"")+r.formatValueText(e),verticalAlign:b?y:"middle",align:b?"center":y});var M={x:f,y:p,style:{fill:u}},x={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var _={duration:100,easing:"cubicInOut",additive:!0};h.x=v.x,h.y=v.y,h.animateTo(M,_),m.animateTo(x,_)}else h.attr(M),m.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var z=0;zr[1]&&(l[1]=1/0),e&&(l[0]===-1/0?this._showIndicator(c,l[1],"< ",o):l[1]===1/0?this._showIndicator(c,l[0],"> ",o):this._showIndicator(c,c,"≈ ",o));var h=this._hoverLinkDataIndices,d=[];(e||qo(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(l));var p=u.d(h,d);this._dispatchHighDown("downplay",Ro(p[0],i)),this._dispatchHighDown("highlight",Ro(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=Object(Dt.a)(e).dataIndex){var n=Object(Dt.a)(e),r=this.ecModel.getSeriesByIndex(n.seriesIndex);if(i.isTargetSeries(r)){var a=r.getData(n.dataType),o=a.getStore().get(i.getDataDimensionIndex(a),n.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var i=0;i=0&&(r.dimension=a,n.push(r))}}),t.getData().setVisual("visualMeta",n)}}];function Jo(t,e,i,n){for(var r=e.targetVisuals[n],a=Un.a.prepareVisualTypes(r),o={color:Object(Xn.b)(t.getData(),"color")},s=0,c=a.length;s