/* Highcharts JS v9.1.1 (2021-06-03) Annotations module (c) 2009-2021 Torstein Honsi License: www.highcharts.com/license */ 'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/annotations",["highcharts"],function(w){a(w);a.Highcharts=w;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function w(b,a,n,u){b.hasOwnProperty(a)||(b[a]=u.apply(null,n))}a=a?a._modules:{};w(a,"Extensions/Annotations/Mixins/EventEmitterMixin.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(b, a){var f=a.addEvent,u=a.fireEvent,l=a.objectEach,m=a.pick,c=a.removeEvent;return{addEvents:function(){var c=this,d=function(d){f(d,b.isTouchDevice?"touchstart":"mousedown",function(d){c.onMouseDown(d)},{passive:!1})};d(this.graphic.element);(c.labels||[]).forEach(function(e){e.options.useHTML&&e.graphic.text&&d(e.graphic.text.element)});l(c.options.events,function(d,e){var b=function(b){"click"===e&&c.cancelClick||d.call(c,c.chart.pointer.normalize(b),c.target)};if(-1===(c.nonDOMEvents||[]).indexOf(e))c.graphic.on(e, b);else f(c,e,b,{passive:!1})});if(c.options.draggable&&(f(c,"drag",c.onDrag),!c.graphic.renderer.styledMode)){var e={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[c.options.draggable]};c.graphic.css(e);(c.labels||[]).forEach(function(d){d.options.useHTML&&d.graphic.text&&d.graphic.text.css(e)})}c.isUpdating||u(c,"add")},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag());this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(c){var d=this, e=d.chart.pointer;c.preventDefault&&c.preventDefault();if(2!==c.button){c=e.normalize(c);var A=c.chartX;var g=c.chartY;d.cancelClick=!1;d.chart.hasDraggedAnnotation=!0;d.removeDrag=f(b.doc,b.isTouchDevice?"touchmove":"mousemove",function(c){d.hasDragged=!0;c=e.normalize(c);c.prevChartX=A;c.prevChartY=g;u(d,"drag",c);A=c.chartX;g=c.chartY},b.isTouchDevice?{passive:!1}:void 0);d.removeMouseUp=f(b.doc,b.isTouchDevice?"touchend":"mouseup",function(e){d.cancelClick=d.hasDragged;d.hasDragged=!1;d.chart.hasDraggedAnnotation= !1;u(m(d.target,d),"afterUpdate");d.onMouseUp(e)},b.isTouchDevice?{passive:!1}:void 0)}},onMouseUp:function(c){var d=this.chart;c=this.target||this;var e=d.options.annotations;d=d.annotations.indexOf(c);this.removeDocEvents();e[d]=c.options},onDrag:function(c){if(this.chart.isInsidePlot(c.chartX-this.chart.plotLeft,c.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){var d=this.mouseMoveToTranslation(c);"x"===this.options.draggable&&(d.y=0);"y"===this.options.draggable&&(d.x=0);this.points.length?this.translate(d.x, d.y):(this.shapes.forEach(function(e){e.translate(d.x,d.y)}),this.labels.forEach(function(e){e.translate(d.x,d.y)}));this.redraw(!1)}},mouseMoveToRadians:function(c,d,e){var b=c.prevChartY-e,g=c.prevChartX-d;e=c.chartY-e;c=c.chartX-d;this.chart.inverted&&(d=g,g=b,b=d,d=c,c=e,e=d);return Math.atan2(e,c)-Math.atan2(b,g)},mouseMoveToTranslation:function(c){var d=c.chartX-c.prevChartX;c=c.chartY-c.prevChartY;if(this.chart.inverted){var e=c;c=d;d=e}return{x:d,y:c}},mouseMoveToScale:function(c,d,e){d=(c.chartX- d||1)/(c.prevChartX-d||1);c=(c.chartY-e||1)/(c.prevChartY-e||1);this.chart.inverted&&(e=c,c=d,d=e);return{x:d,y:c}},destroy:function(){this.removeDocEvents();c(this);this.hcEvents=null}}});w(a,"Extensions/Annotations/ControlPoint.js",[a["Core/Utilities.js"],a["Extensions/Annotations/Mixins/EventEmitterMixin.js"]],function(b,a){var f=b.merge,u=b.pick;return function(){function b(b,c,f,d){this.addEvents=a.addEvents;this.graphic=void 0;this.mouseMoveToRadians=a.mouseMoveToRadians;this.mouseMoveToScale= a.mouseMoveToScale;this.mouseMoveToTranslation=a.mouseMoveToTranslation;this.onDrag=a.onDrag;this.onMouseDown=a.onMouseDown;this.onMouseUp=a.onMouseUp;this.removeDocEvents=a.removeDocEvents;this.nonDOMEvents=["drag"];this.chart=b;this.target=c;this.options=f;this.index=u(f.index,d)}b.prototype.setVisibility=function(b){this.graphic.attr("visibility",b?"visible":"hidden");this.options.visible=b};b.prototype.render=function(){var b=this.chart,c=this.options;this.graphic=b.renderer.symbol(c.symbol,0, 0,c.width,c.height).add(b.controlPointsGroup).css(c.style);this.setVisibility(c.visible);this.addEvents()};b.prototype.redraw=function(b){this.graphic[b?"animate":"attr"](this.options.positioner.call(this,this.target))};b.prototype.destroy=function(){a.destroy.call(this);this.graphic&&(this.graphic=this.graphic.destroy());this.options=this.target=this.chart=null};b.prototype.update=function(b){var c=this.chart,a=this.target,d=this.index;b=f(!0,this.options,b);this.destroy();this.constructor(c,a,b, d);this.render(c.controlPointsGroup);this.redraw()};return b}()});w(a,"Extensions/Annotations/MockPoint.js",[a["Core/Series/Series.js"],a["Core/Utilities.js"],a["Core/Axis/Axis.js"]],function(b,a,n){var f=a.defined,l=a.fireEvent;return function(){function a(c,a,d){this.y=this.x=this.ttBelow=this.plotY=this.plotX=this.negative=this.isInside=void 0;this.mock=!0;this.series={visible:!0,chart:c,getPlotBox:b.prototype.getPlotBox};this.target=a||null;this.options=d;this.applyOptions(this.getOptions())} a.fromPoint=function(c){return new a(c.series.chart,null,{x:c.x,y:c.y,xAxis:c.series.xAxis,yAxis:c.series.yAxis})};a.pointToPixels=function(c,b){var d=c.series,e=d.chart,a=c.plotX,g=c.plotY;e.inverted&&(c.mock?(a=c.plotY,g=c.plotX):(a=e.plotWidth-c.plotY,g=e.plotHeight-c.plotX));d&&!b&&(c=d.getPlotBox(),a+=c.translateX,g+=c.translateY);return{x:a,y:g}};a.pointToOptions=function(c){return{x:c.x,y:c.y,xAxis:c.series.xAxis,yAxis:c.series.yAxis}};a.prototype.hasDynamicOptions=function(){return"function"=== typeof this.options};a.prototype.getOptions=function(){return this.hasDynamicOptions()?this.options(this.target):this.options};a.prototype.applyOptions=function(c){this.command=c.command;this.setAxis(c,"x");this.setAxis(c,"y");this.refresh()};a.prototype.setAxis=function(c,b){b+="Axis";c=c[b];var d=this.series.chart;this.series[b]=c instanceof n?c:f(c)?d[b][c]||d.get(c):null};a.prototype.toAnchor=function(){var c=[this.plotX,this.plotY,0,0];this.series.chart.inverted&&(c[0]=this.plotY,c[1]=this.plotX); return c};a.prototype.getLabelConfig=function(){return{x:this.x,y:this.y,point:this}};a.prototype.isInsidePlot=function(){var c=this.plotX,b=this.plotY,d=this.series.xAxis,e=this.series.yAxis,a={x:c,y:b,isInsidePlot:!0};d&&(a.isInsidePlot=f(c)&&0<=c&&c<=d.len);e&&(a.isInsidePlot=a.isInsidePlot&&f(b)&&0<=b&&b<=e.len);l(this.series.chart,"afterIsInsidePlot",a);return a.isInsidePlot};a.prototype.refresh=function(){var c=this.series,b=c.xAxis;c=c.yAxis;var d=this.getOptions();b?(this.x=d.x,this.plotX= b.toPixels(d.x,!0)):(this.x=null,this.plotX=d.x);c?(this.y=d.y,this.plotY=c.toPixels(d.y,!0)):(this.y=null,this.plotY=d.y);this.isInside=this.isInsidePlot()};a.prototype.translate=function(c,b,d,e){this.hasDynamicOptions()||(this.plotX+=d,this.plotY+=e,this.refreshOptions())};a.prototype.scale=function(c,b,d,e){if(!this.hasDynamicOptions()){var a=this.plotY*e;this.plotX=(1-d)*c+this.plotX*d;this.plotY=(1-e)*b+a;this.refreshOptions()}};a.prototype.rotate=function(c,b,d){if(!this.hasDynamicOptions()){var e= Math.cos(d);d=Math.sin(d);var a=this.plotX,g=this.plotY;a-=c;g-=b;this.plotX=a*e-g*d+c;this.plotY=a*d+g*e+b;this.refreshOptions()}};a.prototype.refreshOptions=function(){var c=this.series,b=c.xAxis;c=c.yAxis;this.x=this.options.x=b?this.options.x=b.toValue(this.plotX,!0):this.plotX;this.y=this.options.y=c?c.toValue(this.plotY,!0):this.plotY};return a}()});w(a,"Extensions/Annotations/Mixins/ControllableMixin.js",[a["Extensions/Annotations/ControlPoint.js"],a["Extensions/Annotations/MockPoint.js"], a["Core/Tooltip.js"],a["Core/Utilities.js"]],function(b,a,n,u){var f=u.isObject,m=u.isString,c=u.merge,G=u.splat;return{init:function(c,b,a){this.annotation=c;this.chart=c.chart;this.options=b;this.points=[];this.controlPoints=[];this.index=a;this.linkPoints();this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var c=this.options;return c.points||c.point&&G(c.point)},attrsFromOptions:function(c){var b=this.constructor.attrsMap,d={}, a,r=this.chart.styledMode;for(a in c){var p=b[a];!p||r&&-1!==["fill","stroke","stroke-width"].indexOf(p)||(d[p]=c[a])}return d},anchor:function(b){var d=b.series.getPlotBox(),a=b.series.chart,g=b.mock?b.toAnchor():n.prototype.getAnchor.call({chart:b.series.chart},b);g={x:g[0]+(this.options.x||0),y:g[1]+(this.options.y||0),height:g[2]||0,width:g[3]||0};return{relativePosition:g,absolutePosition:c(g,{x:g.x+(b.mock?d.translateX:a.plotLeft),y:g.y+(b.mock?d.translateY:a.plotTop)})}},point:function(c,b){if(c&& c.series)return c;b&&null!==b.series||(f(c)?b=new a(this.chart,this,c):m(c)?b=this.chart.get(c)||null:"function"===typeof c&&(b=c.call(b,this),b=b.series?b:new a(this.chart,this,c)));return b},linkPoints:function(){var c=this.getPointsOptions(),b=this.points,a=c&&c.length||0,g;for(g=0;gh&&("right"===e?b.align="left":b.x=(b.x||0)-h);h=c+r.width-f;h>a.plotWidth&&("left"===e?b.align="right":b.x=(b.x||0)+a.plotWidth-h);h=d+f;0>h&&("bottom"===g?b.verticalAlign="top":b.y=(b.y||0)-h);h=d+r.height-f;h>a.plotHeight&&("top"===g?b.verticalAlign="bottom":b.y=(b.y||0)+a.plotHeight-h);return b};a.prototype.translatePoint= function(a,c){b.translatePoint.call(this,a,c,0)};a.prototype.translate=function(b,a){var c=this.annotation.chart,d=this.annotation.userOptions,e=c.annotations.indexOf(this.annotation);e=c.options.annotations[e];c.inverted&&(c=b,b=a,a=c);this.options.x+=b;this.options.y+=a;e[this.collection][this.index].x=this.options.x;e[this.collection][this.index].y=this.options.y;d[this.collection][this.index].x=this.options.x;d[this.collection][this.index].y=this.options.y};a.prototype.render=function(c){var d= this.options,e=this.attrsFromOptions(d),g=d.style;this.graphic=this.annotation.chart.renderer.label("",0,-9999,d.shape,null,null,d.useHTML,null,"annotation-label").attr(e).add(c);this.annotation.chart.styledMode||("contrast"===g.color&&(g.color=this.annotation.chart.renderer.getContrast(-1n&&(n=-e-n);nc+e?m.push(["L",b+l,c+e]):fb+a&&m.push(["L",b+a,c+e/2])}return m||[]};return m});w(a,"Extensions/Annotations/Controllables/ControllableImage.js",[a["Extensions/Annotations/Controllables/ControllableLabel.js"],a["Extensions/Annotations/Mixins/ControllableMixin.js"]], function(b,a){return function(){function f(b,f,m){this.addControlPoints=a.addControlPoints;this.anchor=a.anchor;this.attr=a.attr;this.attrsFromOptions=a.attrsFromOptions;this.destroy=a.destroy;this.getPointsOptions=a.getPointsOptions;this.init=a.init;this.linkPoints=a.linkPoints;this.point=a.point;this.rotate=a.rotate;this.scale=a.scale;this.setControlPointsVisibility=a.setControlPointsVisibility;this.shouldBeDrawn=a.shouldBeDrawn;this.transform=a.transform;this.transformPoint=a.transformPoint;this.translatePoint= a.translatePoint;this.translateShape=a.translateShape;this.update=a.update;this.type="image";this.translate=a.translateShape;this.init(b,f,m);this.collection="shapes"}f.prototype.render=function(b){var f=this.attrsFromOptions(this.options),m=this.options;this.graphic=this.annotation.chart.renderer.image(m.src,0,-9E9,m.width,m.height).attr(f).add(b);this.graphic.width=m.width;this.graphic.height=m.height;a.render.call(this)};f.prototype.redraw=function(f){var l=this.anchor(this.points[0]);if(l=b.prototype.position.call(this, l))this.graphic[f?"animate":"attr"]({x:l.x,y:l.y});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!l;a.redraw.call(this,f)};f.attrsMap={width:"width",height:"height",zIndex:"zIndex"};return f}()});w(a,"Extensions/Annotations/Annotations.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Chart/Chart.js"],a["Extensions/Annotations/Mixins/ControllableMixin.js"],a["Extensions/Annotations/Controllables/ControllableRect.js"],a["Extensions/Annotations/Controllables/ControllableCircle.js"], a["Extensions/Annotations/Controllables/ControllablePath.js"],a["Extensions/Annotations/Controllables/ControllableImage.js"],a["Extensions/Annotations/Controllables/ControllableLabel.js"],a["Extensions/Annotations/ControlPoint.js"],a["Extensions/Annotations/Mixins/EventEmitterMixin.js"],a["Core/Globals.js"],a["Extensions/Annotations/MockPoint.js"],a["Core/Pointer.js"],a["Core/Utilities.js"],a["Core/Color/Palette.js"]],function(a,f,n,u,l,m,c,w,d,e,A,g,r,p,z){var b=a.getDeferredAnimation;a=f.prototype; var B=p.addEvent,x=p.defined,G=p.destroyObjectProperties,h=p.erase,k=p.extend,t=p.find,v=p.fireEvent,q=p.merge,C=p.pick,y=p.splat;p=p.wrap;var D=function(){function a(a,b){this.annotation=void 0;this.coll="annotations";this.shapesGroup=this.labelsGroup=this.labelCollector=this.group=this.graphic=this.animationConfig=this.collection=void 0;this.chart=a;this.points=[];this.controlPoints=[];this.coll="annotations";this.labels=[];this.shapes=[];this.options=q(this.defaultOptions,b);this.userOptions=b; b=this.getLabelsAndShapesOptions(this.options,b);this.options.labels=b.labels;this.options.shapes=b.shapes;this.init(a,this.options)}a.prototype.init=function(){var a=this.chart,c=this.options.animation;this.linkPoints();this.addControlPoints();this.addShapes();this.addLabels();this.setLabelCollector();this.animationConfig=b(a,c)};a.prototype.getLabelsAndShapesOptions=function(a,b){var c={};["labels","shapes"].forEach(function(d){a[d]&&(c[d]=y(b[d]).map(function(b,c){return q(a[d][c],b)}))});return c}; a.prototype.addShapes=function(){(this.options.shapes||[]).forEach(function(a,b){a=this.initShape(a,b);q(!0,this.options.shapes[b],a.options)},this)};a.prototype.addLabels=function(){(this.options.labels||[]).forEach(function(a,b){a=this.initLabel(a,b);q(!0,this.options.labels[b],a.options)},this)};a.prototype.addClipPaths=function(){this.setClipAxes();this.clipXAxis&&this.clipYAxis&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))};a.prototype.setClipAxes=function(){var a=this.chart.xAxis, b=this.chart.yAxis,c=(this.options.labels||[]).concat(this.options.shapes||[]).reduce(function(c,d){return[a[d&&d.point&&d.point.xAxis]||c[0],b[d&&d.point&&d.point.yAxis]||c[1]]},[]);this.clipXAxis=c[0];this.clipYAxis=c[1]};a.prototype.getClipBox=function(){if(this.clipXAxis&&this.clipYAxis)return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}};a.prototype.setLabelCollector=function(){var a=this;a.labelCollector=function(){return a.labels.reduce(function(a, b){b.options.allowOverlap||a.push(b.graphic);return a},[])};a.chart.labelCollectors.push(a.labelCollector)};a.prototype.setOptions=function(a){this.options=q(this.defaultOptions,a)};a.prototype.redraw=function(a){this.linkPoints();this.graphic||this.render();this.clipRect&&this.clipRect.animate(this.getClipBox());this.redrawItems(this.shapes,a);this.redrawItems(this.labels,a);n.redraw.call(this,a)};a.prototype.redrawItems=function(a,b){for(var c=a.length;c--;)this.redrawItem(a[c],b)};a.prototype.renderItems= function(a){for(var b=a.length;b--;)this.renderItem(a[b])};a.prototype.render=function(){var a=this.chart.renderer;this.graphic=a.g("annotation").attr({opacity:0,zIndex:this.options.zIndex,visibility:this.options.visible?"visible":"hidden"}).add();this.shapesGroup=a.g("annotation-shapes").add(this.graphic).clip(this.chart.plotBoxClip);this.labelsGroup=a.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();n.render.call(this)};a.prototype.setVisibility=function(a){var b=this.options;a=C(a,!b.visible);this.graphic.attr("visibility",a?"visible":"hidden");a||this.setControlPointsVisibility(!1);b.visible=a};a.prototype.setControlPointsVisibility=function(a){var b=function(b){b.setControlPointsVisibility(a)};n.setControlPointsVisibility.call(this,a);this.shapes.forEach(b);this.labels.forEach(b)};a.prototype.destroy=function(){var a=this.chart,b=function(a){a.destroy()}; this.labels.forEach(b);this.shapes.forEach(b);this.clipYAxis=this.clipXAxis=null;h(a.labelCollectors,this.labelCollector);e.destroy.call(this);n.destroy.call(this);G(this,a)};a.prototype.remove=function(){return this.chart.removeAnnotation(this)};a.prototype.update=function(a,b){var c=this.chart,d=this.getLabelsAndShapesOptions(this.userOptions,a),e=c.annotations.indexOf(this);a=q(!0,this.userOptions,a);a.labels=d.labels;a.shapes=d.shapes;this.destroy();this.constructor(c,a);c.options.annotations[e]= a;this.isUpdating=!0;C(b,!0)&&c.redraw();v(this,"afterUpdate");this.isUpdating=!1};a.prototype.initShape=function(b,c){b=q(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},b);c=new a.shapesMap[b.type](this,b,c);c.itemType="shape";this.shapes.push(c);return c};a.prototype.initLabel=function(a,b){a=q(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},a);b=new w(this,a,b);b.itemType="label";this.labels.push(b);return b};a.prototype.redrawItem= function(a,b){a.linkPoints();a.shouldBeDrawn()?(a.graphic||this.renderItem(a),a.redraw(C(b,!0)&&a.graphic.placed),a.points.length&&this.adjustVisibility(a)):this.destroyItem(a)};a.prototype.adjustVisibility=function(a){var b=!1,c=a.graphic;a.points.forEach(function(a){!1!==a.series.visible&&!1!==a.visible&&(b=!0)});b?"hidden"===c.visibility&&c.show():c.hide()};a.prototype.destroyItem=function(a){h(this[a.itemType+"s"],a);a.destroy()};a.prototype.renderItem=function(a){a.render("label"===a.itemType? this.labelsGroup:this.shapesGroup)};a.ControlPoint=d;a.MockPoint=g;a.shapesMap={rect:u,circle:l,path:m,image:c};a.types={};return a}();q(!0,D.prototype,n,e,q(D.prototype,{nonDOMEvents:["add","afterUpdate","drag","remove"],defaultOptions:{visible:!0,animation:{},draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:z.neutralColor100,borderRadius:3,borderWidth:1,className:"highcharts-no-tooltip",crop:!1,formatter:function(){return x(this.y)?this.y: "Annotation label"},includeInDataExport:!0,overflow:"justify",padding:5,shadow:!1,shape:"callout",style:{fontSize:"11px",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:{symbol:"circle",width:10,height:10,style:{stroke:z.neutralColor100,"stroke-width":2,fill:z.backgroundColor},visible:!1,events:{}},events:{},zIndex:6}}));A.extendAnnotation=function(a, b,c,d){b=b||D;k(a.prototype,q(b.prototype,c));a.prototype.defaultOptions=q(a.prototype.defaultOptions,d||{})};k(a,{initAnnotation:function(a){a=new (D.types[a.type]||D)(this,a);this.annotations.push(a);return a},addAnnotation:function(a,b){a=this.initAnnotation(a);this.options.annotations.push(a.options);C(b,!0)&&(a.redraw(),a.graphic.attr({opacity:1}));return a},removeAnnotation:function(a){var b=this.annotations,c="annotations"===a.coll?a:t(b,function(b){return b.options.id===a});c&&(v(c,"remove"), h(this.options.annotations,c.options),h(b,c),c.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox);this.annotations.forEach(function(a){a.redraw();a.graphic.animate({opacity:1},a.animationConfig)})}});a.collectionsWithUpdate.push("annotations");a.collectionsWithInit.annotations=[a.addAnnotation];B(f,"afterInit",function(){this.annotations=[];this.options.annotations||(this.options.annotations=[])});a.callbacks.push(function(a){a.plotBoxClip=this.renderer.clipRect(this.plotBox); a.controlPointsGroup=a.renderer.g("control-points").attr({zIndex:99}).clip(a.plotBoxClip).add();a.options.annotations.forEach(function(b,c){if(!a.annotations.some(function(a){return a.options===b})){var d=a.initAnnotation(b);a.options.annotations[c]=d.options}});a.drawAnnotations();B(a,"redraw",a.drawAnnotations);B(a,"destroy",function(){a.plotBoxClip.destroy();a.controlPointsGroup.destroy()});B(a,"exportData",function(b){var c=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter, d=!b.dataRows[1].xValues,q=a.options.lang&&a.options.lang.exportData&&a.options.lang.exportData.annotationHeader,e=function(a){if(c){var b=c(a);if(!1!==b)return b}b=q+" "+a;return d?{columnTitle:b,topLevelColumnTitle:b}:b},v=b.dataRows[0].length,C=a.options.exporting&&a.options.exporting.csv&&a.options.exporting.csv.annotations&&a.options.exporting.csv.annotations.itemDelimiter,h=a.options.exporting&&a.options.exporting.csv&&a.options.exporting.csv.annotations&&a.options.exporting.csv.annotations.join; a.annotations.forEach(function(a){a.options.labelOptions.includeInDataExport&&a.labels.forEach(function(a){if(a.options.text){var c=a.options.text;a.points.forEach(function(a){var d=a.x,q=a.series.xAxis?a.series.xAxis.options.index:-1,e=!1;if(-1===q){a=b.dataRows[0].length;for(var y=Array(a),k=0;kv?a[a.length-1]+=C+c:a.push(c),e= !0)});if(!e){a=b.dataRows[0].length;y=Array(a);for(k=0;k=b-d&&a.value<=c+d&&!a.axis.options.isInternal})[0]}};f.prototype.initNavigationBindings=function(){var a=this.options;a&&a.navigation&&a.navigation.bindings&&(this.navigationBindings=new t(this,a.navigation),this.navigationBindings.initEvents(), this.navigationBindings.initUpdate())};e(f,"load",function(){this.initNavigationBindings()});e(f,"destroy",function(){this.navigationBindings&&this.navigationBindings.destroy()});e(t,"deselectButton",function(){this.selectedButtonElement=null});e(a,"remove",function(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()});l.Annotation&&(b(a),x(a.types,function(a){b(a)}));u({lang:{navigation:{popup:{simpleShapes:"Simple shapes",lines:"Lines",circle:"Circle",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(a){var b=this.chart.pointer.getCoordinates(a);a=this.utils.getAssignedAxis(b.xAxis);b=this.utils.getAssignedAxis(b.yAxis);var c=this.chart.options.navigation;if(a&&b)return this.chart.addAnnotation(B({langKey:"circle",type:"basicAnnotation",shapes:[{type:"circle",point:{x:a.value,y:b.value,xAxis:a.axis.options.index,yAxis:b.axis.options.index},r:5}]},c.annotationsOptions,c.bindings.circleAnnotation.annotationsOptions))}, steps:[function(a,b){var c=b.options.shapes[0].point,d=this.chart.inverted;if(z(c.xAxis)&&z(c.yAxis)){var e=this.chart.xAxis[c.xAxis].toPixels(c.x);c=this.chart.yAxis[c.yAxis].toPixels(c.y);e=Math.max(Math.sqrt(Math.pow(d?c-a.chartX:e-a.chartX,2)+Math.pow(d?e-a.chartY:c-a.chartY,2)),5)}b.update({shapes:[{r:e}]})}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(a){a=this.chart.pointer.getCoordinates(a);var b=this.utils.getAssignedAxis(a.xAxis),c=this.utils.getAssignedAxis(a.yAxis); if(b&&c){a=b.value;var d=c.value;b=b.axis.options.index;c=c.axis.options.index;var e=this.chart.options.navigation;return this.chart.addAnnotation(B({langKey:"rectangle",type:"basicAnnotation",shapes:[{type:"path",points:[{xAxis:b,yAxis:c,x:a,y:d},{xAxis:b,yAxis:c,x:a,y:d},{xAxis:b,yAxis:c,x:a,y:d},{xAxis:b,yAxis:c,x:a,y:d}]}]},e.annotationsOptions,e.bindings.rectangleAnnotation.annotationsOptions))}},steps:[function(a,b){var c=b.options.shapes[0].points,d=this.chart.pointer.getCoordinates(a);a=this.utils.getAssignedAxis(d.xAxis); d=this.utils.getAssignedAxis(d.yAxis);a&&d&&(a=a.value,d=d.value,c[1].x=a,c[2].x=a,c[2].y=d,c[3].y=d,b.update({shapes:[{points:c}]}))}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(a){var b=this.chart.pointer.getCoordinates(a);a=this.utils.getAssignedAxis(b.xAxis);b=this.utils.getAssignedAxis(b.yAxis);var c=this.chart.options.navigation;if(a&&b)return this.chart.addAnnotation(B({langKey:"label",type:"basicAnnotation",labelOptions:{format:"{y:.2f}"},labels:[{point:{xAxis:a.axis.options.index, yAxis:b.axis.options.index,x:a.value,y:b.value},overflow:"none",crop:!0}]},c.annotationsOptions,c.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{animation:{defer:0}}}});e(f,"render",function(){var a=this,b=a.navigationBindings;if(a&&b){var c=!1;a.series.forEach(function(a){!a.options.isInternal&&a.visible&&(c=!0)});x(b.boundClassNames,function(b,d){a.navigationBindings&&a.navigationBindings.container&&a.navigationBindings.container[0]&&(d=a.navigationBindings.container[0].querySelectorAll("."+ d))&&("normal"===b.noDataState?d.forEach(function(a){-1!==a.className.indexOf("highcharts-disabled-btn")&&a.classList.remove("highcharts-disabled-btn")}):c?d.forEach(function(a){-1!==a.className.indexOf("highcharts-disabled-btn")&&a.classList.remove("highcharts-disabled-btn")}):d.forEach(function(a){-1===a.className.indexOf("highcharts-disabled-btn")&&(a.className+=" highcharts-disabled-btn")}))})}});e(t,"closePopup",function(){this.deselectAnnotation()});return t});w(a,"Extensions/Annotations/Popup.js", [a["Core/Globals.js"],a["Extensions/Annotations/NavigationBindings.js"],a["Core/DefaultOptions.js"],a["Core/Pointer.js"],a["Core/Utilities.js"]],function(a,f,n,u,l){var b=a.doc,c=a.isFirefox,w=n.getOptions,d=l.addEvent,e=l.createElement,A=l.defined,g=l.fireEvent,r=l.isArray,p=l.isObject,z=l.isString,E=l.objectEach,B=l.pick,x=l.stableSort;n=l.wrap;var F=/\d/g;n(u.prototype,"onContainerMouseDown",function(a,b){var c=b.target&&b.target.className;z(c)&&0<=c.indexOf("highcharts-popup-field")||a.apply(this, Array.prototype.slice.call(arguments,1))});a.Popup=function(a,b,c){this.init(a,b,c)};a.Popup.prototype={init:function(a,b,c){this.chart=c;this.container=e("div",{className:"highcharts-popup highcharts-no-tooltip"},null,a);this.lang=this.getLangpack();this.iconsURL=b;this.addCloseBtn()},addCloseBtn:function(){var a=this,b=this.iconsURL;var c=e("div",{className:"highcharts-popup-close"},null,this.container);c.style["background-image"]="url("+(b.match(/png|svg|jpeg|jpg|gif/ig)?b:b+"close.svg")+")";["click", "touchstart"].forEach(function(b){d(c,b,function(){a.chart?g(a.chart.navigationBindings,"closePopup"):a.closePopup()})})},addColsContainer:function(a){var b=e("div",{className:"highcharts-popup-lhs-col"},null,a);a=e("div",{className:"highcharts-popup-rhs-col"},null,a);e("div",{className:"highcharts-popup-rhs-col-wrapper"},null,a);return{lhsCol:b,rhsCol:a}},addInput:function(a,c,d,f){var h=a.split(".");h=h[h.length-1];var k=this.lang;c="highcharts-"+c+"-"+h;c.match(F)||e("label",{htmlFor:c},void 0, d).appendChild(b.createTextNode(k[h]||h));e("input",{name:c,value:f[0],type:f[1],className:"highcharts-popup-field"},void 0,d).setAttribute("highcharts-data-name",a)},addButton:function(a,c,f,g,q){var h=this,k=this.closePopup,v=this.getFields;var t=e("button",void 0,void 0,a);t.appendChild(b.createTextNode(c));["click","touchstart"].forEach(function(a){d(t,a,function(){k.call(h);return g(v(q,f))})});return t},getFields:function(a,b){var c=a.querySelectorAll("input"),d=a.querySelectorAll("#highcharts-select-series > option:checked")[0]; a=a.querySelectorAll("#highcharts-select-volume > option:checked")[0];var e,h;var k={actionType:b,linkedTo:d&&d.getAttribute("value"),fields:{}};[].forEach.call(c,function(a){h=a.getAttribute("highcharts-data-name");(e=a.getAttribute("highcharts-data-series-id"))?k.seriesId=a.value:h?k.fields[h]=a.value:k.type=a.value});a&&(k.fields["params.volumeSeriesID"]=a.getAttribute("value"));return k},showPopup:function(){var a=this.container,b=a.querySelectorAll(".highcharts-popup-close")[0];a.innerHTML=""; 0<=a.className.indexOf("highcharts-annotation-toolbar")&&(a.classList.remove("highcharts-annotation-toolbar"),a.removeAttribute("style"));a.appendChild(b);a.style.display="block"},closePopup:function(){B(this.popup&&this.popup.container,this.container).style.display="none"},showForm:function(a,b,c,d){b&&(this.popup=b.navigationBindings.popup,this.showPopup(),"indicators"===a&&this.indicators.addForm.call(this,b,c,d),"annotation-toolbar"===a&&this.annotations.addToolbar.call(this,b,c,d),"annotation-edit"=== a&&this.annotations.addForm.call(this,b,c,d),"flag"===a&&this.annotations.addForm.call(this,b,c,d,!0))},getLangpack:function(){return w().lang.navigation.popup},annotations:{addToolbar:function(a,c,d){var h=this,f=this.lang,k=this.popup.container,g=this.showForm;-1===k.className.indexOf("highcharts-annotation-toolbar")&&(k.className+=" highcharts-annotation-toolbar");a&&(k.style.top=a.plotTop+10+"px");e("span",void 0,void 0,k).appendChild(b.createTextNode(B(f[c.langKey]||c.langKey,c.shapes&&c.shapes[0].type))); var t=this.addButton(k,f.removeButton||"remove","remove",d,k);t.className+=" highcharts-annotation-remove-button";t.style["background-image"]="url("+this.iconsURL+"destroy.svg)";t=this.addButton(k,f.editButton||"edit","edit",function(){g.call(h,"annotation-edit",a,c,d)},k);t.className+=" highcharts-annotation-edit-button";t.style["background-image"]="url("+this.iconsURL+"edit.svg)"},addForm:function(a,c,d,f){var h=this.popup.container,k=this.lang;if(a){var g=e("h2",{className:"highcharts-popup-main-title"}, void 0,h);g.appendChild(b.createTextNode(k[c.langKey]||c.langKey||""));g=e("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},null,h);var t=e("div",{className:"highcharts-popup-bottom-row"},null,h);this.annotations.addFormFields.call(this,g,a,"",c,[],!0);this.addButton(t,f?k.addButton||"add":k.saveButton||"save",f?"add":"save",d,h)}},addFormFields:function(a,d,f,g,q,l){var h=this,k=this.annotations.addFormFields,t=this.addInput,v=this.lang,m,n;d&&(E(g,function(b,c){m=""!==f?f+ "."+c:c;p(b)&&(!r(b)||r(b)&&p(b[0])?(n=v[c]||c,n.match(F)||q.push([!0,n,a]),k.call(h,a,d,m,b,q,!1)):q.push([h,m,"annotation",a,b]))}),l&&(x(q,function(a){return a[1].match(/format/g)?-1:1}),c&&q.reverse(),q.forEach(function(a){!0===a[0]?e("span",{className:"highcharts-annotation-title"},void 0,a[2]).appendChild(b.createTextNode(a[1])):t.apply(a[0],a.splice(1))})))}},indicators:{addForm:function(a,b,c){var d=this.indicators,e=this.lang;if(a){this.tabs.init.call(this,a);b=this.popup.container.querySelectorAll(".highcharts-tab-item-content"); this.addColsContainer(b[0]);d.addIndicatorList.call(this,a,b[0],"add");var h=b[0].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton(h,e.addButton||"add","add",c,h);this.addColsContainer(b[1]);d.addIndicatorList.call(this,a,b[1],"edit");h=b[1].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton(h,e.saveButton||"save","edit",c,h);this.addButton(h,e.removeButton||"remove","remove",c,h)}},addIndicatorList:function(a,c,f){var h=this,g=c.querySelectorAll(".highcharts-popup-lhs-col")[0]; c=c.querySelectorAll(".highcharts-popup-rhs-col")[0];var k="edit"===f,t=k?a.series:a.options.plotOptions,l=this.indicators.addFormFields,m;if(a){var n=e("ul",{className:"highcharts-indicator-list"},null,g);var p=c.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];E(t,function(c,f){var g=c.options;if(c.params||g&&g.params){var q=h.indicators.getNameType(c,f),v=q.type;m=e("li",{className:"highcharts-indicator-list"},void 0,n);m.appendChild(b.createTextNode(q.name));["click","touchstart"].forEach(function(b){d(m, b,function(){l.call(h,a,k?c:t[v],q.type,p);k&&c.options&&e("input",{type:"hidden",name:"highcharts-id-"+v,value:c.options.id},null,p).setAttribute("highcharts-data-series-id",c.options.id)})})}});0