/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/annotations-advanced
 * @requires highcharts
 *
 * Annotations module
 *
 * (c) 2009-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as t from"../highcharts.js";var i,e,s,n,o,a={};a.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return a.d(i,{a:i}),i},a.d=(t,i)=>{for(var e in i)a.o(i,e)&&!a.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},a.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);let r=t.default;var h=a.n(r);function l(t,i){let e=this.initAnnotation(t);return this.options.annotations.push(e.options),(0,r.pick)(i,!0)&&(e.redraw(),e.graphic.attr({opacity:1})),e}function p(){let t=this;t.plotBoxClip=this.renderer.clipRect(this.plotBox),t.controlPointsGroup=t.renderer.g("control-points").attr({zIndex:99}).clip(t.plotBoxClip).add(),t.options.annotations.forEach((i,e)=>{if(!t.annotations.some(t=>t.options===i)){let s=t.initAnnotation(i);t.options.annotations[e]=s.options}}),t.drawAnnotations(),(0,r.addEvent)(t,"redraw",t.drawAnnotations),(0,r.addEvent)(t,"destroy",function(){t.plotBoxClip.destroy(),t.controlPointsGroup.destroy()}),(0,r.addEvent)(t,"exportData",function(i){let e=t.annotations,s=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter,n=!i.dataRows[1].xValues,o=t.options.lang&&t.options.lang.exportData&&t.options.lang.exportData.annotationHeader,a=i.dataRows[0].length,r=t.options.exporting?.csv?.annotations?.itemDelimiter,h=t.options.exporting?.csv?.annotations?.join;e.forEach(t=>{t.options.labelOptions?.includeInDataExport&&t.labels.forEach(t=>{if(t.options.text){let e=t.options.text;t.points.forEach(t=>{let s=t.x,n=t.series.xAxis?t.series.xAxis.index:-1,o=!1;if(-1===n){let t=i.dataRows[0].length,a=Array(t);for(let i=0;i<t;++i)a[i]="";a.push(e),a.xValues=[],a.xValues[n]=s,i.dataRows.push(a),o=!0}if(o||i.dataRows.forEach(t=>{!o&&t.xValues&&void 0!==n&&s===t.xValues[n]&&(h&&t.length>a?t[t.length-1]+=r+e:t.push(e),o=!0)}),!o){let t=i.dataRows[0].length,o=Array(t);for(let i=0;i<t;++i)o[i]="";o[0]=s,o.push(e),o.xValues=[],void 0!==n&&(o.xValues[n]=s),i.dataRows.push(o)}})}})});let l=0;i.dataRows.forEach(t=>{l=Math.max(l,t.length)});let p=l-i.dataRows[0].length;for(let t=0;t<p;t++){let e=function(t){let i;return s&&!1!==(i=s(t))?i:(i=o+" "+t,n)?{columnTitle:i,topLevelColumnTitle:i}:i}(t+1);n?(i.dataRows[0].push(e.topLevelColumnTitle),i.dataRows[1].push(e.columnTitle)):i.dataRows[0].push(e)}})}function c(){this.plotBoxClip.attr(this.plotBox),this.annotations.forEach(t=>{t.redraw(),t.graphic.animate({opacity:1},t.animationConfig)})}function d(t){let i=this.annotations,e="annotations"===t.coll?t:(0,r.find)(i,function(i){return i.options.id===t});e&&((0,r.fireEvent)(e,"remove"),(0,r.erase)(this.options.annotations,e.options),(0,r.erase)(i,e),e.destroy())}function u(){let t=this.options.annotations,i=this.userOptions.annotations;this.annotations=[],(0,r.isArray)(this.options.annotations)||(this.options.annotations=[]),(0,r.isObject)(i,!0)&&(0,r.isObject)(t,!0)&&this.options.annotations.push(t)}function g(t){this.chart.hasDraggedAnnotation||t.apply(this,Array.prototype.slice.call(arguments,1))}(e||(e={})).compose=function(t,i,e){let s=i.prototype;if(!s.addAnnotation){let n=e.prototype;(0,r.addEvent)(i,"afterInit",u),s.addAnnotation=l,s.callbacks.push(p),s.collectionsWithInit.annotations=[l],s.collectionsWithUpdate.push("annotations"),s.drawAnnotations=c,s.removeAnnotation=d,s.initAnnotation=function(i){let e=new(t.types[i.type]||t)(this,i);return this.annotations.push(e),e},(0,r.wrap)(n,"onContainerMouseDown",g)}};let x=e,y={visible:!0,animation:{},crop:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:"var(--highcharts-neutral-color-100)",borderRadius:3,borderWidth:1,className:"highcharts-no-tooltip",crop:!1,formatter:function(){return(0,r.defined)(this.y)?""+this.y:"Annotation label"},includeInDataExport:!0,overflow:"justify",padding:5,shadow:!1,shape:"callout",style:{fontSize:"0.7em",fontWeight:"normal",color:"contrast"},useHTML:!1,verticalAlign:"bottom",x:0,y:-16},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1,fill:"rgba(0, 0, 0, 0.75)",r:0,snap:2},controlPointOptions:{events:{},style:{cursor:"pointer",fill:"var(--highcharts-background-color)",stroke:"var(--highcharts-neutral-color-100)","stroke-width":2},height:10,symbol:"circle",visible:!1,width:10},events:{},typeOptions:{},types:{},zIndex:6},{doc:f,isTouchDevice:m}=h(),v=class{addEvents(){let t=this,i=function(i){(0,r.addEvent)(i,m?"touchstart":"mousedown",i=>{t.onMouseDown(i)},{passive:!1})};if(i(this.graphic.element),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&i(t.graphic.text.element)}),(0,r.objectEach)(t.options.events,(i,e)=>{let s=function(s){"click"===e&&t.cancelClick||i.call(t,t.chart.pointer?.normalize(s),t.target,t)};-1===(t.nonDOMEvents||[]).indexOf(e)?((0,r.addEvent)(t.graphic.element,e,s,{passive:!1}),t.graphic.div&&(0,r.addEvent)(t.graphic.div,e,s,{passive:!1})):(0,r.addEvent)(t,e,s,{passive:!1})}),t.options.draggable&&((0,r.addEvent)(t,"drag",t.onDrag),!t.graphic.renderer.styledMode)){let i={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[t.options.draggable]};t.graphic.css(i),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&t.graphic.text.css(i)})}t.isUpdating||(0,r.fireEvent)(t,"add")}destroy(){this.removeDocEvents(),(0,r.removeEvent)(this),this.hcEvents=null}mouseMoveToRadians(t,i,e){let s=t.prevChartY-e,n=t.prevChartX-i,o=t.chartY-e,a=t.chartX-i,r;return this.chart.inverted&&(r=n,n=s,s=r,r=a,a=o,o=r),Math.atan2(o,a)-Math.atan2(s,n)}mouseMoveToScale(t,i,e){let s=t.prevChartX-i,n=t.prevChartY-e,o=t.chartX-i,a=t.chartY-e,r=(o||1)/(s||1),h=(a||1)/(n||1);if(this.chart.inverted){let t=h;h=r,r=t}return{x:r,y:h}}mouseMoveToTranslation(t){let i=t.chartX-t.prevChartX,e=t.chartY-t.prevChartY,s;return this.chart.inverted&&(s=e,e=i,i=s),{x:i,y:e}}onDrag(t){if(this.chart.isInsidePlot(t.chartX-this.chart.plotLeft,t.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){let i=this.mouseMoveToTranslation(t);"x"===this.options.draggable&&(i.y=0),"y"===this.options.draggable&&(i.x=0),this.points.length?this.translate(i.x,i.y):(this.shapes.forEach(t=>t.translate(i.x,i.y)),this.labels.forEach(t=>t.translate(i.x,i.y))),this.redraw(!1)}}onMouseDown(t){if(t.preventDefault&&t.preventDefault(),2===t.button)return;let i=this,e=i.chart.pointer,s=t?.sourceCapabilities?.firesTouchEvents||!1,n=(t=e?.normalize(t)||t).chartX,o=t.chartY;i.cancelClick=!1,i.chart.hasDraggedAnnotation=!0,i.removeDrag=(0,r.addEvent)(f,m||s?"touchmove":"mousemove",function(t){i.hasDragged=!0,(t=e?.normalize(t)||t).prevChartX=n,t.prevChartY=o,(0,r.fireEvent)(i,"drag",t),n=t.chartX,o=t.chartY},m||s?{passive:!1}:void 0),i.removeMouseUp=(0,r.addEvent)(f,m||s?"touchend":"mouseup",function(){let t=(0,r.pick)(i.target&&i.target.annotation,i.target);t&&(t.cancelClick=i.hasDragged),i.cancelClick=i.hasDragged,i.chart.hasDraggedAnnotation=!1,i.hasDragged&&(0,r.fireEvent)((0,r.pick)(t,i),"afterUpdate"),i.hasDragged=!1,i.onMouseUp()},m||s?{passive:!1}:void 0)}onMouseUp(){this.removeDocEvents()}removeDocEvents(){this.removeDrag&&(this.removeDrag=this.removeDrag()),this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())}},b=class extends v{constructor(t,i,e,s){super(),this.nonDOMEvents=["drag"],this.chart=t,this.target=i,this.options=e,this.index=(0,r.pick)(e.index,s)}destroy(){super.destroy(),this.graphic&&(this.graphic=this.graphic.destroy()),this.chart=null,this.target=null,this.options=null}redraw(t){this.graphic[t?"animate":"attr"](this.options.positioner.call(this,this.target,this))}render(){let t=this.chart,i=this.options;this.graphic=t.renderer.symbol(i.symbol,0,0,i.width,i.height).add(t.controlPointsGroup).css(i.style),this.setVisibility(i.visible),this.addEvents()}setVisibility(t){this.graphic[t?"show":"hide"](),this.options.visible=t}update(t){let i=this.chart,e=this.target,s=this.index,n=(0,r.merge)(!0,this.options,t);this.destroy(),this.constructor(i,e,n,s),this.render(i.controlPointsGroup),this.redraw()}},A=t.default.SeriesRegistry;var P=a.n(A);let{series:{prototype:E}}=P();class O{static fromPoint(t){return new O(t.series.chart,null,{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis})}static pointToPixels(t,i){let e=t.series,s=e.chart,n=t.plotX||0,o=t.plotY||0,a;return s.inverted&&(t.mock?(n=t.plotY,o=t.plotX):(n=s.plotWidth-(t.plotY||0),o=s.plotHeight-(t.plotX||0))),e&&!i&&(n+=(a=e.getPlotBox()).translateX,o+=a.translateY),{x:n,y:o}}static pointToOptions(t){return{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis}}constructor(t,i,e){this.mock=!0,this.point=this,this.series={visible:!0,chart:t,getPlotBox:E.getPlotBox},this.target=i||null,this.options=e,this.applyOptions(this.getOptions())}applyOptions(t){this.command=t.command,this.setAxis(t,"x"),this.setAxis(t,"y"),this.refresh()}getOptions(){return this.hasDynamicOptions()&&"function"==typeof this.options?this.options(this.target):this.options}hasDynamicOptions(){return"function"==typeof this.options}isInsidePlot(){let t=this.plotX,i=this.plotY,e=this.series.xAxis,s=this.series.yAxis,n={x:t,y:i,isInsidePlot:!0,options:{}};return e&&(n.isInsidePlot=(0,r.defined)(t)&&t>=0&&t<=e.len),s&&(n.isInsidePlot=n.isInsidePlot&&(0,r.defined)(i)&&i>=0&&i<=s.len),(0,r.fireEvent)(this.series.chart,"afterIsInsidePlot",n),n.isInsidePlot}refresh(){let t=this.series,i=t.xAxis,e=t.yAxis,s=this.getOptions();i?(this.x=s.x,this.plotX=i.toPixels(s.x,!0)):(this.x=void 0,this.plotX=s.x),e?(this.y=s.y,this.plotY=e.toPixels(s.y,!0)):(this.y=null,this.plotY=s.y),this.isInside=this.isInsidePlot()}refreshOptions(){let t=this.series,i=t.xAxis,e=t.yAxis;this.x=this.options.x=i?this.options.x=i.toValue(this.plotX,!0):this.plotX,this.y=this.options.y=e?e.toValue(this.plotY,!0):this.plotY}rotate(t,i,e){if(!this.hasDynamicOptions()){let s=Math.cos(e),n=Math.sin(e),o=this.plotX-t,a=this.plotY-i;this.plotX=o*s-a*n+t,this.plotY=o*n+a*s+i,this.refreshOptions()}}scale(t,i,e,s){if(!this.hasDynamicOptions()){let n=this.plotX*e,o=this.plotY*s;this.plotX=(1-e)*t+n,this.plotY=(1-s)*i+o,this.refreshOptions()}}setAxis(t,i){let e=i+"Axis",s=t[e],n=this.series.chart;this.series[e]="object"==typeof s?s:(0,r.defined)(s)?n[e][s]||n.get(s):null}toAnchor(){let t=[this.plotX,this.plotY,0,0];return this.series.chart.inverted&&(t[0]=this.plotY,t[1]=this.plotX),t}translate(t,i,e,s){this.hasDynamicOptions()||(this.plotX+=e,this.plotY+=s,this.refreshOptions())}}!function(t){function i(){let t=this.controlPoints,i=this.options.controlPoints||[];i.forEach((e,s)=>{let n=(0,r.merge)(this.options.controlPointOptions,e);n.index||(n.index=s),i[s]=n,t.push(new b(this.chart,this,n))})}function e(t){let i=t.series.getPlotBox(),e=t.series.chart,s=t.mock?t.toAnchor():e.tooltip&&e.tooltip.getAnchor.call({chart:t.series.chart},t)||[0,0,0,0],n={x:s[0]+(this.options.x||0),y:s[1]+(this.options.y||0),height:s[2]||0,width:s[3]||0};return{relativePosition:n,absolutePosition:(0,r.merge)(n,{x:n.x+(t.mock?i.translateX:e.plotLeft),y:n.y+(t.mock?i.translateY:e.plotTop)})}}function s(){this.controlPoints.forEach(t=>t.destroy()),this.chart=null,this.controlPoints=null,this.points=null,this.options=null,this.annotation&&(this.annotation=null)}function n(){let t=this.options;return t.points||t.point&&(0,r.splat)(t.point)}function o(){let t,i,e=this.getPointsOptions(),s=this.points,n=e?.length||0;for(t=0;t<n;t++){if(!(i=this.point(e[t],s[t]))){s.length=0;return}i.mock&&i.refresh(),s[t]=i}return s}function a(t,i){if(t&&t.series)return t;if(!i||null===i.series){if((0,r.isObject)(t))i=new O(this.chart,this,t);else if((0,r.isString)(t))i=this.chart.get(t)||null;else if("function"==typeof t){let e=t.call(i,this);i=e.series?e:new O(this.chart,this,t)}}return i}function h(t){this.controlPoints.forEach(i=>i.redraw(t))}function l(){this.controlPoints.forEach(t=>t.render())}function p(t,i,e,s,n){if(this.chart.inverted){let t=i;i=e,e=t}this.points.forEach((o,a)=>this.transformPoint(t,i,e,s,n,a),this)}function c(t,i,e,s,n,o){let a=this.points[o];a.mock||(a=this.points[o]=O.fromPoint(a)),a[t](i,e,s,n)}function d(t,i){this.transform("translate",null,null,t,i)}function u(t,i,e){this.transformPoint("translate",null,null,t,i,e)}t.compose=function(t){let g=t.prototype;g.addControlPoints||(0,r.merge)(!0,g,{addControlPoints:i,anchor:e,destroyControlTarget:s,getPointsOptions:n,linkPoints:o,point:a,redrawControlPoints:h,renderControlPoints:l,transform:p,transformPoint:c,translate:d,translatePoint:u})}}(s||(s={}));let M=s;class k{constructor(t,i,e,s){this.annotation=t,this.chart=t.chart,this.collection="label"===s?"labels":"shapes",this.controlPoints=[],this.options=i,this.points=[],this.index=e,this.itemType=s,this.init(t,i,e)}attr(){this.graphic.attr.apply(this.graphic,arguments)}attrsFromOptions(t){let i,e,s=this.constructor.attrsMap,n={},o=this.chart.styledMode;for(i in t)e=s[i],void 0===s[i]||o&&-1!==["fill","stroke","stroke-width"].indexOf(e)||(n[e]=t[i]);return n}destroy(){this.graphic&&(this.graphic=this.graphic.destroy()),this.tracker&&(this.tracker=this.tracker.destroy()),this.destroyControlTarget()}calculateAnnotationSize(t,i,e){let s=e.toPixels(t,!0);return Math.abs(e.toPixels(t+i,!0)-s)}init(t,i,e){this.annotation=t,this.chart=t.chart,this.options=i,this.points=[],this.controlPoints=[],this.index=e,this.linkPoints(),this.addControlPoints()}redraw(t){this.redrawControlPoints(t)}render(t){this.options.className&&this.graphic&&this.graphic.addClass(this.options.className),this.renderControlPoints()}rotate(t,i,e){this.transform("rotate",t,i,e)}scale(t,i,e,s){this.transform("scale",t,i,e,s)}setControlPointsVisibility(t){this.controlPoints.forEach(i=>{i.setVisibility(t)})}shouldBeDrawn(){return!!this.points.length}translateShape(t,i,e){let s=this.annotation.chart,n=this.annotation.userOptions,o=s.annotations.indexOf(this.annotation),a=s.options.annotations[o];this.translatePoint(t,i,0),e&&this.translatePoint(t,i,1),a[this.collection][this.index].point=this.options.point,n[this.collection][this.index].point=this.options.point}update(t){let i=this.annotation,e=(0,r.merge)(!0,this.options,t),s=this.graphic.parentGroup,n=this.constructor;this.destroy();let o=new n(i,e,this.index,this.itemType);(0,r.merge)(!0,this,o),this.render(s),this.redraw()}}M.compose(k);let w=k,{defaultMarkers:C}={defaultMarkers:{arrow:{tagName:"marker",attributes:{id:"arrow",refY:5,refX:9,markerWidth:10,markerHeight:10},children:[{tagName:"path",attributes:{d:"M 0 0 L 10 5 L 0 10 Z","stroke-width":0}}]},"reverse-arrow":{tagName:"marker",attributes:{id:"reverse-arrow",refY:5,refX:1,markerWidth:10,markerHeight:10},children:[{tagName:"path",attributes:{d:"M 0 5 L 10 0 L 10 10 Z","stroke-width":0}}]}}},N=L("marker-end"),T=L("marker-start"),B="rgba(192,192,192,"+(h().svg?1e-4:.002)+")";function L(t){return function(i){this.attr(t,"url(#"+i+")")}}function Y(){this.options.defs=(0,r.merge)(C,this.options.defs||{})}function X(t,i){let e={attributes:{id:t}},s={stroke:i.color||"none",fill:i.color||"rgba(0, 0, 0, 0.75)"};e.children=i.children&&i.children.map(function(t){return(0,r.merge)(s,t)});let n=(0,r.merge)(!0,{attributes:{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"}},i,e),o=this.definition(n);return o.id=t,o}class S extends w{static compose(t,i){let e=i.prototype;e.addMarker||((0,r.addEvent)(t,"afterGetContainer",Y),e.addMarker=X)}constructor(t,i,e){super(t,i,e,"shape"),this.type="path"}init(t,i,e){(0,r.defined)(i.yAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=i.yAxis)}),(0,r.defined)(i.xAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=i.xAxis)}),super.init(t,i,e)}toD(){let t=this.options.d;if(t)return"function"==typeof t?t.call(this):t;let i=this.points,e=i.length,s=[],n=e,o=i[0],a=n&&this.anchor(o).absolutePosition,r=0,h;if(a)for(s.push(["M",a.x,a.y]);++r<e&&n;)h=(o=i[r]).command||"L",a=this.anchor(o).absolutePosition,"M"===h||"L"===h?s.push([h,a.x,a.y]):"Z"===h&&s.push([h]),n=o.series.visible;return n&&this.graphic?this.chart.renderer.crispLine(s,this.graphic.strokeWidth()):null}shouldBeDrawn(){return super.shouldBeDrawn()||!!this.options.d}render(t){let i=this.options,e=this.attrsFromOptions(i);this.graphic=this.annotation.chart.renderer.path([["M",0,0]]).attr(e).add(t),this.tracker=this.annotation.chart.renderer.path([["M",0,0]]).addClass("highcharts-tracker-line").attr({zIndex:2}).add(t),this.annotation.chart.styledMode||this.tracker.attr({"stroke-linejoin":"round",stroke:B,fill:B,"stroke-width":this.graphic.strokeWidth()+2*i.snap}),super.render(),(0,r.extend)(this.graphic,{markerStartSetter:T,markerEndSetter:N}),this.setMarkers(this)}redraw(t){if(this.graphic){let i=this.toD(),e=t?"animate":"attr";i?(this.graphic[e]({d:i}),this.tracker[e]({d:i})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"})),this.graphic.placed=this.tracker.placed=!!i}super.redraw(t)}setMarkers(t){let i=t.options,e=t.chart,s=e.options.defs,n=i.fill,o=(0,r.defined)(n)&&"none"!==n?n:i.stroke;["markerStart","markerEnd"].forEach(function(n){let a,h,l,p,c=i[n];if(c){for(l in s)if((c===((a=s[l]).attributes&&a.attributes.id)||c===a.id)&&"marker"===a.tagName){h=a;break}h&&(p=t[n]=e.renderer.addMarker((i.id||(0,r.uniqueKey)())+"-"+c,(0,r.merge)(h,{color:o})),t.attr(n,p.getAttribute("id")))}})}}S.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};class I extends w{constructor(t,i,e){super(t,i,e,"shape"),this.type="rect",this.translate=super.translateShape}init(t,i,e){let{point:s,xAxis:n,yAxis:o}=i;s&&"string"!=typeof s&&((0,r.defined)(n)&&(s.xAxis=n),(0,r.defined)(o)&&(s.yAxis=o)),super.init(t,i,e)}render(t){let i=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9e9,0,0).attr(i).add(t),super.render()}redraw(t){if(this.graphic){let i=this.points[0],e=this.anchor(i).absolutePosition,s=this.options.width||0,n=this.options.height||0;if(e){let o=(0,r.defined)(this.options.xAxis)?this.chart.xAxis[this.options.xAxis]:void 0,a=(0,r.defined)(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;o&&(0,r.defined)(i.x)&&(s=this.calculateAnnotationSize(i.x,s,o)),a&&(0,r.defined)(i.y)&&(n=this.calculateAnnotationSize(i.y,n,a)),this.graphic[t?"animate":"attr"]({x:e.x,y:e.y,width:s,height:n})}else this.attr({x:0,y:-9e9});this.graphic.placed=!!e}super.redraw(t)}}I.attrsMap=(0,r.merge)(S.attrsMap,{width:"width",height:"height"});class D extends w{constructor(t,i,e){super(t,i,e,"shape"),this.type="circle",this.translate=super.translateShape}init(t,i,e){let{point:s,xAxis:n,yAxis:o}=i;s&&"string"!=typeof s&&((0,r.defined)(n)&&(s.xAxis=n),(0,r.defined)(o)&&(s.yAxis=o)),super.init(t,i,e)}redraw(t){if(this.graphic){let i=this.points[0],e=this.anchor(i).absolutePosition,s=this.options.r||0;if(e){let n=(0,r.defined)(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;n&&(0,r.defined)(i.y)&&(s=this.calculateAnnotationSize(i.y,s,n)),this.graphic[t?"animate":"attr"]({x:e.x,y:e.y,r:s})}else this.graphic.attr({x:0,y:-9e9});this.graphic.placed=!!e}super.redraw.call(this,t)}render(t){let i=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9e9,0).attr(i).add(t),super.render()}setRadius(t){this.options.r=t}}D.attrsMap=(0,r.merge)(S.attrsMap,{r:"r"});class R extends w{constructor(t,i,e){super(t,i,e,"shape"),this.type="ellipse"}init(t,i,e){(0,r.defined)(i.yAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=i.yAxis)}),(0,r.defined)(i.xAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=i.xAxis)}),super.init(t,i,e)}render(t){this.graphic=this.annotation.chart.renderer.createElement("ellipse").attr(this.attrsFromOptions(this.options)).add(t),super.render()}translate(t,i){super.translateShape(t,i,!0)}getDistanceFromLine(t,i,e,s){return Math.abs((i.y-t.y)*e-(i.x-t.x)*s+i.x*t.y-i.y*t.x)/Math.sqrt((i.y-t.y)*(i.y-t.y)+(i.x-t.x)*(i.x-t.x))}getAttrs(t,i){let e=t.x,s=t.y,n=i.x,o=i.y,a=(e+n)/2,r=Math.sqrt((e-n)*(e-n)/4+(s-o)*(s-o)/4),h=180*Math.atan((o-s)/(n-e))/Math.PI;return a<e&&(h+=180),{cx:a,cy:(s+o)/2,rx:r,ry:this.getRY(),angle:h}}getRY(){let t=this.getYAxis();return(0,r.defined)(t)?Math.abs(t.toPixels(this.options.ry)-t.toPixels(0)):this.options.ry}getYAxis(){let t=this.options.yAxis;return this.chart.yAxis[t]}getAbsolutePosition(t){return this.anchor(t).absolutePosition}redraw(t){if(this.graphic){let i=this.getAbsolutePosition(this.points[0]),e=this.getAbsolutePosition(this.points[1]),s=this.getAttrs(i,e);i?this.graphic[t?"animate":"attr"]({cx:s.cx,cy:s.cy,rx:s.rx,ry:s.ry,rotation:s.angle,rotationOriginX:s.cx,rotationOriginY:s.cy}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!i}super.redraw(t)}setYRadius(t){let i=this.annotation.userOptions.shapes;this.options.ry=t,i&&i[0]&&(i[0].ry=t,i[0].ry=t)}}R.attrsMap=(0,r.merge)(S.attrsMap,{ry:"ry"});let W=t.default.Templating;var z=a.n(W);let{format:F}=z();function U(t,i,e,s,n){let o=n&&n.anchorX,a=n&&n.anchorY,h,l,p=e/2;return(0,r.isNumber)(o)&&(0,r.isNumber)(a)&&(h=[["M",o,a]],(l=i-a)<0&&(l=-s-l),l<e&&(p=o<t+e/2?l:e-l),a>i+s?h.push(["L",t+p,i+s]):a<i?h.push(["L",t+p,i]):o<t?h.push(["L",t,i+s/2]):o>t+e&&h.push(["L",t+e,i+s/2])),h||[]}class V extends w{static alignedPosition(t,i){return{x:Math.round((i.x||0)+(t.x||0)+(i.width-(t.width||0))*(0,r.getAlignFactor)(t.align)),y:Math.round((i.y||0)+(t.y||0)+(i.height-(t.height||0))*(0,r.getAlignFactor)(t.verticalAlign))}}static compose(t){t.prototype.symbols.connector=U}static justifiedOptions(t,i,e,s){let n,o=e.align,a=e.verticalAlign,r=i.box?0:i.padding||0,h=i.getBBox(),l={align:o,verticalAlign:a,x:e.x,y:e.y,width:i.width,height:i.height},p=(s.x||0)-t.plotLeft,c=(s.y||0)-t.plotTop;return(n=p+r)<0&&("right"===o?l.align="left":l.x=(l.x||0)-n),(n=p+h.width-r)>t.plotWidth&&("left"===o?l.align="right":l.x=(l.x||0)+t.plotWidth-n),(n=c+r)<0&&("bottom"===a?l.verticalAlign="top":l.y=(l.y||0)-n),(n=c+h.height-r)>t.plotHeight&&("top"===a?l.verticalAlign="bottom":l.y=(l.y||0)+t.plotHeight-n),l}constructor(t,i,e){super(t,i,e,"label")}translatePoint(t,i){super.translatePoint(t,i,0)}translate(t,i){var e,s;let n=this.annotation.chart,o=this.annotation.userOptions,a=n.annotations.indexOf(this.annotation),r=n.options.annotations[a];if(n.inverted){let e=t;t=i,i=e}(e=this.options).x||(e.x=0),(s=this.options).y||(s.y=0),this.options.x+=t,this.options.y+=i,r[this.collection][this.index].x=this.options.x,r[this.collection][this.index].y=this.options.y,o[this.collection][this.index].x=this.options.x,o[this.collection][this.index].y=this.options.y}render(t){let i=this.options,e=this.attrsFromOptions(i),s=i.style,n=this.annotation.chart.options.chart,o=n.plotBackgroundColor||n.backgroundColor;if(this.graphic=this.annotation.chart.renderer.label("",0,-9999,i.shape,void 0,void 0,i.useHTML,void 0,"annotation-label").attr(e).add(t),!this.annotation.chart.styledMode){if(s?.color==="contrast"){let t=!i.shape||V.shapesWithoutBackground.indexOf(i.shape)>-1||"none"===i.backgroundColor?o:i.backgroundColor;s.color=this.annotation.chart.renderer.getContrast("string"==typeof t?t:"string"==typeof o?o:"#ffffff")}this.graphic.css(i.style||{}).shadow(i.shadow)}this.graphic.labelrank=i.labelrank,super.render()}redraw(t){let i=this.options,e=this.text||i.format||i.text,s=this.graphic,n=this.points[0];if(!s)return void this.redraw(t);s.attr({text:e?F(String(e),n,this.annotation.chart):i.formatter.call(n,n)});let o=this.anchor(n),a=this.position(o);a?(s.alignAttr=a,a.anchorX=o.absolutePosition.x,a.anchorY=o.absolutePosition.y,s[t?"animate":"attr"](a)):s.attr({x:0,y:-9999}),s.placed=!!a,super.redraw(t)}anchor(t){let i=super.anchor.apply(this,arguments),e=this.options.x||0,s=this.options.y||0;return i.absolutePosition.x-=e,i.absolutePosition.y-=s,i.relativePosition.x-=e,i.relativePosition.y-=s,i}position(t){let i=this.graphic,e=this.annotation.chart,s=e.tooltip,n=this.points[0],o=this.options,a=t.absolutePosition,h=t.relativePosition,l,p,c,d,u=n.series.visible&&O.prototype.isInsidePlot.call(n);if(i&&u){let{width:t=0,height:g=0}=i;o.distance&&s?l=s.getPosition.call({chart:e,distance:(0,r.pick)(o.distance,16),getPlayingField:s.getPlayingField,pointer:s.pointer},t,g,{plotX:h.x,plotY:h.y,negative:n.negative,ttBelow:n.ttBelow,h:h.height||h.width}):o.positioner?l=o.positioner.call(this,this):(p={x:a.x,y:a.y,width:0,height:0},l=V.alignedPosition((0,r.extend)(o,{width:t,height:g}),p),"justify"===this.options.overflow&&(l=V.alignedPosition(V.justifiedOptions(e,i,o,l),p))),o.crop&&(c=l.x-e.plotLeft,d=l.y-e.plotTop,u=e.isInsidePlot(c,d)&&e.isInsidePlot(c+t,d+g))}return u?l:null}}V.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"},V.shapesWithoutBackground=["connector"];class j extends w{constructor(t,i,e){super(t,i,e,"shape"),this.type="image",this.translate=super.translateShape}render(t){let i=this.attrsFromOptions(this.options),e=this.options;this.graphic=this.annotation.chart.renderer.image(e.src,0,-9e9,e.width,e.height).attr(i).add(t),this.graphic.width=e.width,this.graphic.height=e.height,super.render()}redraw(t){if(this.graphic){let i=this.anchor(this.points[0]),e=V.prototype.position.call(this,i);e?this.graphic[t?"animate":"attr"]({x:e.x,y:e.y}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!e}super.redraw(t)}}j.attrsMap={width:"width",height:"height",zIndex:"zIndex"};let q=t.default.AST;var H=a.n(q);let $=t=>`<?xml version="1.0" encoding="utf-8"?>
        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 ${t} ${t}">`,G="#4B4B4D",K={"close.svg":`${$(32)}
<polygon fill="${G}" points="24.308,8.756 23.248,7.695 16.002,14.941 8.757,7.695 7.695,8.754 14.941,16.001 7.696,23.246
    8.755,24.308 16.002,17.061 23.247,24.307 24.308,23.248 17.062,16.001"/>
</svg>
`,"destroy.svg":`${$(32)}
<g>
    <rect x="12.75" y="14" fill="${G}" width="1.5" height="10"/>
    <rect x="17.75" y="14" fill="${G}" width="1.5" height="10"/>
    <path fill="${G}" d="M25.25,10.5c0-1.517-1.233-2.75-2.75-2.75h-3.25V7c0-1.24-1.01-2.25-2.25-2.25h-2
        c-1.24,0-2.25,1.01-2.25,2.25v0.75H9.5c-1.517,0-2.75,1.233-2.75,2.75v1.751h2V27.25h14.5V12.251h2V10.5z M14.25,7
        c0-0.413,0.337-0.75,0.75-0.75h2c0.413,0,0.75,0.337,0.75,0.75v0.75h-3.5V7z M21.75,25.75h-11.5V12.251h11.5V25.75z M23.75,10.751
        H8.25V10.5c0-0.689,0.561-1.25,1.25-1.25h13c0.689,0,1.25,0.561,1.25,1.25V10.751z"/>
</g>
</svg>
`,"edit.svg":`${$(32)}
<path fill="${G}" d="M22.125,3.814L5.817,20.122l-1.818,7.879l7.879-1.818L28.186,9.875L22.125,3.814z M26.064,9.875
    l-1.439,1.439l-3.939-3.939l1.439-1.439L26.064,9.875z M10.186,22.875l9.939-9.939l1.439,1.439l-9.939,9.939L10.186,22.875z
     M7.686,20.375l9.939-9.939l1.439,1.439l-9.939,9.939L7.686,20.375z M18.686,9.375l0.939-0.939l3.939,3.939l-0.939,0.939
    L18.686,9.375z M6.974,21.784l3.242,3.242l-4.215,0.973L6.974,21.784z"/>
</svg>
`},_=(t,i,e)=>{let s,n=e[t];return"renderer"===i&&n?(n=encodeURIComponent(n),s=`url("data:image/svg+xml;charset=utf-8,${n}")`):s=i.startsWith("http")&&i.match(/\.(png|svg|jpe?g|gif)$/ig)?'url("'+i+'")':`url("${i}${t}")`,s},Z=class{constructor(t,i){this.iconsURL=i,this.container=this.createPopupContainer(t),this.closeButton=this.addCloseButton()}createPopupContainer(t,i="highcharts-popup highcharts-no-tooltip"){return(0,r.createElement)("div",{className:i},void 0,t)}addCloseButton(t="highcharts-popup-close"){let i=(0,r.createElement)("button",{className:t},void 0,this.container);return(0,r.createElement)("span",{className:"highcharts-icon"},{backgroundImage:_("close.svg",this.iconsURL,K)},i),["click","touchstart"].forEach(t=>{(0,r.addEvent)(i,t,this.closeButtonEvents.bind(this))}),(0,r.addEvent)(document,"keydown",t=>{"Escape"===t.code&&this.closeButtonEvents()}),i}closeButtonEvents(){this.closePopup()}showPopup(t="highcharts-annotation-toolbar"){let i=this.container,e=this.closeButton;this.type=void 0,i.innerHTML=H().emptyHTML,i.className.indexOf(t)>=0&&(i.classList.remove(t),i.removeAttribute("style")),i.appendChild(e),i.style.display="block",i.style.height=""}closePopup(){this.container.style.display="none"}},J=t.default.Color;var Q=a.n(J);let{doc:tt,isFirefox:ti}=h();function te(t,i,e,s,n,o){let a,h;if(!i)return;let l=this.addInput,p=this.lang;(0,r.objectEach)(s,(s,o)=>{a=""!==e?e+"."+o:o,(0,r.isObject)(s)&&(!(0,r.isArray)(s)||(0,r.isArray)(s)&&(0,r.isObject)(s[0])?((h=p[o]||o).match(/\d/g)||n.push([!0,h,t]),te.call(this,t,i,a,s,n,!1)):n.push([this,a,"annotation",t,s]))}),o&&((0,r.stableSort)(n,t=>t[1].match(/format/g)?-1:1),ti&&n.reverse(),n.forEach(t=>{!0===t[0]?(0,r.createElement)("span",{className:"highcharts-annotation-title"},void 0,t[2]).appendChild(tt.createTextNode(t[1])):(t[4]={value:t[4][0],type:t[4][1]},l.apply(t[0],t.splice(1)))}))}let{doc:ts}=h(),{seriesTypes:tn}=P();(i=n||(n={}))[i["params.algorithm"]=0]="params.algorithm",i[i["params.average"]=1]="params.average";let to={"algorithm-pivotpoints":["standard","fibonacci","camarilla"],"average-disparityindex":["sma","ema","dema","tema","wma"]};function ta(t){let i=(0,r.createElement)("div",{className:"highcharts-popup-lhs-col"},void 0,t),e=(0,r.createElement)("div",{className:"highcharts-popup-rhs-col"},void 0,t);return(0,r.createElement)("div",{className:"highcharts-popup-rhs-col-wrapper"},void 0,e),{lhsCol:i,rhsCol:e}}function tr(t,i,e,s){let n=i.params||i.options.params;s.innerHTML=H().emptyHTML,(0,r.createElement)("h3",{className:"highcharts-indicator-title"},void 0,s).appendChild(ts.createTextNode(tx(i,e).indicatorFullName)),(0,r.createElement)("input",{type:"hidden",name:"highcharts-type-"+e,value:e},void 0,s),ty.call(this,e,"series",t,s,i,i.linkedParent&&i.linkedParent.options.id),n.volumeSeriesID&&ty.call(this,e,"volume",t,s,i,i.linkedParent&&n.volumeSeriesID),tl.call(this,t,"params",n,e,s)}function th(t,i,e,s){function n(i,e){let s=x.parentNode.children[1];tr.call(o,t,i,e,x),s&&(s.style.display="block"),p&&i.options&&(0,r.createElement)("input",{type:"hidden",name:"highcharts-id-"+e,value:i.options.id},void 0,x).setAttribute("highcharts-data-series-id",i.options.id)}let o=this,a=o.lang,h=i.querySelectorAll(".highcharts-popup-lhs-col")[0],l=i.querySelectorAll(".highcharts-popup-rhs-col")[0],p="edit"===e,c=p?t.series:t.options.plotOptions||{};if(!t&&c)return;let d,u=[];p||(0,r.isArray)(c)?(0,r.isArray)(c)&&(u=tg.call(this,c)):u=tu.call(this,c,s),(0,r.stableSort)(u,(t,i)=>{let e=t.indicatorFullName.toLowerCase(),s=i.indicatorFullName.toLowerCase();return e<s?-1:+(e>s)}),h.children[1]&&h.children[1].remove();let g=(0,r.createElement)("ul",{className:"highcharts-indicator-list"},void 0,h),x=l.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];if(u.forEach(t=>{let{indicatorFullName:i,indicatorType:e,series:s}=t;d=(0,r.createElement)("li",{className:"highcharts-indicator-list"},void 0,g);let o=(0,r.createElement)("button",{className:"highcharts-indicator-list-item",textContent:i},void 0,d);["click","touchstart"].forEach(t=>{(0,r.addEvent)(o,t,function(){n(s,e)})})}),u.length>0){let{series:t,indicatorType:i}=u[0];n(t,i)}else p||(H().setElementHTML(x.parentNode.children[0],a.noFilterMatch||""),x.parentNode.children[1].style.display="none")}function tl(t,i,e,s,o){if(!t)return;let a=this.addInput;(0,r.objectEach)(e,(e,h)=>{let l=i+"."+h;if((0,r.defined)(e)&&l)if((0,r.isObject)(e)&&(a.call(this,l,s,o,{}),tl.call(this,t,l,e,s,o)),l in n){let n=tc.call(this,s,l,o);td.call(this,t,i,n,s,h,e)}else"params.volumeSeriesID"===l||(0,r.isArray)(e)||a.call(this,l,s,o,{value:e,type:"number"})})}function tp(t,i){let e=this,s=i.querySelectorAll(".highcharts-popup-lhs-col")[0],n=this.lang.clearFilter,o=(0,r.createElement)("div",{className:"highcharts-input-wrapper"},void 0,s),a=function(i){th.call(e,t,e.container,"add",i)},h=this.addInput("searchIndicators","input",o,{value:"",type:"text",htmlFor:"search-indicators",labelClassName:"highcharts-input-search-indicators-label"}),l=(0,r.createElement)("a",{textContent:n},void 0,o);h.classList.add("highcharts-input-search-indicators"),l.classList.add("clear-filter-button"),(0,r.addEvent)(h,"input",function(){a(this.value),this.value.length?l.style.display="inline-block":l.style.display="none"}),["click","touchstart"].forEach(t=>{(0,r.addEvent)(l,t,function(){h.value="",a(""),l.style.display="none"})})}function tc(t,i,e){let s=i.split("."),n=s[s.length-1],o="highcharts-"+i+"-type-"+t,a=this.lang;(0,r.createElement)("label",{htmlFor:o},null,e).appendChild(ts.createTextNode(a[n]||i));let h=(0,r.createElement)("select",{name:o,className:"highcharts-popup-field",id:"highcharts-select-"+i},null,e);return h.setAttribute("id","highcharts-select-"+i),h}function td(t,i,e,s,n,o,a){"series"===i||"volume"===i?t.series.forEach(t=>{let s=t.options,n=s.name||s.params?t.name:s.id||"";"highcharts-navigator-series"!==s.id&&s.id!==(a&&a.options&&a.options.id)&&((0,r.defined)(o)||"volume"!==i||"column"!==t.type||(o=s.id),(0,r.createElement)("option",{value:s.id},void 0,e).appendChild(ts.createTextNode(n)))}):s&&n&&to[n+"-"+s].forEach(t=>{(0,r.createElement)("option",{value:t},void 0,e).appendChild(ts.createTextNode(t))}),(0,r.defined)(o)&&(e.value=o)}function tu(t,i){let e,s=this.chart&&this.chart.options.lang,n=s&&s.navigation&&s.navigation.popup&&s.navigation.popup.indicatorAliases,o=new Map;return(0,r.objectEach)(t,(t,s)=>{let a=t&&t.options;if(t.params||a&&a.params){let{indicatorFullName:a,indicatorType:r}=tx(t,s);if(i){let s=RegExp(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),h=n&&n[r]&&n[r].join(" ")||"";(a.match(s)||h.match(s))&&(e={indicatorFullName:a,indicatorType:r,series:t},o.set(r.toLowerCase(),e))}else e={indicatorFullName:a,indicatorType:r,series:t},o.set(r.toLowerCase(),e)}}),Array.from(o.values())}function tg(t){let i=[];return t.forEach(t=>{t.is("sma")&&i.push({indicatorFullName:t.name,indicatorType:t.type,series:t})}),i}function tx(t,i){let e=t.options,s=tn[i]&&tn[i].prototype.nameBase||i.toUpperCase(),n=i;return e&&e.type&&(n=t.options.type,s=t.name),{indicatorFullName:s,indicatorType:n}}function ty(t,i,e,s,n,o){if(!e)return;let a=tc.call(this,t,i,s);td.call(this,e,i,a,void 0,void 0,void 0,n),(0,r.defined)(o)&&(a.value=o)}let{doc:tf}=h();function tm(){let t=this.container;return(0,r.createElement)("div",{className:"highcharts-tab-item-content highcharts-no-mousewheel"},void 0,t)}function tv(t,i){let e=this.container,s=this.lang,n="highcharts-tab-item";0===i&&(n+=" highcharts-tab-disabled");let o=(0,r.createElement)("button",{className:n},void 0,e);return o.appendChild(tf.createTextNode(s[t+"Button"]||t)),o.setAttribute("highcharts-data-tab-type",t),o}function tb(){let t=this.container,i=t.querySelectorAll(".highcharts-tab-item"),e=t.querySelectorAll(".highcharts-tab-item-content");for(let t=0;t<i.length;t++)i[t].classList.remove("highcharts-tab-item-active"),e[t].classList.remove("highcharts-tab-item-show")}function tA(t,i){let e=this.container.querySelectorAll(".highcharts-tab-item-content");t.className+=" highcharts-tab-item-active",e[i].className+=" highcharts-tab-item-show"}function tP(t){let i=this;this.container.querySelectorAll(".highcharts-tab-item").forEach((e,s)=>{(0!==t||"edit"!==e.getAttribute("highcharts-data-tab-type"))&&["click","touchstart"].forEach(t=>{(0,r.addEvent)(e,t,function(){tb.call(i),tA.call(i,this,s)})})})}let{doc:tE}=h(),{getOptions:tO}=h();class tM extends Z{constructor(t,i,e){super(t,i),this.chart=e,this.lang=(tO().lang.navigation||{}).popup||{},(0,r.addEvent)(this.container,"mousedown",()=>{let t=e&&e.navigationBindings&&e.navigationBindings.activeAnnotation;if(t){t.cancelClick=!0;let i=(0,r.addEvent)(tE,"click",()=>{setTimeout(()=>{t.cancelClick=!1},0),i()})}})}addInput(t,i,e,s){let n=t.split("."),o=n[n.length-1],a=this.lang,h="highcharts-"+i+"-"+(0,r.pick)(s.htmlFor,o);if(o.match(/^\d+$/)||(0,r.createElement)("label",{htmlFor:h,className:s.labelClassName},void 0,e).appendChild(tE.createTextNode(a[o]||o)),"color"===s.type&&this.chart?.container)return this.createColorInput(t,h,s,e,this.chart.container);let l=(0,r.createElement)("input",{name:h,value:s.value,type:s.type,className:"highcharts-popup-field"},void 0,e);return l.setAttribute("highcharts-data-name",t),l}createColorInput(t,i,e,s,n){let{value:o,alpha:a}=function(t,i){let e=t=>("0"+Math.round(t).toString(16)).slice(-2).toUpperCase(),s=t=>{let[i,s,n,o]=Q().parse(t).rgba;return{value:"#"+e(i)+e(s)+e(n),alpha:o}};if(t.startsWith("rgb")||t.startsWith("rgba"))return s(t);if(t.startsWith("color")||t.startsWith("var")){let n=tE.createElement("span");n.style.setProperty("color",t),i.appendChild(n);let o=window.getComputedStyle(n).color;if(i.removeChild(n),o.startsWith("color")){let t=o.match(RegExp("color\\s*\\(\\s*srgb\\s+([\\d.]+)\\s+([\\d.]+)\\s+([\\d.]+)\\s+(?:\\s*\\/\\s*([\\d.]+))?\\s*\\)"));if(t){let i=Math.round(255*parseFloat(t[1])),s=Math.round(255*parseFloat(t[2])),n=Math.round(255*parseFloat(t[3])),o=t[4]?parseFloat(t[4]):1;return{value:"#"+e(i)+e(s)+e(n),alpha:o}}}if(o.startsWith("rgb")||o.startsWith("rgba"))return s(o)}return{value:t,alpha:1}}(e.value||"",n),h=Q().parse(e.value||"").rgba[3],l=isNaN(h)?a:h,p=(0,r.createElement)("div",{className:"highcharts-popup-color-wrapper"},void 0,s),c=(0,r.createElement)("input",{type:"color",value:o,className:"highcharts-popup-field highcharts-popup-field-color"},void 0,p),d=(0,r.createElement)("input",{name:i,id:i,value:o,type:"text",className:"highcharts-popup-field highcharts-popup-field-text"},void 0,p);d.setAttribute("highcharts-data-name",t);let u=(0,r.createElement)("span",{className:"highcharts-popup-color-separator"},void 0,p),g=(0,r.createElement)("input",{type:"number",value:String(Math.round(100*l)),className:"highcharts-popup-field highcharts-popup-opacity-percentage",min:"0",max:"100",step:"1"},void 0,p),x=(0,r.createElement)("span",{className:"highcharts-popup-opacity-percent-suffix"},void 0,p);x.appendChild(tE.createTextNode(" %"));let y=(0,r.createElement)("input",{type:"range",value:String(Math.round(100*l)),className:"highcharts-popup-opacity-slider",min:"0",max:"100",step:"1"},void 0,s);y.style.setProperty("--highcharts-popup-opacity-track-color",o),y.style.setProperty("display","none");let f=()=>{let t=/^#[0-9A-Fa-f]{6}$/.test(d.value);u.style.display=t?"":"none",g.style.display=t?"":"none",x.style.display=t?"":"none"};f();let m=t=>{let i=t.target,e=(0,r.clamp)(Number(i.value),0,100);y.value=String(e),g.value=String(Math.round(e))},v=t=>{t.target===c?d.value=c.value.toUpperCase():c.value=d.value,y.style.setProperty("--highcharts-popup-opacity-track-color",c.value),f()};return(0,r.addEvent)(s,"mousedown",t=>{t.target!==g&&t.target!==y&&(y.style.display="none")}),(0,r.addEvent)(g,"focus",()=>{y.style.display=""}),(0,r.addEvent)(g,"input",m),(0,r.addEvent)(y,"input",m),(0,r.addEvent)(c,"input",v),(0,r.addEvent)(d,"input",v),p}closeButtonEvents(){if(this.chart){let t=this.chart.navigationBindings;(0,r.fireEvent)(t,"closePopup"),t&&t.selectedButtonElement&&(0,r.fireEvent)(t,"deselectButton",{button:t.selectedButtonElement})}else super.closeButtonEvents()}addButton(t,i,e,s,n){let o=(0,r.createElement)("button",void 0,void 0,t);return o.appendChild(tE.createTextNode(i)),n&&["click","touchstart"].forEach(t=>{(0,r.addEvent)(o,t,()=>{let t,i,o,a,r;return this.closePopup(),n((t=Array.prototype.slice.call(s.querySelectorAll("input")),i=Array.prototype.slice.call(s.querySelectorAll("select")),o=s.querySelectorAll("#highcharts-select-series > option:checked")[0],a=s.querySelectorAll("#highcharts-select-volume > option:checked")[0],r={actionType:e,linkedTo:o&&o.getAttribute("value")||"",fields:{}},t.forEach(t=>{let i=t.getAttribute("highcharts-data-name");if(t.getAttribute("highcharts-data-series-id"))r.seriesId=t.value;else if(i){let e=t.closest(".highcharts-popup-color-wrapper"),s=e?.querySelector(".highcharts-popup-opacity-percentage"),n=s?Number(s.value)/100:1;if(s){let e=Q().parse(t.value).rgba;r.fields[i]=Number.isNaN(e[0])?t.value:`rgba(${e[0]},${e[1]},${e[2]},${n})`}else r.fields[i]=t.value}else r.type=t.value}),i.forEach(t=>{let i=t.id;if("highcharts-select-series"!==i&&"highcharts-select-volume"!==i){let e=i.split("highcharts-select-")[1];r.fields[e]=t.value}}),a&&(r.fields["params.volumeSeriesID"]=a.getAttribute("value")||""),r))})}),o}showForm(t,i,e,s){i&&(this.showPopup(),"indicators"===t&&this.indicators.addForm.call(this,i,e,s),"annotation-toolbar"===t&&this.annotations.addToolbar.call(this,i,e,s),"annotation-edit"===t&&this.annotations.addForm.call(this,i,e,s),"flag"===t&&this.annotations.addForm.call(this,i,e,s,!0),this.type=t,this.container.style.height=this.container.offsetHeight+"px")}}(0,r.extend)(tM.prototype,{annotations:{addForm:function(t,i,e,s){if(!t)return;let n=this.container,o=this.lang,a=(0,r.createElement)("h2",{className:"highcharts-popup-main-title"},void 0,n);a.appendChild(tt.createTextNode(o[i.langKey]||i.langKey||"")),a=(0,r.createElement)("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},void 0,n);let h=(0,r.createElement)("div",{className:"highcharts-popup-bottom-row"},void 0,n);te.call(this,a,t,"",i,[],!0),this.addButton(h,s?o.addButton||"Add":o.saveButton||"Save",s?"add":"save",n,e)},addToolbar:function(t,i,e){let s=this.lang,n=this.container,o=this.showForm,a="highcharts-annotation-toolbar";-1===n.className.indexOf(a)&&(n.className+=" "+a+" highcharts-no-mousewheel"),t&&(n.style.top=t.plotTop+10+"px");let h=(0,r.createElement)("p",{className:"highcharts-annotation-label"},void 0,n);h.setAttribute("aria-label","Annotation type"),h.appendChild(tt.createTextNode((0,r.pick)(s[i.langKey]||i.langKey,i.shapes&&i.shapes[0].type,"")));let l=this.addButton(n,s.editButton||"Edit","edit",n,()=>{o.call(this,"annotation-edit",t,i,e)});l.className+=" highcharts-annotation-edit-button",(0,r.createElement)("span",{className:"highcharts-icon"},{backgroundImage:_("edit.svg",this.iconsURL,K)},l),l=this.addButton(n,s.removeButton||"Remove","remove",n,e),l.className+=" highcharts-annotation-remove-button",(0,r.createElement)("span",{className:"highcharts-icon"},{backgroundImage:_("destroy.svg",this.iconsURL,K)},l)}},indicators:{addForm:function(t,i,e){let s,n=this.lang;if(!t)return;this.tabs.init.call(this,t);let o=this.container.querySelectorAll(".highcharts-tab-item-content");ta(o[0]),tp.call(this,t,o[0]),th.call(this,t,o[0],"add"),s=o[0].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,n.addButton||"add","add",s,e),ta(o[1]),th.call(this,t,o[1],"edit"),s=o[1].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,n.saveButton||"save","edit",s,e),this.addButton(s,n.removeButton||"remove","remove",s,e)},getAmount:function(){let t=0;return this.series.forEach(i=>{(i.params||i.options.params)&&t++}),t}},tabs:{init:function(t){if(!t)return;let i=this.indicators.getAmount.call(t),e=tv.call(this,"add");tv.call(this,"edit",i),tm.call(this),tm.call(this),tP.call(this,i),tA.call(this,e,0)}}});let{composed:tk}=h();function tw(){this.popup&&this.popup.closePopup()}function tC(t){this.popup||(this.popup=new tM(this.chart.container,this.chart.options.navigation.iconsURL||this.chart.options.stockTools&&this.chart.options.stockTools.gui.iconsURL||"renderer",this.chart)),this.popup.showForm(t.formType,this.chart,t.options,t.onSubmit)}function tN(t,i){this.inClass(i.target,"highcharts-popup")||t.apply(this,Array.prototype.slice.call(arguments,1))}let tT=function(t,i){(0,r.pushUnique)(tk,"Popup")&&((0,r.addEvent)(t,"closePopup",tw),(0,r.addEvent)(t,"showPopup",tC),(0,r.wrap)(i.prototype,"onContainerMouseDown",tN))},{getDeferredAnimation:tB}=h(),{defaultOptions:tL}=h();function tY(t,i){let e={};return["labels","shapes"].forEach(s=>{let n=t[s],o=i[s];n&&(o?e[s]=(0,r.splat)(o).map((t,i)=>(0,r.merge)(n[i],t)):e[s]=t[s])}),e}class tX extends v{static compose(t,i,e,s){x.compose(tX,t,e),V.compose(s),S.compose(t,s),i.compose(tX,t),tT(i,e)}constructor(t,i){super(),this.coll="annotations",this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.index=-1,this.labels=[],this.shapes=[],this.setOptions(i),this.userOptions=i;let e=tY(this.options,i);this.options.labels=e.labels,this.options.shapes=e.shapes,this.init(t,this.options)}addClipPaths(){this.setClipAxes(),this.clipXAxis&&this.clipYAxis&&this.options.crop&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))}addLabels(){let t=this.options.labels||[];t.forEach((i,e)=>{let s=this.initLabel(i,e);(0,r.merge)(!0,t[e],s.options)})}addShapes(){let t=this.options.shapes||[];t.forEach((i,e)=>{let s=this.initShape(i,e);(0,r.merge)(!0,t[e],s.options)})}destroy(){let t=this.chart,i=function(t){t.destroy()};this.labels.forEach(i),this.shapes.forEach(i),this.clipXAxis=null,this.clipYAxis=null,(0,r.erase)(t.labelCollectors,this.labelCollector),super.destroy(),this.destroyControlTarget(),(0,r.destroyObjectProperties)(this,t)}destroyItem(t){(0,r.erase)(this[t.itemType+"s"],t),t.destroy()}getClipBox(){if(this.clipXAxis&&this.clipYAxis)return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}}initProperties(t,i){this.setOptions(i);let e=tY(this.options,i);this.options.labels=e.labels,this.options.shapes=e.shapes,this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.userOptions=i,this.labels=[],this.shapes=[]}init(t,i,e=this.index){let s=this.chart,n=this.options.animation;this.index=e,this.linkPoints(),this.addControlPoints(),this.addShapes(),this.addLabels(),this.setLabelCollector(),this.animationConfig=tB(s,n)}initLabel(t,i){this.options.labelOptions?.align;let e=new V(this,(0,r.merge)(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},t),i);return e.itemType="label",this.labels.push(e),e}initShape(t,i){let e=(0,r.merge)(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},t),s=new tX.shapesMap[e.type||"rect"](this,e,i);return s.itemType="shape",this.shapes.push(s),s}redraw(t){this.linkPoints(),this.graphic||this.render(),this.clipRect&&this.clipRect.animate(this.getClipBox()),this.redrawItems(this.shapes,t),this.redrawItems(this.labels,t),this.redrawControlPoints(t)}redrawItem(t,i){if(t.linkPoints(),t.shouldBeDrawn()){let e,s;t.graphic||this.renderItem(t),t.redraw((0,r.pick)(i,!0)&&t.graphic.placed),t.points.length&&(e=t.graphic,s=t.points.some(t=>!1!==t.series.visible&&!1!==t.visible),e&&(s?"hidden"===e.visibility&&e.show():e.hide()))}else this.destroyItem(t)}redrawItems(t,i){let e=t.length;for(;e--;)this.redrawItem(t[e],i)}remove(){return this.chart.removeAnnotation(this)}render(){let t=this.chart.renderer;this.graphic=t.g("annotation").addClass(this.options.className||"").attr({opacity:0,zIndex:this.options.zIndex,visibility:this.options.visible?"inherit":"hidden"}).add(),this.shapesGroup=t.g("annotation-shapes").add(this.graphic),this.options.crop&&this.shapesGroup.clip(this.chart.plotBoxClip),this.labelsGroup=t.g("annotation-labels").attr({translateX:0,translateY:0}).add(this.graphic),this.addClipPaths(),this.clipRect&&this.graphic.clip(this.clipRect),this.renderItems(this.shapes),this.renderItems(this.labels),this.addEvents(),this.renderControlPoints()}renderItem(t){t.render("label"===t.itemType?this.labelsGroup:this.shapesGroup)}renderItems(t){let i=t.length;for(;i--;)this.renderItem(t[i])}setClipAxes(){let t=this.chart.xAxis,i=this.chart.yAxis,e=[...this.options.labels??[],...this.options.shapes??[]].reduce((e,s)=>{let n=s&&(s.point||"points"in s&&s.points?.[0]);return[t[n&&n.xAxis]||e[0],i[n&&n.yAxis]||e[1]]},[]);this.clipXAxis=e[0],this.clipYAxis=e[1]}setControlPointsVisibility(t){let i=function(i){i.setControlPointsVisibility(t)};this.controlPoints.forEach(i=>{i.setVisibility(t)}),this.shapes.forEach(i),this.labels.forEach(i)}setLabelCollector(){let t=this;t.labelCollector=function(){return t.labels.reduce(function(t,i){return i.options.allowOverlap||t.push(i.graphic),t},[])},t.chart.labelCollectors.push(t.labelCollector)}setOptions(t){var i;this.options=(0,r.merge)(this.defaultOptions,t.type&&this.defaultOptions.types?.[t.type]||{},t),(i=this.options).typeOptions||(i.typeOptions={})}setVisibility(t){let i=this.options,e=this.chart.navigationBindings,s=(0,r.pick)(t,!i.visible);if(this.graphic.attr("visibility",s?"inherit":"hidden"),!s){let t=function(t){t.setControlPointsVisibility(s)};this.shapes.forEach(t),this.labels.forEach(t),e.activeAnnotation===this&&e.popup&&"annotation-toolbar"===e.popup.type&&(0,r.fireEvent)(e,"closePopup")}i.visible=s}update(t,i){let e=this.chart,s=tY(this.userOptions,t),n=e.annotations.indexOf(this),o=(0,r.merge)(!0,this.userOptions,t);o.labels=s.labels,o.shapes=s.shapes,this.destroy(),this.initProperties(e,o),this.init(e,o),e.options.annotations[n]=this.options,this.isUpdating=!0,(0,r.pick)(i,!0)&&e.drawAnnotations(),(0,r.fireEvent)(this,"afterUpdate"),this.isUpdating=!1}}tX.ControlPoint=b,tX.MockPoint=O,tX.shapesMap={rect:I,circle:D,ellipse:R,path:S,image:j},tX.types={},tX.prototype.defaultOptions=y,tL.annotations=y,tX.prototype.nonDOMEvents=["add","afterUpdate","drag","remove"],M.compose(tX);let tS=tX;var tI=o||(o={});tI.compose=function(t){return t.navigation||(t.navigation=new tD(t)),t};class tD{constructor(t){this.updates=[],this.chart=t}addUpdate(t){this.chart.navigation.updates.push(t)}update(t,i){this.updates.forEach(e=>{e.call(this.chart,t,i)})}}tI.Additions=tD;let tR=o,tW={backgroundColor:"color",backgroundColors:"color",borderColor:"color",borderRadius:"string",color:"color",fill:"color",fontSize:"string",labels:"string",name:"string",stroke:"color",title:"string"},tz={annotationsFieldsTypes:tW,getAssignedAxis:function(t){return t.filter(t=>{let i=t.axis.getExtremes(),e=i.min,s=i.max,n=(0,r.pick)(t.axis.minPointOffset,0);return(0,r.isNumber)(e)&&(0,r.isNumber)(s)&&t.value>=e-n&&t.value<=s+n&&!t.axis.options.isInternal})[0]},getFieldType:function(t,i){let e=tW[t],s=typeof i;return(0,r.defined)(e)&&(s=e),({string:"text",number:"number",boolean:"checkbox",color:"color"})[s]}},{getAssignedAxis:tF}=tz,tU={lang:{navigation:{popup:{simpleShapes:"Simple shapes",lines:"Lines",circle:"Circle",ellipse:"Ellipse",rectangle:"Rectangle",label:"Label",shapeOptions:"Shape options",typeOptions:"Details",fill:"Fill",format:"Text",strokeWidth:"Line width",stroke:"Line color",title:"Title",name:"Name",labelOptions:"Label options",labels:"Labels",backgroundColor:"Background color",backgroundColors:"Background colors",borderColor:"Border color",borderRadius:"Border radius",borderWidth:"Border width",style:"Style",padding:"Padding",fontSize:"Font size",color:"Color",height:"Height",shapes:"Shape options"}}},navigation:{bindingsClassName:"highcharts-bindings-container",bindings:{circleAnnotation:{className:"highcharts-circle-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&tF(i.xAxis),s=i&&tF(i.yAxis),n=this.chart.options.navigation;if(e&&s)return this.chart.addAnnotation((0,r.merge)({langKey:"circle",type:"basicAnnotation",shapes:[{type:"circle",point:{x:e.value,y:s.value,xAxis:e.axis.index,yAxis:s.axis.index},r:5}]},n.annotationsOptions,n.bindings.circleAnnotation.annotationsOptions))},steps:[function(t,i){let e,s=i.options.shapes,n=s&&s[0]&&s[0].point||{};if((0,r.isNumber)(n.xAxis)&&(0,r.isNumber)(n.yAxis)){let i=this.chart.inverted,s=this.chart.xAxis[n.xAxis].toPixels(n.x),o=this.chart.yAxis[n.yAxis].toPixels(n.y);e=Math.max(Math.sqrt(Math.pow(i?o-t.chartX:s-t.chartX,2)+Math.pow(i?s-t.chartY:o-t.chartY,2)),5)}i.update({shapes:[{r:e}]})}]},ellipseAnnotation:{className:"highcharts-ellipse-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&tF(i.xAxis),s=i&&tF(i.yAxis),n=this.chart.options.navigation;if(e&&s)return this.chart.addAnnotation((0,r.merge)({langKey:"ellipse",type:"basicAnnotation",shapes:[{type:"ellipse",xAxis:e.axis.index,yAxis:s.axis.index,points:[{x:e.value,y:s.value},{x:e.value,y:s.value}],ry:1}]},n.annotationsOptions,n.bindings.ellipseAnnotation.annotationsOptions))},steps:[function(t,i){let e=i.shapes[0],s=e.getAbsolutePosition(e.points[1]);e.translatePoint(t.chartX-s.x,t.chartY-s.y,1),e.redraw(!1)},function(t,i){let e=i.shapes[0],s=e.getAbsolutePosition(e.points[0]),n=e.getAbsolutePosition(e.points[1]),o=e.getDistanceFromLine(s,n,t.chartX,t.chartY),a=e.getYAxis(),r=Math.abs(a.toValue(0)-a.toValue(o));e.setYRadius(r),e.redraw(!1)}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&tF(i.xAxis),s=i&&tF(i.yAxis);if(!e||!s)return;let n=e.value,o=s.value,a=e.axis.index,h=s.axis.index,l=this.chart.options.navigation;return this.chart.addAnnotation((0,r.merge)({langKey:"rectangle",type:"basicAnnotation",shapes:[{type:"path",points:[{xAxis:a,yAxis:h,x:n,y:o},{xAxis:a,yAxis:h,x:n,y:o},{xAxis:a,yAxis:h,x:n,y:o},{xAxis:a,yAxis:h,x:n,y:o},{command:"Z"}]}]},l.annotationsOptions,l.bindings.rectangleAnnotation.annotationsOptions))},steps:[function(t,i){let e=i.options.shapes,s=e&&e[0]&&e[0].points||[],n=this.chart.pointer?.getCoordinates(t),o=n&&tF(n.xAxis),a=n&&tF(n.yAxis);if(o&&a){let t=o.value,e=a.value;s[1].x=t,s[2].x=t,s[2].y=e,s[3].y=e,i.update({shapes:[{points:s}]})}}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&tF(i.xAxis),s=i&&tF(i.yAxis),n=this.chart.options.navigation;if(e&&s)return this.chart.addAnnotation((0,r.merge)({langKey:"label",type:"basicAnnotation",labelOptions:{format:"{y:.2f}",overflow:"none",crop:!0},labels:[{point:{xAxis:e.axis.index,yAxis:s.axis.index,x:e.value,y:s.value}}]},n.annotationsOptions,n.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{animation:{defer:0}}}},{setOptions:tV}=h(),{format:tj}=z(),{composed:tq,doc:tH,win:t$}=h(),{getAssignedAxis:tG,getFieldType:tK}=tz;function t_(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()}function tZ(){this.navigationBindings&&this.navigationBindings.destroy()}function tJ(){let t=this.options;t&&t.navigation&&t.navigation.bindings&&(this.navigationBindings=new t5(this,t.navigation),this.navigationBindings.initEvents(),this.navigationBindings.initUpdate())}function tQ(){let t=this.navigationBindings,i="highcharts-disabled-btn";if(this&&t){let e=!1;if(this.series.forEach(t=>{!t.options.isInternal&&t.visible&&(e=!0)}),this.navigationBindings&&this.navigationBindings.container&&this.navigationBindings.container[0]){let s=this.navigationBindings.container[0];(0,r.objectEach)(t.boundClassNames,(t,n)=>{let o=s.querySelectorAll("."+n);if(o)for(let s=0;s<o.length;s++){let n=o[s],a=n.className;"normal"===t.noDataState||e?-1!==a.indexOf(i)&&n.classList.remove(i):-1===a.indexOf(i)&&(n.className+=" "+i)}})}}}function t0(){this.deselectAnnotation()}function t1(){this.selectedButtonElement=null}function t2(t){let i,e,s=t.prototype.defaultOptions.events&&t.prototype.defaultOptions.events.click;function n(t){let i=this,e=i.chart.navigationBindings,n=e.activeAnnotation;s&&s.call(i,t),n!==i?(e.deselectAnnotation(),e.activeAnnotation=i,i.setControlPointsVisibility(!0),(0,r.fireEvent)(e,"showPopup",{annotation:i,formType:"annotation-toolbar",options:e.annotationToFields(i),onSubmit:function(t){if("remove"===t.actionType)e.activeAnnotation=!1,e.chart.removeAnnotation(i);else{let s={};e.fieldsToOptions(t.fields,s),e.deselectAnnotation();let n=s.typeOptions;"measure"===i.options.type&&(n.crosshairY.enabled=0!==n.crosshairY.strokeWidth,n.crosshairX.enabled=0!==n.crosshairX.strokeWidth),i.update(s)}}})):(0,r.fireEvent)(e,"closePopup"),t.activeAnnotation=!0}(0,r.merge)(!0,t.prototype.defaultOptions.events,{click:n,touchstart:function(t){i=t.touches[0].clientX,e=t.touches[0].clientY},touchend:function(t){i&&Math.sqrt(Math.pow(i-t.changedTouches[0].clientX,2)+Math.pow(e-t.changedTouches[0].clientY,2))>=4||n.call(this,t)}})}class t5{static compose(t,i){(0,r.pushUnique)(tq,"NavigationBindings")&&((0,r.addEvent)(t,"remove",t_),t2(t),(0,r.objectEach)(t.types,t=>{t2(t)}),(0,r.addEvent)(i,"destroy",tZ),(0,r.addEvent)(i,"load",tJ),(0,r.addEvent)(i,"render",tQ),(0,r.addEvent)(t5,"closePopup",t0),(0,r.addEvent)(t5,"deselectButton",t1),tV(tU))}constructor(t,i){this.boundClassNames=void 0,this.chart=t,this.options=i,this.eventsToUnbind=[],this.container=this.chart.container.getElementsByClassName(this.options.bindingsClassName||""),this.container.length||(this.container=tH.getElementsByClassName(this.options.bindingsClassName||""))}getCoords(t){let i=this.chart.pointer?.getCoordinates(t);return[i&&tG(i.xAxis),i&&tG(i.yAxis)]}initEvents(){let t=this,i=t.chart,e=t.container,s=t.options;t.boundClassNames={},(0,r.objectEach)(s.bindings||{},i=>{t.boundClassNames[i.className]=i}),[].forEach.call(e,i=>{t.eventsToUnbind.push((0,r.addEvent)(i,"click",e=>{let s=t.getButtonEvents(i,e);s&&!s.button.classList.contains("highcharts-disabled-btn")&&t.bindingsButtonClick(s.button,s.events,e)}))}),(0,r.objectEach)(s.events||{},(i,e)=>{(0,r.isFunction)(i)&&t.eventsToUnbind.push((0,r.addEvent)(t,e,i,{passive:!1}))}),t.eventsToUnbind.push((0,r.addEvent)(i.container,"click",function(e){!i.cancelClick&&i.isInsidePlot(e.chartX-i.plotLeft,e.chartY-i.plotTop,{visiblePlotOnly:!0})&&t.bindingsChartClick(this,e)})),t.eventsToUnbind.push((0,r.addEvent)(i.container,h().isTouchDevice?"touchmove":"mousemove",function(i){t.bindingsContainerMouseMove(this,i)},h().isTouchDevice?{passive:!1}:void 0))}initUpdate(){let t=this;tR.compose(this.chart).navigation.addUpdate(i=>{t.update(i)})}bindingsButtonClick(t,i,e){let s=this.chart,n=s.renderer.boxWrapper,o=!0;this.selectedButtonElement&&(this.selectedButtonElement.classList===t.classList&&(o=!1),(0,r.fireEvent)(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&s.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1)),o?(this.selectedButton=i,this.selectedButtonElement=t,(0,r.fireEvent)(this,"selectButton",{button:t}),i.init&&i.init.call(this,t,e),(i.start||i.steps)&&s.renderer.boxWrapper.addClass("highcharts-draw-mode")):(s.stockTools&&t.classList.remove("highcharts-active"),n.removeClass("highcharts-draw-mode"),this.nextEvent=!1,this.mouseMoveEvent=!1,this.selectedButton=null)}bindingsChartClick(t,i){t=this.chart;let e=this.activeAnnotation,s=this.selectedButton,n=t.renderer.boxWrapper;e&&(e.cancelClick||i.activeAnnotation||!i.target.parentNode||function(t,i){let e=t$.Element.prototype,s=e.matches||e.msMatchesSelector||e.webkitMatchesSelector,n=null;if(e.closest)n=e.closest.call(t,i);else do{if(s.call(t,i))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return n}(i.target,".highcharts-popup")?e.cancelClick&&setTimeout(()=>{e.cancelClick=!1},0):(0,r.fireEvent)(this,"closePopup")),s&&s.start&&(this.nextEvent?(this.nextEvent(i,this.currentUserDetails),this.steps&&(this.stepIndex++,s.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=s.steps[this.stepIndex]:((0,r.fireEvent)(this,"deselectButton",{button:this.selectedButtonElement}),n.removeClass("highcharts-draw-mode"),s.end&&s.end.call(this,i,this.currentUserDetails),this.nextEvent=!1,this.mouseMoveEvent=!1,this.selectedButton=null))):(this.currentUserDetails=s.start.call(this,i),this.currentUserDetails&&s.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=s.steps[this.stepIndex]):((0,r.fireEvent)(this,"deselectButton",{button:this.selectedButtonElement}),n.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,s.end&&s.end.call(this,i,this.currentUserDetails))))}bindingsContainerMouseMove(t,i){this.mouseMoveEvent&&this.mouseMoveEvent(i,this.currentUserDetails)}fieldsToOptions(t,i){return(0,r.objectEach)(t,(t,e)=>{let s=parseFloat(t),n=e.split("."),o=n.length-1;if(!(0,r.isNumber)(s)||t.match(/px|em/g)||e.match(/format/g)||e.match(/title/g)||(t=s),"undefined"!==t){let e=i;n.forEach((i,s)=>{if("__proto__"!==i&&"constructor"!==i){let a=(0,r.pick)(n[s+1],"");o===s?e[i]=t:(e[i]||(e[i]=a.match(/\d/g)?[]:{}),e=e[i])}})}}),i}deselectAnnotation(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)}annotationToFields(t){let i=t.options,e=t5.annotationsEditable,s=e.nestedOptions,n=(0,r.pick)(i.type,i.shapes?.[0]?.type,i.labels?.[0]?.type,"label"),o=t5.annotationsNonEditable[i.langKey]||[],a={langKey:i.langKey,type:n};function h(i,e,n,a,l){let p;n&&(0,r.defined)(i)&&-1===o.indexOf(e)&&((n.indexOf&&n.indexOf(e))>=0||n[e]||!0===n)&&((0,r.isArray)(i)?(a[e]=[],i.forEach((t,i)=>{(0,r.isObject)(t)?(a[e][i]={},(0,r.objectEach)(t,(t,n)=>{h(t,n,s[e],a[e][i],e)})):h(t,0,s[e],a[e],e)})):(0,r.isObject)(i)?(p={},(0,r.isArray)(a)?(a.push(p),p[e]={},p=p[e]):a[e]=p,(0,r.objectEach)(i,(t,i)=>{h(t,i,0===e?n:s[e],p,e)})):"format"===e?a[e]=[tj(i,t.labels[0].points[0]).toString(),"text"]:(0,r.isArray)(a)?a.push([i,tK(l,i)]):a[e]=[i,tK(e,i)])}return(0,r.objectEach)(i,(t,o)=>{"typeOptions"===o&&"basicAnnotation"!==a.type?(a[o]={},(0,r.objectEach)(i[o],(t,i)=>{h(t,i,s,a[o],i)})):h(t,o,e[n],a,o)}),a}getClickedClassNames(t,i){let e=i.target,s=[],n;for(;e&&e.tagName&&((n=(0,r.attr)(e,"class"))&&(s=s.concat(n.split(" ").map(t=>[t,e]))),(e=e.parentNode)!==t););return s}getButtonEvents(t,i){let e,s=this;return this.getClickedClassNames(t,i).forEach(t=>{s.boundClassNames[t[0]]&&!e&&(e={events:s.boundClassNames[t[0]],button:t[1]})}),e}update(t){this.options=(0,r.merge)(!0,this.options,t),this.removeEvents(),this.initEvents()}removeEvents(){this.eventsToUnbind.forEach(t=>t())}destroy(){this.removeEvents()}}t5.annotationsEditable={nestedOptions:{labelOptions:["style","format","backgroundColor"],labels:["style"],label:["style"],style:["fontSize","color"],background:["fill","strokeWidth","stroke"],innerBackground:["fill","strokeWidth","stroke"],outerBackground:["fill","strokeWidth","stroke"],shapeOptions:["fill","strokeWidth","stroke"],shapes:["fill","strokeWidth","stroke"],line:["strokeWidth","stroke"],backgroundColors:[!0],connector:["fill","strokeWidth","stroke"],crosshairX:["strokeWidth","stroke"],crosshairY:["strokeWidth","stroke"]},circle:["shapes"],ellipse:["shapes"],verticalLine:[],label:["labelOptions"],measure:["background","crosshairY","crosshairX"],fibonacci:[],tunnel:["background","line","height"],pitchfork:["innerBackground","outerBackground"],rect:["shapes"],crookedLine:[],basicAnnotation:["shapes","labelOptions"]},t5.annotationsNonEditable={rectangle:["crosshairX","crosshairY","labelOptions"],ellipse:["labelOptions"],circle:["labelOptions"]};class t9 extends tS{addControlPoints(){let t=this.options,i=t9.basicControlPoints,e=this.basicType;(t.labels||t.shapes||[]).forEach(t=>{t.controlPoints=i[e]})}init(){let t=this.options;if(t.shapes){delete t.labelOptions;let i=t.shapes[0].type;t.shapes[0].className=(t.shapes[0].className||"")+" highcharts-basic-shape",i&&"path"!==i?this.basicType=i:this.basicType="rectangle"}else delete t.shapes,this.basicType="label";super.init.apply(this,arguments)}}t9.basicControlPoints={label:[{symbol:"triangle-down",positioner:function(t){if(!t.graphic.placed)return{x:0,y:-9e7};let i=O.pointToPixels(t.points[0]);return{x:i.x-(this.graphic.width||0)/2,y:i.y-(this.graphic.height||0)/2}},events:{drag:function(t,i){let e=this.mouseMoveToTranslation(t);i.translatePoint(e.x,e.y),i.annotation.userOptions.labels[0].point=i.options.point,i.redraw(!1)}}},{symbol:"square",positioner:function(t){return t.graphic.placed?{x:t.graphic.alignAttr.x-(this.graphic.width||0)/2,y:t.graphic.alignAttr.y-(this.graphic.height||0)/2}:{x:0,y:-9e7}},events:{drag:function(t,i){let e=this.mouseMoveToTranslation(t);i.translate(e.x,e.y),i.annotation.userOptions.labels[0].point=i.options.point,i.redraw(!1)}}}],rectangle:[{positioner:function(t){let i=O.pointToPixels(t.points[2]);return{x:i.x-4,y:i.y-4}},events:{drag:function(t,i){let e=i.annotation,s=this.chart.pointer?.getCoordinates(t),n=i.options.points,o=e.userOptions.shapes,a=e.clipXAxis?.index||0,r=e.clipYAxis?.index||0;if(s){let t=s.xAxis[a].value,e=s.yAxis[r].value;n[1].x=t,n[2].x=t,n[2].y=e,n[3].y=e,o?.[0]&&(o[0].points=i.options.points)}e.redraw(!1)}}}],circle:[{positioner:function(t){let i=O.pointToPixels(t.points[0]),e=t.options.r;return{x:i.x+e*Math.cos(Math.PI/4)-(this.graphic.width||0)/2,y:i.y+e*Math.sin(Math.PI/4)-(this.graphic.height||0)/2}},events:{drag:function(t,i){let e=i.annotation,s=this.mouseMoveToTranslation(t),n=e.userOptions.shapes;i.setRadius(Math.max((i.options.r||0)+s.y/Math.sin(Math.PI/4),5)),n&&n[0]&&(n[0].r=i.options.r,n[0].point=i.options.point),i.redraw(!1)}}}],ellipse:[{positioner:function(t){let i=t.getAbsolutePosition(t.points[0]);return{x:i.x-(this.graphic.width||0)/2,y:i.y-(this.graphic.height||0)/2}},events:{drag:function(t,i){let e=i.getAbsolutePosition(i.points[0]);i.translatePoint(t.chartX-e.x,t.chartY-e.y,0),i.redraw(!1)}}},{positioner:function(t){let i=t.getAbsolutePosition(t.points[1]);return{x:i.x-(this.graphic.width||0)/2,y:i.y-(this.graphic.height||0)/2}},events:{drag:function(t,i){let e=i.getAbsolutePosition(i.points[1]);i.translatePoint(t.chartX-e.x,t.chartY-e.y,1),i.redraw(!1)}}},{positioner:function(t){let i=t.getAbsolutePosition(t.points[0]),e=t.getAbsolutePosition(t.points[1]),s=t.getAttrs(i,e);return{x:s.cx-(this.graphic.width||0)/2+s.ry*Math.sin(s.angle*Math.PI/180),y:s.cy-(this.graphic.height||0)/2-s.ry*Math.cos(s.angle*Math.PI/180)}},events:{drag:function(t,i){let e=i.getAbsolutePosition(i.points[0]),s=i.getAbsolutePosition(i.points[1]),n=i.getDistanceFromLine(e,s,t.chartX,t.chartY),o=i.getYAxis(),a=Math.abs(o.toValue(0)-o.toValue(n));i.setYRadius(a),i.redraw(!1)}}}]},tS.types.basicAnnotation=t9;let{defaultOptions:t3}=h();t3.annotations?.types&&(t3.annotations.types.crookedLine={typeOptions:{xAxis:0,yAxis:0,line:{fill:"none"}},controlPointOptions:{positioner:function(t){let i=this.graphic,e=O.pointToPixels(t.points[this.index]);return{x:e.x-(i.width||0)/2,y:e.y-(i.height||0)/2}},events:{drag:function(t,i){if(i.chart.isInsidePlot(t.chartX-i.chart.plotLeft,t.chartY-i.chart.plotTop,{visiblePlotOnly:!0})){let e=this.mouseMoveToTranslation(t),s=i.options.typeOptions;i.translatePoint(e.x,e.y,this.index),s.points[this.index].x=i.points[this.index].x,s.points[this.index].y=i.points[this.index].y,i.redraw(!1)}}}}});class t7 extends tS{setClipAxes(){this.clipXAxis=this.chart.xAxis[this.options.typeOptions?.xAxis],this.clipYAxis=this.chart.yAxis[this.options.typeOptions?.yAxis]}getPointsOptions(){var t;let i=(t=this.options).typeOptions||(t.typeOptions={});return(i.points||[]).map(t=>("string"!=typeof t&&(t.xAxis=i.xAxis,t.yAxis=i.yAxis),t))}getControlPointsOptions(){return this.getPointsOptions()}addControlPoints(){this.getControlPointsOptions().forEach(function(t,i){let e=new b(this.chart,this,(0,r.merge)(this.options.controlPointOptions,t.controlPoint),i);this.controlPoints.push(e),t.controlPoint=e.options},this)}addShapes(){var t;let i=(t=this.options).typeOptions||(t.typeOptions={}),e=this.initShape((0,r.merge)(i.line,{type:"path",className:"highcharts-crooked-lines",points:this.points.map((t,i)=>function(t){return t.annotation.points[i]})}),0);i.line=e.options}}tS.types.crookedLine=t7;let t4=t7,{defaultOptions:t6}=h();t6.annotations?.types&&(t6.annotations.types.elliottWave=(0,r.merge)(t6.annotations.types.crookedLine,{typeOptions:{labels:["(0)","(A)","(B)","(C)","(D)","(E)"],line:{strokeWidth:1}},labelOptions:{align:"center",allowOverlap:!0,crop:!0,overflow:"none",type:"rect",backgroundColor:"none",borderWidth:0,y:-5,style:{color:"var(--highcharts-neutral-color-80)"}}})),tS.types.elliottWave=class extends t4{addLabels(){this.getPointsOptions().forEach((t,i)=>{let e=this.options.typeOptions,s=this.initLabel((0,r.merge)(t.label,{text:e.labels[i],point:function(t){return t.annotation.points[i]}}),!1);t.label=s.options})}};let{defaultOptions:t8}=h();t8.annotations?.types&&(t8.annotations.types.tunnel=(0,r.merge)(t8.annotations.types.crookedLine,{typeOptions:{background:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0},line:{strokeWidth:1},height:-2,heightControlPoint:{positioner:function(t){var i,e,s;let n=O.pointToPixels(t.points[2]),o=O.pointToPixels(t.points[3]),a=(n.x+o.x)/2;return{x:a-(this.graphic.width||0)/2,y:(i=n,e=o,s=a,(e.y-i.y)/(e.x-i.x)*(s-i.x)+i.y-(this.graphic.height||0)/2)}},events:{drag:function(t,i){i.chart.isInsidePlot(t.chartX-i.chart.plotLeft,t.chartY-i.chart.plotTop,{visiblePlotOnly:!0})&&(i.translateHeight(this.mouseMoveToTranslation(t).y),i.redraw(!1))}}}},controlPointOptions:{events:{drag:function(t,i){if(i.chart.isInsidePlot(t.chartX-i.chart.plotLeft,t.chartY-i.chart.plotTop,{visiblePlotOnly:!0})){let e=this.mouseMoveToTranslation(t);i.translateSide(e.x,e.y,!!this.index),i.redraw(!1)}}}}}));class it extends t4{getPointsOptions(){let t=t4.prototype.getPointsOptions.call(this),i=this.options.typeOptions?.yAxis||0,e=this.chart.yAxis[i];if(t[2]=this.heightPointOptions(t[1]),t[3]=this.heightPointOptions(t[0]),e&&e.logarithmic){let i=e.toPixels(t[2].y)-e.toPixels(t[1].y),s=e.toPixels(t[0].y)+i;t[3].y=e.toValue(s)}return t}getControlPointsOptions(){return this.getPointsOptions().slice(0,2)}heightPointOptions(t){let i=(0,r.merge)(t),e=this.options.typeOptions;return i.y+=e.height,i}addControlPoints(){t4.prototype.addControlPoints.call(this);let t=this.options,i=t.typeOptions,e=new b(this.chart,this,(0,r.merge)(t.controlPointOptions,i.heightControlPoint),2);this.controlPoints.push(e),i.heightControlPoint=e.options}addShapes(){this.addLine(),this.addBackground()}addLine(){var t;let i=this.initShape((0,r.merge)(((t=this.options).typeOptions||(t.typeOptions={})).line,{type:"path",className:"highcharts-tunnel-lines",points:[this.points[0],this.points[1],function(t){let i=O.pointToOptions(t.annotation.points[2]);return i.command="M",i},this.points[3]]}),0);this.options.typeOptions.line=i.options}addBackground(){let t=this.initShape((0,r.merge)(this.options.typeOptions.background,{type:"path",points:this.points.slice(),className:"highcharts-tunnel-background"}),1);this.options.typeOptions.background=t.options}translateSide(t,i,e){let s=Number(e);this.translatePoint(t,i,s),this.translatePoint(t,i,0===s?3:2)}translateHeight(t){this.translatePoint(0,t,2),this.translatePoint(0,t,3),this.options.typeOptions.height=this.points[3].y-this.points[0].y,this.userOptions.typeOptions.height=this.options.typeOptions.height}}tS.types.tunnel=it;let ii=it,{defaultOptions:ie}=h();ie.annotations?.types&&(ie.annotations.types.infinityLine=(0,r.merge)(ie.annotations.types.crookedLine));class is extends t4{static edgePoint(t,i){return function(e){let s=e.annotation,n=s.options.typeOptions.type,o=s.points;return("horizontalLine"===n||"verticalLine"===n)&&(o=[o[0],new O(s.chart,o[0].target,{x:o[0].x+ +("horizontalLine"===n),y:o[0].y+ +("verticalLine"===n),xAxis:o[0].options.xAxis,yAxis:o[0].options.yAxis})]),is.findEdgePoint(o[t],o[i])}}static findEdgeCoordinate(t,i,e,s){let n="x"===e?"y":"x";return(i[e]-t[e])*(s-t[n])/(i[n]-t[n])+t[e]}static findEdgePoint(t,i){let e,s,n,o=t.series.chart,a=t.series.xAxis,r=i.series.yAxis,h=O.pointToPixels(t),l=O.pointToPixels(i),p=l.x-h.x,c=l.y-h.y,d=a.left,u=d+a.width,g=r.top,x=g+r.height,y=p<0?d:u,f=c<0?g:x,m={x:0===p?h.x:y,y:0===c?h.y:f};return 0!==p&&0!==c&&(s=is.findEdgeCoordinate(h,l,"y",y),e=is.findEdgeCoordinate(h,l,"x",f),s>=g&&s<=x?(m.x=y,m.y=s):(m.x=e,m.y=f)),m.x-=o.plotLeft,m.y-=o.plotTop,t.series.chart.inverted&&(n=m.x,m.x=m.y,m.y=n),m}addShapes(){let t=this.options.typeOptions,i=[this.points[0],is.endEdgePoint];t.type.match(/line/gi)&&(i[0]=is.startEdgePoint);let e=this.initShape((0,r.merge)(t.line,{type:"path",className:"highcharts-infinity-lines",points:i}),0);t.line=e.options}}is.endEdgePoint=is.edgePoint(0,1),is.startEdgePoint=is.edgePoint(1,0),tS.types.infinityLine=is;let io=is,{defaultOptions:ia}=h();ia.annotations?.types&&(ia.annotations.types.timeCycles=(0,r.merge)(ia.annotations.types.crookedLine,{typeOptions:{controlPointOptions:[{positioner:function(t){let i=t.points[0];return{x:t.anchor(i).absolutePosition.x-(this.graphic.width||0)/2,y:t.y-(this.graphic.height||0)}},events:{drag:function(t,i){let e=i.anchor(i.points[0]).absolutePosition;i.translatePoint(t.chartX-e.x,0,0),i.redraw(!1)}}},{positioner:function(t){let i=t.points[1];return{x:t.anchor(i).absolutePosition.x-(this.graphic.width||0)/2,y:t.y-(this.graphic.height||0)}},events:{drag:function(t,i){let e=i.anchor(i.points[1]).absolutePosition;i.translatePoint(t.chartX-e.x,0,1),i.redraw(!1)}}}]}})),tS.types.timeCycles=class extends t4{init(t,i,e){(0,r.defined)(i.yAxis)&&i.points.forEach(t=>{t.yAxis=i.yAxis}),(0,r.defined)(i.xAxis)&&i.points.forEach(t=>{t.xAxis=i.xAxis}),super.init(t,i,e)}setPath(){this.shapes[0].options.d=this.getPath()}getPath(){return[["M",this.startX,this.y]].concat(function(t,i,e,s){let n=[];for(let o=1;o<=i;o++)n.push(["A",t/2,t/2,0,1,1,e+o*t,s]);return n}(this.pixelInterval,this.numberOfCircles,this.startX,this.y))}addShapes(){let t=this.options.typeOptions;this.setPathProperties();let i=this.initShape((0,r.merge)(t.line,{type:"path",d:this.getPath(),points:this.options.points,className:"highcharts-timecycles-lines"}),0);t.line=i.options}addControlPoints(){let t=this.options,i=t.typeOptions;t.controlPointOptions.style.cursor=this.chart.inverted?"ns-resize":"ew-resize",i.controlPointOptions.forEach(i=>{let e=(0,r.merge)(t.controlPointOptions,i),s=new b(this.chart,this,e,0);this.controlPoints.push(s)})}setPathProperties(){let t=this.options.typeOptions,i=t.points;if(!i)return;let e=i[0],s=i[1],n=t.xAxis||0,o=t.yAxis||0,a=this.chart.xAxis[n],h=this.chart.yAxis[o],l=e.x,p=e.y,c=s.x;if(!l||!c)return;let d=(0,r.isNumber)(p)?h.toPixels(p):h.top+h.height,u=(0,r.isNumber)(l)?a.toPixels(l):a.left,g=(0,r.isNumber)(c)?a.toPixels(c):a.left+30,x=a.len,y=Math.round(Math.max(Math.abs(g-u),2)),f=Math.floor(x/y)+2,m=(Math.floor((u-a.left)/y)+1)*y;this.startX=u-m,this.y=d,this.pixelInterval=y,this.numberOfCircles=f}redraw(t){this.setPathProperties(),this.setPath(),super.redraw(t)}};let{defaultOptions:ir}=h();function ih(t,i){return function(){let e=this.annotation;if(!e.startRetracements||!e.endRetracements)return[];let s=this.anchor(e.startRetracements[t]).absolutePosition,n=this.anchor(e.endRetracements[t]).absolutePosition,o=[["M",Math.round(s.x),Math.round(s.y)],["L",Math.round(n.x),Math.round(n.y)]];if(i){let i=this.anchor(e.endRetracements[t-1]).absolutePosition,s=this.anchor(e.startRetracements[t-1]).absolutePosition;o.push(["L",Math.round(i.x),Math.round(i.y)],["L",Math.round(s.x),Math.round(s.y)])}return o}}ir.annotations?.types&&(ir.annotations.types.fibonacci=(0,r.merge)(ir.annotations.types.tunnel,{typeOptions:{reversed:!1,height:2,backgroundColors:["rgba(130, 170, 255, 0.4)","rgba(139, 191, 216, 0.4)","rgba(150, 216, 192, 0.4)","rgba(156, 229, 161, 0.4)","rgba(162, 241, 130, 0.4)","rgba(169, 255, 101, 0.4)"],lineColor:"var(--highcharts-neutral-color-40)",lineColors:[],labels:[]},labelOptions:{allowOverlap:!0,align:"right",backgroundColor:"none",borderWidth:0,crop:!1,overflow:"none",shape:"rect",style:{color:"var(--highcharts-neutral-color-80)"},verticalAlign:"middle",y:0}}));class il extends ii{linkPoints(){super.linkPoints(),this.linkRetracementsPoints()}linkRetracementsPoints(){let t=this.points,i=t[0].y-t[3].y,e=t[1].y-t[2].y,s=t[0].x,n=t[1].x;il.levels.forEach((o,a)=>{let r=t[0].y-i*o,h=t[1].y-e*o,l=this.options.typeOptions.reversed?il.levels.length-a-1:a;this.startRetracements=this.startRetracements||[],this.endRetracements=this.endRetracements||[],this.linkRetracementPoint(l,s,r,this.startRetracements),this.linkRetracementPoint(l,n,h,this.endRetracements)})}linkRetracementPoint(t,i,e,s){let n=s[t],o=this.options.typeOptions;n?(n.options.x=i,n.options.y=e,n.refresh()):s[t]=new O(this.chart,this,{x:i,y:e,xAxis:o.xAxis,yAxis:o.yAxis})}addShapes(){il.levels.forEach(function(t,i){let{backgroundColors:e,lineColor:s,lineColors:n}=this.options.typeOptions;this.initShape({type:"path",d:ih(i),stroke:n[i]||s,className:"highcharts-fibonacci-line"},i),i>0&&this.initShape({type:"path",fill:e[i-1],strokeWidth:0,d:ih(i,!0),className:"highcharts-fibonacci-background-"+(i-1)})},this)}addLabels(){il.levels.forEach(function(t,i){let e=this.options.typeOptions,s=this.initLabel((0,r.merge)(e.labels[i],{point:function(t){return O.pointToOptions(t.annotation.startRetracements[i])},text:t.toString()}));e.labels[i]=s.options},this)}}il.levels=[0,.236,.382,.5,.618,.786,1],tS.types.fibonacci=il;let{defaultOptions:ip}=h();function ic(t,i,e){return function(s){let n=s.annotation.chart,o=n.inverted?n.plotTop:n.plotLeft,a=s.annotation.points,r=a[0].series.xAxis,h=a.length>1?a[1].plotX-a[0].plotX:0,l=r.toValue(a[0].plotX+o+e*h);return a=[new O(n,a[0].target,{x:l,y:0,xAxis:a[0].options.xAxis,yAxis:a[0].options.yAxis}),new O(n,a[0].target,{x:l,y:1,xAxis:a[0].options.xAxis,yAxis:a[0].options.yAxis})],io.findEdgePoint(a[t],a[i])}}ip.annotations?.types&&(ip.annotations.types.fibonacciTimeZones=(0,r.merge)(ip.annotations.types.crookedLine,{typeOptions:{line:{stroke:"var(--highcharts-neutral-color-80)",strokeWidth:1,fill:void 0},controlPointOptions:{positioner:function(){let t=this.target,i=this.graphic,e=t.secondLineEdgePoints,s={annotation:t},n=e[0](s).y,o=e[1](s).y,a=this.chart.plotLeft,r=this.chart.plotTop,h=e[0](s).x,l=(n+o)/2;return this.chart.inverted&&([h,l]=[l,h]),{x:a+h-(i.width||0)/2,y:r+l-(i.height||0)/2}},events:{drag:function(t,i){if(i.chart.isInsidePlot(t.chartX-i.chart.plotLeft,t.chartY-i.chart.plotTop,{visiblePlotOnly:!0})){let e=this.mouseMoveToTranslation(t);i.translatePoint(e.x,0,1),i.redraw(!1)}}}}}})),tS.types.fibonacciTimeZones=class extends t4{addShapes(){let t=1,i=1;for(let e=0;e<11;e++){let s=e?t:0,n=[ic(1,0,s),ic(0,1,s)];t=(i=t+i)-t,1===e&&(this.secondLineEdgePoints=[n[0],n[1]]),this.initShape((0,r.merge)(this.options.typeOptions?.line,{type:"path",className:"highcharts-fibonacci-timezones-lines",points:n}),e)}}addControlPoints(){let t=this.options,i=t.typeOptions,e=new b(this.chart,this,(0,r.merge)(t.controlPointOptions,i.controlPointOptions),0);this.controlPoints.push(e),i.controlPointOptions=e.options}};let{defaultOptions:id}=h();id.annotations?.types&&(id.annotations.types.pitchfork=(0,r.merge)(id.annotations.types.infinityLine,{typeOptions:{innerBackground:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0},outerBackground:{fill:"rgba(156, 229, 161, 0.4)",strokeWidth:0}}}));class iu extends io{static outerLineEdgePoint(t){return function(i){let e=i.annotation,s=e.points;return iu.findEdgePoint(s[t],s[0],new O(e.chart,i,e.midPointOptions()))}}static findEdgePoint(t,i,e){let s=Math.atan2(e.plotY-i.plotY,e.plotX-i.plotX);return{x:t.plotX+1e7*Math.cos(s),y:t.plotY+1e7*Math.sin(s)}}static middleLineEdgePoint(t){let i=t.annotation,e=i.points;return io.findEdgePoint(e[0],new O(i.chart,t,i.midPointOptions()))}midPointOptions(){let t=this.points;return{x:(t[1].x+t[2].x)/2,y:(t[1].y+t[2].y)/2,xAxis:t[0].series.xAxis,yAxis:t[0].series.yAxis}}addShapes(){this.addLines(),this.addBackgrounds()}addLines(){let t="highcharts-pitchfork-lines";this.initShape({type:"path",points:[this.points[0],iu.middleLineEdgePoint],className:t},0),this.initShape({type:"path",points:[this.points[1],iu.topLineEdgePoint],className:t},1),this.initShape({type:"path",points:[this.points[2],iu.bottomLineEdgePoint],className:t},2)}addBackgrounds(){let t=this.shapes,i=this.options.typeOptions,e=this.initShape((0,r.merge)(i.innerBackground,{type:"path",points:[function(t){let i=t.annotation,e=i.points,s=i.midPointOptions();return{x:(e[1].x+s.x)/2,y:(e[1].y+s.y)/2,xAxis:s.xAxis,yAxis:s.yAxis}},t[1].points[1],t[2].points[1],function(t){let i=t.annotation,e=i.points,s=i.midPointOptions();return{x:(s.x+e[2].x)/2,y:(s.y+e[2].y)/2,xAxis:s.xAxis,yAxis:s.yAxis}}],className:"highcharts-pitchfork-inner-background"}),3),s=this.initShape((0,r.merge)(i.outerBackground,{type:"path",points:[this.points[1],t[1].points[1],t[2].points[1],this.points[2]],className:"highcharts-pitchfork-outer-background"}),4);i.innerBackground=e.options,i.outerBackground=s.options}}iu.topLineEdgePoint=iu.outerLineEdgePoint(1),iu.bottomLineEdgePoint=iu.outerLineEdgePoint(0),tS.types.pitchfork=iu;let{defaultOptions:ig}=h();ig.annotations?.types&&(ig.annotations.types.verticalLine={typeOptions:{yOffset:10,label:{offset:-40,point:function(t){return t.annotation.points[0]},allowOverlap:!0,backgroundColor:"none",borderWidth:0,crop:!0,overflow:"none",shape:"rect",text:"{y:.2f}"},connector:{strokeWidth:1,markerEnd:"arrow"}},labelOptions:{style:{color:"var(--highcharts-neutral-color-80)",fontSize:"0.7em"}}});class ix extends tS{static connectorFirstPoint(t){let i=t.annotation,e=i.chart,s=e.inverted,n=i.points[0],o=(0,r.pick)(n.series.yAxis?.left,0),a=(0,r.pick)(n.series.yAxis?.top,0),h=i.options.typeOptions?.label?.offset||0,l=O.pointToPixels(n,!0)[s?"x":"y"];return{x:n.x,xAxis:n.series.xAxis,y:l+h+(s?o-e.plotLeft:a-e.plotTop)}}static connectorSecondPoint(t){let i=t.annotation,e=i.chart,s=e.inverted,n=i.options.typeOptions,o=i.points[0],a=(0,r.pick)(o.series.yAxis&&o.series.yAxis.left,0),h=(0,r.pick)(o.series.yAxis&&o.series.yAxis.top,0),l=O.pointToPixels(o,!0)[s?"x":"y"],p=n?.yOffset||0;return 0>(n?.label?.offset||0)&&(p*=-1),{x:o.x,xAxis:o.series.xAxis,y:l+p+(s?a-e.plotLeft:h-e.plotTop)}}getPointsOptions(){return this.options.typeOptions?.point?[this.options.typeOptions.point]:[]}addShapes(){var t;let i=this.options.typeOptions,e=this.initShape((0,r.merge)(i.connector,{type:"path",points:[ix.connectorFirstPoint,ix.connectorSecondPoint],className:"highcharts-vertical-line"}),0);i.connector=e.options,((t=this.userOptions).typeOptions||(t.typeOptions={})).point=i.point}addLabels(){let t=this.options.typeOptions,i=t.label,e=i?.offset||0,s=0,n=e,o=e<0?"bottom":"top",a="center";this.chart.inverted&&(s=e,n=0,o="middle",a=e<0?"right":"left"),t.label=this.initLabel((0,r.merge)(i,{verticalAlign:o,align:a,x:s,y:n})).options}}tS.types.verticalLine=ix;let{defaultOptions:iy}=h();function im(){let t=0,i=0,e=0,s=this.chart.series,n=iP(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax);return s.forEach(t=>{t.visible&&"highcharts-navigator-series"!==t.options.id&&t.points.forEach(t=>{iv(t,n)&&(0,r.isNumber)(t.y)&&(i+=t.y,e++)})}),e>0&&(t=i/e),t}function iv(t,i){return!t.isNull&&(0,r.isNumber)(t.y)&&t.x>i.xAxisMin&&t.x<=i.xAxisMax&&t.y>i.yAxisMin&&t.y<=i.yAxisMax}function ib(){let t=this.chart.series,i=iP(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),e=0;return t.forEach(t=>{t.visible&&"highcharts-navigator-series"!==t.options.id&&t.points.forEach(t=>{iv(t,i)&&e++})}),e}function iA(){return"Min: "+this.min+"<br>Max: "+this.max+"<br>Average: "+this.average.toFixed(2)+"<br>Bins: "+this.bins}function iP(t,i,e,s){return{xAxisMin:Math.min(i,t),xAxisMax:Math.max(i,t),yAxisMin:Math.min(s,e),yAxisMax:Math.max(s,e)}}function iE(t,i,e){return t.toValue(t.toPixels(i)+e)}function iO(){let t=this.options.typeOptions,i=this.chart,e=i.inverted,s=i.xAxis[t.xAxis],n=i.yAxis[t.yAxis],o=t.background,a=e?o.height:o.width,h=e?o.width:o.height,l=t.selectType,p=e?s.left:n.top,c=e?n.top:s.left;this.startXMin=t.point.x,this.startYMin=t.point.y,(0,r.isNumber)(a)?this.startXMax=this.startXMin+a:this.startXMax=iE(s,this.startXMin,parseFloat(a)),(0,r.isNumber)(h)?this.startYMax=this.startYMin-h:this.startYMax=iE(n,this.startYMin,parseFloat(h)),"x"===l?(this.startYMin=n.toValue(p),this.startYMax=n.toValue(p+n.len)):"y"===l&&(this.startXMin=s.toValue(c),this.startXMax=s.toValue(c+s.len))}function iM(){let t=this.chart.series,i=iP(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),e=-1/0,s=!1;return t.forEach(t=>{t.visible&&"highcharts-navigator-series"!==t.options.id&&t.points.forEach(t=>{(0,r.isNumber)(t.y)&&t.y>e&&iv(t,i)&&(e=t.y,s=!0)})}),s||(e=0),e}function ik(){let t=this.chart.series,i=iP(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),e=1/0,s=!1;return t.forEach(t=>{t.visible&&"highcharts-navigator-series"!==t.options.id&&t.points.forEach(t=>{(0,r.isNumber)(t.y)&&t.y<e&&iv(t,i)&&(e=t.y,s=!0)})}),s||(e=0),e}function iw(t){let i=this.options.typeOptions,e=this.chart.xAxis[i.xAxis],s=this.chart.yAxis[i.yAxis],n=this.offsetX,o=this.offsetY;this.xAxisMin=iE(e,this.startXMin,n),this.xAxisMax=iE(e,this.startXMax,n),this.yAxisMin=iE(s,this.startYMin,o),this.yAxisMax=iE(s,this.startYMax,o),this.min=ik.call(this),this.max=iM.call(this),this.average=im.call(this),this.bins=ib.call(this),t&&this.resize(0,0)}function iC(t,i,e,s,n){var o;let a=this.options.typeOptions,r=a.selectType,h=this.chart.xAxis[a.xAxis],l=this.chart.yAxis[a.yAxis],p=this.startXMin,c=this.startXMax,d=this.startYMin,u=this.startYMax,g=this.offsetX,x=this.offsetY;i&&("x"===r?0===e?this.startXMin=iE(h,p,s):this.startXMax=iE(h,c,s):"y"===r?0===e?this.startYMin=iE(l,d,n):this.startYMax=iE(l,u,n):(this.startXMax=iE(h,c,s),this.startYMax=iE(l,u,n))),t&&(this.startXMin=iE(h,p,g),this.startXMax=iE(h,c,g),this.startYMin=iE(l,d,x),this.startYMax=iE(l,u,x),this.offsetX=0,this.offsetY=0),this.options.typeOptions.point={x:this.startXMin,y:this.startYMin},((o=this.userOptions).typeOptions||(o.typeOptions={})).point={x:this.startXMin,y:this.startYMin}}iy.annotations?.types&&(iy.annotations.types.measure={typeOptions:{selectType:"xy",xAxis:0,yAxis:0,background:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0,stroke:void 0},crosshairX:{enabled:!0,zIndex:6,dashStyle:"Dash",markerEnd:"arrow"},crosshairY:{enabled:!0,zIndex:6,dashStyle:"Dash",markerEnd:"arrow"},label:{enabled:!0,style:{fontSize:"0.7em",color:"var(--highcharts-neutral-color-80)"},formatter:void 0}},controlPointOptions:{positioner:function(t){let i=this.index,e=t.chart,s=t.options,n=s.typeOptions,o=n.selectType,a=s.controlPointOptions,r=e.inverted,h=e.xAxis[n.xAxis],l=e.yAxis[n.yAxis],p=iP(t.xAxisMin,t.xAxisMax,t.yAxisMin,t.yAxisMax),c=t.xAxisMax,d=t.yAxisMax,u,g;return"x"===o&&(d=(p.yAxisMax+p.yAxisMin)/2,0===i&&(c=t.xAxisMin)),"y"===o&&(c=p.xAxisMin+(p.xAxisMax-p.xAxisMin)/2,0===i&&(d=t.yAxisMin)),r?(u=l.toPixels(d),g=h.toPixels(c)):(u=h.toPixels(c),g=l.toPixels(d)),{x:u-(a?.width||0)/2,y:g-(a?.height||0)/2}},events:{drag:function(t,i){let e=this.mouseMoveToTranslation(t),s=i.options.typeOptions.selectType,n=this.index,o="y"===s?0:e.x,a="x"===s?0:e.y;i.resize(o,a,n,s),i.resizeX+=o,i.resizeY+=a,i.redraw(!1,!0)}}}}),tS.types.measure=class extends tS{init(t,i,e){super.init(t,i,e),this.offsetX=0,this.offsetY=0,this.resizeX=0,this.resizeY=0,iO.call(this),this.addValues(),this.addShapes()}setClipAxes(){this.clipXAxis=this.chart.xAxis[this.options.typeOptions.xAxis],this.clipYAxis=this.chart.yAxis[this.options.typeOptions.yAxis]}shapePointsOptions(){let t=this.options.typeOptions,i=t.xAxis,e=t.yAxis;return[{x:this.xAxisMin,y:this.yAxisMin,xAxis:i,yAxis:e},{x:this.xAxisMax,y:this.yAxisMin,xAxis:i,yAxis:e},{x:this.xAxisMax,y:this.yAxisMax,xAxis:i,yAxis:e},{x:this.xAxisMin,y:this.yAxisMax,xAxis:i,yAxis:e},{command:"Z"}]}addControlPoints(){let t=this.chart.inverted,i=this.options.controlPointOptions,e=this.options.typeOptions.selectType;(0,r.defined)(this.userOptions.controlPointOptions?.style?.cursor)||("x"===e?i.style.cursor=t?"ns-resize":"ew-resize":"y"===e&&(i.style.cursor=t?"ew-resize":"ns-resize"));let s=new b(this.chart,this,this.options.controlPointOptions,0);this.controlPoints.push(s),"xy"!==e&&(s=new b(this.chart,this,this.options.controlPointOptions,1),this.controlPoints.push(s))}addValues(t){let i=this.options.typeOptions,e=i.label.formatter;iw.call(this,t),i.label.enabled&&(this.labels.length>0?this.labels[0].text=e?.call(this,this)||iA.call(this):this.initLabel((0,r.extend)({shape:"rect",backgroundColor:"none",color:"black",borderWidth:0,dashStyle:"Dash",overflow:"allow",align:"left",y:0,x:0,verticalAlign:"top",crop:!0,xAxis:0,yAxis:0,point:function(t){let e=t.annotation,s=t.options;return{x:e.xAxisMin,y:e.yAxisMin,xAxis:(0,r.pick)(i.xAxis,s.xAxis),yAxis:(0,r.pick)(i.yAxis,s.yAxis)}},text:e?.call(this,this)||iA.call(this)},i.label),void 0))}addShapes(){this.addCrosshairs(),this.addBackground()}addBackground(){let t=this.shapePointsOptions();void 0!==t[0].x&&this.initShape((0,r.extend)({type:"path",points:t,className:"highcharts-measure-background"},this.options.typeOptions.background),2)}addCrosshairs(){let t=this.chart,i=this.options.typeOptions,e=this.options.typeOptions.point,s=t.xAxis[i.xAxis],n=t.yAxis[i.yAxis],o=t.inverted,a={point:e,type:"path"},h=s.toPixels(this.xAxisMin),l=s.toPixels(this.xAxisMax),p=n.toPixels(this.yAxisMin),c=n.toPixels(this.yAxisMax),d=[],u=[],g,x,y;o&&(y=h,h=p,p=y,y=l,l=c,c=y),i.crosshairX.enabled&&(d=[["M",h,p+(c-p)/2],["L",l,p+(c-p)/2]]),i.crosshairY.enabled&&(u=[["M",h+(l-h)/2,p],["L",h+(l-h)/2,c]]),this.shapes.length>0?(this.shapes[0].options.d=d,this.shapes[1].options.d=u):(g=(0,r.merge)(a,{className:"highcharts-measure-crosshair-x"},i.crosshairX),x=(0,r.merge)(a,{className:"highcharts-measure-crosshair-y"},i.crosshairY),this.initShape((0,r.extend)({d:d},g),0),this.initShape((0,r.extend)({d:u},x),1))}onDrag(t){let i=this.mouseMoveToTranslation(t),e=this.options.typeOptions.selectType,s="y"===e?0:i.x,n="x"===e?0:i.y;this.translate(s,n),this.offsetX+=s,this.offsetY+=n,this.redraw(!1,!1,!0)}resize(t,i,e,s){let n=this.shapes[2];"x"===s?0===e?(n.translatePoint(t,0,0),n.translatePoint(t,i,3)):(n.translatePoint(t,0,1),n.translatePoint(t,i,2)):"y"===s?0===e?(n.translatePoint(0,i,0),n.translatePoint(0,i,1)):(n.translatePoint(0,i,2),n.translatePoint(0,i,3)):(n.translatePoint(t,0,1),n.translatePoint(t,i,2),n.translatePoint(0,i,3)),iC.call(this,!1,!0,e,t,i),this.options.typeOptions.background.height=Math.abs(this.startYMax-this.startYMin),this.options.typeOptions.background.width=Math.abs(this.startXMax-this.startXMin)}redraw(t,i,e){this.linkPoints(),this.graphic||this.render(),e&&iC.call(this,!0,!1),this.clipRect&&this.clipRect.animate(this.getClipBox()),this.addValues(i),this.addCrosshairs(),this.redrawItems(this.shapes,t),this.redrawItems(this.labels,t);let s=this.options.typeOptions.background;if(s?.strokeWidth&&this.shapes[2]?.graphic){let t=s.strokeWidth/2,i=this.shapes[2],e=i.graphic.pathArray,n=e[0],o=e[1],a=e[2],r=e[3];n[1]=(n[1]||0)+t,o[1]=(o[1]||0)-t,a[1]=(a[1]||0)-t,r[1]=(r[1]||0)+t,n[2]=(n[2]||0)+t,o[2]=(o[2]||0)+t,a[2]=(a[2]||0)-t,r[2]=(r[2]||0)-t,i.graphic.attr({d:e})}this.controlPoints.forEach(t=>t.redraw())}translate(t,i){this.shapes.forEach(e=>e.translate(t,i))}};let iN=h();iN.Annotation||(iN.Annotation=tS,iN.NavigationBindings=iN.NavigationBindings||t5,iN.Annotation.compose(iN.Chart,iN.NavigationBindings,iN.Pointer,iN.SVGRenderer)),iN.Annotation!==tS&&tS.types&&Object.assign(iN.Annotation.types,tS.types);let iT=h();export{iT as default};