/*
 Highcharts JS v7.0.3 (2019-02-06)
 Annotations module

 (c) 2009-2019 Torstein Honsi

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