/*
 Highcharts JS v7.0.1 (2018-12-19)
 Advanced Highstock tools

 (c) 2010-2018 Highsoft AS
 Author: Torstein Honsi

 License: www.highcharts.com/license
*/
(function(l){"object"===typeof module&&module.exports?module.exports=l:"function"===typeof define&&define.amd?define(function(){return l}):l("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(l){(function(f){var k=f.fireEvent,m=f.defined,l=f.pick,r=f.extend,u=f.isNumber,n=f.correctFloat,c=f.NavigationBindings.prototype.utils;c.addFlagFromForm=function(a){return function(b){var d=this,g=d.chart,e=g.toolbar,h=c.getFieldType;b=c.attractToPoint(b,g);var v={type:"flags",onSeries:b.series.id,
shape:a,data:[{x:b.x,y:b.y}],point:{events:{click:function(){var a=this,b=a.options;k(d,"showPopup",{point:a,formType:"annotation-toolbar",options:{langKey:"flags",type:"flags",title:[b.title,h(b.title)],name:[b.name,h(b.name)]},onSubmit:function(b){a.update(d.fieldsToOptions(b.fields,{}))}})}}}};e&&e.guiEnabled||g.addSeries(v);k(d,"showPopup",{formType:"flag",options:{langKey:"flags",type:"flags",title:["A",h("A")],name:["Flag A",h("Flag A")]},onSubmit:function(a){d.fieldsToOptions(a.fields,v.data[0]);
g.addSeries(v)}})}};c.manageIndicators=function(a){var b=this.chart,d={linkedTo:a.linkedTo,type:a.type},g=["ad","cmf","mfi","vbp","vwap"],e="ad atr cci cmf macd mfi roc rsi vwap ao aroon aroonoscillator trix apo dpo ppo natr williamsr linearRegression linearRegressionSlope linearRegressionIntercept linearRegressionAngle".split(" "),h;if("edit"===a.actionType)this.fieldsToOptions(a.fields,d),(a=b.get(a.seriesId))&&a.update(d,!1);else if("remove"===a.actionType){if(a=b.get(a.seriesId))h=a.yAxis,a.linkedSeries&&
a.linkedSeries.forEach(function(a){a.remove(!1)}),a.remove(!1),0<=e.indexOf(a.type)&&(h.remove(!1),this.resizeYAxes())}else d.id=f.uniqueKey(),this.fieldsToOptions(a.fields,d),0<=e.indexOf(a.type)&&(h=b.addAxis({id:f.uniqueKey(),offset:0,opposite:!0,title:{text:""},tickPixelInterval:40,showLastLabel:!1,labels:{align:"left",y:-2}},!1,!1),d.yAxis=h.options.id,this.resizeYAxes()),0<=g.indexOf(a.type)&&(d.params.volumeSeriesID=b.series.filter(function(a){return"column"===a.options.type})[0].options.id),
b.addSeries(d,!1);k(this,"deselectButton",{button:this.selectedButtonElement});b.redraw()};c.updateHeight=function(a,b){b.update({typeOptions:{height:this.chart.yAxis[0].toValue(a.chartY)-b.options.typeOptions.points[1].y}})};c.attractToPoint=function(a,b){var d=b.xAxis[0].toValue(a.chartX);a=b.yAxis[0].toValue(a.chartY);var g=Number.MAX_VALUE,e;b.series.forEach(function(a){a.points.forEach(function(a){a&&g>Math.abs(a.x-d)&&(g=Math.abs(a.x-d),e=a)})});return{x:e.x,y:e.y,below:a<e.y,series:e.series,
xAxis:e.series.xAxis.index||0,yAxis:e.series.yAxis.index||0}};c.isNotNavigatorYAxis=function(a){return"highcharts-navigator-yaxis"!==a.userOptions.className};c.updateNthPoint=function(a){return function(b,d){var g=d.options.typeOptions,e=this.chart.xAxis[0].toValue(b.chartX),h=this.chart.yAxis[0].toValue(b.chartY);g.points.forEach(function(b,d){d>=a&&(b.x=e,b.y=h)});d.update({typeOptions:{points:g.points}})}};r(f.NavigationBindings.prototype,{getYAxisPositions:function(a,b,d){function g(a){return m(a)&&
!u(a)&&a.match("%")}var e=0;a=a.map(function(a){var h=g(a.options.height)?parseFloat(a.options.height)/100:a.height/b;a=g(a.options.top)?parseFloat(a.options.top)/100:n(a.top-a.chart.plotTop)/b;u(h)||(h=d/100);e=n(e+h);return{height:100*h,top:100*a}});a.allAxesHeight=e;return a},getYAxisResizers:function(a){var b=[];a.forEach(function(d,g){d=a[g+1];b[g]=d?{enabled:!0,controlledAxis:{next:[l(d.options.id,d.options.index)]}}:{enabled:!1}});return b},resizeYAxes:function(a){a=a||20;var b=this.chart,
d=b.yAxis.filter(this.utils.isNotNavigatorYAxis),g=d.length,b=this.getYAxisPositions(d,b.plotHeight,a),e=this.getYAxisResizers(d),h=b.allAxesHeight,c=a;1<h?(6>g?(b[0].height=n(b[0].height-c),b=this.recalculateYAxisPositions(b,c)):(a=100/g,b=this.recalculateYAxisPositions(b,a/(g-1),!0,-1)),b[g-1]={top:n(100-a),height:a}):(c=100*n(1-h),5>g?(b[0].height=n(b[0].height+c),b=this.recalculateYAxisPositions(b,c)):b=this.recalculateYAxisPositions(b,c/g,!0,1));b.forEach(function(a,b){d[b].update({height:a.height+
"%",top:a.top+"%",resize:e[b]},!1)})},recalculateYAxisPositions:function(a,b,d,g){a.forEach(function(e,h){h=a[h-1];e.top=h?n(h.height+h.top):0;d&&(e.height=n(e.height+g*b))});return a}});r={segment:{className:"highcharts-segment",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"segment",type:"crookedLine",typeOptions:{points:[{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1)]},arrowSegment:{className:"highcharts-arrow-segment",
start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"arrowSegment",type:"crookedLine",typeOptions:{line:{markerEnd:"arrow"},points:[{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1)]},ray:{className:"highcharts-ray",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"ray",type:"infinityLine",typeOptions:{type:"ray",
points:[{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1)]},arrowRay:{className:"highcharts-arrow-ray",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"arrowRay",type:"infinityLine",typeOptions:{type:"ray",line:{markerEnd:"arrow"},points:[{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1)]},infinityLine:{className:"highcharts-infinity-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);
a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"infinityLine",type:"infinityLine",typeOptions:{type:"line",points:[{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1)]},arrowInfinityLine:{className:"highcharts-arrow-infinity-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"arrowInfinityLine",type:"infinityLine",typeOptions:{type:"line",line:{markerEnd:"arrow"},points:[{x:b,
y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1)]},horizontalLine:{className:"highcharts-horizontal-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);this.chart.addAnnotation({langKey:"horizontalLine",type:"infinityLine",typeOptions:{type:"horizontalLine",points:[{x:b,y:a}]}})}},verticalLine:{className:"highcharts-vertical-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);this.chart.addAnnotation({langKey:"verticalLine",
type:"infinityLine",typeOptions:{type:"verticalLine",points:[{x:b,y:a}]}})}},crooked3:{className:"highcharts-crooked3",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"crooked3",type:"crookedLine",typeOptions:{points:[{x:b,y:a},{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1),c.updateNthPoint(2)]},crooked5:{className:"highcharts-crooked5",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);
a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"crookedLine",type:"crookedLine",typeOptions:{points:[{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1),c.updateNthPoint(2),c.updateNthPoint(3),c.updateNthPoint(4)]},elliott3:{className:"highcharts-elliott3",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"elliott3",type:"elliottWave",typeOptions:{points:[{x:b,
y:a},{x:b,y:a},{x:b,y:a}]},labelOptions:{style:{color:"#666666"}}})},steps:[c.updateNthPoint(1),c.updateNthPoint(2)]},elliott5:{className:"highcharts-elliott5",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"elliott5",type:"elliottWave",typeOptions:{points:[{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a}]},labelOptions:{style:{color:"#666666"}}})},steps:[c.updateNthPoint(1),c.updateNthPoint(2),c.updateNthPoint(3),
c.updateNthPoint(4)]},measureX:{className:"highcharts-measure-x",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"measure",type:"measure",typeOptions:{selectType:"x",point:{x:b,y:a,xAxis:0,yAxis:0},crosshairX:{strokeWidth:1,stroke:"#000000"},crosshairY:{enabled:!1,strokeWidth:0,stroke:"#000000"},background:{width:0,height:0,strokeWidth:0,stroke:"#ffffff"}},labelOptions:{style:{color:"#666666"}}})},steps:[c.updateRectSize]},
measureY:{className:"highcharts-measure-y",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"measure",type:"measure",typeOptions:{selectType:"y",point:{x:b,y:a,xAxis:0,yAxis:0},crosshairX:{enabled:!1,strokeWidth:0,stroke:"#000000"},crosshairY:{strokeWidth:1,stroke:"#000000"},background:{width:0,height:0,strokeWidth:0,stroke:"#ffffff"}},labelOptions:{style:{color:"#666666"}}})},steps:[c.updateRectSize]},measureXY:{className:"highcharts-measure-xy",
start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"measure",type:"measure",typeOptions:{selectType:"xy",point:{x:b,y:a,xAxis:0,yAxis:0},background:{width:0,height:0,strokeWidth:0,stroke:"#000000"},crosshairX:{strokeWidth:1,stroke:"#000000"},crosshairY:{strokeWidth:1,stroke:"#000000"}},labelOptions:{style:{color:"#666666"}}})},steps:[c.updateRectSize]},fibonacci:{className:"highcharts-fibonacci",start:function(a){var b=
this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"fibonacci",type:"fibonacci",typeOptions:{points:[{x:b,y:a},{x:b,y:a}]},labelOptions:{style:{color:"#666666"}}})},steps:[c.updateNthPoint(1),c.updateHeight]},parallelChannel:{className:"highcharts-parallel-channel",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"parallelChannel",type:"tunnel",
typeOptions:{points:[{x:b,y:a},{x:b,y:a}]}})},steps:[c.updateNthPoint(1),c.updateHeight]},pitchfork:{className:"highcharts-pitchfork",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"pitchfork",type:"pitchfork",typeOptions:{points:[{x:b,y:a,controlPoint:{style:{fill:"red"}}},{x:b,y:a},{x:b,y:a}],innerBackground:{fill:"rgba(100, 170, 255, 0.8)"}},shapeOptions:{strokeWidth:2}})},steps:[c.updateNthPoint(1),
c.updateNthPoint(2)]},verticalCounter:{className:"highcharts-vertical-counter",start:function(a){a=c.attractToPoint(a,this.chart);m(this.verticalCounter)||(this.verticalCounter=0);a=this.chart.addAnnotation({langKey:"verticalCounter",type:"verticalLine",typeOptions:{point:{x:a.x,y:a.y,xAxis:a.xAxis,yAxis:a.yAxis},label:{offset:a.below?40:-40,text:this.verticalCounter.toString()}},labelOptions:{style:{color:"#666666",fontSize:"11px"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}});this.verticalCounter++;
a.options.events.click.call(a,{})}},verticalLabel:{className:"highcharts-vertical-label",start:function(a){a=c.attractToPoint(a,this.chart);a=this.chart.addAnnotation({langKey:"verticalLabel",type:"verticalLine",typeOptions:{point:{x:a.x,y:a.y,xAxis:a.xAxis,yAxis:a.yAxis},label:{offset:a.below?40:-40}},labelOptions:{style:{color:"#666666",fontSize:"11px"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}});a.options.events.click.call(a,{})}},verticalArrow:{className:"highcharts-vertical-arrow",
start:function(a){a=c.attractToPoint(a,this.chart);a=this.chart.addAnnotation({langKey:"verticalArrow",type:"verticalLine",typeOptions:{point:{x:a.x,y:a.y,xAxis:a.xAxis,yAxis:a.yAxis},label:{offset:a.below?40:-40,format:" "},connector:{fill:"none",stroke:a.below?"red":"green"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}});a.options.events.click.call(a,{})}},flagCirclepin:{className:"highcharts-flag-circlepin",start:c.addFlagFromForm("circlepin")},flagDiamondpin:{className:"highcharts-flag-diamondpin",
start:c.addFlagFromForm("flag")},flagSquarepin:{className:"highcharts-flag-squarepin",start:c.addFlagFromForm("squarepin")},flagSimplepin:{className:"highcharts-flag-simplepin",start:c.addFlagFromForm("nopin")},zoomX:{className:"highcharts-zoom-x",init:function(a){this.chart.update({chart:{zoomType:"x"}});k(this,"deselectButton",{button:a})}},zoomY:{className:"highcharts-highcharts-zoom-y",init:function(a){this.chart.update({chart:{zoomType:"y"}});k(this,"deselectButton",{button:a})}},zoomXY:{className:"highcharts-zoom-xy",
init:function(a){this.chart.update({chart:{zoomType:"xy"}});k(this,"deselectButton",{button:a})}},seriesTypeLine:{className:"highcharts-series-type-line",init:function(a){this.chart.series[0].update({type:"line"});k(this,"deselectButton",{button:a})}},seriesTypeOhlc:{className:"highcharts-series-type-ohlc",init:function(a){this.chart.series[0].update({type:"ohlc"});k(this,"deselectButton",{button:a})}},seriesTypeCandlestick:{className:"highcharts-series-type-candlestick",init:function(a){this.chart.series[0].update({type:"candlestick"});
k(this,"deselectButton",{button:a})}},fullScreen:{className:"highcharts-full-screen",init:function(a){var b=this.chart;b.fullScreen=new f.FullScreen(b.container);k(this,"deselectButton",{button:a})}},currentPriceIndicator:{className:"highcharts-current-price-indicator",init:function(a){var b=this.chart.series[0],d=b.options,g=d.lastVisiblePrice&&d.lastVisiblePrice.enabled,d=d.lastPrice&&d.lastPrice.enabled,e=this.chart.stockToolbar;e&&e.guiEnabled&&(a.firstChild.style["background-image"]=d?'url("'+
e.options.iconsURL+'current-price-show.svg")':'url("'+e.options.iconsURL+'current-price-hide.svg")');b.update({lastPrice:{enabled:!d,color:"red"},lastVisiblePrice:{enabled:!g,label:{enabled:!0}}});k(this,"deselectButton",{button:a})}},indicators:{className:"highcharts-indicators",init:function(){var a=this;k(a,"showPopup",{formType:"indicators",options:{},onSubmit:function(b){a.utils.manageIndicators.call(a,b)}})}},toggleAnnotations:{className:"highcharts-toggle-annotations",init:function(a){var b=
this.chart.stockToolbar;this.toggledAnnotations=!this.toggledAnnotations;(this.chart.annotations||[]).forEach(function(a){a.setVisibility(!this.toggledAnnotations)},this);b&&b.guiEnabled&&(a.firstChild.style["background-image"]=this.toggledAnnotations?'url("'+b.options.iconsURL+'annotations-hidden.svg")':'url("'+b.options.iconsURL+'annotations-visible.svg")');k(this,"deselectButton",{button:a})}},saveChart:{className:"highcharts-save-chart",init:function(a){var b=this,d=b.chart,g=[],e=[],h=[],c=[];
d.annotations.forEach(function(a,b){g[b]=a.userOptions});d.series.forEach(function(a){a instanceof f.seriesTypes.sma?e.push(a.userOptions):"flags"===a.type&&h.push(a.userOptions)});d.yAxis.forEach(function(a){b.utils.isNotNavigatorYAxis(a)&&c.push(a.options)});f.win.localStorage.setItem("highcharts-chart",JSON.stringify({annotations:g,indicators:e,flags:h,yAxes:c}));k(this,"deselectButton",{button:a})}}};f.setOptions({navigation:{bindings:r}})})(l);(function(f){var k=f.addEvent,m=f.createElement,
l=f.pick,r=f.isArray,u=f.fireEvent,n=f.getStyle,c=f.merge,a=f.css,b=f.win;f.setOptions({lang:{stockTools:{gui:{simpleShapes:"Simple shapes",lines:"Lines",crookedLines:"Crooked lines",measure:"Measure",advanced:"Advanced",toggleAnnotations:"Toggle annotations",verticalLabels:"Vertical labels",flags:"Flags",zoomChange:"Zoom change",typeChange:"Type change",saveChart:"Save chart",indicators:"Indicators",currentPriceIndicator:"Current Price Indicators",zoomX:"Zoom X",zoomY:"Zoom Y",zoomXY:"Zooom XY",
fullScreen:"Fullscreen",typeOHLC:"OHLC",typeLine:"Line",typeCandlestick:"Candlestick",circle:"Circle",label:"Label",rectangle:"Rectangle",flagCirclepin:"Flag circle",flagDiamondpin:"Flag diamond",flagSquarepin:"Flag square",flagSimplepin:"Flag simple",measureXY:"Measure XY",measureX:"Measure X",measureY:"Measure Y",segment:"Segment",arrowSegment:"Arrow segment",ray:"Ray",arrowRay:"Arrow ray",line:"Line",arrowLine:"Arrow line",horizontalLine:"Horizontal line",verticalLine:"Vertical line",infinityLine:"Infinity line",
crooked3:"Crooked 3 line",crooked5:"Crooked 5 line",elliott3:"Elliott 3 line",elliott5:"Elliott 5 line",verticalCounter:"Vertical counter",verticalLabel:"Vertical label",verticalArrow:"Vertical arrow",fibonacci:"Fibonacci",pitchfork:"Pitchfork",parallelChannel:"Parallel channel"}},navigation:{popup:{circle:"Circle",rectangle:"Rectangle",label:"Label",segment:"Segment",arrowSegment:"Arrow segment",ray:"Ray",arrowRay:"Arrow ray",line:"Line",arrowLine:"Arrow line",horizontalLine:"Horizontal line",verticalLine:"Vertical line",
crooked3:"Crooked 3 line",crooked5:"Crooked 5 line",elliott3:"Elliott 3 line",elliott5:"Elliott 5 line",verticalCounter:"Vertical counter",verticalLabel:"Vertical label",verticalArrow:"Vertical arrow",fibonacci:"Fibonacci",pitchfork:"Pitchfork",parallelChannel:"Parallel channel",infinityLine:"Infinity line",measure:"Measure",measureXY:"Measure XY",measureX:"Measure X",measureY:"Measure Y",flags:"Flags",addButton:"add",saveButton:"save",editButton:"edit",removeButton:"remove",series:"Series",volume:"Volume",
connector:"Connector",innerBackground:"Inner background",outerBackground:"Outer background",crosshairX:"Crosshair X",crosshairY:"Crosshair Y",tunnel:"Tunnel",background:"Background"}}},stockTools:{gui:{enabled:!0,className:"highcharts-bindings-wrapper",toolbarClassName:"stocktools-toolbar",iconsURL:"https://code.highcharts.com/7.0.1/gfx/stock-icons/",buttons:"indicators separator simpleShapes lines crookedLines measure advanced toggleAnnotations separator verticalLabels flags separator zoomChange fullScreen typeChange separator currentPriceIndicator saveChart".split(" "),
definitions:{separator:{symbol:"separator.svg"},simpleShapes:{items:["label","circle","rectangle"],circle:{symbol:"circle.svg"},rectangle:{symbol:"rectangle.svg"},label:{symbol:"label.svg"}},flags:{items:["flagCirclepin","flagDiamondpin","flagSquarepin","flagSimplepin"],flagSimplepin:{symbol:"flag-basic.svg"},flagDiamondpin:{symbol:"flag-diamond.svg"},flagSquarepin:{symbol:"flag-trapeze.svg"},flagCirclepin:{symbol:"flag-elipse.svg"}},lines:{items:"segment arrowSegment ray arrowRay line arrowLine horizontalLine verticalLine".split(" "),
segment:{symbol:"segment.svg"},arrowSegment:{symbol:"arrow-segment.svg"},ray:{symbol:"ray.svg"},arrowRay:{symbol:"arrow-ray.svg"},line:{symbol:"line.svg"},arrowLine:{symbol:"arrow-line.svg"},verticalLine:{symbol:"vertical-line.svg"},horizontalLine:{symbol:"horizontal-line.svg"}},crookedLines:{items:["elliott3","elliott5","crooked3","crooked5"],crooked3:{symbol:"crooked-3.svg"},crooked5:{symbol:"crooked-5.svg"},elliott3:{symbol:"elliott-3.svg"},elliott5:{symbol:"elliott-5.svg"}},verticalLabels:{items:["verticalCounter",
"verticalLabel","verticalArrow"],verticalCounter:{symbol:"vertical-counter.svg"},verticalLabel:{symbol:"vertical-label.svg"},verticalArrow:{symbol:"vertical-arrow.svg"}},advanced:{items:["fibonacci","pitchfork","parallelChannel"],pitchfork:{symbol:"pitchfork.svg"},fibonacci:{symbol:"fibonacci.svg"},parallelChannel:{symbol:"parallel-channel.svg"}},measure:{items:["measureXY","measureX","measureY"],measureX:{symbol:"measure-x.svg"},measureY:{symbol:"measure-y.svg"},measureXY:{symbol:"measure-xy.svg"}},
toggleAnnotations:{symbol:"annotations-visible.svg"},currentPriceIndicator:{symbol:"current-price-show.svg"},indicators:{symbol:"indicators.svg"},zoomChange:{items:["zoomX","zoomY","zoomXY"],zoomX:{symbol:"zoom-x.svg"},zoomY:{symbol:"zoom-y.svg"},zoomXY:{symbol:"zoom-xy.svg"}},typeChange:{items:["typeOHLC","typeLine","typeCandlestick"],typeOHLC:{symbol:"series-ohlc.svg"},typeLine:{symbol:"series-line.svg"},typeCandlestick:{symbol:"series-candlestick.svg"}},fullScreen:{symbol:"fullscreen.svg"},saveChart:{symbol:"save-chart.svg"}}}}});
k(f.Chart,"afterGetContainer",function(a){f.Chart.prototype.setStockTools.call(this,a)});k(f.Chart,"getMargins",function(){var a=this.stockToolbar&&this.stockToolbar.listWrapper&&this.stockToolbar.listWrapper.offsetWidth;a&&a<this.plotWidth&&(this.plotLeft+=a)});k(f.Chart,"destroy",function(){this.stockToolbar&&this.stockToolbar.destroy()});k(f.Chart,"redraw",function(){this.stockToolbar&&this.stockToolbar.guiEnabled&&this.stockToolbar.redraw()});k(f.Chart,"update",function(a){this.stockToolbar&&
this.stockToolbar.destroy();f.Chart.prototype.setStockTools.call(this,a)});f.Toolbar=function(a,b,e){this.chart=e;this.options=a;this.lang=b;this.guiEnabled=a.enabled;this.visible=l(a.visible,!0);this.placed=l(a.placed,!1);this.eventsToUnbind=[];this.guiEnabled&&(this.createHTML(),this.init(),this.showHideNavigatorion());u(this,"afterInit")};f.extend(f.Chart.prototype,{setStockTools:function(a){var b=this.options,d=b.lang,h=a.options&&a.options.stockTools;a=c(b.stockTools&&b.stockTools.gui,h&&h.gui,
a.stockTools&&a.stockTools.gui);this.stockToolbar=new f.Toolbar(a,d.stockTools&&d.stockTools.gui,this);this.stockToolbar.guiEnabled&&(this.isDirtyBox=!0)}});f.Toolbar.prototype={init:function(){var a=this,b=this.lang,e=this.options,h=this.toolbar,c=a.addSubmenu,f=e.buttons,m=e.definitions,q=h.childNodes,l=this.inIframe(),p;f.forEach(function(d){p=a.addButton(h,m,d,b);l&&"fullScreen"===d&&(p.buttonWrapper.className+=" highcharts-disabled-btn");k(p.buttonWrapper,"click",function(){a.eraseActiveButtons(q,
p.buttonWrapper)});r(m[d].items)&&c.call(a,p,m[d])})},addSubmenu:function(b,g){var d=this,h=b.submenuArrow,c=b.buttonWrapper,l=n(c,"width"),w=this.wrapper,q=this.listWrapper,r=this.toolbar.childNodes,p=0,t;this.submenu=t=m("ul",{className:"highcharts-submenu-wrapper"},null,c);this.addSubmenuItems.call(this,c,g);k(h,"click",function(b){b.stopPropagation();d.eraseActiveButtons(r,c);0<=c.className.indexOf("highcharts-current")?(q.style.width=q.startWidth+"px",c.classList.remove("highcharts-current"),
t.style.display="none"):(t.style.display="block",p=t.offsetHeight-c.offsetHeight-3,t.offsetHeight+c.offsetTop>w.offsetHeight&&c.offsetTop>p||(p=0),a(t,{top:-p+"px",left:l+3+"px"}),c.className+=" highcharts-current",q.startWidth=w.offsetWidth,q.style.width=q.startWidth+f.getStyle(q,"padding-left")+t.offsetWidth+3+"px")})},addSubmenuItems:function(a,b){var d=this,g=this.submenu,c=this.lang,f=this.listWrapper,m,l;b.items.forEach(function(e){l=d.addButton(g,b,e,c);k(l.mainButton,"click",function(){d.switchSymbol(this,
a,!0);f.style.width=f.startWidth+"px";g.style.display="none"})});m=g.querySelectorAll("li \x3e .highcharts-menu-item-btn")[0];d.switchSymbol(m,!1)},eraseActiveButtons:function(a,b,e){[].forEach.call(a,function(a){a!==b&&(a.classList.remove("highcharts-current"),a.classList.remove("highcharts-active"),e=a.querySelectorAll(".highcharts-submenu-wrapper"),0<e.length&&(e[0].style.display="none"))})},addButton:function(a,b,e,c){var d=this.options;b=b[e];var g=b.items,h=b.className||"",k;e=m("li",{className:l(f.Toolbar.prototype.classMapping[e],
"")+" "+h,title:c[e]||e},null,a);a=m("span",{className:"highcharts-menu-item-btn"},null,e);g&&1<g.length?k=m("span",{className:"highcharts-submenu-item-arrow highcharts-arrow-right"},null,e):a.style["background-image"]="url("+d.iconsURL+b.symbol+")";return{buttonWrapper:e,mainButton:a,submenuArrow:k}},addNavigation:function(){var a=this.wrapper;this.arrowWrapper=m("div",{className:"highcharts-arrow-wrapper"});this.arrowUp=m("div",{className:"highcharts-arrow-up"},null,this.arrowWrapper);this.arrowDown=
m("div",{className:"highcharts-arrow-down"},null,this.arrowWrapper);a.insertBefore(this.arrowWrapper,a.childNodes[0]);this.scrollButtons()},scrollButtons:function(){var a=0,b=this.wrapper,e=this.toolbar,c=.1*b.offsetHeight;k(this.arrowUp,"click",function(){0<a&&(a-=c,e.style["margin-top"]=-a+"px")});k(this.arrowDown,"click",function(){b.offsetHeight+a<=e.offsetHeight+c&&(a+=c,e.style["margin-top"]=-a+"px")})},createHTML:function(){var a=this.options,b=this.chart.container,e;this.wrapper=e=m("div",
{className:"highcharts-stocktools-wrapper "+a.className});b.parentNode.insertBefore(e,b);this.toolbar=b=m("ul",{className:"highcharts-stocktools-toolbar "+a.toolbarClassName});this.listWrapper=a=m("div",{className:"highcharts-menu-wrapper"});e.insertBefore(a,e.childNodes[0]);a.insertBefore(b,a.childNodes[0]);this.showHideToolbar();this.addNavigation()},showHideNavigatorion:function(){this.visible&&this.toolbar.offsetHeight>this.wrapper.offsetHeight-50?this.arrowWrapper.style.display="block":(this.toolbar.style.marginTop=
"0px",this.arrowWrapper.style.display="none")},showHideToolbar:function(){var a=this.chart,b=this.wrapper,e=this.listWrapper,c=this.submenu,l=this.visible,n;this.showhideBtn=n=m("div",{className:"highcharts-toggle-toolbar highcharts-arrow-left"},null,b);l?(n.style.top=f.getStyle(e,"padding-top")+"px",n.style.left=b.offsetWidth+f.getStyle(e,"padding-left")+"px"):(c&&(c.style.display="none"),n.style.left="0px",this.visible=l=!1,e.classList.add("highcharts-hide"),n.classList.toggle("highcharts-arrow-right"));
k(n,"click",function(){a.update({stockTools:{gui:{visible:!l,placed:!0}}})})},switchSymbol:function(a,b){var d=a.parentNode,c=d.classList.value,d=d.parentNode.parentNode;d.className="";c&&d.classList.add(c.trim());d.querySelectorAll(".highcharts-menu-item-btn")[0].style["background-image"]=a.style["background-image"];b&&this.selectButton(d)},selectButton:function(a){0<=a.className.indexOf("highcharts-active")?a.classList.remove("highcharts-active"):a.classList.add("highcharts-active")},unselectAllButtons:function(a){var b=
a.parentNode.querySelectorAll(".highcharts-active");[].forEach.call(b,function(b){b!==a&&b.classList.remove("highcharts-active")})},inIframe:function(){try{return b.self!==b.top}catch(d){return!0}},destroy:function(){var a=this.wrapper,b=a&&a.parentNode;this.eventsToUnbind.forEach(function(a){a()});b&&b.removeChild(a);delete this.chart.stockToolbar;this.chart.isDirtyBox=!0;this.chart.redraw()},redraw:function(){this.showHideNavigatorion()},classMapping:{circle:"highcharts-circle-annotation",rectangle:"highcharts-rectangle-annotation",
label:"highcharts-label-annotation",segment:"highcharts-segment",arrowSegment:"highcharts-arrow-segment",ray:"highcharts-ray",arrowRay:"highcharts-arrow-ray",line:"highcharts-infinity-line",arrowLine:"highcharts-arrow-infinity-line",verticalLine:"highcharts-vertical-line",horizontalLine:"highcharts-horizontal-line",crooked3:"highcharts-crooked3",crooked5:"highcharts-crooked5",elliott3:"highcharts-elliott3",elliott5:"highcharts-elliott5",pitchfork:"highcharts-pitchfork",fibonacci:"highcharts-fibonacci",
parallelChannel:"highcharts-parallel-channel",measureX:"highcharts-measure-x",measureY:"highcharts-measure-y",measureXY:"highcharts-measure-xy",verticalCounter:"highcharts-vertical-counter",verticalLabel:"highcharts-vertical-label",verticalArrow:"highcharts-vertical-arrow",currentPriceIndicator:"highcharts-current-price-indicator",indicators:"highcharts-indicators",flagCirclepin:"highcharts-flag-circlepin",flagDiamondpin:"highcharts-flag-diamondpin",flagSquarepin:"highcharts-flag-squarepin",flagSimplepin:"highcharts-flag-simplepin",
zoomX:"highcharts-zoom-x",zoomY:"highcharts-zoom-y",zoomXY:"highcharts-zoom-xy",typeLine:"highcharts-series-type-line",typeOHLC:"highcharts-series-type-ohlc",typeCandlestick:"highcharts-series-type-candlestick",fullScreen:"highcharts-full-screen",toggleAnnotations:"highcharts-toggle-annotations",saveChart:"highcharts-save-chart",separator:"highcharts-separator"}};k(f.NavigationBindings,"selectButton",function(a){var b=a.button,c=this.chart.stockToolbar;c&&c.guiEnabled&&(c.unselectAllButtons(a.button),
0<=b.parentNode.className.indexOf("highcharts-submenu-wrapper")&&(b=b.parentNode.parentNode),c.selectButton(b))});k(f.NavigationBindings,"deselectButton",function(a){a=a.button;var b=this.chart.stockToolbar;b&&b.guiEnabled&&(0<=a.parentNode.className.indexOf("highcharts-submenu-wrapper")&&(a=a.parentNode.parentNode),b.selectButton(a))})})(l)});
//# sourceMappingURL=stock-tools.js.map
