UNPKG

@arcgis/map-components

Version:
2 lines • 171 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */ import{a as Et,b as Qe,c as we,d as Me}from"./2AZXE2Y3.js";import{$ as de,D as be,E,F as pt,L as Ke,P as U,R as De,S as B,W as K,X as Pe,Y as Ot,Z as Q,_ as j,a as ue,aa as Ut,b as _e,ba as R,c as H,ca as ti,da as Ft,ea as ei,f as G,g as ye,ga as Te,h as ot,ja as Ae,la as ii,ma as si,na as ke,oa as ai,p as qe,qa as Ie,ra as Ce,sa as $e,y as ve}from"./ID7AT6M5.js";import{N as xe,O as Y,P as ce,R as je,S as Ze,a as kt,d as Ue,f as pe,k as ze,o as Be,q as We,u as Lt,v as He}from"./XDQDTW2I.js";import{a as It,b as Yt,d as $,e as ne}from"./XENQYCEN.js";import{B as mt,C as Ee,F as Gt,I as Ct,J as vt,P as Oe,T as ft,V as re,W as z,X as Je,a as at,g as v,o as T,r as Rt,s as me,t as Vt,v as fe,w as Ge}from"./ZJXSHJF2.js";import"./3TTFCHAA.js";var le=class extends Je{setupDefaultRules(){super.setupDefaultRules();let t=this._root.interfaceColors,e=this._root.language,i=this.rule.bind(this);i("XYChart").setAll({colors:$e.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),i("XYSeries").setAll({legendLabelText:"{name}"}),i("Rectangle",["plotbackground","xy","background"]).setAll({fill:Ze.fromHex(0),fillOpacity:0}),i("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:$e.new(this._root,{saturation:0})});{let n=i("Graphics",["scrollbar","overlay"]);n.setAll({fillOpacity:.5}),B(n,"fill",t,"background")}i("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),i("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),i("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),i("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),i("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),i("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),i("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:$,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),i("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),i("AxisLabel",["x"]).setAll({centerY:0}),i("AxisLabel",["x","inside"]).setAll({centerY:$}),i("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),i("AxisLabel",["x","opposite"]).setAll({centerY:$}),i("AxisLabel",["y"]).setAll({centerX:$}),i("AxisLabel",["y","inside"]).setAll({centerX:0}),i("AxisLabel",["y","inside","opposite"]).setAll({centerX:$}),i("AxisLabel",["y","opposite"]).setAll({centerX:0}),i("AxisLabel",["minor"]).setAll({fontSize:"0.6em"}),i("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),i("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{let n=i("Grid",["cursor","x"]);n.setAll({forceInactive:!0,strokeOpacity:.8,strokeDasharray:[2,2],role:"slider",ariaLabel:e.translate("Use left and right arrows to move selection")}),B(n,"stroke",t,"alternativeBackground")}{let n=i("Grid",["cursor","y"]);n.setAll({forceInactive:!0,strokeOpacity:.8,strokeDasharray:[2,2],role:"slider",ariaLabel:e.translate("Use up and down arrows to move selection")}),B(n,"stroke",t,"alternativeBackground")}{let n=i("Graphics",["cursor","selection"]);n.setAll({fillOpacity:.15}),B(n,"fill",t,"alternativeBackground")}i("Axis").setAll({zoomOut:!0,start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),i("AxisLabel").setAll({location:.5,multiLocation:0,centerX:ne,centerY:ne,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),i("Container",["axis","header"]).setAll({layer:30}),i("Rectangle",["axis","header","background"]).setAll({crisp:!0});{let n=i("AxisRenderer");n.setAll({crisp:!0,strokeOpacity:0}),B(n,"stroke",t,"grid")}i("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:$}),i("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:$});{let n=i("Rectangle",["axis","thumb","zoomgrip"]);n.setAll({fillOpacity:0}),B(n,"fill",t,"alternativeBackground"),n.states.create("hover",{fillOpacity:.1})}i("Rectangle",["axis","thumb","x","zoomgrip"]).setAll({cursorOverStyle:"ew-resize"}),i("Rectangle",["axis","thumb","y","zoomgrip"]).setAll({cursorOverStyle:"ns-resize"});{let n=i("Grid");n.setAll({location:0,strokeOpacity:.15,crisp:!0}),B(n,"stroke",t,"grid")}{let n=i("Grid",["minor"]);n.setAll({location:0,strokeOpacity:.07,crisp:!0}),B(n,"stroke",t,"grid")}i("Grid",["base"]).setAll({strokeOpacity:.3});{let n=i("Graphics",["axis","fill"]);n.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),B(n,"fill",t,"alternativeBackground")}i("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),i("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),i("Grid",["series","range"]).setAll({visible:!1}),i("AxisTick",["series","range"]).setAll({visible:!1}),i("AxisLabel",["series","range"]).setAll({visible:!1});{let n=i("AxisTick");n.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),B(n,"stroke",t,"grid")}i("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(n,l)=>{let h=n.get("axisFill");h&&(!v(l)||l%2==0?h.setPrivate("visible",!0):h.setPrivate("visible",!1))}});let s=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],a={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_hour"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month"),year:e.translate("_date_year")},o={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_day"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month")+" "+e.translate("_date_year"),year:e.translate("_date_year")},r={millisecond:e.translate("_date_millisecond_full"),second:e.translate("_date_second_full"),minute:e.translate("_date_minute_full"),hour:e.translate("_date_hour_full"),day:e.translate("_date_day_full"),week:e.translate("_date_week_full"),month:e.translate("_date_month_full"),year:e.translate("_date_year")};i("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:fe(s),dateFormats:Ct(a),periodChangeDateFormats:Ct(o)}),i("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,skipFirstMinor:!0,weekLabelLocation:0,gridIntervals:fe(s),dateFormats:Ct(a),periodChangeDateFormats:Ct(o),tooltipDateFormats:r,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:n=>{let l=n.get("axisFill");if(l){let h=n.component,c=n.get("value"),d=n.get("endValue"),u=h.intervalDuration(),f=h.getPrivate("baseInterval"),m=h.getPrivate("gridInterval",f),g=h.getPrivate("min",0);if(g=ti(new Date(g),m.timeUnit,m.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),c!=null&&d!=null){let p=Math.round(Math.round((c-g)/u))/2;p==Math.round(p)?l.setPrivate("visible",!0):l.setPrivate("visible",!1)}}}}),i("GaplessDateAxis").setAll({fillRule:n=>{let l=n.get("axisFill");if(l){let h=n.get("index"),c=!1;(!v(h)||h%2==0)&&(c=!0),l.setPrivate("visible",c)}}}),i("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:n=>{let l=n.get("axisFill");if(l){let h=n.component,c=n.get("value"),d=h.getPrivate("step");v(c)&&v(d)&&(G(c/d/2,5)==Math.round(c/d/2)?l.setPrivate("visible",!1):l.setPrivate("visible",!0))}}}),i("DurationAxis").setAll({baseUnit:"second"}),i("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),i("BaseColumnSeries").setAll({adjustBulletPosition:!0}),i("ColumnSeries").setAll({clustered:!0}),i("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:Yt(70),height:Yt(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),i("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),i("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),i("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(n,l)=>{let h=l.parent;if(h){let c=h.height(),d=h.width();n.moveTo(0,c/2),n.lineTo(d,c/2)}}});{let n=i("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});B(n,"stroke",t,"disabled")}i("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(n,l)=>{let h=l.parent;if(h){let c=h.height(),d=h.width();n.moveTo(0,0),n.lineTo(d,0),n.lineTo(d,c),n.lineTo(0,c),n.lineTo(0,0)}}});{let n=i("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});B(n,"stroke",t,"disabled")}i("SmoothedXYLineSeries").setAll({tension:.5}),i("SmoothedXLineSeries").setAll({tension:.5}),i("SmoothedYLineSeries").setAll({tension:.5}),i("Candlestick").setAll({position:"absolute",isMeasured:!1,width:Yt(50),height:Yt(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("OHLC").setAll({width:Yt(80),height:Yt(80)}),i("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{let n=i("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});B(n,"fill",t,"positive"),B(n,"stroke",t,"positive")}{let n=i("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});B(n,"fill",t,"negative"),B(n,"stroke",t,"negative")}i("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),i("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{let n=i("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});B(n,"fill",t,"positive"),B(n,"stroke",t,"positive")}{let n=i("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});B(n,"fill",t,"negative"),B(n,"stroke",t,"negative")}i("RoundedRectangle",["rangegrip"]).setAll({strokeOpacity:0,fillOpacity:0,strokeWidth:1,width:12,height:12});{let n=i("Graphics",["rangegrip","button","icon"]);n.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(2,.5),l.lineTo(2,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),B(n,"stroke",t,"secondaryButtonText")}i("Button",["rangegrip"]).setAll({draggable:!0,paddingTop:0,paddingBottom:0}),i("Button",["rangegrip","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize",centerX:ne}),i("Button",["rangegrip","horizontal"]).setAll({cursorOverStyle:"ew-resize",centerX:ne}),i("Button",["rangegrip","vertical","left"]).setAll({centerY:$}),i("Button",["rangegrip","vertical","right"]).setAll({centerY:0}),i("Button",["rangegrip","horizontal","top"]).setAll({centerY:0}),i("Button",["rangegrip","horizontal","bottom"]).setAll({centerY:$})}};var $t=class extends Ie{constructor(){super(...arguments),this.xAxes=new _e,this.yAxes=new _e,this.topAxesContainer=this.chartContainer.children.push(U.new(this._root,{width:$,layout:this._root.verticalLayout})),this.yAxesAndPlotContainer=this.chartContainer.children.push(U.new(this._root,{width:$,height:$,layout:this._root.horizontalLayout})),this.bottomAxesContainer=this.chartContainer.children.push(U.new(this._root,{width:$,layout:this._root.verticalLayout})),this.leftAxesContainer=this.yAxesAndPlotContainer.children.push(U.new(this._root,{height:$,layout:this._root.horizontalLayout})),this.plotsContainer=this.yAxesAndPlotContainer.children.push(U.new(this._root,{width:$,height:$,maskContent:!1})),this.plotContainer=this.plotsContainer.children.push(U.new(this._root,{width:$,height:$})),this.topPlotContainer=this.plotsContainer.children.push(U.new(this._root,{width:$,height:$})),this.gridContainer=this.plotContainer.children.push(U.new(this._root,{width:$,height:$,isMeasured:!1})),this.topGridContainer=U.new(this._root,{width:$,height:$,isMeasured:!1}),this.rightAxesContainer=this.yAxesAndPlotContainer.children.push(U.new(this._root,{height:$,layout:this._root.horizontalLayout})),this.axisHeadersContainer=this.plotContainer.children.push(U.new(this._root,{})),this.zoomOutButton=this.topPlotContainer.children.push(Qe.new(this._root,{themeTags:["zoom"],icon:E.new(this._root,{themeTags:["button","icon"]})})),this._movePoint={x:0,y:0},this._movePoints={}}_afterNew(){this._defaultThemes.push(le.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);let t=this._root,e=this._root.verticalLayout,i=this.zoomOutButton;i.events.on("click",()=>{this.zoomOut()}),i.hide(0),i.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",e);let s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set("interactive",!0),s.set("interactiveChildren",!1),s.set("background",pt.new(t,{themeTags:["plotbackground","xy","background"]})),this._disposers.push(s.events.on("pointerdown",a=>{this._handlePlotDown(a)})),this._disposers.push(s.events.on("globalpointerup",a=>{this._handlePlotUp(a)})),this._disposers.push(s.events.on("globalpointermove",a=>{this._handlePlotMove(a)})),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(t){t._unstack(),t._posXDp&&t._posXDp.dispose(),t._posYDp&&t._posYDp.dispose(),t.set("baseAxis",void 0);let e=t.get("xAxis");e&&(Rt(e.series,t),e.markDirtyExtremes());let i=t.get("yAxis");i&&(Rt(i.series,t),i.markDirtyExtremes());let s=this.get("cursor");if(s){let a=s.get("snapToSeries");a&&Rt(a,t)}super._removeSeries(t)}_applyThemes(t=!1){let e=this.get("colors");return e&&e.reset(),super._applyThemes(t)}handleWheel(t){let e=this.get("wheelX"),i=this.get("wheelY"),s=this.plotContainer,a=t.originalEvent,o=!1;if(Be(a,this))o=!0;else return;let r=s.toLocal(t.point),n=this.get("wheelStep",.2),l=a.deltaY/100,h=a.deltaX/100,c=this.get("wheelZoomPositionX"),d=this.get("wheelZoomPositionY");(e==="zoomX"||e==="zoomXY")&&h!=0&&this.xAxes.each(u=>{if(u.get("zoomX")){let f=u.get("start"),m=u.get("end"),g=u.fixPosition(r.x/s.width());c!=null&&(g=c);let p=u.get("maxDeviation",0),_=Math.min(1+p,Math.max(-p,f-n*(m-f)*h*g)),x=Math.max(-p,Math.min(1+p,m+n*(m-f)*h*(1-g)));_==f&&x==m&&(o=!1),1/(x-_)<u.getPrivate("maxZoomFactor",1/0)/u.get("minZoomCount",1)?this._handleWheelAnimation(u.zoom(_,x)):o=!1}}),(i==="zoomX"||i==="zoomXY")&&l!=0&&this.xAxes.each(u=>{if(u.get("zoomX")){let f=u.get("start"),m=u.get("end"),g=u.fixPosition(r.x/s.width());c!=null&&(g=c);let p=u.get("maxDeviation",0),_=Math.min(1+p,Math.max(-p,f-n*(m-f)*l*g)),x=Math.max(-p,Math.min(1+p,m+n*(m-f)*l*(1-g)));_==f&&x==m&&(o=!1),1/(x-_)<u.getPrivate("maxZoomFactor",1/0)/u.get("minZoomCount",1)?this._handleWheelAnimation(u.zoom(_,x)):o=!1}}),(e==="zoomY"||e==="zoomXY")&&h!=0&&this.yAxes.each(u=>{if(u.get("zoomY")){let f=u.get("start"),m=u.get("end"),g=u.fixPosition(r.y/s.height());d!=null&&(g=d);let p=u.get("maxDeviation",0),_=Math.min(1+p,Math.max(-p,f-n*(m-f)*h*g)),x=Math.max(-p,Math.min(1+p,m+n*(m-f)*h*(1-g)));_==f&&x==m&&(o=!1),1/(x-_)<u.getPrivate("maxZoomFactor",1/0)/u.get("minZoomCount",1)?this._handleWheelAnimation(u.zoom(_,x)):o=!1}}),(i==="zoomY"||i==="zoomXY")&&l!=0&&this.yAxes.each(u=>{if(u.get("zoomY")){let f=u.get("start"),m=u.get("end"),g=u.fixPosition(r.y/s.height());d!=null&&(g=d);let p=u.get("maxDeviation",0),_=Math.min(1+p,Math.max(-p,f-n*(m-f)*l*g)),x=Math.max(-p,Math.min(1+p,m+n*(m-f)*l*(1-g)));_==f&&x==m&&(o=!1),1/(x-_)<u.getPrivate("maxZoomFactor",1/0)/u.get("minZoomCount",1)?this._handleWheelAnimation(u.zoom(_,x)):o=!1}}),(e==="panX"||e==="panXY")&&h!=0&&this.xAxes.each(u=>{if(u.get("panX")){let f=u.get("start"),m=u.get("end"),g=this._getWheelSign(u)*n*(m-f)*h,p=f+g,_=m+g,x=this._fixWheel(p,_);p=x[0],_=x[1],p==f&&_==m&&(o=!1),this._handleWheelAnimation(u.zoom(p,_))}}),(i==="panX"||i==="panXY")&&l!=0&&this.xAxes.each(u=>{if(u.get("panX")){let f=u.get("start"),m=u.get("end"),g=this._getWheelSign(u)*n*(m-f)*l,p=f+g,_=m+g,x=this._fixWheel(p,_);p=x[0],_=x[1],p==f&&_==m&&(o=!1),this._handleWheelAnimation(u.zoom(p,_))}}),(e==="panY"||e==="panXY")&&h!=0&&this.yAxes.each(u=>{if(u.get("panY")){let f=u.get("start"),m=u.get("end"),g=this._getWheelSign(u)*n*(m-f)*h,p=f+g,_=m+g,x=this._fixWheel(p,_);p=x[0],_=x[1],p==f&&_==m&&(o=!1),this._handleWheelAnimation(u.zoom(p,_))}}),(i==="panY"||i==="panXY")&&l!=0&&this.yAxes.each(u=>{if(u.get("panY")){let f=u.get("start"),m=u.get("end"),g=this._getWheelSign(u)*n*(m-f)*l,p=f-g,_=m-g,x=this._fixWheel(p,_);p=x[0],_=x[1],p==f&&_==m&&(o=!1),this._handleWheelAnimation(u.zoom(p,_))}}),o&&a.preventDefault()}_handleSetWheel(){let t=this.get("wheelX"),e=this.get("wheelY"),i=this.plotContainer;t!=="none"||e!=="none"?(this._wheelDp=i.events.on("wheel",s=>{let a=s.originalEvent;(t!=="none"&&Math.abs(a.deltaX)!=0||e!=="none"&&Math.abs(a.deltaY)!=0)&&this.handleWheel(s)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(t){let e=1;return t.get("renderer").get("inversed")&&(e=-1),e}_fixWheel(t,e){let i=e-t;return t<0&&(t=0,e=t+i),e>1&&(e=1,t=e-i),[t,e]}_handlePlotDown(t){let e=t.originalEvent;if(e.button==2)return;let i=this.plotContainer,s=i.toLocal(t.point);if((this.get("pinchZoomX")||this.get("pinchZoomY"))&&e.pointerId&&Gt(i._downPoints).length>0){let o=this.xAxes.getIndex(0),r=this.yAxes.getIndex(0);o&&(this._downStartX=o.get("start",0),this._downEndX=o.get("end",1)),r&&(this._downStartY=r.get("start",0),this._downEndY=r.get("end",1))}if((this.get("panX")||this.get("panY"))&&s.x>=0&&s.y>=0&&s.x<=i.width()&&s.y<=this.height()){this._downPoint={x:e.clientX,y:e.clientY};let a=this.get("panX"),o=this.get("panY");a&&this.xAxes.each(n=>{n._panStart=n.get("start"),n._panEnd=n.get("end")}),o&&this.yAxes.each(n=>{n._panStart=n.get("start"),n._panEnd=n.get("end")});let r="panstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:t.originalEvent})}}_handleWheelAnimation(t){t?t.events.on("stopped",()=>{this._dispatchWheelAnimation()}):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){let t="wheelended";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}_handlePlotUp(t){let e=this._downPoint;if(e&&(this.get("panX")||this.get("panY"))){if(t.originalEvent.clientX==e.x&&t.originalEvent.clientY==e.y){let s="pancancelled";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent})}let i="panended";this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,originalEvent:t.originalEvent})}this._downPoint=void 0,this.xAxes.each(i=>{i._isPanning=!1}),this.yAxes.each(i=>{i._isPanning=!1})}_handlePlotMove(t){let e=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){let a=t.originalEvent.pointerId;if(a&&(this._movePoints[a]=t.point,Gt(e._downPoints).length>1)){this._handlePinch();return}}let i=this._downPoint;if(i){i=e.toLocal(this._root.documentPointToRoot(i));let s=e.toLocal(t.point),a=this.get("panX"),o=this.get("panY");if(a){let r=this.get("scrollbarX");r&&r.events.disableType("rangechanged"),this.xAxes.each(n=>{if(n.get("panX")){n._isPanning=!0;let l=n._panStart,h=n._panEnd,d=(h-l)*(i.x-s.x)/e.width();n.get("renderer").get("inversed")&&(d*=-1);let u=l+d,f=h+d;f-u<1+n.get("maxDeviation",1)*2&&(n.set("start",u),n.set("end",f))}}),r&&r.events.enableType("rangechanged")}if(o){let r=this.get("scrollbarY");r&&r.events.disableType("rangechanged"),this.yAxes.each(n=>{if(n.get("panY")){n._isPanning=!0;let l=n._panStart,h=n._panEnd,d=(h-l)*(i.y-s.y)/e.height();n.get("renderer").get("inversed")&&(d*=-1);let u=l-d,f=h-d;f-u<1+n.get("maxDeviation",1)*2&&(n.set("start",u),n.set("end",f))}}),r&&r.events.enableType("rangechanged")}}}_handlePinch(){let t=this.plotContainer,e=0,i=[],s=[];if(vt(t._downPoints,(a,o)=>{i[e]=o;let r=this._movePoints[a];r&&(s[e]=r),e++}),i.length>1&&s.length>1){let a=t.width(),o=t.height(),r=i[0],n=i[1],l=s[0],h=s[1];if(r&&n&&l&&h){if(l=t.toLocal(l),h=t.toLocal(h),r=t.toLocal(r),n=t.toLocal(n),this.get("pinchZoomX")){let c=this._downStartX,d=this._downEndX;if(c!=null&&d!=null){r.x>n.x&&([r,n]=[n,r],[l,h]=[h,l]);let u=c+r.x/a*(d-c),f=c+n.x/a*(d-c),m=c+l.x/a*(d-c),g=c+h.x/a*(d-c),p=Math.max(.001,f-u),_=Math.max(.001,g-m),x=p/_,y=c*x+u-m*x,b=d*x+f-g*x;this.xAxes.each(w=>{let M=w.fixPosition(y),D=w.fixPosition(b);w.zoom(M,D,0)})}}if(this.get("pinchZoomY")){let c=this._downStartY,d=this._downEndY;if(c!=null&&d!=null){r.y<n.y&&([r,n]=[n,r],[l,h]=[h,l]);let u=c+(1-r.y/o)*(d-c),f=c+(1-n.y/o)*(d-c),m=c+(1-l.y/o)*(d-c),g=c+(1-h.y/o)*(d-c),p=Math.max(.001,f-u),_=Math.max(.001,g-m),x=p/_,y=c*x+u-m*x,b=d*x+f-g*x;this.yAxes.each(w=>{let M=w.fixPosition(y),D=w.fixPosition(b);w.zoom(M,D,0)})}}}}}_handleCursorPosition(){let t=this.get("cursor");if(t){let e=t.getPrivate("point"),i=t.get("snapToSeries");if(t._downPoint&&(i=void 0),i&&e){let s=t.get("snapToSeriesBy"),a=[];T(i,n=>{if(!n.isHidden()&&!n.isHiding())if(s!="x!"&&s!="y!"){let l=n.startIndex(),h=n.endIndex();for(let c=l;c<h;c++){let d=n.dataItems[c];d&&!d.isHidden()&&a.push(d)}}else{let l=n.get("tooltipDataItem");l&&a.push(l)}});let o=1/0,r;if(T(a,n=>{let l=n.get("point");if(l){let h=0;s=="x"||s=="x!"?h=Math.abs(e.x-l.x):s=="y"||s=="y!"?h=Math.abs(e.y-l.y):h=Math.hypot(e.x-l.x,e.y-l.y),h<o&&(o=h,r=n)}}),T(i,n=>{let l=n.get("tooltip");l&&l._setDataItem(void 0)}),r){let n=r.component;n.showDataItemTooltip(r),n.setRaw("tooltipDataItem",r);let l=r.get("point");l&&t.handleMove(n.toGlobal({x:l.x-n.x(),y:l.y-n.y()}),!0)}}}}_updateCursor(){let t=this.get("cursor");t&&t.updateCursor()}_addCursor(t){this.plotContainer.children.push(t)}_prepareChildren(){if(super._prepareChildren(),this.series.each(t=>{this._colorize(t)}),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){let t=this._prevSettings.cursor,e=this.get("cursor");e!==t&&(this._disposeProperty("cursor"),t&&t.dispose(),e&&(e._setChart(this),this._addCursor(e),this._pushPropertyDisposer("cursor",e.events.on("selectended",()=>{this._handleCursorSelectEnd()}))),this._prevSettings.cursor=e)}if(this.isDirty("scrollbarX")){let t=this._prevSettings.scrollbarX,e=this.get("scrollbarX");e!==t&&(this._disposeProperty("scrollbarX"),t&&t.dispose(),e&&(e.parent||this.topAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarX",e.events.on("rangechanged",i=>{this._handleScrollbar(this.xAxes,i.start,i.end,i.grip)})),this._pushPropertyDisposer("scrollbarX",e.events.on("released",()=>{this.xAxes.each(i=>{i.get("zoomable")&&this._handleAxisSelection(i)})})),e.setPrivate("positionTextFunction",i=>{let s=this.xAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarX=e)}if(this.isDirty("scrollbarY")){let t=this._prevSettings.scrollbarY,e=this.get("scrollbarY");e!==t&&(this._disposeProperty("scrollbarY"),t&&t.dispose(),e&&(e.parent||this.rightAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarY",e.events.on("rangechanged",i=>{this._handleScrollbar(this.yAxes,i.start,i.end,i.grip)})),this._pushPropertyDisposer("scrollbarY",e.events.on("released",()=>{this.yAxes.each(i=>{i.get("zoomable")&&this._handleAxisSelection(i)})})),e.setPrivate("positionTextFunction",i=>{let s=this.yAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarY=e)}this._handleZoomOut()}_processSeries(t){super._processSeries(t);let e=t.get("xAxis"),i=t.get("yAxis");Vt(e.series,t),Vt(i.series,t),t._posXDp=t.addDisposer(e.events.on("positionchanged",()=>{t._fixPosition()})),t._posXDp=t.addDisposer(i.events.on("positionchanged",()=>{t._fixPosition()})),t.get("baseAxis")||(i.isType("CategoryAxis")||i.isType("DateAxis")?t.set("baseAxis",i):t.set("baseAxis",e)),t.get("stacked")&&(t._markDirtyKey("stacked"),T(t.dataItems,s=>{s.set("stackToItemY",void 0),s.set("stackToItemX",void 0)})),t._markDirtyAxes(),i.markDirtyExtremes(),e.markDirtyExtremes(),e._seriesAdded=!0,i._seriesAdded=!0,this._colorize(t)}_colorize(t){let e=this.get("colors");if(e&&t.get("fill")==null){let s=e.next();t._setSoft("stroke",s),t._setSoft("fill",s)}let i=this.get("patterns");if(i&&t.get("fillPattern")==null){let s=i.next();t._setSoft("fillPattern",s)}}_handleCursorSelectEnd(){let t=this.get("cursor"),e=t.get("behavior"),i=t.getPrivate("downPositionX",0),s=t.getPrivate("downPositionY",0),a=Math.min(1,Math.max(0,t.getPrivate("positionX",.5))),o=Math.min(1,Math.max(0,t.getPrivate("positionY",.5)));this.xAxes.each(r=>{if(e==="zoomX"||e==="zoomXY"){let n=r.toAxisPosition(i),l=r.toAxisPosition(a);r.zoom(n,l)}r.setPrivate("updateScrollbar",!0)}),this.yAxes.each(r=>{if(e==="zoomY"||e==="zoomXY"){let n=r.toAxisPosition(s),l=r.toAxisPosition(o);r.zoom(n,l)}r.setPrivate("updateScrollbar",!0)})}_handleScrollbar(t,e,i,s){t.each(a=>{let o=a.fixPosition(e),r=a.fixPosition(i),n=a.zoom(o,r,void 0,s),l="updateScrollbar";a.setPrivateRaw(l,!1),n?n.events.on("stopped",()=>{a.setPrivateRaw(l,!0)}):a.setPrivateRaw(l,!0)})}_processAxis(t,e){return t.events.onAll(i=>{if(i.type==="clear")T(i.oldValues,s=>{this._removeAxis(s)});else if(i.type==="push")e.children.push(i.newValue),i.newValue.processChart(this);else if(i.type==="setIndex")e.children.setIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="insertIndex")e.children.insertIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="removeIndex")this._removeAxis(i.oldValue);else if(i.type==="moveIndex")e.children.moveValue(i.value,i.newIndex),i.value.processChart(this);else throw new Error("Unknown IListEvent type")})}_removeAxis(t){if(!t.isDisposed()){let e=t.parent;e&&e.children.removeValue(t);let i=t.gridContainer,s=i.parent;s&&s.children.removeValue(i);let a=t.topGridContainer,o=a.parent;o&&o.children.removeValue(a)}}_updateChartLayout(){let t=this.leftAxesContainer.width(),e=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set("paddingLeft",t),i.set("paddingRight",e);let s=this.topAxesContainer;s.set("paddingLeft",t),s.set("paddingRight",e)}processAxis(t){var e=this.get("cursor");e&&(this.addDisposer(t.on("start",()=>{this._updateCursor()})),this.addDisposer(t.on("end",()=>{this._updateCursor()})))}_handleAxisSelection(t,e){let i=t.fixPosition(t.get("start",0)),s=t.fixPosition(t.get("end",1));if(i>s&&([i,s]=[s,i]),this.xAxes.indexOf(t)!=-1){if(e||t.getPrivate("updateScrollbar")){let a=this.get("scrollbarX");a&&(!a.getPrivate("isBusy")||e)&&(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}}else if(this.yAxes.indexOf(t)!=-1&&(e||t.getPrivate("updateScrollbar"))){let a=this.get("scrollbarY");a&&(!a.getPrivate("isBusy")||e)&&(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let t=this.zoomOutButton;if(t&&t.parent){let e=!1;this.xAxes.each(i=>{i.get("zoomOut",!0)&&(G(i.get("start",0),5)!=0||G(i.get("end",1),5)!=1)&&(e=!0)}),this.yAxes.each(i=>{i.get("zoomOut",!0)&&(G(i.get("start",0),5)!=0||G(i.get("end",1),5)!=1)&&(e=!0)}),e?t.isHidden()&&t.show():t.hide()}}inPlot(t){let e=this.plotContainer,i=this.getPrivate("otherCharts",this._otherCharts),s=e.toGlobal(t);if(t.x>=-.5&&t.y>=-.5&&t.x<=e.width()+.5&&t.y<=e.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){let o=i[a];if(o!=this){let r=o.plotContainer,n=this._root.rootPointToDocument(s),l=o._root.documentPointToRoot(n),h=r.toLocal(l);if(h.x>=-.1&&h.y>=-.1&&h.x<=r.width()+.1&&h.y<=r.height()+.1)return!0}}return!1}arrangeTooltips(){let t=this.plotContainer,e=t.width(),i=t.height(),s=this.height(),a=this._root.tooltipContainer.get("layerMargin");a&&a.bottom>s&&(s=a.bottom);let o=t._display.toGlobal({x:0,y:0}),r=t._display.toGlobal({x:e,y:i}),n=[],l=0,h=1/0,c=this._movePoint,d=this.get("maxTooltipDistance"),u=this.get("maxTooltipDistanceBy","xy"),f,m;v(d)&&this.series.each(p=>{if(!p.isHidden()){let _=p.get("tooltip");if(_){let x=_.get("pointTo");if(x){let y=Math.hypot(c.x-x.x,c.y-x.y);u=="x"?y=Math.abs(c.x-x.x):u=="y"&&(y=Math.abs(c.y-x.y)),y<h&&(h=y,f=p,m=x)}}}});let g=[];if(this.series.each(p=>{let _=p.get("tooltip");if(_&&!_.get("forceHidden")){let x=!1,y=_.get("pointTo");if(y){if(d>=0){let b=_.get("pointTo");if(b&&m&&p!=f){let w=Math.hypot(m.x-b.x,m.y-b.y);u=="x"?w=Math.abs(m.x-b.x):u=="y"&&(w=Math.abs(m.y-b.y)),w>d&&(x=!0)}}else d==-1&&p!=f&&(x=!0);!this.inPlot(this._tooltipToLocal(y))||!_.dataItem?x=!0:x||(l+=y.y),x||p.isHidden()||p.isHiding()?_.hide(0):(_.show(),n.push(_),g.push(p))}}}),this.setPrivate("tooltipSeries",g),this.get("arrangeTooltips")){let p=0,_=0,x=this._root.tooltipContainer,y=n.length;if(l/y>i/2+o.y){n.sort((M,D)=>re(D.get("pointTo").y,M.get("pointTo").y));let w=r.y;if(T(n,M=>{let D=M.height();_++,p+=D;let P=M.get("centerY");P instanceof It&&(D*=P.value),D+=M.get("marginBottom",0),M.set("bounds",{left:o.x,top:o.y,right:r.x,bottom:w}),M.setPrivate("customData",{left:o.x,top:o.y,right:r.x,bottom:w}),w=Math.min(w-D,M._fy-D),M.parent==x&&x.children.moveValue(M,0)}),w<0){n.reverse();let M=w;T(n,D=>{_++;let P=D.get("bounds");if(P){let k=P.top-w,I=P.bottom-w;k<M&&(k=M,I=k+D.height()),D.set("bounds",{left:P.left,top:k,right:P.right,bottom:I}),M=P.bottom-w+D.get("marginBottom",0)}})}}else{n.reverse(),n.sort((M,D)=>re(M.get("pointTo").y,D.get("pointTo").y));let w=0;if(T(n,M=>{_++;let D=M.height();p+=D;let P=M.get("centerY");P instanceof It&&(D*=P.value),D+=M.get("marginBottom",0),M.set("bounds",{left:o.x,top:w,right:r.x,bottom:Math.max(o.y+s,w+D)}),M.parent==x&&x.children.moveValue(M,0),w=Math.max(w+D,M._fy+D)}),w>s){n.reverse();let M=s;T(n,D=>{_++;let P=D.get("bounds");if(P){let k=P.top-(s-w),I=P.bottom-(s-w);I>M&&(I=M,k=I-D.height()),D.set("bounds",{left:P.left,top:k,right:P.right,bottom:I}),M=I-D.height()-D.get("marginBottom",0)}})}}p==0&&_>0&&this._disposers.push(this.root.events.once("frameended",()=>{this.arrangeTooltips()}))}}_tooltipToLocal(t){return this.plotContainer.toLocal(t)}zoomOut(){this.xAxes.each(t=>{t.get("zoomOut",!0)&&(t.setPrivate("updateScrollbar",!0),t.zoom(0,1))}),this.yAxes.each(t=>{t.get("zoomOut",!0)&&(t.setPrivate("updateScrollbar",!0),t.zoom(0,1))})}_dispose(){super._dispose();let t=this.get("cursor");t&&t.dispose()}};$t.className="XYChart";$t.classNames=Ie.classNames.concat([$t.className]);var zt=class extends Me{constructor(){super(...arguments),this.chart=this.children.push($t.new(this._root,{themeTags:["chart"],interactive:!1,interactiveChildren:!1,panX:!1,panY:!1,wheelX:"none",wheelY:"none"})),this.overlay=this.children.push(E.new(this._root,{themeTags:["overlay"],interactive:!1}))}_afterNew(){this._addOrientationClass(),this._settings.themeTags=Y(this._settings.themeTags,["scrollbar","xy","chart",this._settings.orientation]);let t=this.children;t.moveValue(this.thumb),t.moveValue(this.startGrip),t.moveValue(this.endGrip),this.thumb.set("opacity",0),this.thumb.states.create("hover",{opacity:.2});let e=this.chart.plotContainer;e.set("interactive",!1),e.remove("background"),e.children.removeValue(this.chart.zoomOutButton),super._afterNew()}_updateThumb(){super._updateThumb(),this.overlay.set("draw",t=>{let e=this.startGrip,i=this.endGrip,s=e.x(),a=e.y(),o=i.x(),r=i.y(),n=this.height(),l=this.width();s>o&&([s,o]=[o,s]),a>r&&([a,r]=[r,a]),this.get("orientation")==="horizontal"?(t.moveTo(0,0),t.lineTo(s,0),t.lineTo(s,n),t.lineTo(0,n),t.lineTo(0,0),t.moveTo(o,0),t.lineTo(l,0),t.lineTo(l,n),t.lineTo(o,n),t.lineTo(o,0)):(t.moveTo(0,0),t.lineTo(0,a),t.lineTo(l,a),t.lineTo(l,0),t.lineTo(0,0),t.moveTo(0,r),t.lineTo(0,n),t.lineTo(l,n),t.lineTo(l,r),t.lineTo(0,r))})}};zt.className="XYChartScrollbar";zt.classNames=Me.classNames.concat([zt.className]);var gt=class extends E{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}};gt.className="Grid";gt.classNames=E.classNames.concat([gt.className]);var Bt=class extends U{constructor(){super(...arguments),this._alwaysShow=!1,this.lineX=this.children.push(gt.new(this._root,{themeTags:["x"]})),this.lineY=this.children.push(gt.new(this._root,{themeTags:["y"]})),this.selection=this.children.push(E.new(this._root,{themeTags:["selection","cursor"],layer:30})),this._lastPoint={x:0,y:0},this._lastPoint2={x:0,y:0},this._tooltipX=!1,this._tooltipY=!1}_afterNew(){this._settings.themeTags=Y(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:$,height:$,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout(()=>{this.setPrivate("visible",!0)},500)),this._disposers.push(this.lineX.events.on("positionchanged",()=>{this._handleXLine()})),this._disposers.push(this.lineY.events.on("positionchanged",()=>{this._handleYLine()})),this._disposers.push(this.lineX.events.on("focus",()=>this._handleLineFocus())),this._disposers.push(this.lineX.events.on("blur",()=>this._handleLineBlur())),this._disposers.push(this.lineY.events.on("focus",()=>this._handleLineFocus())),this._disposers.push(this.lineY.events.on("blur",()=>this._handleLineBlur())),pe("keyboardevents")&&this._disposers.push(Ue(document,"keydown",t=>{this._handleLineMove(We(t),t.ctrlKey)}))}_setUpTouch(){let t=this.chart;t&&(t.plotContainer._display.cancelTouch=this.get("behavior")!="none")}_handleXLine(){let t=this.lineX.x(),e=!0;(t<0||t>this.width())&&(e=!1),this.lineX.setPrivate("visible",e)}_handleYLine(){let t=this.lineY.y(),e=!0;(t<0||t>this.height())&&(e=!1),this.lineY.setPrivate("visible",e)}_handleLineMove(t,e){let i="",s=this.chart,a;if(s&&s.xAxes.length){this._root.focused(this.lineX)?(i="positionX",a=s.xAxes.getIndex(0)):this._root.focused(this.lineY)&&(a=s.yAxes.getIndex(0),i="positionY");let o=1;if(e&&(o=5),a){let r=a.get("renderer").get("inversed",!1),n;t=="ArrowRight"||t=="ArrowDown"?n=1:t=="ArrowLeft"||t=="ArrowUp"?n=-1:t=="Tab"&&(n=0),n!=null&&(r&&(n*=-1),this.set(i,a.nextPosition(n*o)))}}}_handleLineFocus(){this._alwaysShow=this.get("alwaysShow",!1),this.setAll({positionX:this.getPrivate("positionX",0),positionY:this.getPrivate("positionY",0),alwaysShow:!0}),this._handleLineMove("Tab")}_handleLineBlur(){(this.lineX.isFocus()||this.lineY.isFocus())&&this.setAll({positionX:void 0,positionY:void 0,alwaysShow:this._alwaysShow})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;let t=this.get("xAxis");if(t){let e=t.get("tooltip");e&&(this._tooltipX=!0,this._disposers.push(e.on("pointTo",()=>{this._updateXLine(e)})))}}if(this.isDirty("yAxis")){this._tooltipY=!1;let t=this.get("yAxis");if(t){let e=t.get("tooltip");e&&(this._tooltipY=!0,this._disposers.push(e.on("pointTo",()=>{this._updateYLine(e)})))}}}_handleSyncWith(){let t=this.chart;if(t){let e=this.get("syncWith"),i=[];e&&T(e,s=>{let a=s.chart;a&&i.push(a)}),t._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){let t=this.get("positionX"),e=this.get("positionY");t==null&&e==null?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(t){let e=G(this._display.toLocal(t.get("pointTo",{x:0,y:0})).x,3);this._toX!=e&&(this.lineX.animate({key:"x",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toX=e)}_updateYLine(t){let e=G(this._display.toLocal(t.get("pointTo",{x:0,y:0})).y,3);this._toY!=e&&(this.lineY.animate({key:"y",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toY=e)}_drawLines(){this.lineX.set("draw",t=>{t.moveTo(0,0),t.lineTo(0,this.height())}),this.lineY.set("draw",t=>{t.moveTo(0,0),t.lineTo(this.width(),0)})}updateCursor(){this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0)))),this.handleMove()}_setChart(t){this.chart=t,this._handleSyncWith();let e=t.plotContainer;this.events.on("boundschanged",()=>{this._disposers.push(this.setTimeout(()=>{this.updateCursor()},50))}),pe("touchevents")&&(this._disposers.push(e.events.on("click",s=>{ze(s.originalEvent)&&this._handleMove(s)})),this._setUpTouch()),this._disposers.push(e.events.on("pointerdown",s=>{this._handleCursorDown(s)})),this._disposers.push(e.events.on("globalpointerup",s=>{this._handleCursorUp(s),!s.native&&!this.isHidden()&&this._handleMove(s)})),this._disposers.push(e.events.on("globalpointermove",s=>{!this.get("syncWith")&&Gt(e._downPoints).length==0&&!s.native&&this.isHidden()||(this._handleMove(s),Math.hypot(this._lastPoint2.x-s.point.x,this._lastPoint2.y-s.point.y)>1&&(this._handleLineBlur(),this._lastPoint2=s.point))}));let i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(t){let e=this.chart;return e?e.inPlot(t):!1}_handleCursorDown(t){if(t.originalEvent.button==2)return;let e=t.point,i=this._display.toLocal(e),s=this.chart;if(this.selection.set("draw",()=>{}),s&&this._inPlot(i)){if(this._downPoint=i,this.get("behavior")!="none"){this.selection.show();let r="selectstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:t.originalEvent})}let a=this._getPosition(i).x,o=this._getPosition(i).y;this.setPrivate("downPositionX",a),this.setPrivate("downPositionY",o)}}_handleCursorUp(t){if(this._downPoint){let e=this.get("behavior","none");if(e!="none"){e.charAt(0)==="z"&&this.selection.hide();let i=t.point,s=this._display.toLocal(i),a=this._downPoint,o=this.get("moveThreshold",1);if(s&&a){let r=!1;if((e==="zoomX"||e==="zoomXY"||e==="selectX"||e==="selectXY")&&Math.abs(s.x-a.x)>o&&(r=!0),(e==="zoomY"||e==="zoomXY"||e==="selectY"||e==="selectXY")&&Math.abs(s.y-a.y)>o&&(r=!0),r){let n="selectended";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this,originalEvent:t.originalEvent})}else{let n="selectcancelled";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this,originalEvent:t.originalEvent})}}}}this._downPoint=void 0}_handleMove(t){if(this.getPrivate("visible")){let e=this.chart;if(e&&Gt(e.plotContainer._downPoints).length>1){this.set("forceHidden",!0);return}else this.set("forceHidden",!1);let i=t.point,s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate("lastPoint",i),this.handleMove({x:i.x,y:i.y},!1,t.originalEvent)}}_getPosition(t){return{x:t.x/this.width(),y:t.y/this.height()}}handleMove(t,e,i){t||(t=this._movePoint);let s=this.get("alwaysShow");if(!t){this.hide(0);return}this._movePoint=t;let a=this._display.toLocal(t),o=this.chart;if(o&&(this._inPlot(a)||this._downPoint)){o._movePoint=t,this.isHidden()&&(this.show(),this.get("behavior","").charAt(0)=="z"&&this.selection.set("draw",()=>{}));let r=a.x,n=a.y,l=this._getPosition(a);this.setPrivate("point",a);let h=this.get("snapToSeries");this._downPoint&&(h=void 0);let c=this.get("positionX"),d=l.x;v(c)&&(d=c);let u=this.get("positionY"),f=l.y;v(u)&&(f=u),this.setPrivate("positionX",d),this.setPrivate("positionY",f);let m=this._getPoint(d,f);if(r=m.x,n=m.y,o.xAxes.each(g=>{g._handleCursorPosition(d,h),s&&g.handleCursorShow()}),o.yAxes.each(g=>{g._handleCursorPosition(f,h),s&&g.handleCursorShow()}),!e){o._handleCursorPosition();let g="cursormoved";this.events.isEnabled(g)&&this.events.dispatch(g,{type:g,target:this,point:t,originalEvent:i})}this._updateLines(r,n),o.arrangeTooltips()}else if(!this._downPoint&&!s){this.hide(0);let r="cursorhidden";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this})}this._downPoint&&this.get("behavior")!="none"&&this._updateSelection(a)}_getPoint(t,e){return{x:this.width()*t,y:this.height()*e}}_updateLines(t,e){this._tooltipX||this.lineX.set("x",t),this._tooltipY||this.lineY.set("y",e),this._drawLines()}_updateSelection(t){let e=this.selection,i=this.get("behavior"),s=this.width(),a=this.height();t.x<0&&(t.x=0),t.x>s&&(t.x=s),t.y<0&&(t.y=0),t.y>a&&(t.y=a),e.set("draw",o=>{let r=this._downPoint;r&&(i==="zoomXY"||i==="selectXY"?(o.moveTo(r.x,r.y),o.lineTo(r.x,t.y),o.lineTo(t.x,t.y),o.lineTo(t.x,r.y),o.lineTo(r.x,r.y)):i==="zoomX"||i==="selectX"?(o.moveTo(r.x,0),o.lineTo(r.x,a),o.lineTo(t.x,a),o.lineTo(t.x,0),o.lineTo(r.x,0)):(i==="zoomY"||i==="selectY")&&(o.moveTo(0,r.y),o.lineTo(s,r.y),o.lineTo(s,t.y),o.lineTo(0,t.y),o.lineTo(0,r.y)))})}_onHide(){if(this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorHide()}),t.yAxes.each(e=>{e.handleCursorHide()}),t.series.each(e=>{e.handleCursorHide()}))}super._onHide()}_onShow(){if(!this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorShow()}),t.yAxes.each(e=>{e.handleCursorShow()}))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}};Bt.className="XYCursor";Bt.classNames=U.classNames.concat([Bt.className]);function Xe(A,t){return A==null?t:t==null?A:t<A?t:A}function Ye(A,t){return A==null?t:t==null||A>t?A:t}var lt=class extends Te{constructor(){super(...arguments),this._axesDirty=!1,this._stackDirty=!1,this._selectionProcessed=!1,this._dataSets={},this._x=0,this._y=0,this._bullets={},this.mainContainer=this.children.push(U.new(this._root,{})),this.axisRanges=new ue,this._skipped=!1,this._couldStackTo=[],this._reallyStackedTo={},this._stackedSeries={},this._aLocationX0=0,this._aLocationX1=1,this._aLocationY0=0,this._aLocationY1=1,this._showBullets=!0,this.valueXFields=["valueX","openValueX","lowValueX","highValueX"],this.valueYFields=["valueY","openValueY","lowValueY","highValueY"],this._emptyDataItem=new K(this,void 0,{})}_afterNew(){this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high");let t=this.get("xAxis");t&&(this._xRenderer=t.get("renderer"));let e=this.get("yAxis");e&&(this._yRenderer=e.get("renderer")),super._afterNew(),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll(i=>{if(i.type==="clear")T(i.oldValues,s=>{this._removeAxisRange(s)});else if(i.type==="push")this._processAxisRange(i.newValue);else if(i.type==="setIndex")this._processAxisRange(i.newValue);else if(i.type==="insertIndex")this._processAxisRange(i.newValue);else if(i.type==="removeIndex")this._removeAxisRange(i.oldValue);else if(i.type==="moveIndex")this._processAxisRange(i.value);else throw new Error("Unknown IStreamEvent type")})),this.states.create("hidden",{opacity:1,visible:!1}),this.onPrivate("startIndex",()=>{this.root.events.once("frameended",()=>{this.updateLegendValue()})}),this.onPrivate("endIndex",()=>{this.root.events.once("frameended",()=>{this.updateLegendValue()})}),this._makeFieldNames()}_processAxisRange(t){let e=U.new(this._root,{});t.container=e,this.children.push(e),t.series=this;let i=t.axisDataItem;i.setRaw("isRange",!0);let s=i.component;if(s){s._processAxisRange(i,["range","series"]);let a=i.get("bullet");if(a){let r=a.get("sprite");r&&r.setPrivate("visible",!1)}let o=i.get("axisFill");o&&e.set("mask",o),s._seriesAxisRanges.push(i)}}_onDataClear(){super._onDataClear(),vt(this._dataSets,(t,e)=>{T(e,i=>{i.dispose()}),e.length=0})}_removeAxisRange(t){let e=t.axisDataItem,i=e.component;e.dispose(),Rt(i._seriesAxisRanges,e);let s=t.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&T(this.valueXFields,t=>{if(this.get(t+"Field")){this._valueXFields.push(t);let i=this.get(t+"Show");this.__valueXShowFields.push(i),i.indexOf("Working")!=-1?this._valueXShowFields.push(i.split("Working")[0]):this._valueXShowFields.push(i)}}),this.valueYFields&&T(this.valueYFields,t=>{if(this.get(t+"Field")){this._valueYFields.push(t);let i=this.get(t+"Show");this.__valueYShowFields.push(i),i.indexOf("Working")!=-1?this._valueYShowFields.push(i.split("Working")[0]):this._valueYShowFields.push(i)}})}_dispose(){super._dispose(),this._bullets={};let t=this.chart;t&&t.series.removeValue(this),me(this.get("xAxis").series,this),me(this.get("yAxis").series,this)}_min(t,e){let i=Xe(this.getPrivate(t),e);this.setPrivate(t,i)}_max(t,e){let i=Ye(this.getPrivate(t),e);this.setPrivate(t,i)}_shouldMakeBullet(t){let e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis");if(!e.inited||!i.inited)return!1;let a=this.get("minBulletDistance",0);if(a>0){let o=this.startIndex(),n=this.endIndex()-o;if(e==s){if(this._xRenderer.axisLength()/n<a/5)return!1}else if(i==s&&this._yRenderer.axisLength()/n<a/5)return!1}return t.get(this._xField)!=null&&t.get(this._yField)!=null}_makeFieldNames(){let t=this.get("xAxis"),e=this.get("yAxis"),i=t.getPrivate("name"),s=xe(i),a=e.getPrivate("name"),o=xe(a),r=t.get("renderer").getPrivate("letter"),n=e.get("renderer").getPrivate("letter"),l="open",h="low",c="high",d="Show";t.className==="ValueAxis"?(this._xField=this.get(i+r+d),this._xOpenField=this.get(l+s+r+d),this._xLowField=this.get(h+s+r+d),this._xHighField=this.get(c+s+r+d)):(this._xField=i+r,this._xOpenField=l+s+r,this._xLowField=h+s+r,this._xHighField=c+s+r),e.className==="ValueAxis"?(this._yField=this.get(a+n+d),this._yOpenField=this.get(l+o+n+d),this._yLowField=this.get(h+o+n+d),this._yHighField=this.get(c+o+n+d)):(this._yField=a+n,this._yOpenField=l+o+n,this._yLowField=h+o+n,this._yHighField=c+o+n)}_fixVC(){let t=this.get("xAxis"),e=this.get("yAxis"),i=this.get("baseAxis"),s=this.states.lookup("hidden"),a=this.get("sequencedInterpolation");if(s){let o=0;a&&(o=.999999999999),t===i?s.set("vcy",o):(e===i||s.set("vcy",o),s.set("vcx",o))}}_handleMaskBullets(){this.isDirty("maskBullets")&&this.bulletsContainer.set("maskContent",this.get("maskBullets"))}_fixPosition(){let t=this.get("xAxis"),e=this.get("yAxis");this.set("x",t.x()-Lt(t.get("centerX",0),t.width())-t.parent.get("paddingLeft",0)),this.set("y",e.y()-Lt(e.get("centerY",0),e.height())-e.parent.get("paddingTop",0)),this.bulletsContainer.set("y",this.y()),this.bulletsContainer.set("x",this.x())}_prepareChildren(){super._prepareChildren(),this._xRenderer=this.get("xAxis").get("renderer"),this._yRenderer=this.get("yAxis").get("renderer"),this._bullets={},(this.isDirty("valueYShow")||this.isDirty("valueXShow")||this.isDirty("openValueYShow")||this.isDirty("openValueXShow")||this.isDirty("lowValueYShow")||this.isDirty("lowValueXShow")||this.isDirty("highValueYShow")||this.isDirty("highValue