let t;/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/navigator
 * @requires highcharts
 *
 * Standalone navigator module
 *
 * (c) 2009-2026 Highsoft AS
 * Author: Mateusz Bernacik
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as e from"../highcharts.js";var i,s={};s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let a=e.default;var r=s.n(a);let o=e.default.Chart;var n=s.n(o);let h=e.default.Axis;var d=s.n(h);let{isTouchDevice:l}=r(),c=[];function g(){this.navigator&&this.navigator.setBaseSeries(null,!1)}function p(){let t,e,i,s=this.legend,r=this.navigator;if(r){t=s&&s.options,e=r.xAxis,i=r.yAxis;let{scrollbarHeight:o,scrollButtonSize:n}=r;this.inverted?(r.left=r.opposite?this.chartWidth-o-r.height:this.spacing[3]+o,r.top=this.plotTop+n):(r.left=(0,a.pick)(e.left,this.plotLeft+n),r.top=r.navigatorOptions.top||this.chartHeight-r.height-o-(this.scrollbar?.options.margin||0)-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(t&&"bottom"===t.verticalAlign&&"proximate"!==t.layout&&t.enabled&&!t.floating?s.legendHeight+(0,a.pick)(t.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0)),e&&i&&(this.inverted?e.options.left=i.options.left=r.left:e.options.top=i.options.top=r.top,e.setAxisSize(),i.setAxisSize())}}function x(e){!this.navigator&&!this.scroller&&(this.options.navigator.enabled||this.options.scrollbar.enabled)&&(this.scroller=this.navigator=new t(this),(0,a.pick)(e.redraw,!0)&&this.redraw(e.animation))}function u(){let e=this.options;(e.navigator.enabled||e.scrollbar.enabled)&&(this.scroller=this.navigator=new t(this))}function v(){let t=this.options,e=t.navigator,i=t.rangeSelector;if((e&&e.enabled||i&&i.enabled)&&(!l&&"x"===this.zooming.type||l&&"x"===this.zooming.pinchType))return!1}function m(t){let e=t.navigator;if(e&&t.xAxis[0]){let i=t.xAxis[0].getExtremes();e.render(i.min,i.max)}}function b(t){let e=t.options.navigator||{},i=t.options.scrollbar||{};!this.navigator&&!this.scroller&&(e.enabled||i.enabled)&&((0,a.merge)(!0,this.options.navigator,e),(0,a.merge)(!0,this.options.scrollbar,i),delete t.options.navigator,delete t.options.scrollbar)}let f=function(e,i){if((0,a.pushUnique)(c,e)){let s=e.prototype;t=i,s.callbacks.push(m),(0,a.addEvent)(e,"afterAddSeries",g),(0,a.addEvent)(e,"afterSetChartSize",p),(0,a.addEvent)(e,"afterUpdate",x),(0,a.addEvent)(e,"beforeRender",u),(0,a.addEvent)(e,"beforeShowResetZoom",v),(0,a.addEvent)(e,"update",b)}},{isTouchDevice:M}=r();function E(){this.navigatorAxis||(this.navigatorAxis=new k(this))}function A(t){let e,i=this.chart,s=i.options,r=s.navigator,o=this.navigatorAxis,n=i.zooming.pinchType,h=s.rangeSelector,d=i.zooming.type;if(this.isXAxis&&(r?.enabled||h?.enabled)){if("y"===d&&"zoom"===t.trigger)e=!1;else if(("zoom"===t.trigger&&"xy"===d||M&&"xy"===n)&&this.options.range){let e=o.previousZoom;(0,a.defined)(t.min)?o.previousZoom=[this.min,this.max]:e&&(t.min=e[0],t.max=e[1],o.previousZoom=void 0)}}void 0!==e&&t.preventDefault()}class k{static compose(t){t.keepProps.includes("navigatorAxis")||(t.keepProps.push("navigatorAxis"),(0,a.addEvent)(t,"init",E),(0,a.addEvent)(t,"setExtremes",A))}constructor(t){this.axis=t}destroy(){this.axis=void 0}toFixedRange(t,e,i,s){let r=this.axis,o=(r.pointRange||0)/2,n=(0,a.pick)(i,r.translate(t,!0,!r.horiz)),h=(0,a.pick)(s,r.translate(e,!0,!r.horiz));return(0,a.defined)(i)||(n=(0,a.correctFloat)(n+o)),(0,a.defined)(s)||(h=(0,a.correctFloat)(h-o)),(0,a.isNumber)(n)&&(0,a.isNumber)(h)||(n=h=void 0),{min:n,max:h}}}let y=e.default.SeriesRegistry,{seriesTypes:w}=s.n(y)(),O={height:40,margin:22,maskInside:!0,handles:{width:7,borderRadius:0,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0,lineWidth:1,backgroundColor:"var(--highcharts-neutral-color-5)",borderColor:"var(--highcharts-neutral-color-40)"},maskFill:"color-mix(var(--highcharts-highlight-color-60) 30%, transparent)",outlineColor:"var(--highcharts-neutral-color-40)",outlineWidth:1,series:{type:void 0===w.areaspline?"line":"areaspline",fillOpacity:.05,lineWidth:1,compare:null,sonification:{enabled:!1},dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,firstAnchor:"firstPoint",anchor:"middle",lastAnchor:"lastPoint",units:[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2,3,4]],["week",[1,2,3]],["month",[1,3,6]],["year",null]]},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"var(--highcharts-neutral-color-10)",id:"navigator-x-axis",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"var(--highcharts-neutral-color-100)",fontSize:"0.7em",opacity:.6,textOutline:"2px contrast"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,id:"navigator-y-axis",maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:void 0},tickLength:0,tickWidth:0}},S={"navigator-handle":function(t,e,i,s,r={}){var o,n,h,d;let l=r.width?r.width/2:i,c=(0,a.relativeLength)(r.borderRadius||0,Math.min(2*l,s));return[["M",-1.5,(s=r.height||s)/2-3.5],["L",-1.5,s/2+4.5],["M",.5,s/2-3.5],["L",.5,s/2+4.5],...(o=-l-1,n=2*l+1,h=s,d={r:c},d?.r?function(t,e,i,s,a){let r=a?.r||0;return[["M",t+r,e],["L",t+i-r,e],["A",r,r,0,0,1,t+i,e+r],["L",t+i,e+s-r],["A",r,r,0,0,1,t+i-r,e+s],["L",t+r,e+s],["A",r,r,0,0,1,t,e+s-r],["L",t,e+r],["A",r,r,0,0,1,t+r,e],["Z"]]}(o,.5,n,h,d):[["M",o,.5],["L",o+n,.5],["L",o+n,.5+h],["L",o,.5+h],["Z"]])]}},z=e.default.SVGRenderer;var T=s.n(z);let{defaultOptions:D}=r(),{composed:R}=r(),{setFixedRange:B}={setFixedRange:function(t){let e=this.xAxis[0];(0,a.defined)(e.dataMax)&&(0,a.defined)(e.dataMin)&&t?this.fixedRange=Math.min(t,e.dataMax-e.dataMin):this.fixedRange=t}};function P(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}let C=function(t,e,i){k.compose(e),(0,a.pushUnique)(R,"Navigator")&&(t.prototype.setFixedRange=B,(0,a.extend)(T().prototype.symbols,S),(0,a.extend)(D,{navigator:O}),(0,a.addEvent)(i,"afterUpdate",P))},{composed:L}=r();!function(t){let e;function i(t){let e=(0,a.pick)(t.options?.min,t.min),i=(0,a.pick)(t.options?.max,t.max);return{axisMin:e,axisMax:i,scrollMin:(0,a.defined)(t.dataMin)?Math.min(e,t.min??1/0,t.dataMin,t.threshold??1/0):e,scrollMax:t.treeGrid?.adjustedMax??((0,a.defined)(t.dataMax)?Math.max(i,t.max??-1/0,t.dataMax,t.threshold??-1/0):i)}}function s(){let t=this.scrollbar,e=t&&!t.options.opposite,i=this.horiz?2:e?3:1;t&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[i]+=t.size+(t.options.margin||0))}function r(){let t=this;t.options?.scrollbar?.enabled&&(t.options.scrollbar.vertical=!t.horiz,t.options.startOnTick=t.options.endOnTick=!1,t.scrollbar=new e(t.chart.renderer,t.options.scrollbar,t.chart),(0,a.addEvent)(t.scrollbar,"changed",function(e){let s,r,{axisMin:o,axisMax:n,scrollMin:h,scrollMax:d}=i(t),l=t.toPixels(h),c=t.toPixels(d)-l;if((0,a.defined)(o)&&(0,a.defined)(n))if(t.horiz&&!t.reversed||!t.horiz&&t.reversed?(s=Math.min(d,t.toValue(l+c*this.to)),r=Math.max(h,t.toValue(l+c*this.from))):(s=Math.min(d,t.toValue(l+c*(1-this.from))),r=Math.max(h,t.toValue(l+c*(1-this.to)))),this.shouldUpdateExtremes(e.DOMType)){let i="mousemove"!==e.DOMType&&"touchmove"!==e.DOMType&&void 0;t.setExtremes((0,a.correctFloat)(r),(0,a.correctFloat)(s),!0,i,e)}else this.setRange(this.from,this.to)}))}function o(){let t,e,s,{scrollMin:r,scrollMax:o}=i(this),n=this.scrollbar,h=(this.axisTitleMargin||0)+(this.titleOffset||0),d=this.chart.scrollbarsOffsets,l=this.options.margin||0;if(n&&d){if(this.horiz)this.opposite||(d[1]+=h),n.position(this.left,this.top+this.height+2+d[1]-(this.opposite?l:0),this.width,this.height),this.opposite||(d[1]+=l),t=1;else{let e;this.opposite&&(d[0]+=h),e=n.options.opposite?this.left+this.width+2+d[0]-(this.opposite?0:l):this.opposite?0:l,n.position(e,this.top,this.width,this.height),this.opposite&&(d[0]+=l),t=0}if(d[t]+=n.size+(n.options.margin||0),isNaN(r)||isNaN(o)||!(0,a.defined)(this.min)||!(0,a.defined)(this.max)||(0,a.defined)(this.dataMin)&&this.dataMin===this.dataMax)n.setRange(0,1);else if(this.min===this.max){let t=this.pointRange/(this.dataMax+1);e=t*this.min,s=t*(this.max+1),n.setRange(e,s)}else e=(this.toPixels(this.min)-this.toPixels(r))/(this.toPixels(o)-this.toPixels(r)),s=(this.toPixels(this.max)-this.toPixels(r))/(this.toPixels(o)-this.toPixels(r)),this.horiz&&!this.reversed||!this.horiz&&this.reversed?n.setRange(e,s):n.setRange(1-s,1-e)}}t.compose=function(t,i){(0,a.pushUnique)(L,"Axis.Scrollbar")&&(e=i,(0,a.addEvent)(t,"afterGetOffset",s),(0,a.addEvent)(t,"afterInit",r),(0,a.addEvent)(t,"afterRender",o))}}(i||(i={}));let W=i,N={height:10,barBorderRadius:5,buttonBorderRadius:0,buttonsEnabled:!1,liveRedraw:void 0,margin:void 0,minWidth:6,opposite:!0,step:.2,zIndex:3,barBackgroundColor:"var(--highcharts-neutral-color-20)",barBorderWidth:0,barBorderColor:"var(--highcharts-neutral-color-20)",buttonArrowColor:"var(--highcharts-neutral-color-80)",buttonBackgroundColor:"var(--highcharts-neutral-color-10)",buttonBorderColor:"var(--highcharts-neutral-color-20)",buttonBorderWidth:1,rifleColor:"none",trackBackgroundColor:"rgba(255, 255, 255, 0.001)",trackBorderColor:"var(--highcharts-neutral-color-20)",trackBorderRadius:5,trackBorderWidth:1},{defaultOptions:U}=r(),{composed:H}=r();class I{static compose(t){W.compose(t,I),(0,a.pushUnique)(H,"Scrollbar")&&(0,a.extend)(U,{scrollbar:N})}static swapXY(t,e){return e&&t.forEach(t=>{let e,i=t.length;for(let s=0;s<i;s+=2)"number"==typeof(e=t[s+1])&&(t[s+1]=t[s+2],t[s+2]=e)}),t}constructor(t,e,i){this._events=[],this.chartX=0,this.chartY=0,this.from=0,this.scrollbarButtons=[],this.scrollbarLeft=0,this.scrollbarStrokeWidth=1,this.scrollbarTop=0,this.size=0,this.to=0,this.trackBorderWidth=1,this.x=0,this.y=0,this.init(t,e,i)}addEvents(){let t=this.options.inverted?[1,0]:[0,1],e=this.scrollbarButtons,i=this.scrollbarGroup.element,s=this.track.element,r=this.mouseDownHandler.bind(this),o=this.mouseMoveHandler.bind(this),n=this.mouseUpHandler.bind(this),h=[[e[t[0]].element,"click",this.buttonToMinClick.bind(this)],[e[t[1]].element,"click",this.buttonToMaxClick.bind(this)],[s,"click",this.trackClick.bind(this)],[i,"mousedown",r],[i.ownerDocument,"mousemove",o],[i.ownerDocument,"mouseup",n],[i,"touchstart",r],[i.ownerDocument,"touchmove",o],[i.ownerDocument,"touchend",n]];h.forEach(function(t){a.addEvent.apply(null,t)}),this._events=h}buttonToMaxClick(t){let e=(this.to-this.from)*(0,a.pick)(this.options.step,.2);this.updatePosition(this.from+e,this.to+e),(0,a.fireEvent)(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:t})}buttonToMinClick(t){let e=(0,a.correctFloat)(this.to-this.from)*(0,a.pick)(this.options.step,.2);this.updatePosition((0,a.correctFloat)(this.from-e),(0,a.correctFloat)(this.to-e)),(0,a.fireEvent)(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:t})}cursorToScrollbarPosition(t){let e=this.options,i=e.minWidth>this.calculatedWidth?e.minWidth:0;return{chartX:(t.chartX-this.x-this.xOffset)/(this.barWidth-i),chartY:(t.chartY-this.y-this.yOffset)/(this.barWidth-i)}}destroy(){let t=this,e=t.chart.scroller;t.removeEvents(),["track","scrollbarRifles","scrollbar","scrollbarGroup","group"].forEach(function(e){t[e]&&t[e].destroy&&(t[e]=t[e].destroy())}),e&&t===e.scrollbar&&(e.scrollbar=null,(0,a.destroyObjectProperties)(e.scrollbarButtons))}drawScrollbarButton(t){let e=this.renderer,i=this.scrollbarButtons,s=this.options,a=this.size,r=e.g().add(this.group);if(i.push(r),s.buttonsEnabled){let o=e.rect().addClass("highcharts-scrollbar-button").add(r);this.chart.styledMode||o.attr({stroke:s.buttonBorderColor,"stroke-width":s.buttonBorderWidth,fill:s.buttonBackgroundColor}),o.attr(o.crisp({x:-.5,y:-.5,width:a,height:a,r:s.buttonBorderRadius},o.strokeWidth()));let n=e.path(I.swapXY([["M",a/2+(t?-1:1),a/2-3],["L",a/2+(t?-1:1),a/2+3],["L",a/2+(t?2:-2),a/2]],s.vertical)).addClass("highcharts-scrollbar-arrow").add(i[t]);this.chart.styledMode||n.attr({fill:s.buttonArrowColor})}}init(t,e,i){this.scrollbarButtons=[],this.renderer=t,this.userOptions=e,this.options=(0,a.merge)(N,U.scrollbar,e),this.options.margin=(0,a.pick)(this.options.margin,10),this.chart=i,this.size=(0,a.pick)(this.options.size,this.options.height),e.enabled&&(this.render(),this.addEvents())}mouseDownHandler(t){let e=this.chart.pointer?.normalize(t)||t,i=this.cursorToScrollbarPosition(e);this.chartX=i.chartX,this.chartY=i.chartY,this.initPositions=[this.from,this.to],this.grabbedCenter=!0}mouseMoveHandler(t){let e,i=this.chart.pointer?.normalize(t)||t,s=this.options.vertical?"chartY":"chartX",r=this.initPositions||[];this.grabbedCenter&&(!t.touches||0!==t.touches[0][s])&&(e=this.cursorToScrollbarPosition(i)[s]-this[s],this.hasDragged=!0,this.updatePosition(r[0]+e,r[1]+e),this.hasDragged&&(0,a.fireEvent)(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:t.type,DOMEvent:t}))}mouseUpHandler(t){this.hasDragged&&(0,a.fireEvent)(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:t.type,DOMEvent:t}),this.grabbedCenter=this.hasDragged=this.chartX=this.chartY=null}position(t,e,i,s){let{buttonsEnabled:a,margin:r=0,vertical:o}=this.options,n=this.rendered?"animate":"attr",h=s,d=0;this.group.show(),this.x=t,this.y=e+this.trackBorderWidth,this.width=i,this.height=s,this.xOffset=h,this.yOffset=d,o?(this.width=this.yOffset=i=d=this.size,this.xOffset=h=0,this.yOffset=d=a?this.size:0,this.barWidth=s-(a?2*i:0),this.x=t+=r):(this.height=s=this.size,this.xOffset=h=a?this.size:0,this.barWidth=i-(a?2*s:0),this.y=this.y+r),this.group[n]({translateX:t,translateY:this.y}),this.track[n]({width:i,height:s}),this.scrollbarButtons[1][n]({translateX:o?0:i-h,translateY:o?s-d:0})}removeEvents(){this._events.forEach(function(t){a.removeEvent.apply(null,t)}),this._events.length=0}render(){let t=this.renderer,e=this.options,i=this.size,s=this.chart.styledMode,r=t.g("scrollbar").attr({zIndex:e.zIndex}).hide().add();this.group=r,this.track=t.rect().addClass("highcharts-scrollbar-track").attr({r:e.trackBorderRadius||0,height:i,width:i}).add(r),s||this.track.attr({fill:e.trackBackgroundColor,stroke:e.trackBorderColor,"stroke-width":e.trackBorderWidth});let o=this.trackBorderWidth=this.track.strokeWidth();this.track.attr({x:-(0,a.crisp)(0,o),y:-(0,a.crisp)(0,o)}),this.scrollbarGroup=t.g().add(r),this.scrollbar=t.rect().addClass("highcharts-scrollbar-thumb").attr({height:i-o,width:i-o,r:e.barBorderRadius||0}).add(this.scrollbarGroup),this.scrollbarRifles=t.path(I.swapXY([["M",-3,i/4],["L",-3,2*i/3],["M",0,i/4],["L",0,2*i/3],["M",3,i/4],["L",3,2*i/3]],e.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup),s||(this.scrollbar.attr({fill:e.barBackgroundColor,stroke:e.barBorderColor,"stroke-width":e.barBorderWidth}),this.scrollbarRifles.attr({stroke:e.rifleColor,"stroke-width":1})),this.scrollbarStrokeWidth=this.scrollbar.strokeWidth(),this.scrollbarGroup.translate(-(0,a.crisp)(0,this.scrollbarStrokeWidth),-(0,a.crisp)(0,this.scrollbarStrokeWidth)),this.drawScrollbarButton(0),this.drawScrollbarButton(1)}setRange(t,e){let i,s,r=this.options,o=r.vertical,n=r.minWidth,h=this.barWidth,d=!this.rendered||this.hasDragged||this.chart.navigator&&this.chart.navigator.hasDragged?"attr":"animate";if(!(0,a.defined)(h))return;let l=h*Math.min(e,1);i=Math.ceil(h*(t=Math.max(t,0))),this.calculatedWidth=s=(0,a.correctFloat)(l-i),s<n&&(i=(h-n+s)*t,s=n);let c=Math.floor(i+this.xOffset+this.yOffset),g=s/2-.5;this.from=t,this.to=e,o?(this.scrollbarGroup[d]({translateY:c}),this.scrollbar[d]({height:s}),this.scrollbarRifles[d]({translateY:g}),this.scrollbarTop=c,this.scrollbarLeft=0):(this.scrollbarGroup[d]({translateX:c}),this.scrollbar[d]({width:s}),this.scrollbarRifles[d]({translateX:g}),this.scrollbarLeft=c,this.scrollbarTop=0),s<=12?this.scrollbarRifles.hide():this.scrollbarRifles.show(),!1===r.showFull&&(t<=0&&e>=1?this.group.hide():this.group.show()),this.rendered=!0}shouldUpdateExtremes(t){return(0,a.pick)(this.options.liveRedraw,r().svg&&!r().isTouchDevice&&!this.chart.boosted)||"mouseup"===t||"touchend"===t||!(0,a.defined)(t)}trackClick(t){let e=this.chart.pointer?.normalize(t)||t,i=this.to-this.from,s=this.y+this.scrollbarTop,r=this.x+this.scrollbarLeft;this.options.vertical&&e.chartY>s||!this.options.vertical&&e.chartX>r?this.updatePosition(this.from+i,this.to+i):this.updatePosition(this.from-i,this.to-i),(0,a.fireEvent)(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:t})}update(t){this.destroy(),this.init(this.chart.renderer,(0,a.merge)(!0,this.options,t),this.chart)}updatePosition(t,e){e>1&&(t=(0,a.correctFloat)(1-(0,a.correctFloat)(e-t)),e=1),t<0&&(e=(0,a.correctFloat)(e-t),t=0),this.from=t,this.to=e}}I.defaultOptions=N;let{defaultOptions:F}=r(),{isTouchDevice:X}=r();function Y(t,...e){let i=[].filter.call(e,a.isNumber);if(i.length)return Math[t].apply(0,i)}class G{static compose(t,e,i){f(t,G),C(t,e,i)}constructor(t){this.isDirty=!1,this.scrollbarHeight=0,this.init(t)}drawHandle(t,e,i,s){let a=this.navigatorOptions.handles.height;this.handles[e][s](i?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+parseInt(t,10)+.5-a)}:{translateX:Math.round(this.left+parseInt(t,10)),translateY:Math.round(this.top+this.height/2-a/2-1)})}drawOutline(t,e,i,s){let a=this.navigatorOptions.maskInside,r=this.outline.strokeWidth(),o=r/2,n=r%2/2,h=this.scrollButtonSize,d=this.size,l=this.top,c=this.height,g=l-o,p=l+c,x=this.left,u,v;i?(u=l+e+n,e=l+t+n,v=[["M",x+c,l-h-n],["L",x+c,u],["L",x,u],["M",x,e],["L",x+c,e],["L",x+c,l+d+h]],a&&v.push(["M",x+c,u-o],["L",x+c,e+o])):(x-=h,t+=x+h-n,e+=x+h-n,v=[["M",x,g],["L",t,g],["L",t,p],["M",e,p],["L",e,g],["L",x+d+2*h,g]],a&&v.push(["M",t-o,g],["L",e+o,g])),this.outline[s]({d:v})}drawMasks(t,e,i,s){let a,r,o,n,h=this.left,d=this.top,l=this.height;i?(o=[h,h,h],n=[d,d+t,d+e],r=[l,l,l],a=[t,e-t,this.size-e]):(o=[h,h+t,h+e],n=[d,d,d],r=[t,e-t,this.size-e],a=[l,l,l]),this.shades.forEach((t,e)=>{t[s]({x:o[e],y:n[e],width:r[e],height:a[e]})})}renderElements(){let t=this,e=t.navigatorOptions,i=e.maskInside,s=t.chart,a=s.inverted,r=s.renderer,o={cursor:a?"ns-resize":"ew-resize"},n=t.navigatorGroup??(t.navigatorGroup=r.g("navigator").attr({zIndex:8,visibility:"hidden"}).add());if([!i,i,!i].forEach((i,a)=>{let h=t.shades[a]??(t.shades[a]=r.rect().addClass("highcharts-navigator-mask"+(1===a?"-inside":"-outside")).add(n));s.styledMode||(h.attr({fill:i?e.maskFill:"rgba(0,0,0,0)"}),1===a&&h.css(o))}),t.outline||(t.outline=r.path().addClass("highcharts-navigator-outline").add(n)),s.styledMode||t.outline.attr({"stroke-width":e.outlineWidth,stroke:e.outlineColor}),e.handles?.enabled){let i=!1,a=e.handles,{height:h,width:d}=a;[0,1].forEach(e=>{let l=a.symbols[e];(i=i||t.handles[e]?.symbolName!==l)&&(t.handles[e]?.destroy(),t.handles[e]=r.symbol(l,-d/2-1,0,d,h,a),t.handles[e].attr({zIndex:7-e}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][e]).add(n)),s.inverted&&t.handles[e].attr({rotation:90,rotationOriginX:Math.floor(-d/2),rotationOriginY:(h+d)/2}),s.styledMode||t.handles[e].attr({fill:a.backgroundColor,stroke:a.borderColor,"stroke-width":a.lineWidth,width:a.width,height:a.height,x:-d/2-1,y:0}).css(o)}),i&&(t.partsEventsToUnbind?.forEach(t=>{t()}),t.partsEventsToUnbind=[...t.getPartsEvents("mousedown"),...t.getPartsEvents("touchstart")])}}update(t,e=!1){let i=this.chart,s=i.options.chart.inverted!==i.scrollbar?.options.vertical;if((0,a.merge)(!0,i.options.navigator,t),this.navigatorOptions=i.options.navigator||{},this.setOpposite(),(0,a.defined)(t.enabled)||s)return this.destroy(),this.navigatorEnabled=t.enabled||this.navigatorEnabled,this.init(i);if(this.navigatorEnabled&&(this.isDirty=!0,!1===t.adaptToUpdatedData&&this.baseSeries.forEach(t=>{(0,a.removeEvent)(t,"updatedData",this.updatedDataHandler)},this),t.adaptToUpdatedData&&this.baseSeries.forEach(t=>{t.eventsToUnbind.push((0,a.addEvent)(t,"updatedData",this.updatedDataHandler))},this),(t.series||t.baseSeries)&&this.setBaseSeries(void 0,!1),t.height||t.xAxis||t.yAxis)){this.height=t.height??this.height;let e=this.getXAxisOffsets();this.xAxis.update({...t.xAxis,offsets:e,[i.inverted?"width":"height"]:this.height,[i.inverted?"height":"width"]:void 0},!1),this.yAxis.update({...t.yAxis,[i.inverted?"width":"height"]:this.height},!1)}e&&i.redraw()}render(t,e,i,s){let r=this.chart,o=this.xAxis,n=o.pointRange||0,h=o.navigatorAxis.fake?r.xAxis[0]:o,d=this.navigatorEnabled,l=this.rendered,c=r.inverted,g=r.xAxis[0].minRange,p=r.xAxis[0].options.maxRange,x=this.scrollButtonSize,u,v,m,b=this.scrollbarHeight,f,M;if(this.hasDragged&&!(0,a.defined)(i))return;if(this.isDirty&&this.renderElements(),t=(0,a.correctFloat)(t-n/2),e=(0,a.correctFloat)(e+n/2),!(0,a.isNumber)(t)||!(0,a.isNumber)(e))if(!l)return;else i=0,s=(0,a.pick)(o.width,h.width);this.left=(0,a.pick)(o.left,r.plotLeft+x+(c?r.plotWidth:0));let E=this.size=f=(0,a.pick)(o.len,(c?r.plotHeight:r.plotWidth)-2*x);u=c?b:f+2*x,i=(0,a.pick)(i,o.toPixels(t,!0)),s=(0,a.pick)(s,o.toPixels(e,!0)),(0,a.isNumber)(i)&&Math.abs(i)!==1/0||(i=0,s=u);let A=o.toValue(i,!0),k=o.toValue(s,!0),y=Math.abs((0,a.correctFloat)(k-A));(0,a.defined)(g)&&y<g?this.grabbedLeft?i=o.toPixels(k-g-n,!0):this.grabbedRight&&(s=o.toPixels(A+g+n,!0)):(0,a.defined)(p)&&(0,a.correctFloat)(y-n)>p&&(this.grabbedLeft?i=o.toPixels(k-p-n,!0):this.grabbedRight&&(s=o.toPixels(A+p+n,!0))),this.zoomedMax=(0,a.clamp)(Math.max(i,s),0,E),this.zoomedMin=(0,a.clamp)(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(i,s),0,E),this.range=this.zoomedMax-this.zoomedMin,E=Math.round(this.zoomedMax);let w=Math.round(this.zoomedMin);d&&(this.navigatorGroup.attr({visibility:"inherit"}),M=l&&!this.hasDragged?"animate":"attr",this.drawMasks(w,E,c,M),this.drawOutline(w,E,c,M),this.navigatorOptions.handles?.enabled&&(this.drawHandle(w,0,c,M),this.drawHandle(E,1,c,M))),this.scrollbar&&(c?(m=this.top-x,v=this.left-b+(d||!h.opposite?0:(h.titleOffset||0)+h.axisTitleMargin),b=f+2*x):(m=this.top+(d?this.height:-b),v=this.left-x),this.scrollbar.position(v,m,u,b),this.scrollbar.setRange(this.zoomedMin/(f||1),this.zoomedMax/(f||1))),this.rendered=!0,this.isDirty=!1,(0,a.fireEvent)(this,"afterRender")}addMouseEvents(){let t,e,i=this,s=i.chart,r=s.container,o=[];i.mouseMoveHandler=t=function(t){i.onMouseMove(t)},i.mouseUpHandler=e=function(t){i.onMouseUp(t)},o.push((0,a.addEvent)(s.renderTo,"mousemove",t),(0,a.addEvent)(r.ownerDocument,"mouseup",e),(0,a.addEvent)(s.renderTo,"touchmove",t),(0,a.addEvent)(r.ownerDocument,"touchend",e)),i.eventsToUnbind=o,i.series&&i.series[0]&&o.push((0,a.addEvent)(i.series[0].xAxis,"foundExtremes",function(){s.navigator?.modifyNavigatorAxisExtremes()}))}getPartsEvents(t){let e=this,i=[];return["shades","handles"].forEach(s=>{e[s].forEach(function(r,o){i.push((0,a.addEvent)(r.element,t,function(t){e[`${s}Mousedown`](t,o)}))})}),i}shadesMousedown(t,e){t=this.chart.pointer?.normalize(t)||t;let i=this.chart,s=this.xAxis,r=this.zoomedMin,o=this.size,n=this.range,h=this.left,d=t.chartX,l,c,g,p;i.inverted&&(d=t.chartY,h=this.top),1===e?(this.grabbedCenter=d,this.fixedWidth=n,this.dragOffset=d-r):(p=d-h-n/2,0===e?p=Math.max(0,p):2===e&&p+n>=o&&(p=o-n,this.reversedExtremes?(p-=n,c=this.getUnionExtremes()?.dataMin):l=this.getUnionExtremes()?.dataMax),p!==r&&(this.fixedWidth=n,g=s.navigatorAxis.toFixedRange(p,p+n,c,l),(0,a.defined)(g.min)&&(0,a.fireEvent)(this,"setRange",{min:Math.min(g.min,g.max),max:Math.max(g.min,g.max),redraw:!0,eventArguments:{trigger:"navigator"}})))}handlesMousedown(t,e){t=this.chart.pointer?.normalize(t)||t;let i=this.chart,s=i.xAxis[0],a=this.reversedExtremes;0===e?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=a?s.min:s.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=a?s.max:s.min),i.setFixedRange(void 0)}onMouseMove(t){let e=this,i=e.chart,s=e.navigatorSize,r=e.range,o=e.dragOffset,n=i.inverted,h=e.left,d;(!t.touches||0!==t.touches[0].pageX)&&(d=(t=i.pointer?.normalize(t)||t).chartX,n&&(h=e.top,d=t.chartY),e.grabbedLeft?(e.hasDragged=!0,e.render(0,0,d-h,e.otherHandlePos)):e.grabbedRight?(e.hasDragged=!0,e.render(0,0,e.otherHandlePos,d-h)):e.grabbedCenter&&o&&(e.hasDragged=!0,d<o?d=o:d>s+o-r&&(d=s+o-r),e.render(0,0,d-o,d-o+r)),e.hasDragged&&(0,a.pick)(e.scrollbarOptions?.liveRedraw,!X&&!this.chart.boosted)&&(t.DOMType=t.type,setTimeout(function(){e.onMouseUp(t)},0)))}onMouseUp(t){let e,i,s,r,o,n,h=this.chart,d=this.xAxis,l=this.scrollbar,c=t.DOMEvent||t,g=h.inverted,p=this.rendered&&!this.hasDragged?"animate":"attr";(this.hasDragged&&(!l||!l.hasDragged)||"scrollbar"===t.trigger)&&(s=this.getUnionExtremes(),this.zoomedMin===this.otherHandlePos?r=this.fixedExtreme:this.zoomedMax===this.otherHandlePos&&(o=this.fixedExtreme),this.zoomedMax===this.size&&(o=this.reversedExtremes?s.dataMin:s.dataMax),0===this.zoomedMin&&(r=this.reversedExtremes?s.dataMax:s.dataMin),n=d.navigatorAxis.toFixedRange(this.zoomedMin,this.zoomedMax,r,o),(0,a.defined)(n.min)&&(0,a.fireEvent)(this,"setRange",{min:Math.min(n.min,n.max),max:Math.max(n.min,n.max),redraw:!0,animation:!this.hasDragged&&null,eventArguments:{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:c}})),"mousemove"!==t.DOMType&&"touchmove"!==t.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null),this.navigatorEnabled&&(0,a.isNumber)(this.zoomedMin)&&(0,a.isNumber)(this.zoomedMax)&&(i=Math.round(this.zoomedMin),e=Math.round(this.zoomedMax),this.shades&&this.drawMasks(i,e,g,p),this.outline&&this.drawOutline(i,e,g,p),this.navigatorOptions.handles?.enabled&&Object.keys(this.handles).length===this.handles.length&&(this.drawHandle(i,0,g,p),this.drawHandle(e,1,g,p)))}removeEvents(){this.eventsToUnbind?.forEach(t=>{t()}),this.eventsToUnbind=void 0,this.removeBaseSeriesEvents()}removeBaseSeriesEvents(){let t=this.baseSeries||[];this.navigatorEnabled&&t[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&t.forEach(function(t){(0,a.removeEvent)(t,"updatedData",this.updatedDataHandler)},this),t[0].xAxis&&(0,a.removeEvent)(t[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))}getXAxisOffsets(){return this.chart.inverted?[this.scrollButtonSize,0,-this.scrollButtonSize,0]:[0,-this.scrollButtonSize,0,this.scrollButtonSize]}init(t){let e=t.options,i=e.navigator||{},s=i.enabled,r=e.scrollbar||{},o=r.enabled,n=s&&i.height||0,h=o&&r.height||0,l=r.buttonsEnabled&&h||0;this.handles=[],this.shades=[],this.chart=t,this.setBaseSeries(),this.height=n,this.scrollbarHeight=h,this.scrollButtonSize=l,this.scrollbarEnabled=o,this.navigatorEnabled=!!s,this.navigatorOptions=i,this.scrollbarOptions=r,this.setOpposite();let c=this,g=c.baseSeries,p=t.xAxis.length,x=t.yAxis.length,u=g&&g[0]&&g[0].xAxis||t.xAxis[0]||{options:{}};if(t.isDirtyBox=!0,c.navigatorEnabled){let e=this.getXAxisOffsets();c.xAxis=new(d())(t,(0,a.merge)({breaks:u.options.breaks,ordinal:u.options.ordinal,overscroll:u.options.overscroll},i.xAxis,{type:"datetime",yAxis:i.yAxis?.id,index:p,isInternal:!0,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:u.options.ordinal?0:u.options.minPadding,maxPadding:u.options.ordinal?0:u.options.maxPadding,zoomEnabled:!1},t.inverted?{offsets:e,width:n}:{offsets:e,height:n}),"xAxis"),c.yAxis=new(d())(t,(0,a.merge)(i.yAxis,{alignTicks:!1,offset:0,index:x,isInternal:!0,reversed:(0,a.pick)(i.yAxis&&i.yAxis.reversed,t.yAxis[0]&&t.yAxis[0].reversed,!1),zoomEnabled:!1},t.inverted?{width:n}:{height:n}),"yAxis"),c.xAxis.clippable=!1,c.yAxis.clippable=!1,g||i.series?.data||i.series?.dataTable?c.updateNavigatorSeries(!1):0===t.series.length&&(c.unbindRedraw=(0,a.addEvent)(t,"beforeRedraw",function(){t.series.length>0&&!c.series&&(c.setBaseSeries(),c.unbindRedraw?.())})),c.reversedExtremes=t.inverted&&!c.xAxis.reversed||!t.inverted&&c.xAxis.reversed,c.renderElements(),c.addMouseEvents()}else c.xAxis={chart:t,navigatorAxis:{fake:!0},translate:function(e,i){let s=t.xAxis[0],a=s.getExtremes(),r=s.len-2*l,o=Y("min",s.options.min,a.dataMin),n=Y("max",s.options.max,a.dataMax)-o;return i?e*n/r+o:r*(e-o)/n},toPixels:function(t){return this.translate(t)},toValue:function(t){return this.translate(t,!0)}},c.xAxis.navigatorAxis.axis=c.xAxis,c.xAxis.navigatorAxis.toFixedRange=k.prototype.toFixedRange.bind(c.xAxis.navigatorAxis);if(t.options.scrollbar?.enabled){let e=(0,a.merge)(t.options.scrollbar,{vertical:t.inverted});(0,a.isNumber)(e.margin)||(e.margin=t.inverted?-3:3),t.scrollbar=c.scrollbar=new I(t.renderer,e,t),(0,a.addEvent)(c.scrollbar,"changed",function(t){let e=c.size,i=e*this.to,s=e*this.from;c.hasDragged=c.scrollbar?.hasDragged,c.render(0,0,s,i),this.shouldUpdateExtremes(t.DOMType)&&setTimeout(function(){c.onMouseUp(t)})})}c.addBaseSeriesEvents(),c.addChartEvents()}setOpposite(){let t=this.navigatorOptions,e=this.navigatorEnabled,i=this.chart;this.opposite=(0,a.pick)(t.opposite,!!(!e&&i.inverted))}getUnionExtremes(t){let e,i=this.chart.xAxis[0],s=this.chart.time,r=this.xAxis,o=r.options,n=i.options;return t&&null===i.dataMin||(e={dataMin:(0,a.pick)(s.parse(o?.min),Y("min",s.parse(n.min),i.dataMin,r.dataMin,r.min)),dataMax:(0,a.pick)(s.parse(o?.max),Y("max",s.parse(n.max),i.dataMax,r.dataMax,r.max))}),e}setBaseSeries(t,e){let i=this.chart,s=this.baseSeries=[];t=t||i.options.navigator?.baseSeries||(i.series.length?(0,a.find)(i.series,t=>!t.options.isInternal).index:0),(i.series||[]).forEach((e,i)=>{!e.options.isInternal&&(e.options.showInNavigator||(i===t||e.options.id===t)&&!1!==e.options.showInNavigator)&&s.push(e)}),this.xAxis&&!this.xAxis.navigatorAxis.fake&&this.updateNavigatorSeries(!0,e)}updateNavigatorSeries(t,e){let i=this,s=i.chart,r=i.baseSeries,o={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:this.navigatorOptions.xAxis?.id,yAxis:this.navigatorOptions.yAxis?.id,showInLegend:!1,stacking:void 0,isInternal:!0,states:{inactive:{opacity:1}}},n=i.series=(i.series||[]).filter(t=>{let e=t.baseSeries;return!(e&&0>r.indexOf(e))||(e&&((0,a.removeEvent)(e,"updatedData",i.updatedDataHandler),delete e.navigatorSeries),t.chart&&t.destroy(),!1)}),h,d,l=i.navigatorOptions.series,c;if(r&&r.length&&r.forEach(t=>{let g=t.navigatorSeries,p=(0,a.extend)({color:t.color,visible:t.visible},(0,a.isArray)(l)?F.navigator.series:l);if(g&&!1===i.navigatorOptions.adaptToUpdatedData)return;o.name="Navigator "+r.length,c=(h=t.options||{}).navigatorOptions||{},p.dataLabels=(0,a.splat)(p.dataLabels),(d=(0,a.merge)(h,o,p,c)).pointRange=(0,a.pick)(p.pointRange,c.pointRange,F.plotOptions[d.type||"line"]?.pointRange);let x=c.data||p.data,u=c.dataTable||p.dataTable;i.hasNavigatorData=i.hasNavigatorData||!!x||!!u,d.data=x||h.data?.slice(0),d.dataTable=u||h.dataTable,g&&g.options?g.update(d,e):(t.navigatorSeries=s.initSeries(d),(0,a.fireEvent)(t.navigatorSeries,"afterUpdate"),t.navigatorSeries.baseSeries=t,n.push(t.navigatorSeries))}),(l?.data||l?.dataTable)&&!(r&&r.length)||(0,a.isArray)(l)){let t=s.options.colors||[];i.hasNavigatorData=!1,(l=(0,a.splat)(l)).forEach((e,r)=>{o.name="Navigator "+(n.length+1),(d=(0,a.merge)(F.navigator?.series,{color:s.series[r]&&!s.series[r].options.isInternal&&s.series[r].color||t[r]||t[0]},o,e)).data=e.data,d.dataTable=e.dataTable,(d.data||d.dataTable)&&(i.hasNavigatorData=!0,n.push(s.initSeries(d)))})}t&&this.addBaseSeriesEvents()}addBaseSeriesEvents(){let t=this,e=t.baseSeries||[];e[0]&&e[0].xAxis&&e[0].eventsToUnbind.push((0,a.addEvent)(e[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes)),e.forEach(i=>{i.eventsToUnbind.push((0,a.addEvent)(i,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)})),i.eventsToUnbind.push((0,a.addEvent)(i,"hide",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)})),!1!==this.navigatorOptions.adaptToUpdatedData&&i.xAxis&&i.eventsToUnbind.push((0,a.addEvent)(i,"updatedData",this.updatedDataHandler)),i.eventsToUnbind.push((0,a.addEvent)(i,"remove",function(){e&&(0,a.erase)(e,i),this.navigatorSeries&&t.series&&((0,a.erase)(t.series,this.navigatorSeries),(0,a.defined)(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1),delete this.navigatorSeries)}))})}getBaseSeriesMin(t){return this.baseSeries.reduce(function(t,e){return Math.min(t,e.getColumn("x")[0]??t)},t)}modifyNavigatorAxisExtremes(){let t=this.xAxis;if(void 0!==t.getExtremes){let e=this.getUnionExtremes(!0);e&&(e.dataMin!==t.min||e.dataMax!==t.max)&&(t.min=e.dataMin,t.max=e.dataMax)}}modifyBaseAxisExtremes(){let t,e,i=this.chart.navigator,s=this.getExtremes(),r=s.min,o=s.max,n=s.dataMin,h=s.dataMax,d=o-r,l=i?.stickToMin,c=i?.stickToMax,g=(0,a.pick)(this.ordinal?.convertOverscroll(this.options.overscroll),0),p=i.series&&i.series[0],x=!!this.setExtremes;!(this.eventArgs&&"rangeSelectorButton"===this.eventArgs.trigger)&&(l&&(t=(e=n)+d),c&&(t=h+g,l||(e=Math.max(n,t-d,i.getBaseSeriesMin(p&&p.xData?p.xData[0]:-Number.MAX_VALUE)))),x&&(l||c)&&(0,a.isNumber)(e)&&(this.min=this.userMin=e,this.max=this.userMax=t)),i.stickToMin=i.stickToMax=null}updatedDataHandler(){let t=this.chart.navigator,e=this.navigatorSeries,i=t.reversedExtremes?0===Math.round(t.zoomedMin):Math.round(t.zoomedMax)>=Math.round(t.size);t.stickToMax=(0,a.pick)(this.chart.options.navigator&&this.chart.options.navigator.stickToMax,i),t.stickToMin=t.shouldStickToMin(this,t),e&&!t.hasNavigatorData&&(e.options.pointStart=this.getColumn("x")[0],e.setData(this.options.data||this.options.dataTable,!1,void 0,!1))}shouldStickToMin(t,e){let i=e.getBaseSeriesMin(t.getColumn("x")[0]),s=t.xAxis,r=s.max,o=s.min,n=s.options.range;return!!((0,a.isNumber)(r)&&(0,a.isNumber)(o))&&(n&&r-i>0?r-i<n:o<=i)}addChartEvents(){this.eventsToUnbind||(this.eventsToUnbind=[]),this.eventsToUnbind.push((0,a.addEvent)(this.chart,"redraw",function(){let t=this.navigator,e=t&&(t.baseSeries&&t.baseSeries[0]&&t.baseSeries[0].xAxis||this.xAxis[0]);e&&t.render(e.min,e.max)}),(0,a.addEvent)(this.chart,"getMargins",function(){let t=this.navigator,e=t.opposite?"plotTop":"marginBottom";this.inverted&&(e=t.opposite?"marginRight":"plotLeft"),this[e]=(this[e]||0)+(t.navigatorEnabled||!this.inverted?t.height+(this.scrollbar?.options.margin||0)+t.scrollbarHeight:0)+(t.navigatorOptions.margin||0)}),(0,a.addEvent)(this,"setRange",function(t){this.chart.xAxis[0].setExtremes(t.min,t.max,t.redraw,t.animation,t.eventArguments)}))}destroy(){this.removeEvents(),this.xAxis&&((0,a.erase)(this.chart.xAxis,this.xAxis),(0,a.erase)(this.chart.axes,this.xAxis)),this.yAxis&&((0,a.erase)(this.chart.yAxis,this.yAxis),(0,a.erase)(this.chart.axes,this.yAxis)),(this.series||[]).forEach(t=>{t.destroy&&t.destroy()}),["series","xAxis","yAxis","shades","outline","scrollbarTrack","scrollbarRifles","scrollbarGroup","scrollbar","navigatorGroup","rendered"].forEach(t=>{this[t]&&this[t].destroy&&this[t].destroy(),this[t]=null}),[this.handles].forEach(t=>{(0,a.destroyObjectProperties)(t)}),this.baseSeries.forEach(t=>{t.navigatorSeries=void 0}),this.navigatorEnabled=!1}}let V={chart:{height:70,margin:[0,5,0,5]},exporting:{enabled:!1},legend:{enabled:!1},navigator:{enabled:!1},plotOptions:{series:{states:{hover:{enabled:!1}},marker:{enabled:!1}}},scrollbar:{enabled:!1},title:{text:""},tooltip:{enabled:!1},xAxis:{visible:!1},yAxis:{height:0,visible:!1}};class _{static navigator(t,e){let i=new _(t,e);return r().navigators?r().navigators.push(i):r().navigators=[i],i}constructor(t,e){this.boundAxes=[],this.userOptions=e,this.chartOptions=(0,a.merge)(r().getOptions(),V,e.chart,{navigator:e}),this.chartOptions.chart&&e.height&&(this.chartOptions.chart.height=e.height);let i=new(n())(t,this.chartOptions);i.options=(0,a.merge)(i.options,{navigator:{enabled:!0},scrollbar:{enabled:!0}}),this.chartOptions.navigator&&this.chartOptions.scrollbar&&(this.chartOptions.navigator.enabled=!0,this.chartOptions.scrollbar.enabled=!0),this.navigator=new G(i),i.navigator=this.navigator,this.initNavigator()}bind(t,e=!0){let i=this,s=t instanceof n()?t.xAxis[0]:t;if(!(s instanceof d()))return;let{min:r,max:o}=this.navigator.xAxis,h=[];if(e){let t=(0,a.addEvent)(s,"setExtremes",t=>{("pan"===t.trigger||"zoom"===t.trigger||"mousewheel"===t.trigger||"rangeSelectorButton"===t.trigger||"rangeSelectorInput"===t.trigger)&&i.setRange(t.min,t.max,!0,"pan"!==t.trigger&&"mousewheel"!==t.trigger,{trigger:s})});h.push(t)}let l=(0,a.addEvent)(this.navigator,"setRange",t=>{s.setExtremes(t.min,t.max,t.redraw,t.animation)});h.push(l);let c=this.boundAxes.filter(function(t){return t.axis===s})[0];c||(c={axis:s,callbacks:[]},this.boundAxes.push(c)),c.callbacks=h,s.series.forEach(t=>{t.options.showInNavigator&&i.addSeries(t.options)}),s.setExtremes(r,o),(0,a.addEvent)(s,"destroy",t=>{t.keepEvents||this.unbind(s)})}unbind(t){if(!t){this.boundAxes.forEach(({callbacks:t})=>{t.forEach(t=>t())}),this.boundAxes.length=0;return}let e=t instanceof d()?t:t.xAxis[0];for(let t=this.boundAxes.length-1;t>=0;t--)this.boundAxes[t].axis===e&&(this.boundAxes[t].callbacks.forEach(t=>t()),this.boundAxes.splice(t,1))}destroy(){this.boundAxes.forEach(({callbacks:t})=>{t.forEach(t=>t())}),this.boundAxes.length=0,this.navigator.destroy(),this.navigator.chart.destroy()}update(t,e){this.chartOptions=(0,a.merge)(this.chartOptions,t.height&&{chart:{height:t.height}},t.chart,{navigator:t}),this.navigator.chart.update(this.chartOptions,e)}redraw(){this.navigator.chart.redraw()}addSeries(t){this.navigator.chart.addSeries((0,a.merge)(t,{showInNavigator:(0,a.pick)(t.showInNavigator,!0)})),this.navigator.setBaseSeries()}initNavigator(){let t=this.navigator;t.top=1,t.xAxis.setScale(),t.yAxis.setScale(),t.xAxis.render(),t.yAxis.render(),t.series?.forEach(t=>{t.translate(),t.render(),t.redraw()});let{min:e,max:i}=this.getInitialExtremes();t.chart.xAxis[0].userMin=e,t.chart.xAxis[0].userMax=i,t.render(e,i)}getRange(){let{min:t,max:e}=this.navigator.chart.xAxis[0].getExtremes(),{userMin:i,userMax:s,min:r,max:o}=this.navigator.xAxis.getExtremes();return{min:(0,a.pick)(t,r),max:(0,a.pick)(e,o),dataMin:r,dataMax:o,userMin:i,userMax:s}}setRange(t,e,i,s,r){(0,a.fireEvent)(this.navigator,"setRange",{min:t,max:e,redraw:i,animation:s,eventArguments:(0,a.merge)(r,{trigger:"navigator"})})}getInitialExtremes(){let{min:t,max:e}=this.navigator.xAxis.getExtremes();return{min:t,max:e}}}let j=r();j.StandaloneNavigator=j.StandaloneNavigator||_,j.navigator=j.StandaloneNavigator.navigator,C(j.Chart,j.Axis,j.Series);let Z=r();export{Z as default};