UNPKG

highcharts

Version:
34 lines 63.2 kB
/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/annotations * @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";let e={};e.n=t=>{let i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var o=i[s++],n=i[s++];e.o(t,o)?0===n&&s++:0===n?Object.defineProperty(t,o,{enumerable:!0,value:i[s++]}):Object.defineProperty(t,o,{enumerable:!0,get:n})}else for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var s,o,n,a,r,h=e.n(i);function l(t,e){let s=this.initAnnotation(t);return this.options.annotations.push(s.options),(0,i.pick)(e,!0)&&(s.redraw(),s.graphic.attr({opacity:1})),s}function c(){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((e,i)=>{if(!t.annotations.some(t=>t.options===e)){let s=t.initAnnotation(e);t.options.annotations[i]=s.options}}),t.drawAnnotations(),(0,i.addEvent)(t,"redraw",t.drawAnnotations),(0,i.addEvent)(t,"destroy",function(){t.plotBoxClip.destroy(),t.controlPointsGroup.destroy()}),(0,i.addEvent)(t,"exportData",function(e){let i=t.annotations,s=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter,o=!e.dataRows[1].xValues,n=t.options.lang&&t.options.lang.exportData&&t.options.lang.exportData.annotationHeader,a=e.dataRows[0].length,r=t.options.exporting?.csv?.annotations?.itemDelimiter,h=t.options.exporting?.csv?.annotations?.join;i.forEach(t=>{t.options.labelOptions?.includeInDataExport&&t.labels.forEach(t=>{if(t.options.text){let i=t.options.text;t.points.forEach(t=>{let s=t.x,o=t.series.xAxis?t.series.xAxis.index:-1,n=!1;if(-1===o){let t=e.dataRows[0].length,a=Array(t);for(let e=0;e<t;++e)a[e]="";a.push(i),a.xValues=[],a.xValues[o]=s,e.dataRows.push(a),n=!0}if(n||e.dataRows.forEach(t=>{!n&&t.xValues&&void 0!==o&&s===t.xValues[o]&&(h&&t.length>a?t[t.length-1]+=r+i:t.push(i),n=!0)}),!n){let t=e.dataRows[0].length,n=Array(t);for(let e=0;e<t;++e)n[e]="";n[0]=s,n.push(i),n.xValues=[],void 0!==o&&(n.xValues[o]=s),e.dataRows.push(n)}})}})});let l=0;e.dataRows.forEach(t=>{l=Math.max(l,t.length)});let c=l-e.dataRows[0].length;for(let t=0;t<c;t++){let i=function(t){let e;return s&&!1!==(e=s(t))?e:(e=n+" "+t,o)?{columnTitle:e,topLevelColumnTitle:e}:e}(t+1);o?(e.dataRows[0].push(i.topLevelColumnTitle),e.dataRows[1].push(i.columnTitle)):e.dataRows[0].push(i)}})}function p(){this.plotBoxClip.attr(this.plotBox),this.annotations.forEach(t=>{t.redraw(),t.graphic.animate({opacity:1},t.animationConfig)})}function d(t){let e=this.annotations,s="annotations"===t.coll?t:(0,i.find)(e,function(e){return e.options.id===t});s&&((0,i.fireEvent)(s,"remove"),(0,i.erase)(this.options.annotations,s.options),(0,i.erase)(e,s),s.destroy())}function u(){let t=this.options.annotations,e=this.userOptions.annotations;this.annotations=[],(0,i.isArray)(this.options.annotations)||(this.options.annotations=[]),(0,i.isObject)(e,!0)&&(0,i.isObject)(t,!0)&&this.options.annotations.push(t)}function g(t){this.chart.hasDraggedAnnotation||t.apply(this,Array.prototype.slice.call(arguments,1))}(o||(o={})).compose=function(t,e,s){let o=e.prototype;if(!o.addAnnotation){let n=s.prototype;(0,i.addEvent)(e,"afterInit",u),o.addAnnotation=l,o.callbacks.push(c),o.collectionsWithInit.annotations=[l],o.collectionsWithUpdate.push("annotations"),o.drawAnnotations=p,o.removeAnnotation=d,o.initAnnotation=function(e){let i=new(t.types[e.type]||t)(this,e);return this.annotations.push(i),i},(0,i.wrap)(n,"onContainerMouseDown",g)}};let m=o,f={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,i.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:v,isTouchDevice:y}=h(),x=class{addEvents(){let t=this,e=function(e){(0,i.addEvent)(e,y?"touchstart":"mousedown",e=>{t.onMouseDown(e)},{passive:!1})};if(e(this.graphic.element),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&e(t.graphic.text.element)}),(0,i.objectEach)(t.options.events,(e,s)=>{let o=function(i){"click"===s&&t.cancelClick||e.call(t,t.chart.pointer?.normalize(i),t.target,t)};-1===(t.nonDOMEvents||[]).indexOf(s)?((0,i.addEvent)(t.graphic.element,s,o,{passive:!1}),t.graphic.div&&(0,i.addEvent)(t.graphic.div,s,o,{passive:!1})):(0,i.addEvent)(t,s,o,{passive:!1})}),t.options.draggable&&((0,i.addEvent)(t,"drag",t.onDrag),!t.graphic.renderer.styledMode)){let e={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[t.options.draggable]};t.graphic.css(e),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&t.graphic.text.css(e)})}t.isUpdating||(0,i.fireEvent)(t,"add")}destroy(){this.removeDocEvents(),(0,i.removeEvent)(this),this.hcEvents=null}mouseMoveToRadians(t,e,i){let s=t.prevChartY-i,o=t.prevChartX-e,n=t.chartY-i,a=t.chartX-e,r;return this.chart.inverted&&(r=o,o=s,s=r,r=a,a=n,n=r),Math.atan2(n,a)-Math.atan2(s,o)}mouseMoveToScale(t,e,i){let s=t.prevChartX-e,o=t.prevChartY-i,n=t.chartX-e,a=t.chartY-i,r=(n||1)/(s||1),h=(a||1)/(o||1);if(this.chart.inverted){let t=h;h=r,r=t}return{x:r,y:h}}mouseMoveToTranslation(t){let e=t.chartX-t.prevChartX,i=t.chartY-t.prevChartY,s;return this.chart.inverted&&(s=i,i=e,e=s),{x:e,y:i}}onDrag(t){if(this.chart.isInsidePlot(t.chartX-this.chart.plotLeft,t.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){let e=this.mouseMoveToTranslation(t);"x"===this.options.draggable&&(e.y=0),"y"===this.options.draggable&&(e.x=0),this.points.length?this.translate(e.x,e.y):(this.shapes.forEach(t=>t.translate(e.x,e.y)),this.labels.forEach(t=>t.translate(e.x,e.y))),this.redraw(!1)}}onMouseDown(t){if(t.preventDefault&&t.preventDefault(),2===t.button)return;let e=this,s=e.chart.pointer,o=t?.sourceCapabilities?.firesTouchEvents||!1,n=(t=s?.normalize(t)||t).chartX,a=t.chartY;e.cancelClick=!1,e.chart.hasDraggedAnnotation=!0,e.removeDrag=(0,i.addEvent)(v,y||o?"touchmove":"mousemove",function(t){e.hasDragged=!0,(t=s?.normalize(t)||t).prevChartX=n,t.prevChartY=a,(0,i.fireEvent)(e,"drag",t),n=t.chartX,a=t.chartY},y||o?{passive:!1}:void 0),e.removeMouseUp=(0,i.addEvent)(v,y||o?"touchend":"mouseup",function(){let t=(0,i.pick)(e.target&&e.target.annotation,e.target);t&&(t.cancelClick=e.hasDragged),e.cancelClick=e.hasDragged,e.chart.hasDraggedAnnotation=!1,e.hasDragged&&(0,i.fireEvent)((0,i.pick)(t,e),"afterUpdate"),e.hasDragged=!1,e.onMouseUp()},y||o?{passive:!1}:void 0)}onMouseUp(){this.removeDocEvents()}removeDocEvents(){this.removeDrag&&(this.removeDrag=this.removeDrag()),this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())}},b=class extends x{constructor(t,e,s,o){super(),this.nonDOMEvents=["drag"],this.chart=t,this.target=e,this.options=s,this.index=(0,i.pick)(s.index,o)}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,e=this.options;this.graphic=t.renderer.symbol(e.symbol,0,0,e.width,e.height).add(t.controlPointsGroup).css(e.style),this.setVisibility(e.visible),this.addEvents()}setVisibility(t){this.graphic[t?"show":"hide"](),this.options.visible=t}update(t){let e=this.chart,s=this.target,o=this.index,n=(0,i.merge)(!0,this.options,t);this.destroy(),this.constructor(e,s,n,o),this.render(e.controlPointsGroup),this.redraw()}},A={backgroundColor:"color",backgroundColors:"color",borderColor:"color",borderRadius:"string",color:"color",fill:"color",fontSize:"string",labels:"string",name:"string",stroke:"color",title:"string"},E={annotationsFieldsTypes:A,getAssignedAxis:function(t){return t.filter(t=>{let e=t.axis.getExtremes(),s=e.min,o=e.max,n=(0,i.pick)(t.axis.minPointOffset,0);return(0,i.isNumber)(s)&&(0,i.isNumber)(o)&&t.value>=s-n&&t.value<=o+n&&!t.axis.options.isInternal})[0]},getAxisFromOptions:function(t,e,s){return(0,i.isNumber)(s)?t[e][s]:(0,i.defined)(s)?(0,i.find)(t[e],t=>t.options.id===s):void 0},getFieldType:function(t,e){let s=A[t],o=typeof e;return(0,i.defined)(s)&&(o=s),({string:"text",number:"number",boolean:"checkbox",color:"color"})[o]}},k=t.default.SeriesRegistry;var w=e.n(k);let{getAxisFromOptions:C}=E,{series:{prototype:P}}=w();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,e){let i=t.series,s=i.chart,o=t.plotX||0,n=t.plotY||0,a;return s.inverted&&(t.mock?(o=t.plotY,n=t.plotX):(o=s.plotWidth-(t.plotY||0),n=s.plotHeight-(t.plotX||0))),i&&!e&&(o+=(a=i.getPlotBox()).translateX,n+=a.translateY),{x:o,y:n}}static pointToOptions(t){return{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis}}constructor(t,e,i){this.mock=!0,this.point=this,this.series={visible:!0,chart:t,getPlotBox:P.getPlotBox},this.target=e||null,this.options=i,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,e=this.plotY,s=this.series.xAxis,o=this.series.yAxis,n={x:t,y:e,isInsidePlot:!0,options:{}};return s&&(n.isInsidePlot=(0,i.defined)(t)&&t>=0&&t<=s.len),o&&(n.isInsidePlot=n.isInsidePlot&&(0,i.defined)(e)&&e>=0&&e<=o.len),(0,i.fireEvent)(this.series.chart,"afterIsInsidePlot",n),n.isInsidePlot}refresh(){let t=this.series,e=t.xAxis,i=t.yAxis,s=this.getOptions();e?(this.x=s.x,this.plotX=e.toPixels(s.x,!0)):(this.x=void 0,this.plotX=s.x),i?(this.y=s.y,this.plotY=i.toPixels(s.y,!0)):(this.y=null,this.plotY=s.y),this.isInside=this.isInsidePlot()}refreshOptions(){let t=this.series,e=t.xAxis,i=t.yAxis;this.x=this.options.x=e?this.options.x=e.toValue(this.plotX,!0):this.plotX,this.y=this.options.y=i?i.toValue(this.plotY,!0):this.plotY}rotate(t,e,i){if(!this.hasDynamicOptions()){let s=Math.cos(i),o=Math.sin(i),n=this.plotX-t,a=this.plotY-e;this.plotX=n*s-a*o+t,this.plotY=n*o+a*s+e,this.refreshOptions()}}scale(t,e,i,s){if(!this.hasDynamicOptions()){let o=this.plotX*i,n=this.plotY*s;this.plotX=(1-i)*t+o,this.plotY=(1-s)*e+n,this.refreshOptions()}}setAxis(t,e){let i=e+"Axis",s=t[i],o=this.series.chart;this.series[i]="object"==typeof s?s:C(o,i,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,e,i,s){this.hasDynamicOptions()||(this.plotX+=i,this.plotY+=s,this.refreshOptions())}}!function(t){function e(){let t=this.controlPoints,e=this.options.controlPoints||[];e.forEach((s,o)=>{let n=(0,i.merge)(this.options.controlPointOptions,s);n.index||(n.index=o),e[o]=n,t.push(new b(this.chart,this,n))})}function s(t){let e=t.series.getPlotBox(),s=t.series.chart,o=t.mock?t.toAnchor():s.tooltip&&s.tooltip.getAnchor.call({chart:t.series.chart},t)||[0,0,0,0],n={x:o[0]+(this.options.x||0),y:o[1]+(this.options.y||0),height:o[2]||0,width:o[3]||0};return{relativePosition:n,absolutePosition:(0,i.merge)(n,{x:n.x+(t.mock?e.translateX:s.plotLeft),y:n.y+(t.mock?e.translateY:s.plotTop)})}}function o(){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,i.splat)(t.point)}function a(){let t,e,i=this.getPointsOptions(),s=this.points,o=i?.length||0;for(t=0;t<o;t++){if(!(e=this.point(i[t],s[t]))){s.length=0;return}e.mock&&e.refresh(),s[t]=e}return s}function r(t,e){if(t&&t.series)return t;if(!e||null===e.series){if((0,i.isObject)(t))e=new O(this.chart,this,t);else if((0,i.isString)(t))e=this.chart.get(t)||null;else if("function"==typeof t){let i=t.call(e,this);e=i.series?i:new O(this.chart,this,t)}}return e}function h(t){this.controlPoints.forEach(e=>e.redraw(t))}function l(){this.controlPoints.forEach(t=>t.render())}function c(t,e,i,s,o){if(this.chart.inverted){let t=e;e=i,i=t}this.points.forEach((n,a)=>this.transformPoint(t,e,i,s,o,a),this)}function p(t,e,i,s,o,n){let a=this.points[n];a.mock||(a=this.points[n]=O.fromPoint(a)),a[t](e,i,s,o)}function d(t,e){this.transform("translate",null,null,t,e)}function u(t,e,i){this.transformPoint("translate",null,null,t,e,i)}t.compose=function(t){let g=t.prototype;g.addControlPoints||(0,i.merge)(!0,g,{addControlPoints:e,anchor:s,destroyControlTarget:o,getPointsOptions:n,linkPoints:a,point:r,redrawControlPoints:h,renderControlPoints:l,transform:c,transformPoint:p,translate:d,translatePoint:u})}}(n||(n={}));let M=n;class N{constructor(t,e,i,s){this.annotation=t,this.chart=t.chart,this.collection="label"===s?"labels":"shapes",this.controlPoints=[],this.options=e,this.points=[],this.index=i,this.itemType=s,this.init(t,e,i)}attr(){this.graphic.attr.apply(this.graphic,arguments)}attrsFromOptions(t){let e,i,s=this.constructor.attrsMap,o={},n=this.chart.styledMode;for(e in t)i=s[e],void 0===s[e]||n&&-1!==["fill","stroke","stroke-width"].indexOf(i)||(o[i]=t[e]);return o}destroy(){this.graphic&&(this.graphic=this.graphic.destroy()),this.tracker&&(this.tracker=this.tracker.destroy()),this.destroyControlTarget()}calculateAnnotationSize(t,e,i){let s=i.toPixels(t,!0);return Math.abs(i.toPixels(t+e,!0)-s)}init(t,e,i){this.annotation=t,this.chart=t.chart,this.options=e,this.points=[],this.controlPoints=[],this.index=i,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,e,i){this.transform("rotate",t,e,i)}scale(t,e,i,s){this.transform("scale",t,e,i,s)}setControlPointsVisibility(t){this.controlPoints.forEach(e=>{e.setVisibility(t)})}shouldBeDrawn(){return!!this.points.length}translateShape(t,e,i){let s=this.annotation.chart,o=this.annotation.userOptions,n=s.annotations.indexOf(this.annotation),a=s.options.annotations[n];this.translatePoint(t,e,0),i&&this.translatePoint(t,e,1),a[this.collection][this.index].point=this.options.point,o[this.collection][this.index].point=this.options.point}update(t){let e=this.annotation,s=(0,i.merge)(!0,this.options,t),o=this.graphic.parentGroup,n=this.constructor;this.destroy();let a=new n(e,s,this.index,this.itemType);(0,i.merge)(!0,this,a),this.render(o),this.redraw()}}M.compose(N);let B=N,{defaultMarkers:T}={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}}]}}},L=D("marker-end"),I=D("marker-start"),S="rgba(192,192,192,"+(h().svg?1e-4:.002)+")";function D(t){return function(e){this.attr(t,"url(#"+e+")")}}function Y(){this.options.defs=(0,i.merge)(T,this.options.defs||{})}function X(t,e){let s={attributes:{id:t}},o={stroke:e.color||"none",fill:e.color||"rgba(0, 0, 0, 0.75)"};s.children=e.children&&e.children.map(function(t){return(0,i.merge)(o,t)});let n=(0,i.merge)(!0,{attributes:{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"}},e,s),a=this.definition(n);return a.id=t,a}class F extends B{static compose(t,e){let s=e.prototype;s.addMarker||((0,i.addEvent)(t,"afterGetContainer",Y),s.addMarker=X)}constructor(t,e,i){super(t,e,i,"shape"),this.type="path"}init(t,e,s){(0,i.defined)(e.yAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=e.yAxis)}),(0,i.defined)(e.xAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=e.xAxis)}),super.init(t,e,s)}toD(){let t=this.options.d;if(t)return"function"==typeof t?t.call(this):t;let e=this.points,i=e.length,s=[],o=i,n=e[0],a=o&&this.anchor(n).absolutePosition,r=0,h;if(a)for(s.push(["M",a.x,a.y]);++r<i&&o;)h=(n=e[r]).command||"L",a=this.anchor(n).absolutePosition,"M"===h||"L"===h?s.push([h,a.x,a.y]):"Z"===h&&s.push([h]),o=n.series.visible;return o&&this.graphic?this.chart.renderer.crispLine(s,this.graphic.strokeWidth()):null}shouldBeDrawn(){return super.shouldBeDrawn()||!!this.options.d}render(t){let e=this.options,s=this.attrsFromOptions(e);this.graphic=this.annotation.chart.renderer.path([["M",0,0]]).attr(s).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:S,fill:S,"stroke-width":this.graphic.strokeWidth()+2*e.snap}),super.render(),(0,i.extend)(this.graphic,{markerStartSetter:I,markerEndSetter:L}),this.setMarkers(this)}redraw(t){if(this.graphic){let e=this.toD(),i=t?"animate":"attr";e?(this.graphic[i]({d:e}),this.tracker[i]({d:e})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"})),this.graphic.placed=this.tracker.placed=!!e}super.redraw(t)}setMarkers(t){let e=t.options,s=t.chart,o=s.options.defs,n=e.fill,a=(0,i.defined)(n)&&"none"!==n?n:e.stroke;["markerStart","markerEnd"].forEach(function(n){let r,h,l,c,p=e[n];if(p){for(l in o)if((p===((r=o[l]).attributes&&r.attributes.id)||p===r.id)&&"marker"===r.tagName){h=r;break}h&&(c=t[n]=s.renderer.addMarker((e.id||(0,i.uniqueKey)())+"-"+p,(0,i.merge)(h,{color:a})),t.attr(n,c.getAttribute("id")))}})}}F.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};class U extends B{constructor(t,e,i){super(t,e,i,"shape"),this.type="rect",this.translate=super.translateShape}init(t,e,s){let{point:o,xAxis:n,yAxis:a}=e;o&&"string"!=typeof o&&((0,i.defined)(n)&&(o.xAxis=n),(0,i.defined)(a)&&(o.yAxis=a)),super.init(t,e,s)}render(t){let e=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9e9,0,0).attr(e).add(t),super.render()}redraw(t){if(this.graphic){let e=this.points[0],s=this.anchor(e).absolutePosition,o=this.options.width||0,n=this.options.height||0;if(s){let a=(0,i.defined)(this.options.xAxis)?this.chart.xAxis[this.options.xAxis]:void 0,r=(0,i.defined)(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;a&&(0,i.defined)(e.x)&&(o=this.calculateAnnotationSize(e.x,o,a)),r&&(0,i.defined)(e.y)&&(n=this.calculateAnnotationSize(e.y,n,r)),this.graphic[t?"animate":"attr"]({x:s.x,y:s.y,width:o,height:n})}else this.attr({x:0,y:-9e9});this.graphic.placed=!!s}super.redraw(t)}}U.attrsMap=(0,i.merge)(F.attrsMap,{width:"width",height:"height"});class R extends B{constructor(t,e,i){super(t,e,i,"shape"),this.type="circle",this.translate=super.translateShape}init(t,e,s){let{point:o,xAxis:n,yAxis:a}=e;o&&"string"!=typeof o&&((0,i.defined)(n)&&(o.xAxis=n),(0,i.defined)(a)&&(o.yAxis=a)),super.init(t,e,s)}redraw(t){if(this.graphic){let e=this.points[0],s=this.anchor(e).absolutePosition,o=this.options.r||0;if(s){let n=(0,i.defined)(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;n&&(0,i.defined)(e.y)&&(o=this.calculateAnnotationSize(e.y,o,n)),this.graphic[t?"animate":"attr"]({x:s.x,y:s.y,r:o})}else this.graphic.attr({x:0,y:-9e9});this.graphic.placed=!!s}super.redraw.call(this,t)}render(t){let e=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9e9,0).attr(e).add(t),super.render()}setRadius(t){this.options.r=t}}R.attrsMap=(0,i.merge)(F.attrsMap,{r:"r"});class W extends B{constructor(t,e,i){super(t,e,i,"shape"),this.type="ellipse"}init(t,e,s){(0,i.defined)(e.yAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=e.yAxis)}),(0,i.defined)(e.xAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=e.xAxis)}),super.init(t,e,s)}render(t){this.graphic=this.annotation.chart.renderer.createElement("ellipse").attr(this.attrsFromOptions(this.options)).add(t),super.render()}translate(t,e){super.translateShape(t,e,!0)}getDistanceFromLine(t,e,i,s){return Math.abs((e.y-t.y)*i-(e.x-t.x)*s+e.x*t.y-e.y*t.x)/Math.sqrt((e.y-t.y)*(e.y-t.y)+(e.x-t.x)*(e.x-t.x))}getAttrs(t,e){let i=t.x,s=t.y,o=e.x,n=e.y,a=(i+o)/2,r=Math.sqrt((i-o)*(i-o)/4+(s-n)*(s-n)/4),h=180*Math.atan((n-s)/(o-i))/Math.PI;return a<i&&(h+=180),{cx:a,cy:(s+n)/2,rx:r,ry:this.getRY(),angle:h}}getRY(){let t=this.getYAxis();return(0,i.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 e=this.getAbsolutePosition(this.points[0]),i=this.getAbsolutePosition(this.points[1]),s=this.getAttrs(e,i);e?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=!!e}super.redraw(t)}setYRadius(t){let e=this.annotation.userOptions.shapes;this.options.ry=t,e&&e[0]&&(e[0].ry=t,e[0].ry=t)}}W.attrsMap=(0,i.merge)(F.attrsMap,{ry:"ry"});let j=t.default.Templating;var z=e.n(j);let{format:V}=z();function q(t,e,s,o,n){let a=n&&n.anchorX,r=n&&n.anchorY,h,l,c=s/2;return(0,i.isNumber)(a)&&(0,i.isNumber)(r)&&(h=[["M",a,r]],(l=e-r)<0&&(l=-o-l),l<s&&(c=a<t+s/2?l:s-l),r>e+o?h.push(["L",t+c,e+o]):r<e?h.push(["L",t+c,e]):a<t?h.push(["L",t,e+o/2]):a>t+s&&h.push(["L",t+s,e+o/2])),h||[]}class $ extends B{static alignedPosition(t,e){return{x:Math.round((e.x||0)+(t.x||0)+(e.width-(t.width||0))*(0,i.getAlignFactor)(t.align)),y:Math.round((e.y||0)+(t.y||0)+(e.height-(t.height||0))*(0,i.getAlignFactor)(t.verticalAlign))}}static compose(t){t.prototype.symbols.connector=q}static justifiedOptions(t,e,i,s){let o,n=i.align,a=i.verticalAlign,r=e.box?0:e.padding||0,h=e.getBBox(),l={align:n,verticalAlign:a,x:i.x,y:i.y,width:e.width,height:e.height},c=(s.x||0)-t.plotLeft,p=(s.y||0)-t.plotTop;return(o=c+r)<0&&("right"===n?l.align="left":l.x=(l.x||0)-o),(o=c+h.width-r)>t.plotWidth&&("left"===n?l.align="right":l.x=(l.x||0)+t.plotWidth-o),(o=p+r)<0&&("bottom"===a?l.verticalAlign="top":l.y=(l.y||0)-o),(o=p+h.height-r)>t.plotHeight&&("top"===a?l.verticalAlign="bottom":l.y=(l.y||0)+t.plotHeight-o),l}constructor(t,e,i){super(t,e,i,"label")}translatePoint(t,e){super.translatePoint(t,e,0)}translate(t,e){var i,s;let o=this.annotation.chart,n=this.annotation.userOptions,a=o.annotations.indexOf(this.annotation),r=o.options.annotations[a];if(o.inverted){let i=t;t=e,e=i}(i=this.options).x||(i.x=0),(s=this.options).y||(s.y=0),this.options.x+=t,this.options.y+=e,r[this.collection][this.index].x=this.options.x,r[this.collection][this.index].y=this.options.y,n[this.collection][this.index].x=this.options.x,n[this.collection][this.index].y=this.options.y}render(t){let e=this.options,i=this.attrsFromOptions(e),s=e.style,o=this.annotation.chart.options.chart,n=o.plotBackgroundColor||o.backgroundColor;if(this.graphic=this.annotation.chart.renderer.label("",0,-9999,e.shape,void 0,void 0,e.useHTML,void 0,"annotation-label").attr(i).add(t),!this.annotation.chart.styledMode){if(s?.color==="contrast"){let t=!e.shape||$.shapesWithoutBackground.indexOf(e.shape)>-1||"none"===e.backgroundColor?n:e.backgroundColor;s.color=this.annotation.chart.renderer.getContrast("string"==typeof t?t:"string"==typeof n?n:"#ffffff")}this.graphic.css(e.style||{}).shadow(e.shadow)}this.graphic.labelrank=e.labelrank,super.render()}redraw(t){let e=this.options,i=this.text||e.format||e.text,s=this.graphic,o=this.points[0];if(!s)return void this.redraw(t);s.attr({text:i?V(String(i),o,this.annotation.chart):e.formatter.call(o,o)});let n=this.anchor(o),a=this.position(n);a?(s.alignAttr=a,a.anchorX=n.absolutePosition.x,a.anchorY=n.absolutePosition.y,s[t?"animate":"attr"](a)):s.attr({x:0,y:-9999}),s.placed=!!a,super.redraw(t)}anchor(t){let e=super.anchor.apply(this,arguments),i=this.options.x||0,s=this.options.y||0;return e.absolutePosition.x-=i,e.absolutePosition.y-=s,e.relativePosition.x-=i,e.relativePosition.y-=s,e}position(t){let e=this.graphic,s=this.annotation.chart,o=s.tooltip,n=this.points[0],a=this.options,r=t.absolutePosition,h=t.relativePosition,l,c,p,d,u=n.series.visible&&O.prototype.isInsidePlot.call(n);if(e&&u){let{width:t=0,height:g=0}=e;a.distance&&o?l=o.getPosition.call({chart:s,distance:(0,i.pick)(a.distance,16),getPlayingField:o.getPlayingField,pointer:o.pointer},t,g,{plotX:h.x,plotY:h.y,negative:n.negative,ttBelow:n.ttBelow,h:h.height||h.width}):a.positioner?l=a.positioner.call(this,this):(c={x:r.x,y:r.y,width:0,height:0},l=$.alignedPosition((0,i.extend)(a,{width:t,height:g}),c),"justify"===this.options.overflow&&(l=$.alignedPosition($.justifiedOptions(s,e,a,l),c))),a.crop&&(p=l.x-s.plotLeft,d=l.y-s.plotTop,u=s.isInsidePlot(p,d)&&s.isInsidePlot(p+t,d+g))}return u?l:null}}$.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"},$.shapesWithoutBackground=["connector"];class H extends B{constructor(t,e,i){super(t,e,i,"shape"),this.type="image",this.translate=super.translateShape}render(t){let e=this.attrsFromOptions(this.options),i=this.options;this.graphic=this.annotation.chart.renderer.image(i.src,0,-9e9,i.width,i.height).attr(e).add(t),this.graphic.width=i.width,this.graphic.height=i.height,super.render()}redraw(t){if(this.graphic){let e=this.anchor(this.points[0]),i=$.prototype.position.call(this,e);i?this.graphic[t?"animate":"attr"]({x:i.x,y:i.y}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!i}super.redraw(t)}}H.attrsMap={width:"width",height:"height",zIndex:"zIndex"};let G=t.default.AST;var K=e.n(G);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}">`,Z="#4B4B4D",J={"close.svg":`${_(32)} <polygon fill="${Z}" 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="${Z}" width="1.5" height="10"/> <rect x="17.75" y="14" fill="${Z}" width="1.5" height="10"/> <path fill="${Z}" 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="${Z}" 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> `},Q=(t,e,i)=>{let s,o=i[t];return"renderer"===e&&o?(o=encodeURIComponent(o),s=`url("data:image/svg+xml;charset=utf-8,${o}")`):s=e.startsWith("http")&&e.match(/\.(png|svg|jpe?g|gif)$/ig)?'url("'+e+'")':`url("${e}${t}")`,s},tt=class{constructor(t,e){this.iconsURL=e,this.container=this.createPopupContainer(t),this.closeButton=this.addCloseButton()}createPopupContainer(t,e="highcharts-popup highcharts-no-tooltip"){return(0,i.createElement)("div",{className:e},void 0,t)}addCloseButton(t="highcharts-popup-close"){let e=(0,i.createElement)("button",{className:t},void 0,this.container);return(0,i.createElement)("span",{className:"highcharts-icon"},{backgroundImage:Q("close.svg",this.iconsURL,J)},e),["click","touchstart"].forEach(t=>{(0,i.addEvent)(e,t,this.closeButtonEvents.bind(this))}),(0,i.addEvent)(document,"keydown",t=>{"Escape"===t.code&&this.closeButtonEvents()}),e}closeButtonEvents(){this.closePopup()}showPopup(t="highcharts-annotation-toolbar"){let e=this.container,i=this.closeButton;this.type=void 0,e.innerHTML=K().emptyHTML,e.className.indexOf(t)>=0&&(e.classList.remove(t),e.removeAttribute("style")),e.appendChild(i),e.style.display="block",e.style.height=""}closePopup(){this.container.style.display="none"}},te=t.default.Color;var ti=e.n(te);let{doc:ts,isFirefox:to}=h();function tn(t,e,s,o,n,a){let r,h;if(!e)return;let l=this.addInput,c=this.lang;(0,i.objectEach)(o,(o,a)=>{r=""!==s?s+"."+a:a,(0,i.isObject)(o)&&(!(0,i.isArray)(o)||(0,i.isArray)(o)&&(0,i.isObject)(o[0])?((h=c[a]||a).match(/\d/g)||n.push([!0,h,t]),tn.call(this,t,e,r,o,n,!1)):n.push([this,r,"annotation",t,o]))}),a&&((0,i.stableSort)(n,t=>t[1].match(/format/g)?-1:1),to&&n.reverse(),n.forEach(t=>{!0===t[0]?(0,i.createElement)("span",{className:"highcharts-annotation-title"},void 0,t[2]).appendChild(ts.createTextNode(t[1])):(t[4]={value:t[4][0],type:t[4][1]},l.apply(t[0],t.splice(1)))}))}let{doc:ta}=h(),{seriesTypes:tr}=w();(s=a||(a={}))[s["params.algorithm"]=0]="params.algorithm",s[s["params.average"]=1]="params.average";let th={"algorithm-pivotpoints":["standard","fibonacci","camarilla"],"average-disparityindex":["sma","ema","dema","tema","wma"]};function tl(t){let e=(0,i.createElement)("div",{className:"highcharts-popup-lhs-col"},void 0,t),s=(0,i.createElement)("div",{className:"highcharts-popup-rhs-col"},void 0,t);return(0,i.createElement)("div",{className:"highcharts-popup-rhs-col-wrapper"},void 0,s),{lhsCol:e,rhsCol:s}}function tc(t,e,s,o){let n=e.params||e.options.params;o.innerHTML=K().emptyHTML,(0,i.createElement)("h3",{className:"highcharts-indicator-title"},void 0,o).appendChild(ta.createTextNode(ty(e,s).indicatorFullName)),(0,i.createElement)("input",{type:"hidden",name:"highcharts-type-"+s,value:s},void 0,o),tx.call(this,s,"series",t,o,e,e.linkedParent&&e.linkedParent.options.id),n.volumeSeriesID&&tx.call(this,s,"volume",t,o,e,e.linkedParent&&n.volumeSeriesID),td.call(this,t,"params",n,s,o)}function tp(t,e,s,o){function n(e,s){let o=m.parentNode.children[1];tc.call(a,t,e,s,m),o&&(o.style.display="block"),c&&e.options&&(0,i.createElement)("input",{type:"hidden",name:"highcharts-id-"+s,value:e.options.id},void 0,m).setAttribute("highcharts-data-series-id",e.options.id)}let a=this,r=a.lang,h=e.querySelectorAll(".highcharts-popup-lhs-col")[0],l=e.querySelectorAll(".highcharts-popup-rhs-col")[0],c="edit"===s,p=c?t.series:t.options.plotOptions||{};if(!t&&p)return;let d,u=[];c||(0,i.isArray)(p)?(0,i.isArray)(p)&&(u=tv.call(this,p)):u=tf.call(this,p,o),(0,i.stableSort)(u,(t,e)=>{let i=t.indicatorFullName.toLowerCase(),s=e.indicatorFullName.toLowerCase();return i<s?-1:+(i>s)}),h.children[1]&&h.children[1].remove();let g=(0,i.createElement)("ul",{className:"highcharts-indicator-list"},void 0,h),m=l.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];if(u.forEach(t=>{let{indicatorFullName:e,indicatorType:s,series:o}=t;d=(0,i.createElement)("li",{className:"highcharts-indicator-list"},void 0,g);let a=(0,i.createElement)("button",{className:"highcharts-indicator-list-item",textContent:e},void 0,d);["click","touchstart"].forEach(t=>{(0,i.addEvent)(a,t,function(){n(o,s)})})}),u.length>0){let{series:t,indicatorType:e}=u[0];n(t,e)}else c||(K().setElementHTML(m.parentNode.children[0],r.noFilterMatch||""),m.parentNode.children[1].style.display="none")}function td(t,e,s,o,n){if(!t)return;let r=this.addInput;(0,i.objectEach)(s,(s,h)=>{let l=e+"."+h;if((0,i.defined)(s)&&l)if((0,i.isObject)(s)&&(r.call(this,l,o,n,{}),td.call(this,t,l,s,o,n)),l in a){let i=tg.call(this,o,l,n);tm.call(this,t,e,i,o,h,s)}else"params.volumeSeriesID"===l||(0,i.isArray)(s)||r.call(this,l,o,n,{value:s,type:"number"})})}function tu(t,e){let s=this,o=e.querySelectorAll(".highcharts-popup-lhs-col")[0],n=this.lang.clearFilter,a=(0,i.createElement)("div",{className:"highcharts-input-wrapper"},void 0,o),r=function(e){tp.call(s,t,s.container,"add",e)},h=this.addInput("searchIndicators","input",a,{value:"",type:"text",htmlFor:"search-indicators",labelClassName:"highcharts-input-search-indicators-label"}),l=(0,i.createElement)("a",{textContent:n},void 0,a);h.classList.add("highcharts-input-search-indicators"),l.classList.add("clear-filter-button"),(0,i.addEvent)(h,"input",function(){r(this.value),this.value.length?l.style.display="inline-block":l.style.display="none"}),["click","touchstart"].forEach(t=>{(0,i.addEvent)(l,t,function(){h.value="",r(""),l.style.display="none"})})}function tg(t,e,s){let o=e.split("."),n=o[o.length-1],a="highcharts-"+e+"-type-"+t,r=this.lang;(0,i.createElement)("label",{htmlFor:a},null,s).appendChild(ta.createTextNode(r[n]||e));let h=(0,i.createElement)("select",{name:a,className:"highcharts-popup-field",id:"highcharts-select-"+e},null,s);return h.setAttribute("id","highcharts-select-"+e),h}function tm(t,e,s,o,n,a,r){"series"===e||"volume"===e?t.series.forEach(t=>{let o=t.options,n=o.name||o.params?t.name:o.id||"";"highcharts-navigator-series"!==o.id&&o.id!==(r&&r.options&&r.options.id)&&((0,i.defined)(a)||"volume"!==e||"column"!==t.type||(a=o.id),(0,i.createElement)("option",{value:o.id},void 0,s).appendChild(ta.createTextNode(n)))}):o&&n&&th[n+"-"+o].forEach(t=>{(0,i.createElement)("option",{value:t},void 0,s).appendChild(ta.createTextNode(t))}),(0,i.defined)(a)&&(s.value=a)}function tf(t,e){let s,o=this.chart&&this.chart.options.lang,n=o&&o.navigation&&o.navigation.popup&&o.navigation.popup.indicatorAliases,a=new Map;return(0,i.objectEach)(t,(t,i)=>{let o=t&&t.options;if(t.params||o&&o.params){let{indicatorFullName:o,indicatorType:r}=ty(t,i);if(e){let i=RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),h=n&&n[r]&&n[r].join(" ")||"";(o.match(i)||h.match(i))&&(s={indicatorFullName:o,indicatorType:r,series:t},a.set(r.toLowerCase(),s))}else s={indicatorFullName:o,indicatorType:r,series:t},a.set(r.toLowerCase(),s)}}),Array.from(a.values())}function tv(t){let e=[];return t.forEach(t=>{t.is("sma")&&e.push({indicatorFullName:t.name,indicatorType:t.type,series:t})}),e}function ty(t,e){let i=t.options,s=tr[e]&&tr[e].prototype.nameBase||e.toUpperCase(),o=e;return i&&i.type&&(o=t.options.type,s=t.name),{indicatorFullName:s,indicatorType:o}}function tx(t,e,s,o,n,a){if(!s)return;let r=tg.call(this,t,e,o);tm.call(this,s,e,r,void 0,void 0,void 0,n),(0,i.defined)(a)&&(r.value=a)}let{doc:tb}=h();function tA(){let t=this.container;return(0,i.createElement)("div",{className:"highcharts-tab-item-content highcharts-no-mousewheel"},void 0,t)}function tE(t,e){let s=this.container,o=this.lang,n="highcharts-tab-item";0===e&&(n+=" highcharts-tab-disabled");let a=(0,i.createElement)("button",{className:n},void 0,s);return a.appendChild(tb.createTextNode(o[t+"Button"]||t)),a.setAttribute("highcharts-data-tab-type",t),a}function tk(){let t=this.container,e=t.querySelectorAll(".highcharts-tab-item"),i=t.querySelectorAll(".highcharts-tab-item-content");for(let t=0;t<e.length;t++)e[t].classList.remove("highcharts-tab-item-active"),i[t].classList.remove("highcharts-tab-item-show")}function tw(t,e){let i=this.container.querySelectorAll(".highcharts-tab-item-content");t.className+=" highcharts-tab-item-active",i[e].className+=" highcharts-tab-item-show"}function tC(t){let e=this;this.container.querySelectorAll(".highcharts-tab-item").forEach((s,o)=>{(0!==t||"edit"!==s.getAttribute("highcharts-data-tab-type"))&&["click","touchstart"].forEach(t=>{(0,i.addEvent)(s,t,function(){tk.call(e),tw.call(e,this,o)})})})}let{doc:tP}=h(),{getOptions:tO}=h();class tM extends tt{constructor(t,e,s){super(t,e),this.chart=s,this.lang=(tO().lang.navigation||{}).popup||{},(0,i.addEvent)(this.container,"mousedown",()=>{let t=s&&s.navigationBindings&&s.navigationBindings.activeAnnotation;if(t){t.cancelClick=!0;let e=(0,i.addEvent)(tP,"click",()=>{setTimeout(()=>{t.cancelClick=!1},0),e()})}})}addInput(t,e,s,o){let n=t.split("."),a=n[n.length-1],r=this.lang,h="highcharts-"+e+"-"+(0,i.pick)(o.htmlFor,a);if(a.match(/^\d+$/)||(0,i.createElement)("label",{htmlFor:h,className:o.labelClassName},void 0,s).appendChild(tP.createTextNode(r[a]||a)),"color"===o.type&&this.chart?.container)return this.createColorInput(t,h,o,s,this.chart.container);let l=(0,i.createElement)("input",{name:h,value:o.value,type:o.type,className:"highcharts-popup-field"},void 0,s);return l.setAttribute("highcharts-data-name",t),l}createColorInput(t,e,s,o,n){let{value:a,alpha:r}=function(t,e){let i=t=>("0"+Math.round(t).toString(16)).slice(-2).toUpperCase(),s=t=>{let[e,s,o,n]=ti().parse(t).rgba;return{value:"#"+i(e)+i(s)+i(o),alpha:n}};if(t.startsWith("rgb")||t.startsWith("rgba"))return s(t);if(t.startsWith("color")||t.startsWith("var")){let o=tP.createElement("span");o.style.setProperty("color",t),e.appendChild(o);let n=window.getComputedStyle(o).color;if(e.removeChild(o),n.startsWith("color")){let t=n.match(RegExp("color\\s*\\(\\s*srgb\\s+([\\d.]+)\\s+([\\d.]+)\\s+([\\d.]+)\\s+(?:\\s*\\/\\s*([\\d.]+))?\\s*\\)"));if(t){let e=Math.round(255*parseFloat(t[1])),s=Math.round(255*parseFloat(t[2])),o=Math.round(255*parseFloat(t[3])),n=t[4]?parseFloat(t[4]):1;return{value:"#"+i(e)+i(s)+i(o),alpha:n}}}if(n.startsWith("rgb")||n.startsWith("rgba"))return s(n)}return{value:t,alpha:1}}(s.value||"",n),h=ti().parse(s.value||"").rgba[3],l=isNaN(h)?r:h,c=(0,i.createElement)("div",{className:"highcharts-popup-color-wrapper"},void 0,o),p=(0,i.createElement)("input",{type:"color",value:a,className:"highcharts-popup-field highcharts-popup-field-color"},void 0,c),d=(0,i.createElement)("input",{name:e,id:e,value:a,type:"text",className:"highcharts-popup-field highcharts-popup-field-text"},void 0,c);d.setAttribute("highcharts-data-name",t);let u=(0,i.createElement)("span",{className:"highcharts-popup-color-separator"},void 0,c),g=(0,i.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,c),m=(0,i.createElement)("span",{className:"highcharts-popup-opacity-percent-suffix"},void 0,c);m.appendChild(tP.createTextNode(" %"));let f=(0,i.createElement)("input",{type:"range",value:String(Math.round(100*l)),className:"highcharts-popup-opacity-slider",min:"0",max:"100",step:"1"},void 0,o);f.style.setProperty("--highcharts-popup-opacity-track-color",a),f.style.setProperty("display","none");let v=()=>{let t=/^#[0-9A-Fa-f]{6}$/.test(d.value);u.style.display=t?"":"none",g.style.display=t?"":"none",m.style.display=t?"":"none"};v();let y=t=>{let e=t.target,s=(0,i.clamp)(Number(e.value),0,100);f.value=String(s),g.value=String(Math.round(s))},x=t=>{t.target===p?d.value=p.value.toUpperCase():p.value=d.value,f.style.setProperty("--highcharts-popup-opacity-track-color",p.value),v()};return(0,i.addEvent)(o,"mousedown",t=>{t.target!==g&&t.target!==f&&(f.style.display="none")}),(0,i.addEvent)(g,"focus",()=>{f.style.display=""}),(0,i.addEvent)(g,"input",y),(0,i.addEvent)(f,"input",y),(0,i.addEvent)(p,"input",x),(0,i.addEvent)(d,"input",x),c}closeButtonEvents(){if(this.chart){let t=this.chart.navigationBindings;(0,i.fireEvent)(t,"closePopup"),t&&t.selectedButtonElement&&(0,i.fireEvent)(t,"deselectButton",{button:t.selectedButtonElement})}else super.closeButtonEvents()}addButton(t,e,s,o,n){let a=(0,i.createElement)("button",void 0,void 0,t);return a.appendChild(tP.createTextNode(e)),n&&["click","touchstart"].forEach(t=>{(0,i.addEvent)(a,t,()=>{let t,e,i,a,r;return this.closePopup(),n((t=Array.prototype.slice.call(o.querySelectorAll("input")),e=Array.prototype.slice.call(o.querySelectorAll("select")),i=o.querySelectorAll("#highcharts-select-series > option:checked")[0],a=o.querySelectorAll("#highcharts-select-volume > option:checked")[0],r={actionType:s,linkedTo:i&&i.getAttribute("value")||"",fields:{}},t.forEach(t=>{let e=t.getAttribute("highcharts-data-name");if(t.getAttribute("highcharts-data-series-id"))r.seriesId=t.value;else if(e){let i=t.closest(".highcharts-popup-color-wrapper"),s=i?.querySelector(".highcharts-popup-opacity-percentage"),o=s?Number(s.value)/100:1;if(s){let i=ti().parse(t.value).rgba;r.fields[e]=Number.isNaN(i[0])?t.value:`rgba(${i[0]},${i[1]},${i[2]},${o})`}else r.fields[e]=t.value}else r.type=t.value}),e.forEach(t=>{let e=t.id;if("highcharts-select-series"!==e&&"highcharts-select-volume"!==e){let i=e.split("highcharts-select-")[1];r.fields[i]=t.value}}),a&&(r.fields["params.volumeSeriesID"]=a.getAttribute("value")||""),r))})}),a}showForm(t,e,i,s){e&&(this.showPopup(),"indicators"===t&&this.indicators.addForm.call(this,e,i,s),"annotation-toolbar"===t&&this.annotations.addToolbar.call(this,e,i,s),"annotation-edit"===t&&this.annotations.addForm.call(this,e,i,s),"flag"===t&&this.annotations.addForm.call(this,e,i,s,!0),this.type=t,this.container.style.height=this.container.offsetHeight+"px")}}(0,i.extend)(tM.prototype,{annotations:{addForm:function(t,e,s,o){if(!t)return;let n=this.container,a=this.lang,r=(0,i.createElement)("h2",{className:"highcharts-popup-main-title"},void 0,n);r.appendChild(ts.createTextNode(a[e.langKey]||e.langKey||"")),r=(0,i.createElement)("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},void 0,n);let h=(0,i.createElement)("div",{className:"highcharts-popup-bottom-row"},void 0,n);tn.call(this,r,t,"",e,[],!0),this.addButton(h,o?a.addButton||"Add":a.saveButton||"Save",o?"add":"save",n,s)},addToolbar:function(t,e,s){let o=this.lang,n=this.container,a=this.showForm,r="highcharts-annotation-toolbar";-1===n.className.indexOf(r)&&(n.className+=" "+r+" highcharts-no-mousewheel"),t&&(n.style.top=t.plotTop+10+"px");let h=(0,i.createElement)("p",{className:"highcharts-annotation-label"},void 0,n);h.setAttribute("aria-label","Annotation type"),h.appendChild(ts.createTextNode((0,i.pick)(o[e.langKey]||e.langKey,e.shapes&&e.shapes[0].type,"")));let l=this.addButton(n,o.editButton||"Edit","edit",n,()=>{a.call(this,"annotation-edit",t,e,s)});l.className+=" highcharts-annotation-edit-button",(0,i.createElement)("span",{className:"highcharts-icon"},{backgroundImage:Q("edit.svg",this.iconsURL,J)},l),l=this.addButton(n,o.removeButton||"Remove","remove",n,s),l.className+=" highcharts-annotation-remove-button",(0,i.createElement)("span",{className:"highcharts-icon"},{backgroundImage:Q("destroy.svg",this.iconsURL,J)},l)}},indicators:{addForm:function(t,e,i){let s,o=this.lang;if(!t)return;this.tabs.init.call(this,t);let n=this.container.querySelectorAll(".highcharts-tab-item-content");tl(n[0]),tu.call(this,t,n[0]),tp.call(this,t,n[0],"add"),s=n[0].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,o.addButton||"add","add",s,i),tl(n[1]),tp.call(this,t,n[1],"edit"),s=n[1].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,o.saveButton||"save","edit",s,i),this.addButton(s,o.removeButton||"remove","remove",s,i)},getAmount:function(){let t=0;return this.series.forEach(e=>{(e.params||e.options.params)&&t++}),t}},tabs:{init:function(t){if(!t)return;let e=this.indicators.getAmount.call(t),i=tE.call(this,"add");tE.call(this,"edit",e),tA.call(this),tA.call(this),tC.call(this,e),tw.call(this,i,0)}}});let{composed:tN}=h();function tB(){this.popup&&this.popup.closePopup()}function tT(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 tL(t,e){this.inClass(e.target,"highcharts-popup")||t.apply(this,Array.prototype.slice.call(arguments,1))}let tI=function(t,e){(0,i.pushUnique)(tN,"Popup")&&((0,i.addEvent)(t,"closePopup",tB),(0,i.addEvent)(t,"showPopup",tT),(0,i.wrap)(e.prototype,"onContainerMouseDown",tL))},{defaultOptions:tS}=h();function tD(t,e){let s={};return["labels","shapes"].forEach(o=>{let n=t[o],a=e[o];n&&(a?s[o]=(0,i.splat)(a).map((t,e)=>(0,i.merge)(n[e],t)):s[o]=t[o])}),s}class tY extends x{static compose(t,e,i,s){m.compose(tY,t,i),$.compose(s),F.compose(t,s),e.compose(tY,t),tI(e,i)}constructor(t,e){super(),this.coll="annotations",this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.index=-1,this.labels=[],this.shapes=[],this.setOptions(e),this.userOptions=e;let i=tD(this.options,e);this.options.labels=i.labels,this.options.shapes=i.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((e,s)=>{let o=this.initLabel(e,s);(0,i.merge)(!0,t[s],o.options)})}addShapes(){let t=this.options.shapes||[];t.forEach((e,s)=>{let o=this.initShape(e,s);(0,i.merge)(!0,t[s],o.options)})}destroy(){let t=this.chart,e=function(t){t.destroy()};this.labels.forEach(e),this.shapes.forEach(e),this.clipXAxis=null,this.clipYAxis=null,(0,i.erase)(t.labelCollectors,this.labelCollector),super.destroy(),this.destroyControlTarget(),(0,i.destroyObjectProperties)(this,t)}destroyItem(t){(0,i.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,e){this.setOptions(e);let i=tD(this.options,e);this.options.labels=i.labels,this.options.shapes=i.shapes,this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.userOptions=e,this.labels=[],this.shapes=[]}init(t,e,s=this.index){let o=this.chart,n=this.options.animation;this.index=s,this.linkPoints(),this.addControlPoints(),this.addShapes(),this.addLabels(),this.setLabelCollector(),this.animationConfig=(0,i.getDeferredAnimation)(o,n)}initLabel(t,e){this.options.labelOptions?.align;let s=new $(this,(0,i.merge)(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},t),e);return s.itemType="label",this.labels.push(s),s}initShape(t,e){let s=(0,i.merge)(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},t),o=new tY.shapesMap[s.type||"rect"](this,s,e);return o.itemType="shape",this.shapes.push(o),o}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,e){if(t.linkPoints(),t.shouldBeDrawn()){let s,o;t.graphic||this.renderItem(t),t.redraw((0,i.pick)(e,!0)&&t.graphic.placed),t.points.length&&(s=t.graphic,o=t.points.some(t=>!1!==t.series.visible&&!1!==t.visible),s&&(o?"hidden"===s.visibility&&s.show():s.hide()))}else this.destroyItem(t)}redrawItems(t,e){let i=t.length;for(;i--;)this.redrawItem(t[i],e)}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 e=t.length;for(;e--;)this.renderItem(t[e])}setClipAxes(){let t=this.chart.xAxis,e=this.chart.yAxis,i=[...this.options.labels??[],...this.options.shapes??[]].reduce((i,s)=>{let o=s&&(s.point||"points"in s&&s.points?.[0]);return[t[o&&o.xAxis]||i[0],e[o&&o.yAxis]||i[1]]},[]);this.clipXAxis=i[0],this.clipYAxis=i[1]}setControlPointsVisibility(t){let e=function(e){e.setControlPointsVisibility(t)};this.controlPoints.forEach(e=>{e.setVisibility(t)}),this.shapes.forEach(e),this.labels.forEach(e)}setLabelCollector(){let t=this;t.labelCollector=function(){return t.labels.reduce(function(t,e){return e.options.allowOverlap||t.push(e.graphic),t},[])},t.chart.labelCollectors.push(t.labelCollector)}setOptions(t){var e;this.options=(0,i.merge)(this.defaultOptions,t.type&&this.defaultOptions.types?.[t.type]||{},t),(e=this.options).typeOptions||(e.typeOptions={})}setVisibility(t){let e=this.options,s=this.chart.navigationBindings,o=(0,i.pick)(t,!e.visible);if(this.graphic.attr("visibility",o?"inherit":"hidden"),!o){let t=function(t){t.setControlPointsVisibility(o)};this.shapes.forEach(t),this.labels.forEach(t),s.activeAnnotation===this&&s.popup&&"annotation-toolbar"===s.popup.type&&(0,i.fireEvent)(s,"closePopup")}e.visible=o}update(t,e){let s=this.chart,o=tD(this.userOptions,t),n=s.annotations.indexOf(this),a=(0,i.merge)(!0,this.userOptions,t);a.labels=o.labels,a.shapes=o.shapes,this.destroy(),this.initProperties(s,a),this.init(s,a),s.options.annotations[n]=this.options,this.isUpdating=!0,(0,i.pick)(e,!0)&&s.drawAnnotations(),(0,i.fireEvent)(this,"afterUpdate"),this.isUpdating=!1}}tY.ControlPoint=b,tY.MockPoint=O,tY.sha