/*
 Highcharts JS v8.0.0 (2019-12-10)

 Annotations module

 (c) 2009-2019 Torstein Honsi

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