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