/*
 Highcharts JS v8.0.4 (2020-03-10)

 Annotations module

 (c) 2009-2019 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(d){"object"===typeof module&&module.exports?(d["default"]=d,module.exports=d):"function"===typeof define&&define.amd?define("highcharts/modules/annotations-advanced",["highcharts"],function(r){d(r);d.Highcharts=r;return d}):d("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(d){function r(k,b,d,m){k.hasOwnProperty(b)||(k[b]=m.apply(null,d))}d=d?d._modules:{};r(d,"annotations/eventEmitterMixin.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(k,b){var d=b.addEvent,
m=b.inArray,p=b.objectEach,g=b.pick,f=b.removeEvent,c=k.fireEvent;return{addEvents:function(){var a=this;d(a.graphic.element,"mousedown",function(c){a.onMouseDown(c)});p(a.options.events,function(c,n){var e=function(e){"click"===n&&a.cancelClick||c.call(a,a.chart.pointer.normalize(e),a.target)};if(-1===m(n,a.nonDOMEvents||[]))a.graphic.on(n,e);else d(a,n,e)});a.options.draggable&&(d(a,"drag",a.onDrag),a.graphic.renderer.styledMode||a.graphic.css({cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[a.options.draggable]}));
a.isUpdating||c(a,"add")},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag());this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(a){var l=this,n=l.chart.pointer;a.preventDefault&&a.preventDefault();if(2!==a.button){a=n.normalize(a);var e=a.chartX;var h=a.chartY;l.cancelClick=!1;l.chart.hasDraggedAnnotation=!0;l.removeDrag=d(k.doc,"mousemove",function(a){l.hasDragged=!0;a=n.normalize(a);a.prevChartX=e;a.prevChartY=h;c(l,"drag",a);e=a.chartX;
h=a.chartY});l.removeMouseUp=d(k.doc,"mouseup",function(a){l.cancelClick=l.hasDragged;l.hasDragged=!1;l.chart.hasDraggedAnnotation=!1;c(g(l.target,l),"afterUpdate");l.onMouseUp(a)})}},onMouseUp:function(a){var c=this.chart;a=this.target||this;var n=c.options.annotations;c=c.annotations.indexOf(a);this.removeDocEvents();n[c]=a.options},onDrag:function(a){if(this.chart.isInsidePlot(a.chartX-this.chart.plotLeft,a.chartY-this.chart.plotTop)){var c=this.mouseMoveToTranslation(a);"x"===this.options.draggable&&
(c.y=0);"y"===this.options.draggable&&(c.x=0);this.points.length?this.translate(c.x,c.y):(this.shapes.forEach(function(a){a.translate(c.x,c.y)}),this.labels.forEach(function(a){a.translate(c.x,c.y)}));this.redraw(!1)}},mouseMoveToRadians:function(a,c,n){var e=a.prevChartY-n,h=a.prevChartX-c;n=a.chartY-n;a=a.chartX-c;this.chart.inverted&&(c=h,h=e,e=c,c=a,a=n,n=c);return Math.atan2(n,a)-Math.atan2(e,h)},mouseMoveToTranslation:function(a){var c=a.chartX-a.prevChartX;a=a.chartY-a.prevChartY;if(this.chart.inverted){var n=
a;a=c;c=n}return{x:c,y:a}},mouseMoveToScale:function(a,c,n){c=(a.chartX-c||1)/(a.prevChartX-c||1);a=(a.chartY-n||1)/(a.prevChartY-n||1);this.chart.inverted&&(n=a,a=c,c=n);return{x:c,y:a}},destroy:function(){this.removeDocEvents();f(this);this.hcEvents=null}}});r(d,"annotations/ControlPoint.js",[d["parts/Utilities.js"],d["annotations/eventEmitterMixin.js"]],function(k,b){var d=k.extend,m=k.merge,p=k.pick;k=function(b,f,c,a){this.chart=b;this.target=f;this.options=c;this.index=p(c.index,a)};d(k.prototype,
b);k.prototype.nonDOMEvents=["drag"];k.prototype.setVisibility=function(b){this.graphic.attr("visibility",b?"visible":"hidden");this.options.visible=b};k.prototype.render=function(){var b=this.chart,f=this.options;this.graphic=b.renderer.symbol(f.symbol,0,0,f.width,f.height).add(b.controlPointsGroup).css(f.style);this.setVisibility(f.visible);this.addEvents()};k.prototype.redraw=function(b){this.graphic[b?"animate":"attr"](this.options.positioner.call(this,this.target))};k.prototype.destroy=function(){b.destroy.call(this);
this.graphic&&(this.graphic=this.graphic.destroy());this.options=this.target=this.chart=null};k.prototype.update=function(b){var f=this.chart,c=this.target,a=this.index;b=m(!0,this.options,b);this.destroy();this.constructor(f,c,b,a);this.render(f.controlPointsGroup);this.redraw()};return k});r(d,"annotations/MockPoint.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(k,b){var d=b.defined;b=b.extend;var m=function(b,g,f){this.series={visible:!0,chart:b,getPlotBox:k.Series.prototype.getPlotBox};
this.target=g||null;this.options=f;this.applyOptions(this.getOptions())};m.fromPoint=function(b){return new m(b.series.chart,null,{x:b.x,y:b.y,xAxis:b.series.xAxis,yAxis:b.series.yAxis})};m.pointToPixels=function(b,g){var f=b.series,c=f.chart,a=b.plotX,l=b.plotY;c.inverted&&(b.mock?(a=b.plotY,l=b.plotX):(a=c.plotWidth-b.plotY,l=c.plotHeight-b.plotX));f&&!g&&(b=f.getPlotBox(),a+=b.translateX,l+=b.translateY);return{x:a,y:l}};m.pointToOptions=function(b){return{x:b.x,y:b.y,xAxis:b.series.xAxis,yAxis:b.series.yAxis}};
b(m.prototype,{mock:!0,hasDynamicOptions:function(){return"function"===typeof this.options},getOptions:function(){return this.hasDynamicOptions()?this.options(this.target):this.options},applyOptions:function(b){this.command=b.command;this.setAxis(b,"x");this.setAxis(b,"y");this.refresh()},setAxis:function(b,g){g+="Axis";b=b[g];var f=this.series.chart;this.series[g]=b instanceof k.Axis?b:d(b)?f[g][b]||f.get(b):null},toAnchor:function(){var b=[this.plotX,this.plotY,0,0];this.series.chart.inverted&&
(b[0]=this.plotY,b[1]=this.plotX);return b},getLabelConfig:function(){return{x:this.x,y:this.y,point:this}},isInsidePane:function(){var b=this.plotX,g=this.plotY,f=this.series.xAxis,c=this.series.yAxis,a=!0;f&&(a=d(b)&&0<=b&&b<=f.len);c&&(a=a&&d(g)&&0<=g&&g<=c.len);return a},refresh:function(){var b=this.series,g=b.xAxis;b=b.yAxis;var f=this.getOptions();g?(this.x=f.x,this.plotX=g.toPixels(f.x,!0)):(this.x=null,this.plotX=f.x);b?(this.y=f.y,this.plotY=b.toPixels(f.y,!0)):(this.y=null,this.plotY=f.y);
this.isInside=this.isInsidePane()},translate:function(b,g,f,c){this.hasDynamicOptions()||(this.plotX+=f,this.plotY+=c,this.refreshOptions())},scale:function(b,g,f,c){if(!this.hasDynamicOptions()){var a=this.plotY*c;this.plotX=(1-f)*b+this.plotX*f;this.plotY=(1-c)*g+a;this.refreshOptions()}},rotate:function(b,g,f){if(!this.hasDynamicOptions()){var c=Math.cos(f);f=Math.sin(f);var a=this.plotX,l=this.plotY;a-=b;l-=g;this.plotX=a*c-l*f+b;this.plotY=a*f+l*c+g;this.refreshOptions()}},refreshOptions:function(){var b=
this.series,g=b.xAxis;b=b.yAxis;this.x=this.options.x=g?this.options.x=g.toValue(this.plotX,!0):this.plotX;this.y=this.options.y=b?b.toValue(this.plotY,!0):this.plotY}});return m});r(d,"annotations/controllable/controllableMixin.js",[d["parts/Utilities.js"],d["annotations/ControlPoint.js"],d["annotations/MockPoint.js"],d["parts/Tooltip.js"]],function(k,b,d,m){var p=k.isObject,g=k.isString,f=k.merge,c=k.splat;return{init:function(a,c,b){this.annotation=a;this.chart=a.chart;this.options=c;this.points=
[];this.controlPoints=[];this.index=b;this.linkPoints();this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var a=this.options;return a.points||a.point&&c(a.point)},attrsFromOptions:function(a){var c=this.constructor.attrsMap,b={},e,h=this.chart.styledMode;for(e in a){var q=c[e];!q||h&&-1!==["fill","stroke","stroke-width"].indexOf(q)||(b[q]=a[e])}return b},anchor:function(a){var c=a.series.getPlotBox();a=a.mock?a.toAnchor():m.prototype.getAnchor.call({chart:a.series.chart},
a);a={x:a[0]+(this.options.x||0),y:a[1]+(this.options.y||0),height:a[2]||0,width:a[3]||0};return{relativePosition:a,absolutePosition:f(a,{x:a.x+c.translateX,y:a.y+c.translateY})}},point:function(a,c){if(a&&a.series)return a;c&&null!==c.series||(p(a)?c=new d(this.chart,this,a):g(a)?c=this.chart.get(a)||null:"function"===typeof a&&(c=a.call(c,this),c=c.series?c:new d(this.chart,this,a)));return c},linkPoints:function(){var a=this.getPointsOptions(),c=this.points,b=a&&a.length||0,e;for(e=0;e<b;e++){var h=
this.point(a[e],c[e]);if(!h){c.length=0;return}h.mock&&h.refresh();c[e]=h}return c},addControlPoints:function(){var a=this.options.controlPoints;(a||[]).forEach(function(c,n){c=f(this.options.controlPointOptions,c);c.index||(c.index=n);a[n]=c;this.controlPoints.push(new b(this.chart,this,c))},this)},shouldBeDrawn:function(){return!!this.points.length},render:function(a){this.controlPoints.forEach(function(a){a.render()})},redraw:function(a){this.controlPoints.forEach(function(c){c.redraw(a)})},transform:function(a,
c,b,e,h){if(this.chart.inverted){var l=c;c=b;b=l}this.points.forEach(function(l,n){this.transformPoint(a,c,b,e,h,n)},this)},transformPoint:function(a,c,b,e,h,q){var l=this.points[q];l.mock||(l=this.points[q]=d.fromPoint(l));l[a](c,b,e,h)},translate:function(a,c){this.transform("translate",null,null,a,c)},translatePoint:function(a,c,b){this.transformPoint("translate",null,null,a,c,b)},translateShape:function(a,c){var b=this.annotation.chart,e=this.annotation.userOptions,h=b.annotations.indexOf(this.annotation);
b=b.options.annotations[h];this.translatePoint(a,c,0);b[this.collection][this.index].point=this.options.point;e[this.collection][this.index].point=this.options.point},rotate:function(a,c,b){this.transform("rotate",a,c,b)},scale:function(a,c,b,e){this.transform("scale",a,c,b,e)},setControlPointsVisibility:function(a){this.controlPoints.forEach(function(c){c.setVisibility(a)})},destroy:function(){this.graphic&&(this.graphic=this.graphic.destroy());this.tracker&&(this.tracker=this.tracker.destroy());
this.controlPoints.forEach(function(a){a.destroy()});this.options=this.controlPoints=this.points=this.chart=null;this.annotation&&(this.annotation=null)},update:function(a){var c=this.annotation;a=f(!0,this.options,a);var b=this.graphic.parentGroup;this.destroy();this.constructor(c,a);this.render(b);this.redraw()}}});r(d,"annotations/controllable/markerMixin.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(k,b){var d=b.addEvent,m=b.defined,p=b.merge,g=b.objectEach,f=b.uniqueKey,c={arrow:{tagName:"marker",
render:!1,id:"arrow",refY:5,refX:9,markerWidth:10,markerHeight:10,children:[{tagName:"path",d:"M 0 0 L 10 5 L 0 10 Z",strokeWidth:0}]},"reverse-arrow":{tagName:"marker",render:!1,id:"reverse-arrow",refY:5,refX:1,markerWidth:10,markerHeight:10,children:[{tagName:"path",d:"M 0 5 L 10 0 L 10 10 Z",strokeWidth:0}]}};k.SVGRenderer.prototype.addMarker=function(a,c){var b={id:a},e={stroke:c.color||"none",fill:c.color||"rgba(0, 0, 0, 0.75)"};b.children=c.children.map(function(c){return p(e,c)});c=this.definition(p(!0,
{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"},c,b));c.id=a;return c};b=function(c){return function(a){this.attr(c,"url(#"+a+")")}};b={markerEndSetter:b("marker-end"),markerStartSetter:b("marker-start"),setItemMarkers:function(c){var a=c.options,b=c.chart,e=b.options.defs,h=a.fill,q=m(h)&&"none"!==h?h:a.stroke;["markerStart","markerEnd"].forEach(function(h){var l=a[h],n;if(l){for(n in e){var v=e[n];if(l===v.id&&"marker"===v.tagName){var t=v;break}}t&&(l=c[h]=b.renderer.addMarker((a.id||
f())+"-"+t.id,p(t,{color:q})),c.attr(h,l.attr("id")))}})}};d(k.Chart,"afterGetContainer",function(){this.options.defs=p(c,this.options.defs||{});g(this.options.defs,function(c){"marker"===c.tagName&&!1!==c.render&&this.renderer.addMarker(c.id,c)},this)});return b});r(d,"annotations/controllable/ControllablePath.js",[d["parts/Globals.js"],d["parts/Utilities.js"],d["annotations/controllable/controllableMixin.js"],d["annotations/controllable/markerMixin.js"]],function(k,b,d,m){var p=b.extend;b=b.merge;
var g="rgba(192,192,192,"+(k.svg?.0001:.002)+")";k=function(b,c,a){this.init(b,c,a);this.collection="shapes"};k.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};b(!0,k.prototype,d,{type:"path",setMarkers:m.setItemMarkers,toD:function(){var b=this.options.d;if(b)return"function"===typeof b?b.call(this):b;var c=this.points,a=c.length,l=a,n=c[0],e=l&&this.anchor(n).absolutePosition,h=0,q=2;for(b=e&&["M",e.x,e.y];++h<a&&l;)n=c[h],l=n.command||"L",
e=this.anchor(n).absolutePosition,"Z"===l?b[++q]=l:(l!==c[h-1].command&&(b[++q]=l),b[++q]=e.x,b[++q]=e.y),l=n.series.visible;return l?this.chart.renderer.crispLine(b,this.graphic.strokeWidth()):null},shouldBeDrawn:function(){return d.shouldBeDrawn.call(this)||!!this.options.d},render:function(b){var c=this.options,a=this.attrsFromOptions(c);this.graphic=this.annotation.chart.renderer.path(["M",0,0]).attr(a).add(b);c.className&&this.graphic.addClass(c.className);this.tracker=this.annotation.chart.renderer.path(["M",
0,0]).addClass("highcharts-tracker-line").attr({zIndex:2}).add(b);this.annotation.chart.styledMode||this.tracker.attr({"stroke-linejoin":"round",stroke:g,fill:g,"stroke-width":this.graphic.strokeWidth()+2*c.snap});d.render.call(this);p(this.graphic,{markerStartSetter:m.markerStartSetter,markerEndSetter:m.markerEndSetter});this.setMarkers(this)},redraw:function(b){var c=this.toD(),a=b?"animate":"attr";c?(this.graphic[a]({d:c}),this.tracker[a]({d:c})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"}));
this.graphic.placed=this.tracker.placed=!!c;d.redraw.call(this,b)}});return k});r(d,"annotations/controllable/ControllableRect.js",[d["parts/Utilities.js"],d["annotations/controllable/controllableMixin.js"],d["annotations/controllable/ControllablePath.js"]],function(d,b,u){d=d.merge;var k=function(b,g,f){this.init(b,g,f);this.collection="shapes"};k.attrsMap=d(u.attrsMap,{width:"width",height:"height"});d(!0,k.prototype,b,{type:"rect",translate:b.translateShape,render:function(d){var g=this.attrsFromOptions(this.options);
this.graphic=this.annotation.chart.renderer.rect(0,-9E9,0,0).attr(g).add(d);b.render.call(this)},redraw:function(d){var g=this.anchor(this.points[0]).absolutePosition;if(g)this.graphic[d?"animate":"attr"]({x:g.x,y:g.y,width:this.options.width,height:this.options.height});else this.attr({x:0,y:-9E9});this.graphic.placed=!!g;b.redraw.call(this,d)}});return k});r(d,"annotations/controllable/ControllableCircle.js",[d["parts/Utilities.js"],d["annotations/controllable/controllableMixin.js"],d["annotations/controllable/ControllablePath.js"]],
function(d,b,u){d=d.merge;var k=function(b,d,f){this.init(b,d,f);this.collection="shapes"};k.attrsMap=d(u.attrsMap,{r:"r"});d(!0,k.prototype,b,{type:"circle",translate:b.translateShape,render:function(d){var g=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9E9,0).attr(g).add(d);b.render.call(this)},redraw:function(d){var g=this.anchor(this.points[0]).absolutePosition;if(g)this.graphic[d?"animate":"attr"]({x:g.x,y:g.y,r:this.options.r});else this.graphic.attr({x:0,
y:-9E9});this.graphic.placed=!!g;b.redraw.call(this,d)},setRadius:function(b){this.options.r=b}});return k});r(d,"annotations/controllable/ControllableLabel.js",[d["parts/Globals.js"],d["parts/Utilities.js"],d["annotations/controllable/controllableMixin.js"],d["annotations/MockPoint.js"],d["parts/Tooltip.js"]],function(d,b,u,m,p){var g=b.extend,f=b.format,c=b.isNumber,a=b.merge,l=b.pick,n=function(c,a,b){this.init(c,a,b);this.collection="labels"};n.shapesWithoutBackground=["connector"];n.alignedPosition=
function(c,a){var e=c.align,b=c.verticalAlign,h=(a.x||0)+(c.x||0),l=(a.y||0)+(c.y||0),n,d;"right"===e?n=1:"center"===e&&(n=2);n&&(h+=(a.width-(c.width||0))/n);"bottom"===b?d=1:"middle"===b&&(d=2);d&&(l+=(a.height-(c.height||0))/d);return{x:Math.round(h),y:Math.round(l)}};n.justifiedOptions=function(c,a,b,l){var e=b.align,h=b.verticalAlign,n=a.box?0:a.padding||0,q=a.getBBox();a={align:e,verticalAlign:h,x:b.x,y:b.y,width:a.width,height:a.height};b=l.x-c.plotLeft;var d=l.y-c.plotTop;l=b+n;0>l&&("right"===
e?a.align="left":a.x=-l);l=b+q.width-n;l>c.plotWidth&&("left"===e?a.align="right":a.x=c.plotWidth-l);l=d+n;0>l&&("bottom"===h?a.verticalAlign="top":a.y=-l);l=d+q.height-n;l>c.plotHeight&&("top"===h?a.verticalAlign="bottom":a.y=c.plotHeight-l);return a};n.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"};a(!0,n.prototype,u,{translatePoint:function(c,a){u.translatePoint.call(this,c,a,0)},translate:function(c,a){var b=
this.annotation.chart,e=this.annotation.userOptions,h=b.annotations.indexOf(this.annotation);h=b.options.annotations[h];b.inverted&&(b=c,c=a,a=b);this.options.x+=c;this.options.y+=a;h[this.collection][this.index].x=this.options.x;h[this.collection][this.index].y=this.options.y;e[this.collection][this.index].x=this.options.x;e[this.collection][this.index].y=this.options.y},render:function(c){var a=this.options,b=this.attrsFromOptions(a),e=a.style;this.graphic=this.annotation.chart.renderer.label("",
0,-9999,a.shape,null,null,a.useHTML,null,"annotation-label").attr(b).add(c);this.annotation.chart.styledMode||("contrast"===e.color&&(e.color=this.annotation.chart.renderer.getContrast(-1<n.shapesWithoutBackground.indexOf(a.shape)?"#FFFFFF":a.backgroundColor)),this.graphic.css(a.style).shadow(a.shadow));a.className&&this.graphic.addClass(a.className);this.graphic.labelrank=a.labelrank;u.render.call(this)},redraw:function(c){var a=this.options,b=this.text||a.format||a.text,e=this.graphic,l=this.points[0];
e.attr({text:b?f(b,l.getLabelConfig(),this.annotation.chart):a.formatter.call(l,this)});a=this.anchor(l);(b=this.position(a))?(e.alignAttr=b,b.anchorX=a.absolutePosition.x,b.anchorY=a.absolutePosition.y,e[c?"animate":"attr"](b)):e.attr({x:0,y:-9999});e.placed=!!b;u.redraw.call(this,c)},anchor:function(){var a=u.anchor.apply(this,arguments),c=this.options.x||0,b=this.options.y||0;a.absolutePosition.x-=c;a.absolutePosition.y-=b;a.relativePosition.x-=c;a.relativePosition.y-=b;return a},position:function(a){var c=
this.graphic,b=this.annotation.chart,e=this.points[0],d=this.options,f=a.absolutePosition,k=a.relativePosition;if(a=e.series.visible&&m.prototype.isInsidePane.call(e)){if(d.distance)var t=p.prototype.getPosition.call({chart:b,distance:l(d.distance,16)},c.width,c.height,{plotX:k.x,plotY:k.y,negative:e.negative,ttBelow:e.ttBelow,h:k.height||k.width});else d.positioner?t=d.positioner.call(this):(e={x:f.x,y:f.y,width:0,height:0},t=n.alignedPosition(g(d,{width:c.width,height:c.height}),e),"justify"===
this.options.overflow&&(t=n.alignedPosition(n.justifiedOptions(b,c,d,t),e)));d.crop&&(d=t.x-b.plotLeft,e=t.y-b.plotTop,a=b.isInsidePlot(d,e)&&b.isInsidePlot(d+c.width,e+c.height))}return a?t:null}});d.SVGRenderer.prototype.symbols.connector=function(a,b,l,n,d){var e=d&&d.anchorX;d=d&&d.anchorY;var h=l/2;if(c(e)&&c(d)){var f=["M",e,d];var g=b-d;0>g&&(g=-n-g);g<l&&(h=e<a+l/2?g:l-g);d>b+n?f.push("L",a+h,b+n):d<b?f.push("L",a+h,b):e<a?f.push("L",a,b+n/2):e>a+l&&f.push("L",a+l,b+n/2)}return f||[]};return n});
r(d,"annotations/controllable/ControllableImage.js",[d["parts/Utilities.js"],d["annotations/controllable/controllableMixin.js"],d["annotations/controllable/ControllableLabel.js"]],function(d,b,u){d=d.merge;var k=function(b,d,f){this.init(b,d,f);this.collection="shapes"};k.attrsMap={width:"width",height:"height",zIndex:"zIndex"};d(!0,k.prototype,b,{type:"image",translate:b.translateShape,render:function(d){var g=this.attrsFromOptions(this.options),f=this.options;this.graphic=this.annotation.chart.renderer.image(f.src,
0,-9E9,f.width,f.height).attr(g).add(d);this.graphic.width=f.width;this.graphic.height=f.height;b.render.call(this)},redraw:function(d){var g=this.anchor(this.points[0]);if(g=u.prototype.position.call(this,g))this.graphic[d?"animate":"attr"]({x:g.x,y:g.y});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!g;b.redraw.call(this,d)}});return k});r(d,"annotations/annotations.btx.js",[d["parts/Globals.js"],d["parts/Utilities.js"],d["annotations/controllable/controllableMixin.js"],d["annotations/controllable/ControllableRect.js"],
d["annotations/controllable/ControllableCircle.js"],d["annotations/controllable/ControllablePath.js"],d["annotations/controllable/ControllableImage.js"],d["annotations/controllable/ControllableLabel.js"],d["annotations/eventEmitterMixin.js"],d["annotations/MockPoint.js"],d["annotations/ControlPoint.js"]],function(d,b,u,m,p,g,f,c,a,l,n){var e=b.addEvent,h=b.defined,q=b.destroyObjectProperties,k=b.erase,C=b.extend,w=b.find,x=b.merge,t=b.pick,z=b.splat;b=b.wrap;var A=d.fireEvent,D=d.reduce,B=d.Chart.prototype,
y=d.Annotation=function(a,c){this.chart=a;this.points=[];this.controlPoints=[];this.coll="annotations";this.labels=[];this.shapes=[];this.options=x(this.defaultOptions,c);this.userOptions=c;c=this.getLabelsAndShapesOptions(this.options,c);this.options.labels=c.labels;this.options.shapes=c.shapes;this.init(a,this.options)};x(!0,y.prototype,u,a,{nonDOMEvents:["add","afterUpdate","drag","remove"],defaultOptions:{visible:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",
borderColor:"black",borderRadius:3,borderWidth:1,className:"",crop:!1,formatter:function(){return h(this.y)?this.y:"Annotation label"},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:"black","stroke-width":2,fill:"white"},
visible:!1,events:{}},events:{},zIndex:6},init:function(){this.linkPoints();this.addControlPoints();this.addShapes();this.addLabels();this.addClipPaths();this.setLabelCollector()},getLabelsAndShapesOptions:function(a,c){var b={};["labels","shapes"].forEach(function(e){a[e]&&(b[e]=z(c[e]).map(function(c,b){return x(a[e][b],c)}))});return b},addShapes:function(){(this.options.shapes||[]).forEach(function(a,c){a=this.initShape(a,c);x(!0,this.options.shapes[c],a.options)},this)},addLabels:function(){(this.options.labels||
[]).forEach(function(a,c){a=this.initLabel(a,c);x(!0,this.options.labels[c],a.options)},this)},addClipPaths:function(){this.setClipAxes();this.clipXAxis&&this.clipYAxis&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))},setClipAxes:function(){var a=this.chart.xAxis,c=this.chart.yAxis,b=D((this.options.labels||[]).concat(this.options.shapes||[]),function(b,e){return[a[e&&e.point&&e.point.xAxis]||b[0],c[e&&e.point&&e.point.yAxis]||b[1]]},[]);this.clipXAxis=b[0];this.clipYAxis=b[1]},getClipBox:function(){return{x:this.clipXAxis.left,
y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}},setLabelCollector:function(){var a=this;a.labelCollector=function(){return a.labels.reduce(function(a,c){c.options.allowOverlap||a.push(c.graphic);return a},[])};a.chart.labelCollectors.push(a.labelCollector)},setOptions:function(a){this.options=x(this.defaultOptions,a)},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);u.redraw.call(this,a)},redrawItems:function(a,c){for(var b=a.length;b--;)this.redrawItem(a[b],c)},render:function(){var a=this.chart.renderer;this.graphic=a.g("annotation").attr({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.clipRect&&this.graphic.clip(this.clipRect);
this.addEvents();u.render.call(this)},setVisibility:function(a){var c=this.options;a=t(a,!c.visible);this.graphic.attr("visibility",a?"visible":"hidden");a||this.setControlPointsVisibility(!1);c.visible=a},setControlPointsVisibility:function(a){var c=function(c){c.setControlPointsVisibility(a)};u.setControlPointsVisibility.call(this,a);this.shapes.forEach(c);this.labels.forEach(c)},destroy:function(){var c=this.chart,b=function(a){a.destroy()};this.labels.forEach(b);this.shapes.forEach(b);this.clipYAxis=
this.clipXAxis=null;k(c.labelCollectors,this.labelCollector);a.destroy.call(this);u.destroy.call(this);q(this,c)},remove:function(){return this.chart.removeAnnotation(this)},update:function(a){var c=this.chart,b=this.getLabelsAndShapesOptions(this.userOptions,a),e=c.annotations.indexOf(this);a=x(!0,this.userOptions,a);a.labels=b.labels;a.shapes=b.shapes;this.destroy();this.constructor(c,a);c.options.annotations[e]=a;this.isUpdating=!0;this.redraw();this.isUpdating=!1;A(this,"afterUpdate")},initShape:function(a,
c){a=x(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},a);c=new y.shapesMap[a.type](this,a,c);c.itemType="shape";this.shapes.push(c);return c},initLabel:function(a,b){a=x(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},a);b=new c(this,a,b);b.itemType="label";this.labels.push(b);return b},redrawItem:function(a,c){a.linkPoints();a.shouldBeDrawn()?(a.graphic||this.renderItem(a),a.redraw(t(c,!0)&&a.graphic.placed),a.points.length&&this.adjustVisibility(a)):
this.destroyItem(a)},adjustVisibility:function(a){var c=!1,b=a.graphic;a.points.forEach(function(a){!1!==a.series.visible&&!1!==a.visible&&(c=!0)});c?"hidden"===b.visibility&&b.show():b.hide()},destroyItem:function(a){k(this[a.itemType+"s"],a);a.destroy()},renderItem:function(a){a.render("label"===a.itemType?this.labelsGroup:this.shapesGroup)}});y.shapesMap={rect:m,circle:p,path:g,image:f};y.types={};y.MockPoint=l;y.ControlPoint=n;d.extendAnnotation=function(a,c,b,e){c=c||y;x(!0,a.prototype,c.prototype,
b);a.prototype.defaultOptions=x(a.prototype.defaultOptions,e||{})};C(B,{initAnnotation:function(a){a=new (y.types[a.type]||y)(this,a);this.annotations.push(a);return a},addAnnotation:function(a,c){a=this.initAnnotation(a);this.options.annotations.push(a.options);t(c,!0)&&a.redraw();return a},removeAnnotation:function(a){var c=this.annotations,b="annotations"===a.coll?a:w(c,function(c){return c.options.id===a});b&&(A(b,"remove"),k(this.options.annotations,b.options),k(c,b),b.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox);
this.annotations.forEach(function(a){a.redraw()})}});B.collectionsWithUpdate.push("annotations");B.collectionsWithInit.annotations=[B.addAnnotation];B.callbacks.push(function(a){a.annotations=[];a.options.annotations||(a.options.annotations=[]);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(c,b){c=a.initAnnotation(c);a.options.annotations[b]=c.options});a.drawAnnotations();
e(a,"redraw",a.drawAnnotations);e(a,"destroy",function(){a.plotBoxClip.destroy();a.controlPointsGroup.destroy()})});b(d.Pointer.prototype,"onContainerMouseDown",function(a){this.chart.hasDraggedAnnotation||a.apply(this,Array.prototype.slice.call(arguments,1))})});r(d,"annotations/types/CrookedLine.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge,m=d.Annotation,p=m.MockPoint,g=m.ControlPoint;b=function(){m.apply(this,arguments)};d.extendAnnotation(b,null,{setClipAxes:function(){this.clipXAxis=
this.chart.xAxis[this.options.typeOptions.xAxis];this.clipYAxis=this.chart.yAxis[this.options.typeOptions.yAxis]},getPointsOptions:function(){var b=this.options.typeOptions;return b.points.map(function(c){c.xAxis=b.xAxis;c.yAxis=b.yAxis;return c})},getControlPointsOptions:function(){return this.getPointsOptions()},addControlPoints:function(){this.getControlPointsOptions().forEach(function(b,c){c=new g(this.chart,this,k(this.options.controlPointOptions,b.controlPoint),c);this.controlPoints.push(c);
b.controlPoint=c.options},this)},addShapes:function(){var b=this.options.typeOptions,c=this.initShape(k(b.line,{type:"path",points:this.points.map(function(a,c){return function(a){return a.annotation.points[c]}})}),!1);b.line=c.options}},{typeOptions:{xAxis:0,yAxis:0,line:{fill:"none"}},controlPointOptions:{positioner:function(b){var c=this.graphic;b=p.pointToPixels(b.points[this.index]);return{x:b.x-c.width/2,y:b.y-c.height/2}},events:{drag:function(b,c){c.chart.isInsidePlot(b.chartX-c.chart.plotLeft,
b.chartY-c.chart.plotTop)&&(b=this.mouseMoveToTranslation(b),c.translatePoint(b.x,b.y,this.index),c.options.typeOptions.points[this.index].x=c.points[this.index].x,c.options.typeOptions.points[this.index].y=c.points[this.index].y,c.redraw(!1))}}}});return m.types.crookedLine=b});r(d,"annotations/types/ElliottWave.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge;b=d.Annotation;var m=b.types.crookedLine,p=function(){m.apply(this,arguments)};d.extendAnnotation(p,m,{addLabels:function(){this.getPointsOptions().forEach(function(b,
d){var c=this.initLabel(k(b.label,{text:this.options.typeOptions.labels[d],point:function(a){return a.annotation.points[d]}}),!1);b.label=c.options},this)}},{typeOptions:{labels:"(0) (A) (B) (C) (D) (E)".split(" "),line:{strokeWidth:1}},labelOptions:{align:"center",allowOverlap:!0,crop:!0,overflow:"none",type:"rect",backgroundColor:"none",borderWidth:0,y:-5}});return b.types.elliottWave=p});r(d,"annotations/types/Tunnel.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge;
b=d.Annotation;var m=b.types.crookedLine,p=b.ControlPoint,g=b.MockPoint,f=function(){m.apply(this,arguments)};d.extendAnnotation(f,m,{getPointsOptions:function(){var c=m.prototype.getPointsOptions.call(this);c[2]=this.heightPointOptions(c[1]);c[3]=this.heightPointOptions(c[0]);return c},getControlPointsOptions:function(){return this.getPointsOptions().slice(0,2)},heightPointOptions:function(c){c=k(c);c.y+=this.options.typeOptions.height;return c},addControlPoints:function(){m.prototype.addControlPoints.call(this);
var c=this.options,a=new p(this.chart,this,k(c.controlPointOptions,c.typeOptions.heightControlPoint),2);this.controlPoints.push(a);c.typeOptions.heightControlPoint=a.options},addShapes:function(){this.addLine();this.addBackground()},addLine:function(){var c=this.initShape(k(this.options.typeOptions.line,{type:"path",points:[this.points[0],this.points[1],function(a){a=g.pointToOptions(a.annotation.points[2]);a.command="M";return a},this.points[3]]}),!1);this.options.typeOptions.line=c.options},addBackground:function(){var c=
this.initShape(k(this.options.typeOptions.background,{type:"path",points:this.points.slice()}));this.options.typeOptions.background=c.options},translateSide:function(c,a,b){b=Number(b);var d=0===b?3:2;this.translatePoint(c,a,b);this.translatePoint(c,a,d)},translateHeight:function(c){this.translatePoint(0,c,2);this.translatePoint(0,c,3);this.options.typeOptions.height=this.points[3].y-this.points[0].y}},{typeOptions:{xAxis:0,yAxis:0,background:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0},line:{strokeWidth:1},
height:-2,heightControlPoint:{positioner:function(c){var a=g.pointToPixels(c.points[2]);c=g.pointToPixels(c.points[3]);var b=(a.x+c.x)/2;return{x:b-this.graphic.width/2,y:(c.y-a.y)/(c.x-a.x)*(b-a.x)+a.y-this.graphic.height/2}},events:{drag:function(c,a){a.chart.isInsidePlot(c.chartX-a.chart.plotLeft,c.chartY-a.chart.plotTop)&&(a.translateHeight(this.mouseMoveToTranslation(c).y),a.redraw(!1))}}}},controlPointOptions:{events:{drag:function(c,a){a.chart.isInsidePlot(c.chartX-a.chart.plotLeft,c.chartY-
a.chart.plotTop)&&(c=this.mouseMoveToTranslation(c),a.translateSide(c.x,c.y,this.index),a.redraw(!1))}}}});return b.types.tunnel=f});r(d,"annotations/types/InfinityLine.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge;b=d.Annotation;var m=b.MockPoint,p=b.types.crookedLine,g=function(){p.apply(this,arguments)};g.findEdgeCoordinate=function(c,a,b,d){var e="x"===b?"y":"x";return(a[b]-c[b])*(d-c[e])/(a[e]-c[e])+c[b]};g.findEdgePoint=function(c,a){var b=c.series.xAxis,d=
a.series.yAxis,e=m.pointToPixels(c),h=m.pointToPixels(a),q=h.x-e.x,k=h.y-e.y;a=b.left;var f=a+b.width;b=d.top;d=b+d.height;var w=0>q?a:f,p=0>k?b:d;f={x:0===q?e.x:w,y:0===k?e.y:p};0!==q&&0!==k&&(q=g.findEdgeCoordinate(e,h,"y",w),e=g.findEdgeCoordinate(e,h,"x",p),q>=b&&q<=d?(f.x=w,f.y=q):(f.x=e,f.y=p));f.x-=a;f.y-=b;c.series.chart.inverted&&(c=f.x,f.x=f.y,f.y=c);return f};var f=function(c,a){return function(b){b=b.annotation;var d=b.points,e=b.options.typeOptions.type;"horizontalLine"===e?d=[d[0],new m(b.chart,
d[0].target,{x:d[0].x+1,y:d[0].y,xAxis:d[0].options.xAxis,yAxis:d[0].options.yAxis})]:"verticalLine"===e&&(d=[d[0],new m(b.chart,d[0].target,{x:d[0].x,y:d[0].y+1,xAxis:d[0].options.xAxis,yAxis:d[0].options.yAxis})]);return g.findEdgePoint(d[c],d[a])}};g.endEdgePoint=f(0,1);g.startEdgePoint=f(1,0);d.extendAnnotation(g,p,{addShapes:function(){var c=this.options.typeOptions,a=[this.points[0],g.endEdgePoint];c.type.match(/Line/g)&&(a[0]=g.startEdgePoint);a=this.initShape(k(c.line,{type:"path",points:a}),
!1);c.line=a.options}});return b.types.infinityLine=g});r(d,"annotations/types/Fibonacci.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge;b=d.Annotation;var m=b.MockPoint,p=b.types.tunnel,g=function(c,a){return function(){var b=this.annotation,d=this.anchor(b.startRetracements[c]).absolutePosition,e=this.anchor(b.endRetracements[c]).absolutePosition;d=["M",Math.round(d.x),Math.round(d.y),"L",Math.round(e.x),Math.round(e.y)];a&&(e=this.anchor(b.endRetracements[c-1]).absolutePosition,
b=this.anchor(b.startRetracements[c-1]).absolutePosition,d.push("L",Math.round(e.x),Math.round(e.y),"L",Math.round(b.x),Math.round(b.y)));return d}},f=function(){this.startRetracements=[];this.endRetracements=[];p.apply(this,arguments)};f.levels=[0,.236,.382,.5,.618,.786,1];d.extendAnnotation(f,p,{linkPoints:function(){p.prototype.linkPoints.call(this);this.linkRetracementsPoints()},linkRetracementsPoints:function(){var c=this.points,a=c[0].y-c[3].y,b=c[1].y-c[2].y,d=c[0].x,e=c[1].x;f.levels.forEach(function(h,
l){var n=c[1].y-b*h;this.linkRetracementPoint(l,d,c[0].y-a*h,this.startRetracements);this.linkRetracementPoint(l,e,n,this.endRetracements)},this)},linkRetracementPoint:function(c,a,b,d){var e=d[c],h=this.options.typeOptions;e?(e.options.x=a,e.options.y=b,e.refresh()):d[c]=new m(this.chart,this,{x:a,y:b,xAxis:h.xAxis,yAxis:h.yAxis})},addShapes:function(){f.levels.forEach(function(c,a){this.initShape({type:"path",d:g(a)},!1);0<a&&this.initShape({type:"path",fill:this.options.typeOptions.backgroundColors[a-
1],strokeWidth:0,d:g(a,!0)})},this)},addLabels:function(){f.levels.forEach(function(c,a){var b=this.options.typeOptions;c=this.initLabel(k(b.labels[a],{point:function(c){return m.pointToOptions(c.annotation.startRetracements[a])},text:c.toString()}));b.labels[a]=c.options},this)}},{typeOptions:{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)".split(";"),lineColor:"grey",
lineColors:[],labels:[]},labelOptions:{allowOverlap:!0,align:"right",backgroundColor:"none",borderWidth:0,crop:!1,overflow:"none",shape:"rect",style:{color:"grey"},verticalAlign:"middle",y:0}});return b.types.fibonacci=f});r(d,"annotations/types/Pitchfork.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge;b=d.Annotation;var m=b.MockPoint,p=b.types.infinityLine,g=function(){p.apply(this,arguments)};g.findEdgePoint=function(c,a,b){a=Math.atan2(b.plotY-a.plotY,b.plotX-a.plotX);
return{x:c.plotX+1E7*Math.cos(a),y:c.plotY+1E7*Math.sin(a)}};g.middleLineEdgePoint=function(c){var a=c.annotation;return p.findEdgePoint(a.points[0],new m(a.chart,c,a.midPointOptions()))};var f=function(c){return function(a){var b=a.annotation,d=b.points;return g.findEdgePoint(d[c],d[0],new m(b.chart,a,b.midPointOptions()))}};g.topLineEdgePoint=f(1);g.bottomLineEdgePoint=f(0);d.extendAnnotation(g,p,{midPointOptions:function(){var c=this.points;return{x:(c[1].x+c[2].x)/2,y:(c[1].y+c[2].y)/2,xAxis:c[0].series.xAxis,
yAxis:c[0].series.yAxis}},addShapes:function(){this.addLines();this.addBackgrounds()},addLines:function(){this.initShape({type:"path",points:[this.points[0],g.middleLineEdgePoint]},!1);this.initShape({type:"path",points:[this.points[1],g.topLineEdgePoint]},!1);this.initShape({type:"path",points:[this.points[2],g.bottomLineEdgePoint]},!1)},addBackgrounds:function(){var c=this.shapes,a=this.options.typeOptions,b=this.initShape(k(a.innerBackground,{type:"path",points:[function(a){var c=a.annotation;
a=c.points;c=c.midPointOptions();return{x:(a[1].x+c.x)/2,y:(a[1].y+c.y)/2,xAxis:c.xAxis,yAxis:c.yAxis}},c[1].points[1],c[2].points[1],function(a){var c=a.annotation;a=c.points;c=c.midPointOptions();return{x:(c.x+a[2].x)/2,y:(c.y+a[2].y)/2,xAxis:c.xAxis,yAxis:c.yAxis}}]}));c=this.initShape(k(a.outerBackground,{type:"path",points:[this.points[1],c[1].points[1],c[2].points[1],this.points[2]]}));a.innerBackground=b.options;a.outerBackground=c.options}},{typeOptions:{innerBackground:{fill:"rgba(130, 170, 255, 0.4)",
strokeWidth:0},outerBackground:{fill:"rgba(156, 229, 161, 0.4)",strokeWidth:0}}});return b.types.pitchfork=g});r(d,"annotations/types/VerticalLine.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.merge;b=d.Annotation;var m=b.MockPoint,p=function(){d.Annotation.apply(this,arguments)};p.connectorFirstPoint=function(b){b=b.annotation;var d=b.points[0],c=m.pointToPixels(d,!0),a=c.y,l=b.options.typeOptions.label.offset;b.chart.inverted&&(a=c.x);return{x:d.x,xAxis:d.series.xAxis,
y:a+l}};p.connectorSecondPoint=function(b){var d=b.annotation;b=d.options.typeOptions;var c=d.points[0],a=b.yOffset;d=m.pointToPixels(c,!0)[d.chart.inverted?"x":"y"];0>b.label.offset&&(a*=-1);return{x:c.x,xAxis:c.series.xAxis,y:d+a}};d.extendAnnotation(p,null,{getPointsOptions:function(){return[this.options.typeOptions.point]},addShapes:function(){var b=this.options.typeOptions,d=this.initShape(k(b.connector,{type:"path",points:[p.connectorFirstPoint,p.connectorSecondPoint]}),!1);b.connector=d.options},
addLabels:function(){var b=this.options.typeOptions,d=b.label,c=0,a=d.offset,l=0>d.offset?"bottom":"top",n="center";this.chart.inverted&&(c=d.offset,a=0,l="middle",n=0>d.offset?"right":"left");d=this.initLabel(k(d,{verticalAlign:l,align:n,x:c,y:a}));b.label=d.options}},{typeOptions:{yOffset:10,label:{offset:-40,point:function(b){return b.annotation.points[0]},allowOverlap:!0,backgroundColor:"none",borderWidth:0,crop:!0,overflow:"none",shape:"rect",text:"{y:.2f}"},connector:{strokeWidth:1,markerEnd:"arrow"}}});
return b.types.verticalLine=p});r(d,"annotations/types/Measure.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.extend,m=b.isNumber,p=b.merge,g=d.Annotation,f=g.ControlPoint;b=function(){g.apply(this,arguments)};g.types.measure=b;d.extendAnnotation(b,null,{init:function(){g.prototype.init.apply(this,arguments);this.resizeY=this.resizeX=this.offsetY=this.offsetX=0;this.calculations.init.call(this);this.addValues();this.addShapes()},setClipAxes:function(){this.clipXAxis=this.chart.xAxis[this.options.typeOptions.xAxis];
this.clipYAxis=this.chart.yAxis[this.options.typeOptions.yAxis]},pointsOptions:function(){return this.options.points},shapePointsOptions:function(){var c=this.options.typeOptions,a=c.xAxis;c=c.yAxis;return[{x:this.xAxisMin,y:this.yAxisMin,xAxis:a,yAxis:c},{x:this.xAxisMax,y:this.yAxisMin,xAxis:a,yAxis:c},{x:this.xAxisMax,y:this.yAxisMax,xAxis:a,yAxis:c},{x:this.xAxisMin,y:this.yAxisMax,xAxis:a,yAxis:c}]},addControlPoints:function(){var c=this.options.typeOptions.selectType;var a=new f(this.chart,
this,this.options.controlPointOptions,0);this.controlPoints.push(a);"xy"!==c&&(a=new f(this.chart,this,this.options.controlPointOptions,1),this.controlPoints.push(a))},addValues:function(c){var a=this.options.typeOptions,b=a.label.formatter;this.calculations.recalculate.call(this,c);a.label.enabled&&(0<this.labels.length?this.labels[0].text=b&&b.call(this)||this.calculations.defaultFormatter.call(this):this.initLabel(k({shape:"rect",backgroundColor:"none",color:"black",borderWidth:0,dashStyle:"dash",
overflow:"none",align:"left",vertical:"top",crop:!0,point:function(c){c=c.annotation;var b=c.chart,d=b.inverted,l=b.yAxis[a.yAxis],k=b.plotTop,n=b.plotLeft;return{x:(d?k:10)+b.xAxis[a.xAxis].toPixels(c.xAxisMin,!d),y:(d?-n+10:k)+l.toPixels(c.yAxisMin)}},text:b&&b.call(this)||this.calculations.defaultFormatter.call(this)},a.label)))},addShapes:function(){this.addCrosshairs();this.addBackground()},addBackground:function(){"undefined"!==typeof this.shapePointsOptions()[0].x&&this.initShape(k({type:"path",
points:this.shapePointsOptions()},this.options.typeOptions.background),!1)},addCrosshairs:function(){var c=this.chart,a=this.options.typeOptions,b=this.options.typeOptions.point,d=c.xAxis[a.xAxis],e=c.yAxis[a.yAxis],h=c.inverted;c=d.toPixels(this.xAxisMin);d=d.toPixels(this.xAxisMax);var q=e.toPixels(this.yAxisMin),f=e.toPixels(this.yAxisMax),g={point:b,type:"path"};b=[];e=[];h&&(h=c,c=q,q=h,h=d,d=f,f=h);a.crosshairX.enabled&&(b=["M",c,q+(f-q)/2,"L",d,q+(f-q)/2]);a.crosshairY.enabled&&(e=["M",c+(d-
c)/2,q,"L",c+(d-c)/2,f]);0<this.shapes.length?(this.shapes[0].options.d=b,this.shapes[1].options.d=e):(c=p(g,a.crosshairX),a=p(g,a.crosshairY),this.initShape(k({d:b},c),!1),this.initShape(k({d:e},a),!1))},onDrag:function(c){var a=this.mouseMoveToTranslation(c),b=this.options.typeOptions.selectType;c="y"===b?0:a.x;a="x"===b?0:a.y;this.translate(c,a);this.offsetX+=c;this.offsetY+=a;this.redraw(!1,!1,!0)},resize:function(c,a,b,d){var e=this.shapes[2];"x"===d?0===b?(e.translatePoint(c,0,0),e.translatePoint(c,
a,3)):(e.translatePoint(c,0,1),e.translatePoint(c,a,2)):"y"===d?0===b?(e.translatePoint(0,a,0),e.translatePoint(0,a,1)):(e.translatePoint(0,a,2),e.translatePoint(0,a,3)):(e.translatePoint(c,0,1),e.translatePoint(c,a,2),e.translatePoint(0,a,3));this.calculations.updateStartPoints.call(this,!1,!0,b,c,a);this.options.typeOptions.background.height=Math.abs(this.startYMax-this.startYMin);this.options.typeOptions.background.width=Math.abs(this.startXMax-this.startXMin)},redraw:function(c,a,b){this.linkPoints();
this.graphic||this.render();b&&this.calculations.updateStartPoints.call(this,!0,!1);this.clipRect&&this.clipRect.animate(this.getClipBox());this.addValues(a);this.addCrosshairs();this.redrawItems(this.shapes,c);this.redrawItems(this.labels,c);this.controlPoints.forEach(function(a){a.redraw()})},translate:function(c,a){this.shapes.forEach(function(b){b.translate(c,a)});this.options.typeOptions.point.x=this.startXMin;this.options.typeOptions.point.y=this.startYMin},calculations:{init:function(){var c=
this.options.typeOptions,a=this.chart,b=this.calculations.getPointPos,d=a.inverted,e=a.xAxis[c.xAxis],h=a.yAxis[c.yAxis],k=c.background,f=d?k.height:k.width;k=d?k.width:k.height;var g=c.selectType,w=d?a.plotLeft:a.plotTop;a=d?a.plotTop:a.plotLeft;this.startXMin=c.point.x;this.startYMin=c.point.y;m(f)?this.startXMax=this.startXMin+f:this.startXMax=b(e,this.startXMin,parseFloat(f));m(k)?this.startYMax=this.startYMin-k:this.startYMax=b(h,this.startYMin,parseFloat(k));"x"===g?(this.startYMin=h.toValue(w),
this.startYMax=h.toValue(w+h.len)):"y"===g&&(this.startXMin=e.toValue(a),this.startXMax=e.toValue(a+e.len))},recalculate:function(c){var a=this.calculations,b=this.options.typeOptions,d=this.chart.xAxis[b.xAxis];b=this.chart.yAxis[b.yAxis];var e=this.calculations.getPointPos,h=this.offsetX,k=this.offsetY;this.xAxisMin=e(d,this.startXMin,h);this.xAxisMax=e(d,this.startXMax,h);this.yAxisMin=e(b,this.startYMin,k);this.yAxisMax=e(b,this.startYMax,k);this.min=a.min.call(this);this.max=a.max.call(this);
this.average=a.average.call(this);this.bins=a.bins.call(this);c&&this.resize(0,0)},getPointPos:function(c,a,b){return c.toValue(c.toPixels(a)+b)},updateStartPoints:function(c,a,b,d,e){var h=this.options.typeOptions,k=h.selectType,l=this.chart.xAxis[h.xAxis];h=this.chart.yAxis[h.yAxis];var f=this.calculations.getPointPos,g=this.startXMin,n=this.startXMax,t=this.startYMin,z=this.startYMax,A=this.offsetX,D=this.offsetY;a&&("x"===k?0===b?this.startXMin=f(l,g,d):this.startXMax=f(l,n,d):"y"===k?0===b?this.startYMin=
f(h,t,e):this.startYMax=f(h,z,e):(this.startXMax=f(l,n,d),this.startYMax=f(h,z,e)));c&&(this.startXMin=f(l,g,A),this.startXMax=f(l,n,A),this.startYMin=f(h,t,D),this.startYMax=f(h,z,D),this.offsetY=this.offsetX=0)},defaultFormatter:function(){return"Min: "+this.min+"<br>Max: "+this.max+"<br>Average: "+this.average+"<br>Bins: "+this.bins},getExtremes:function(c,a,b,d){return{xAxisMin:Math.min(a,c),xAxisMax:Math.max(a,c),yAxisMin:Math.min(d,b),yAxisMax:Math.max(d,b)}},min:function(){var c=Infinity,a=
this.chart.series,b=this.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),d=!1;a.forEach(function(a){a.visible&&"highcharts-navigator-series"!==a.options.id&&a.points.forEach(function(a){!a.isNull&&a.y<c&&a.x>b.xAxisMin&&a.x<=b.xAxisMax&&a.y>b.yAxisMin&&a.y<=b.yAxisMax&&(c=a.y,d=!0)})});d||(c="");return c},max:function(){var c=-Infinity,a=this.chart.series,b=this.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),d=!1;a.forEach(function(a){a.visible&&
"highcharts-navigator-series"!==a.options.id&&a.points.forEach(function(a){!a.isNull&&a.y>c&&a.x>b.xAxisMin&&a.x<=b.xAxisMax&&a.y>b.yAxisMin&&a.y<=b.yAxisMax&&(c=a.y,d=!0)})});d||(c="");return c},average:function(){var c="";""!==this.max&&""!==this.min&&(c=(this.max+this.min)/2);return c},bins:function(){var c=0,a=this.chart.series,b=this.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),d=!1;a.forEach(function(a){a.visible&&"highcharts-navigator-series"!==a.options.id&&
a.points.forEach(function(a){!a.isNull&&a.x>b.xAxisMin&&a.x<=b.xAxisMax&&a.y>b.yAxisMin&&a.y<=b.yAxisMax&&(c++,d=!0)})});d||(c="");return c}}},{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:"11px",color:"#666666"},formatter:void 0}},controlPointOptions:{positioner:function(c){var a=
this.index,b=c.chart,d=c.options,e=d.typeOptions,h=e.selectType;d=d.controlPointOptions;var k=b.inverted,f=b.xAxis[e.xAxis];b=b.yAxis[e.yAxis];e=c.xAxisMax;var g=c.yAxisMax,m=c.calculations.getExtremes(c.xAxisMin,c.xAxisMax,c.yAxisMin,c.yAxisMax);"x"===h&&(g=(m.yAxisMax-m.yAxisMin)/2,0===a&&(e=c.xAxisMin));"y"===h&&(e=m.xAxisMin+(m.xAxisMax-m.xAxisMin)/2,0===a&&(g=c.yAxisMin));k?(c=b.toPixels(g),a=f.toPixels(e)):(c=f.toPixels(e),a=b.toPixels(g));return{x:c-d.width/2,y:a-d.height/2}},events:{drag:function(b,
a){var c=this.mouseMoveToTranslation(b);b=a.options.typeOptions.selectType;var d="y"===b?0:c.x;c="x"===b?0:c.y;a.resize(d,c,this.index,b);a.resizeX+=d;a.resizeY+=c;a.redraw(!1,!0)}}}});return g.types.measure=b});r(d,"mixins/navigation.js",[],function(){return{initUpdate:function(d){d.navigation||(d.navigation={updates:[],update:function(b,d){this.updates.forEach(function(k){k.update.call(k.context,b,d)})}})},addUpdate:function(d,b){b.navigation||this.initUpdate(b);b.navigation.updates.push({update:d,
context:b})}}});r(d,"annotations/navigationBindings.js",[d["parts/Globals.js"],d["parts/Utilities.js"],d["mixins/navigation.js"]],function(d,b,r){function k(b){var c=b.prototype.defaultOptions.events&&b.prototype.defaultOptions.events.click;q(!0,b.prototype.defaultOptions.events,{click:function(b){var d=this,e=d.chart.navigationBindings,h=e.activeAnnotation;c&&c.click.call(d,b);h!==d?(e.deselectAnnotation(),e.activeAnnotation=d,d.setControlPointsVisibility(!0),a(e,"showPopup",{annotation:d,formType:"annotation-toolbar",
options:e.annotationToFields(d),onSubmit:function(a){var b={};"remove"===a.actionType?(e.activeAnnotation=!1,e.chart.removeAnnotation(d)):(e.fieldsToOptions(a.fields,b),e.deselectAnnotation(),a=b.typeOptions,"measure"===d.options.type&&(a.crosshairY.enabled=0!==a.crosshairY.strokeWidth,a.crosshairX.enabled=0!==a.crosshairX.strokeWidth),d.update(b))}})):(e.deselectAnnotation(),a(e,"closePopup"));b.activeAnnotation=!0}})}var p=b.addEvent,g=b.attr,f=b.extend,c=b.format,a=b.fireEvent,l=b.isArray,n=b.isFunction,
e=b.isNumber,h=b.isObject,q=b.merge,v=b.objectEach,C=b.pick,w=d.doc,x=d.win;d.NavigationBindings=function(a,b){this.chart=a;this.options=b;this.eventsToUnbind=[];this.container=w.getElementsByClassName(this.options.bindingsClassName)};d.NavigationBindings.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"],verticalLine:[],label:["labelOptions"],measure:["background","crosshairY","crosshairX"],fibonacci:[],tunnel:["background","line","height"],pitchfork:["innerBackground","outerBackground"],rect:["shapes"],crookedLine:[]};
d.NavigationBindings.annotationsNonEditable={rectangle:["crosshairX","crosshairY","label"]};f(d.NavigationBindings.prototype,{initEvents:function(){var a=this,b=a.chart,c=a.container,d=a.options;a.boundClassNames={};v(d.bindings,function(b){a.boundClassNames[b.className]=b});[].forEach.call(c,function(b){a.eventsToUnbind.push(p(b,"click",function(b){var d=a.getButtonEvents(c,b);d&&a.bindingsButtonClick(d.button,d.events,b)}))});v(d.events||{},function(b,c){n(b)&&a.eventsToUnbind.push(p(a,c,b))});
a.eventsToUnbind.push(p(b.container,"click",function(c){!b.cancelClick&&b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop)&&a.bindingsChartClick(this,c)}));a.eventsToUnbind.push(p(b.container,"mousemove",function(b){a.bindingsContainerMouseMove(this,b)}))},initUpdate:function(){var a=this;r.addUpdate(function(b){a.update(b)},this.chart)},bindingsButtonClick:function(b,c,d){var e=this.chart;this.selectedButtonElement&&(a(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&
(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&e.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1));this.selectedButton=c;this.selectedButtonElement=b;a(this,"selectButton",{button:b});c.init&&c.init.call(this,b,d);(c.start||c.steps)&&e.renderer.boxWrapper.addClass("highcharts-draw-mode")},bindingsChartClick:function(b,c){b=this.chart;var d=this.selectedButton;b=b.renderer.boxWrapper;var e;if(e=this.activeAnnotation&&!c.activeAnnotation&&c.target.parentNode){a:{e=
c.target;var h=x.Element.prototype,f=h.matches||h.msMatchesSelector||h.webkitMatchesSelector,g=null;if(h.closest)g=h.closest.call(e,".highcharts-popup");else{do{if(f.call(e,".highcharts-popup"))break a;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType)}e=g}e=!e}e&&(a(this,"closePopup"),this.deselectAnnotation());d&&d.start&&(this.nextEvent?(this.nextEvent(c,this.currentUserDetails),this.steps&&(this.stepIndex++,d.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=d.steps[this.stepIndex]:
(a(this,"deselectButton",{button:this.selectedButtonElement}),b.removeClass("highcharts-draw-mode"),d.end&&d.end.call(this,c,this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1,this.selectedButton=null))):(this.currentUserDetails=d.start.call(this,c),d.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=d.steps[this.stepIndex]):(a(this,"deselectButton",{button:this.selectedButtonElement}),b.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,
d.end&&d.end.call(this,c,this.currentUserDetails))))},bindingsContainerMouseMove:function(a,b){this.mouseMoveEvent&&this.mouseMoveEvent(b,this.currentUserDetails)},fieldsToOptions:function(a,b){v(a,function(a,c){var d=parseFloat(a),h=c.split("."),f=b,g=h.length-1;!e(d)||a.match(/px/g)||c.match(/format/g)||(a=d);""!==a&&"undefined"!==a&&h.forEach(function(b,c){var d=C(h[c+1],"");g===c?f[b]=a:(f[b]||(f[b]=d.match(/\d/g)?[]:{}),f=f[b])})});return b},deselectAnnotation:function(){this.activeAnnotation&&
(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)},annotationToFields:function(a){function b(d,e,f,q){if(f&&-1===t.indexOf(e)&&(0<=(f.indexOf&&f.indexOf(e))||f[e]||!0===f))if(l(d))q[e]=[],d.forEach(function(a,c){h(a)?(q[e][c]={},v(a,function(a,d){b(a,d,g[e],q[e][c])})):b(a,0,g[e],q[e])});else if(h(d)){var m={};l(q)?(q.push(m),m[e]={},m=m[e]):q[e]=m;v(d,function(a,c){b(a,c,0===e?f:g[e],m)})}else"format"===e?q[e]=[c(d,a.labels[0].points[0]).toString(),"text"]:l(q)?q.push([d,
k(d)]):q[e]=[d,k(d)]}var e=a.options,f=d.NavigationBindings.annotationsEditable,g=f.nestedOptions,k=this.utils.getFieldType,q=C(e.type,e.shapes&&e.shapes[0]&&e.shapes[0].type,e.labels&&e.labels[0]&&e.labels[0].itemType,"label"),t=d.NavigationBindings.annotationsNonEditable[e.langKey]||[],m={langKey:e.langKey,type:q};v(e,function(a,c){"typeOptions"===c?(m[c]={},v(e[c],function(a,d){b(a,d,g,m[c],!0)})):b(a,c,f[q],m)});return m},getClickedClassNames:function(a,b){var c=b.target;b=[];for(var d;c&&((d=
g(c,"class"))&&(b=b.concat(d.split(" ").map(function(a){return[a,c]}))),c=c.parentNode,c!==a););return b},getButtonEvents:function(a,b){var c=this,d;this.getClickedClassNames(a,b).forEach(function(a){c.boundClassNames[a[0]]&&!d&&(d={events:c.boundClassNames[a[0]],button:a[1]})});return d},update:function(a){this.options=q(!0,this.options,a);this.removeEvents();this.initEvents()},removeEvents:function(){this.eventsToUnbind.forEach(function(a){a()})},destroy:function(){this.removeEvents()},utils:{updateRectSize:function(a,
b){var c=b.chart,d=b.options.typeOptions,e=c.pointer.getCoordinates(a);a=e.xAxis[0].value-d.point.x;d=d.point.y-e.yAxis[0].value;b.update({typeOptions:{background:{width:c.inverted?d:a,height:c.inverted?a:d}}})},getFieldType:function(a){return{string:"text",number:"number","boolean":"checkbox"}[typeof a]}}});d.Chart.prototype.initNavigationBindings=function(){var a=this.options;a&&a.navigation&&a.navigation.bindings&&(this.navigationBindings=new d.NavigationBindings(this,a.navigation),this.navigationBindings.initEvents(),
this.navigationBindings.initUpdate())};p(d.Chart,"load",function(){this.initNavigationBindings()});p(d.Chart,"destroy",function(){this.navigationBindings&&this.navigationBindings.destroy()});p(d.NavigationBindings,"deselectButton",function(){this.selectedButtonElement=null});p(d.Annotation,"remove",function(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()});d.Annotation&&(k(d.Annotation),v(d.Annotation.types,function(a){k(a)}));d.setOptions({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){a=this.chart.pointer.getCoordinates(a);var b=this.chart.options.navigation;return this.chart.addAnnotation(q({langKey:"circle",shapes:[{type:"circle",point:{xAxis:0,yAxis:0,x:a.xAxis[0].value,y:a.yAxis[0].value},r:5,controlPoints:[{positioner:function(a){var b=d.Annotation.MockPoint.pointToPixels(a.points[0]);a=a.options.r;return{x:b.x+a*Math.cos(Math.PI/
4)-this.graphic.width/2,y:b.y+a*Math.sin(Math.PI/4)-this.graphic.height/2}},events:{drag:function(a,b){var c=b.annotation;a=this.mouseMoveToTranslation(a);b.setRadius(Math.max(b.options.r+a.y/Math.sin(Math.PI/4),5));c.options.shapes[0]=c.userOptions.shapes[0]=b.options;b.redraw(!1)}}}]}]},b.annotationsOptions,b.bindings.circleAnnotation.annotationsOptions))},steps:[function(a,b){var c=b.options.shapes[0].point,d=this.chart.xAxis[0].toPixels(c.x);c=this.chart.yAxis[0].toPixels(c.y);var e=this.chart.inverted;
b.update({shapes:[{r:Math.max(Math.sqrt(Math.pow(e?c-a.chartX:d-a.chartX,2)+Math.pow(e?d-a.chartY:c-a.chartY,2)),5)}]})}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(a){var b=this.chart.pointer.getCoordinates(a),c=this.chart.options.navigation,e=b.xAxis[0].value;b=b.yAxis[0].value;return this.chart.addAnnotation(q({langKey:"rectangle",shapes:[{type:"path",points:[{xAxis:0,yAxis:0,x:e,y:b},{xAxis:0,yAxis:0,x:e,y:b},{xAxis:0,yAxis:0,x:e,y:b},{xAxis:0,yAxis:0,x:e,
y:b}]}],controlPoints:[{positioner:function(a){a=d.Annotation.MockPoint.pointToPixels(a.shapes[0].points[2]);return{x:a.x-4,y:a.y-4}},events:{drag:function(b){var c=this.chart.pointer.getCoordinates(a),d=c.xAxis[0].value;c=c.yAxis[0].value;var e=b.options.shapes[0].points;e[1].x=d;e[2].x=d;e[2].y=c;e[3].y=c;b.options.shapes[0].points=e;b.redraw(!1)}}}]},c.annotationsOptions,c.bindings.rectangleAnnotation.annotationsOptions))},steps:[function(a,b){var c=b.options.shapes[0].points,d=this.chart.pointer.getCoordinates(a);
a=d.xAxis[0].value;d=d.yAxis[0].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){a=this.chart.pointer.getCoordinates(a);var b=this.chart.options.navigation;return this.chart.addAnnotation(q({langKey:"label",labelOptions:{format:"{y:.2f}"},labels:[{point:{xAxis:0,yAxis:0,x:a.xAxis[0].value,y:a.yAxis[0].value},overflow:"none",crop:!0,controlPoints:[{symbol:"triangle-down",positioner:function(a){if(!a.graphic.placed)return{x:0,
y:-9E7};a=d.Annotation.MockPoint.pointToPixels(a.points[0]);return{x:a.x-this.graphic.width/2,y:a.y-this.graphic.height/2}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.translatePoint(a.x,a.y);b.annotation.labels[0].options=b.options;b.redraw(!1)}}},{symbol:"square",positioner:function(a){return a.graphic.placed?{x:a.graphic.alignAttr.x-this.graphic.width/2,y:a.graphic.alignAttr.y-this.graphic.height/2}:{x:0,y:-9E7}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.translate(a.x,
a.y);b.annotation.labels[0].options=b.options;b.redraw(!1)}}}]}]},b.annotationsOptions,b.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{}}})});r(d,"annotations/popup.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(d,b){var k=b.addEvent,m=b.createElement,p=b.defined,g=b.isArray,f=b.isObject,c=b.isString,a=b.objectEach,l=b.pick;b=b.wrap;var n=/\d/g;b(d.Pointer.prototype,"onContainerMouseDown",function(a,b){var d=b.target&&b.target.className;c(d)&&0<=d.indexOf("highcharts-popup-field")||
a.apply(this,Array.prototype.slice.call(arguments,1))});d.Popup=function(a,b){this.init(a,b)};d.Popup.prototype={init:function(a,b){this.container=m("div",{className:"highcharts-popup"},null,a);this.lang=this.getLangpack();this.iconsURL=b;this.addCloseBtn()},addCloseBtn:function(){var a=this;var b=m("div",{className:"highcharts-popup-close"},null,this.container);b.style["background-image"]="url("+this.iconsURL+"close.svg)";["click","touchstart"].forEach(function(c){k(b,c,function(){a.closePopup()})})},
addColsContainer:function(a){var b=m("div",{className:"highcharts-popup-lhs-col"},null,a);a=m("div",{className:"highcharts-popup-rhs-col"},null,a);m("div",{className:"highcharts-popup-rhs-col-wrapper"},null,a);return{lhsCol:b,rhsCol:a}},addInput:function(a,b,c,d){var e=a.split(".");e=e[e.length-1];var h=this.lang;b="highcharts-"+b+"-"+e;b.match(n)||m("label",{innerHTML:h[e]||e,htmlFor:b},null,c);m("input",{name:b,value:d[0],type:d[1],className:"highcharts-popup-field"},null,c).setAttribute("highcharts-data-name",
a)},addButton:function(a,b,c,d,f){var e=this,h=this.closePopup,g=this.getFields;var q=m("button",{innerHTML:b},null,a);["click","touchstart"].forEach(function(a){k(q,a,function(){h.call(e);return d(g(f,c))})});return q},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 f={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"))?f.seriesId=a.value:h?f.fields[h]=a.value:f.type=a.value});a&&(f.fields["params.volumeSeriesID"]=a.getAttribute("value"));return f},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(){this.popup.container.style.display="none"},showForm:function(a,b,c,d){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 d.getOptions().lang.navigation.popup},annotations:{addToolbar:function(a,
b,c){var d=this,e=this.lang,h=this.popup.container,f=this.showForm;-1===h.className.indexOf("highcharts-annotation-toolbar")&&(h.className+=" highcharts-annotation-toolbar");h.style.top=a.plotTop+10+"px";m("span",{innerHTML:l(e[b.langKey]||b.langKey,b.shapes&&b.shapes[0].type)},null,h);var g=this.addButton(h,e.removeButton||"remove","remove",c,h);g.className+=" highcharts-annotation-remove-button";g.style["background-image"]="url("+this.iconsURL+"destroy.svg)";g=this.addButton(h,e.editButton||"edit",
"edit",function(){f.call(d,"annotation-edit",a,b,c)},h);g.className+=" highcharts-annotation-edit-button";g.style["background-image"]="url("+this.iconsURL+"edit.svg)"},addForm:function(a,b,c,d){var e=this.popup.container,h=this.lang;m("h2",{innerHTML:h[b.langKey]||b.langKey,className:"highcharts-popup-main-title"},null,e);var f=m("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},null,e);var g=m("div",{className:"highcharts-popup-bottom-row"},null,e);this.annotations.addFormFields.call(this,
f,a,"",b,[],!0);this.addButton(g,d?h.addButton||"add":h.saveButton||"save",d?"add":"save",c,e)},addFormFields:function(b,c,d,k,l,p){var e=this,h=this.annotations.addFormFields,q=this.addInput,v=this.lang,w,r;a(k,function(a,k){w=""!==d?d+"."+k:k;f(a)&&(!g(a)||g(a)&&f(a[0])?(r=v[k]||k,r.match(n)||l.push([!0,r,b]),h.call(e,b,c,w,a,l,!1)):l.push([e,w,"annotation",b,a]))});p&&(l=l.sort(function(a){return a[1].match(/format/g)?-1:1}),l.forEach(function(a){!0===a[0]?m("span",{className:"highcharts-annotation-title",
innerHTML:a[1]},null,a[2]):q.apply(a[0],a.splice(1))}))}},indicators:{addForm:function(a,b,c){var d=this.indicators,e=this.lang;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(b,c,d){var e=this,h=c.querySelectorAll(".highcharts-popup-lhs-col")[0];c=c.querySelectorAll(".highcharts-popup-rhs-col")[0];var f="edit"===d,g=f?b.series:b.options.plotOptions,l=this.indicators.addFormFields,q;var n=m("ul",{className:"highcharts-indicator-list"},null,h);var p=c.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];a(g,function(a,c){var d=a.options;
if(a.params||d&&d.params){var h=e.indicators.getNameType(a,c),v=h.type;q=m("li",{className:"highcharts-indicator-list",innerHTML:h.name},null,n);["click","touchstart"].forEach(function(c){k(q,c,function(){l.call(e,b,f?a:g[v],h.type,p);f&&a.options&&m("input",{type:"hidden",name:"highcharts-id-"+v,value:a.options.id},null,p).setAttribute("highcharts-data-series-id",a.options.id)})})}});0<n.childNodes.length&&n.childNodes[0].click()},getNameType:function(a,b){var c=a.options,e=d.seriesTypes;e=e[b]&&
e[b].prototype.nameBase||b.toUpperCase();c&&c.type&&(b=a.options.type,e=a.name);return{name:e,type:b}},listAllSeries:function(a,b,c,d,f){a="highcharts-"+b+"-type-"+a;var e;m("label",{innerHTML:this.lang[b]||b,htmlFor:a},null,d);var h=m("select",{name:a,className:"highcharts-popup-field"},null,d);h.setAttribute("id","highcharts-select-"+b);c.series.forEach(function(a){e=a.options;!e.params&&e.id&&"highcharts-navigator-series"!==e.id&&m("option",{innerHTML:e.name||e.id,value:e.id},null,h)});p(f)&&(h.value=
f)},addFormFields:function(a,b,c,d){var e=b.params||b.options.params,f=this.indicators.getNameType;d.innerHTML="";m("h3",{className:"highcharts-indicator-title",innerHTML:f(b,c).name},null,d);m("input",{type:"hidden",name:"highcharts-type-"+c,value:c},null,d);this.indicators.listAllSeries.call(this,c,"series",a,d,b.linkedParent&&e.volumeSeriesID);e.volumeSeriesID&&this.indicators.listAllSeries.call(this,c,"volume",a,d,b.linkedParent&&b.linkedParent.options.id);this.indicators.addParamInputs.call(this,
a,"params",e,c,d)},addParamInputs:function(b,c,d,g,k){var e=this,h=this.indicators.addParamInputs,l=this.addInput,m;a(d,function(a,d){m=c+"."+d;f(a)?h.call(e,b,m,a,g,k):"params.volumeSeriesID"!==m&&l.call(e,m,g,k,[a,"text"])})},getAmount:function(){var b=0;a(this.series,function(a){var c=a.options;(a.params||c&&c.params)&&b++});return b}},tabs:{init:function(a){var b=this.tabs;a=this.indicators.getAmount.call(a);var c=b.addMenuItem.call(this,"add");b.addMenuItem.call(this,"edit",a);b.addContentItem.call(this,
"add");b.addContentItem.call(this,"edit");b.switchTabs.call(this,a);b.selectTab.call(this,c,0)},addMenuItem:function(a,b){var c=this.popup.container,d="highcharts-tab-item",e=this.lang;0===b&&(d+=" highcharts-tab-disabled");b=m("span",{innerHTML:e[a+"Button"]||a,className:d},null,c);b.setAttribute("highcharts-data-tab-type",a);return b},addContentItem:function(){return m("div",{className:"highcharts-tab-item-content"},null,this.popup.container)},switchTabs:function(a){var b=this,c;this.popup.container.querySelectorAll(".highcharts-tab-item").forEach(function(d,
e){c=d.getAttribute("highcharts-data-tab-type");"edit"===c&&0===a||["click","touchstart"].forEach(function(a){k(d,a,function(){b.tabs.deselectAll.call(b);b.tabs.selectTab.call(b,this,e)})})})},selectTab:function(a,b){var c=this.popup.container.querySelectorAll(".highcharts-tab-item-content");a.className+=" highcharts-tab-item-active";c[b].className+=" highcharts-tab-item-show"},deselectAll:function(){var a=this.popup.container,b=a.querySelectorAll(".highcharts-tab-item");a=a.querySelectorAll(".highcharts-tab-item-content");
var c;for(c=0;c<b.length;c++)b[c].classList.remove("highcharts-tab-item-active"),a[c].classList.remove("highcharts-tab-item-show")}}};k(d.NavigationBindings,"showPopup",function(a){this.popup||(this.popup=new d.Popup(this.chart.container,this.chart.options.navigation.iconsURL||this.chart.options.stockTools&&this.chart.options.stockTools.gui.iconsURL||"https://code.highcharts.com/8.0.4/gfx/stock-icons/"));this.popup.showForm(a.formType,this.chart,a.options,a.onSubmit)});k(d.NavigationBindings,"closePopup",
function(){this.popup&&this.popup.closePopup()})});r(d,"masters/modules/annotations-advanced.btx.js",[],function(){})});
//# sourceMappingURL=annotations-advanced.js.map