/*
 Highcharts JS v6.1.1 (2018-06-27)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(J){"object"===typeof module&&module.exports?module.exports=J:J(Highcharts)})(function(J){(function(a){var D=a.addEvent,k=a.Axis,F=a.Chart,z=a.css,H=a.defined,G=a.each,A=a.extend,v=a.noop,w=a.pick,u=a.timeUnits,y=a.wrap;y(a.Series.prototype,"init",function(g){var a;g.apply(this,Array.prototype.slice.call(arguments,1));(a=this.xAxis)&&a.options.ordinal&&D(this,"updatedData",function(){delete a.ordinalIndex})});y(k.prototype,"getTimeTicks",function(g,a,d,t,r,l,p,c){var b=0,f,q,n={},E,h,B,m=
[],x=-Number.MAX_VALUE,C=this.options.tickPixelInterval,K=this.chart.time;if(!this.options.ordinal&&!this.options.breaks||!l||3>l.length||void 0===d)return g.call(this,a,d,t,r);h=l.length;for(f=0;f<h;f++){B=f&&l[f-1]>t;l[f]<d&&(b=f);if(f===h-1||l[f+1]-l[f]>5*p||B){if(l[f]>x){for(q=g.call(this,a,l[b],l[f],r);q.length&&q[0]<=x;)q.shift();q.length&&(x=q[q.length-1]);m=m.concat(q)}b=f+1}if(B)break}g=q.info;if(c&&g.unitRange<=u.hour){f=m.length-1;for(b=1;b<f;b++)K.dateFormat("%d",m[b])!==K.dateFormat("%d",
m[b-1])&&(n[m[b]]="day",E=!0);E&&(n[m[0]]="day");g.higherRanks=n}m.info=g;if(c&&H(C)){c=K=m.length;f=[];var I;for(E=[];c--;)b=this.translate(m[c]),I&&(E[c]=I-b),f[c]=I=b;E.sort();E=E[Math.floor(E.length/2)];E<.6*C&&(E=null);c=m[K-1]>t?K-1:K;for(I=void 0;c--;)b=f[c],t=Math.abs(I-b),I&&t<.8*C&&(null===E||t<.8*E)?(n[m[c]]&&!n[m[c+1]]?(t=c+1,I=b):t=c,m.splice(t,1)):I=b}return m});A(k.prototype,{beforeSetTickPositions:function(){var a,e=[],d,t=!1,r,l=this.getExtremes(),p=l.min,c=l.max,b,f=this.isXAxis&&
!!this.options.breaks,l=this.options.ordinal,q=Number.MAX_VALUE,n=this.chart.options.chart.ignoreHiddenSeries;r="highcharts-navigator-xaxis"===this.options.className;!this.options.overscroll||this.max!==this.dataMax||this.chart.mouseIsDown&&!r||this.eventArgs&&(!this.eventArgs||"navigator"===this.eventArgs.trigger)||(this.max+=this.options.overscroll,!r&&H(this.userMin)&&(this.min+=this.options.overscroll));if(l||f){G(this.series,function(b,h){d=[];if(!(n&&!1===b.visible||!1===b.takeOrdinalPosition&&
!f)&&(e=e.concat(b.processedXData),a=e.length,e.sort(function(b,m){return b-m}),q=Math.min(q,w(b.closestPointRange,q)),a)){for(h=0;h<a-1;)e[h]!==e[h+1]&&d.push(e[h+1]),h++;d[0]!==e[0]&&d.unshift(e[0]);e=d}});a=e.length;if(2<a){r=e[1]-e[0];for(b=a-1;b--&&!t;)e[b+1]-e[b]!==r&&(t=!0);!this.options.keepOrdinalPadding&&(e[0]-p>r||c-e[e.length-1]>r)&&(t=!0)}else this.options.overscroll&&(2===a?q=e[1]-e[0]:1===a?(q=this.options.overscroll,e=[e[0],e[0]+q]):q=this.overscrollPointsRange);t?(this.options.overscroll&&
(this.overscrollPointsRange=q,e=e.concat(this.getOverscrollPositions())),this.ordinalPositions=e,r=this.ordinal2lin(Math.max(p,e[0]),!0),b=Math.max(this.ordinal2lin(Math.min(c,e[e.length-1]),!0),1),this.ordinalSlope=c=(c-p)/(b-r),this.ordinalOffset=p-r*c):(this.overscrollPointsRange=w(this.closestPointRange,this.overscrollPointsRange),this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=void 0)}this.isOrdinal=l&&t;this.groupIntervalFactor=null},val2lin:function(a,e){var d=this.ordinalPositions;
if(d){var g=d.length,r,l;for(r=g;r--;)if(d[r]===a){l=r;break}for(r=g-1;r--;)if(a>d[r]||0===r){a=(a-d[r])/(d[r+1]-d[r]);l=r+a;break}e=e?l:this.ordinalSlope*(l||0)+this.ordinalOffset}else e=a;return e},lin2val:function(a,e){var d=this.ordinalPositions;if(d){var g=this.ordinalSlope,r=this.ordinalOffset,l=d.length-1,p;if(e)0>a?a=d[0]:a>l?a=d[l]:(l=Math.floor(a),p=a-l);else for(;l--;)if(e=g*l+r,a>=e){g=g*(l+1)+r;p=(a-e)/(g-e);break}return void 0!==p&&void 0!==d[l]?d[l]+(p?p*(d[l+1]-d[l]):0):a}return a},
getExtendedPositions:function(){var a=this,e=a.chart,d=a.series[0].currentDataGrouping,t=a.ordinalIndex,r=d?d.count+d.unitName:"raw",l=a.options.overscroll,p=a.getExtremes(),c,b;t||(t=a.ordinalIndex={});t[r]||(c={series:[],chart:e,getExtremes:function(){return{min:p.dataMin,max:p.dataMax+l}},options:{ordinal:!0},val2lin:k.prototype.val2lin,ordinal2lin:k.prototype.ordinal2lin},G(a.series,function(p){b={xAxis:c,xData:p.xData.slice(),chart:e,destroyGroupedData:v};b.xData=b.xData.concat(a.getOverscrollPositions());
b.options={dataGrouping:d?{enabled:!0,forced:!0,approximation:"open",units:[[d.unitName,[d.count]]]}:{enabled:!1}};p.processData.apply(b);c.series.push(b)}),a.beforeSetTickPositions.apply(c),t[r]=c.ordinalPositions);return t[r]},getOverscrollPositions:function(){var g=this.options.overscroll,e=this.overscrollPointsRange,d=[],t=this.dataMax;if(a.defined(e))for(d.push(t);t<=this.dataMax+g;)t+=e,d.push(t);return d},getGroupIntervalFactor:function(a,e,d){var g;d=d.processedXData;var r=d.length,l=[];g=
this.groupIntervalFactor;if(!g){for(g=0;g<r-1;g++)l[g]=d[g+1]-d[g];l.sort(function(a,c){return a-c});l=l[Math.floor(r/2)];a=Math.max(a,d[0]);e=Math.min(e,d[r-1]);this.groupIntervalFactor=g=r*l/(e-a)}return g},postProcessTickInterval:function(a){var g=this.ordinalSlope;return g?this.options.breaks?this.closestPointRange||a:a/(g/this.closestPointRange):a}});k.prototype.ordinal2lin=k.prototype.val2lin;y(F.prototype,"pan",function(a,e){var d=this.xAxis[0],g=d.options.overscroll,r=e.chartX,l=!1;if(d.options.ordinal&&
d.series.length){var p=this.mouseDownX,c=d.getExtremes(),b=c.dataMax,f=c.min,q=c.max,n=this.hoverPoints,E=d.closestPointRange||d.overscrollPointsRange,p=(p-r)/(d.translationSlope*(d.ordinalSlope||E)),h={ordinalPositions:d.getExtendedPositions()},E=d.lin2val,B=d.val2lin,m;h.ordinalPositions?1<Math.abs(p)&&(n&&G(n,function(m){m.setState()}),0>p?(n=h,m=d.ordinalPositions?d:h):(n=d.ordinalPositions?d:h,m=h),h=m.ordinalPositions,b>h[h.length-1]&&h.push(b),this.fixedRange=q-f,p=d.toFixedRange(null,null,
E.apply(n,[B.apply(n,[f,!0])+p,!0]),E.apply(m,[B.apply(m,[q,!0])+p,!0])),p.min>=Math.min(c.dataMin,f)&&p.max<=Math.max(b,q)+g&&d.setExtremes(p.min,p.max,!0,!1,{trigger:"pan"}),this.mouseDownX=r,z(this.container,{cursor:"move"})):l=!0}else l=!0;l&&(g&&(d.max=d.dataMax+g),a.apply(this,Array.prototype.slice.call(arguments,1)))})})(J);(function(a){function D(){return Array.prototype.slice.call(arguments,1)}function k(a){a.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,z(this.pointArrayMap,
["y"]))}var F=a.addEvent,z=a.pick,H=a.wrap,G=a.each,A=a.extend,v=a.isArray,w=a.fireEvent,u=a.Axis,y=a.Series;A(u.prototype,{isInBreak:function(a,e){var d=a.repeat||Infinity,g=a.from,r=a.to-a.from;e=e>=g?(e-g)%d:d-(g-e)%d;return a.inclusive?e<=r:e<r&&0!==e},isInAnyBreak:function(a,e){var d=this.options.breaks,g=d&&d.length,r,l,p;if(g){for(;g--;)this.isInBreak(d[g],a)&&(r=!0,l||(l=z(d[g].showPoints,this.isXAxis?!1:!0)));p=r&&e?r&&!l:r}return p}});F(u,"afterSetTickPositions",function(){if(this.options.breaks){var a=
this.tickPositions,e=this.tickPositions.info,d=[],t;for(t=0;t<a.length;t++)this.isInAnyBreak(a[t])||d.push(a[t]);this.tickPositions=d;this.tickPositions.info=e}});F(u,"afterSetOptions",function(){this.options.breaks&&this.options.breaks.length&&(this.options.ordinal=!1)});F(u,"afterInit",function(){var a=this,e;e=this.options.breaks;a.isBroken=v(e)&&!!e.length;a.isBroken&&(a.val2lin=function(d){var e=d,g,l;for(l=0;l<a.breakArray.length;l++)if(g=a.breakArray[l],g.to<=d)e-=g.len;else if(g.from>=d)break;
else if(a.isInBreak(g,d)){e-=d-g.from;break}return e},a.lin2val=function(d){var e,g;for(g=0;g<a.breakArray.length&&!(e=a.breakArray[g],e.from>=d);g++)e.to<d?d+=e.len:a.isInBreak(e,d)&&(d+=e.len);return d},a.setExtremes=function(a,e,g,l,p){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(e);)e-=this.closestPointRange;u.prototype.setExtremes.call(this,a,e,g,l,p)},a.setAxisTranslation=function(d){u.prototype.setAxisTranslation.call(this,d);d=a.options.breaks;var e=[],g=[],
l=0,p,c,b=a.userMin||a.min,f=a.userMax||a.max,q=z(a.pointRangePadding,0),n,E;G(d,function(h){c=h.repeat||Infinity;a.isInBreak(h,b)&&(b+=h.to%c-b%c);a.isInBreak(h,f)&&(f-=f%c-h.from%c)});G(d,function(a){n=a.from;for(c=a.repeat||Infinity;n-c>b;)n-=c;for(;n<b;)n+=c;for(E=n;E<f;E+=c)e.push({value:E,move:"in"}),e.push({value:E+(a.to-a.from),move:"out",size:a.breakSize})});e.sort(function(a,b){return a.value===b.value?("in"===a.move?0:1)-("in"===b.move?0:1):a.value-b.value});p=0;n=b;G(e,function(a){p+=
"in"===a.move?1:-1;1===p&&"in"===a.move&&(n=a.value);0===p&&(g.push({from:n,to:a.value,len:a.value-n-(a.size||0)}),l+=a.value-n-(a.size||0))});a.breakArray=g;a.unitLength=f-b-l+q;w(a,"afterBreaks");a.options.staticScale?a.transA=a.options.staticScale:a.unitLength&&(a.transA*=(f-a.min+q)/a.unitLength);q&&(a.minPixelPadding=a.transA*a.minPointOffset);a.min=b;a.max=f})});H(y.prototype,"generatePoints",function(a){a.apply(this,D(arguments));var e=this.xAxis,d=this.yAxis,g=this.points,r,l=g.length,p=this.options.connectNulls,
c;if(e&&d&&(e.options.breaks||d.options.breaks))for(;l--;)r=g[l],c=null===r.y&&!1===p,c||!e.isInAnyBreak(r.x,!0)&&!d.isInAnyBreak(r.y,!0)||(g.splice(l,1),this.data[l]&&this.data[l].destroyElements())});a.Series.prototype.drawBreaks=function(a,e){var d=this,g=d.points,r,l,p,c;a&&G(e,function(b){r=a.breakArray||[];l=a.isXAxis?a.min:z(d.options.threshold,a.min);G(g,function(f){c=z(f["stack"+b.toUpperCase()],f[b]);G(r,function(b){p=!1;if(l<b.from&&c>b.to||l>b.from&&c<b.from)p="pointBreak";else if(l<b.from&&
c>b.from&&c<b.to||l>b.from&&c>b.to&&c<b.from)p="pointInBreak";p&&w(a,p,{point:f,brk:b})})})})};a.Series.prototype.gappedPath=function(){var g=this.currentDataGrouping,e=g&&g.totalRange,g=this.options.gapSize,d=this.points.slice(),t=d.length-1,r=this.yAxis;if(g&&0<t)for("value"!==this.options.gapUnit&&(g*=this.closestPointRange),e&&e>g&&(g=e);t--;)d[t+1].x-d[t].x>g&&(e=(d[t].x+d[t+1].x)/2,d.splice(t+1,0,{isNull:!0,x:e}),this.options.stacking&&(e=r.stacks[this.stackKey][e]=new a.StackItem(r,r.options.stackLabels,
!1,e,this.stack),e.total=0));return this.getGraphPath(d)};H(a.seriesTypes.column.prototype,"drawPoints",k);H(a.Series.prototype,"drawPoints",k)})(J);(function(a){var D=a.addEvent,k=a.arrayMax,F=a.arrayMin,z=a.Axis,H=a.defaultPlotOptions,G=a.defined,A=a.each,v=a.extend,w=a.format,u=a.isNumber,y=a.merge,g=a.pick,e=a.Point,d=a.Series,t=a.Tooltip,r=a.wrap,l=d.prototype,p=l.processData,c=l.generatePoints,b={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L",
"%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},f={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},
areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},q=a.defaultDataGroupingUnits=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],n=a.approximations={sum:function(a){var b=a.length,c;if(!b&&a.hasNulls)c=null;else if(b)for(c=
0;b--;)c+=a[b];return c},average:function(a){var b=a.length;a=n.sum(a);u(a)&&b&&(a/=b);return a},averages:function(){var a=[];A(arguments,function(b){a.push(n.average(b))});return void 0===a[0]?void 0:a},open:function(a){return a.length?a[0]:a.hasNulls?null:void 0},high:function(a){return a.length?k(a):a.hasNulls?null:void 0},low:function(a){return a.length?F(a):a.hasNulls?null:void 0},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:void 0},ohlc:function(a,b,c,m){a=n.open(a);b=n.high(b);
c=n.low(c);m=n.close(m);if(u(a)||u(b)||u(c)||u(m))return[a,b,c,m]},range:function(a,b){a=n.low(a);b=n.high(b);if(u(a)||u(b))return[a,b];if(null===a&&null===b)return null}};l.groupData=function(a,c,p,m){var x=this.data,C=this.options.data,h=[],I=[],q=[],e=a.length,d,E,B=!!c,g=[];m="function"===typeof m?m:n[m]||f[this.type]&&n[f[this.type].approximation]||n[b.approximation];var l=this.pointArrayMap,r=l&&l.length,t=0;E=0;var w,y;r?A(l,function(){g.push([])}):g.push([]);w=r||1;for(y=0;y<=e&&!(a[y]>=p[0]);y++);
for(y;y<=e;y++){for(;void 0!==p[t+1]&&a[y]>=p[t+1]||y===e;){d=p[t];this.dataGroupInfo={start:E,length:g[0].length};E=m.apply(this,g);void 0!==E&&(h.push(d),I.push(E),q.push(this.dataGroupInfo));E=y;for(d=0;d<w;d++)g[d].length=0,g[d].hasNulls=!1;t+=1;if(y===e)break}if(y===e)break;if(l){d=this.cropStart+y;var v=x&&x[d]||this.pointClass.prototype.applyOptions.apply({series:this},[C[d]]),k;for(d=0;d<r;d++)k=v[l[d]],u(k)?g[d].push(k):null===k&&(g[d].hasNulls=!0)}else d=B?c[y]:null,u(d)?g[0].push(d):null===
d&&(g[0].hasNulls=!0)}return[h,I,q]};l.processData=function(){var a=this.chart,b=this.options.dataGrouping,c=!1!==this.allowDG&&b&&g(b.enabled,a.options.isStock),m=this.visible||!a.options.chart.ignoreHiddenSeries,x,C=this.currentDataGrouping,f;this.forceCrop=c;this.groupPixelWidth=null;this.hasProcessed=!0;if(!1!==p.apply(this,arguments)&&c){this.destroyGroupedData();var I,d=b.groupAll?this.xData:this.processedXData,n=b.groupAll?this.yData:this.processedYData,e=a.plotSizeX,a=this.xAxis,r=a.options.ordinal,
t=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth();if(t){this.isDirty=x=!0;this.points=null;c=a.getExtremes();f=c.min;c=c.max;r=r&&a.getGroupIntervalFactor(f,c,this)||1;t=t*(c-f)/e*r;e=a.getTimeTicks(a.normalizeTimeTickInterval(t,b.units||q),Math.min(f,d[0]),Math.max(c,d[d.length-1]),a.options.startOfWeek,d,this.closestPointRange);n=l.groupData.apply(this,[d,n,e,b.approximation]);d=n[0];r=n[1];if(b.smoothed&&d.length){I=d.length-1;for(d[I]=Math.min(d[I],c);I--&&0<I;)d[I]+=t/2;d[0]=
Math.max(d[0],f)}f=e.info;this.closestPointRange=e.info.totalRange;this.groupMap=n[2];G(d[0])&&d[0]<a.dataMin&&m&&(a.min<=a.dataMin&&(a.min=d[0]),a.dataMin=d[0]);b.groupAll&&(b=this.cropData(d,r,a.min,a.max,1),d=b.xData,r=b.yData);this.processedXData=d;this.processedYData=r}else this.groupMap=null;this.hasGroupedData=x;this.currentDataGrouping=f;this.preventGraphAnimation=(C&&C.totalRange)!==(f&&f.totalRange)}};l.destroyGroupedData=function(){var a=this.groupedData;A(a||[],function(b,c){b&&(a[c]=
b.destroy?b.destroy():null)});this.groupedData=null};l.generatePoints=function(){c.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};D(e,"update",function(){if(this.dataGroup)return a.error(24),!1});r(t.prototype,"tooltipFooterHeaderFormatter",function(a,b,c){var m=this.chart.time,x=b.series,C=x.tooltipOptions,p=x.options.dataGrouping,f=C.xDateFormat,d,q=x.xAxis;return q&&"datetime"===q.options.type&&p&&u(b.key)?(a=x.currentDataGrouping,p=p.dateTimeLabelFormats,
a?(q=p[a.unitName],1===a.count?f=q[0]:(f=q[1],d=q[2])):!f&&p&&(f=this.getXDateFormat(b,C,q)),f=m.dateFormat(f,b.key),d&&(f+=m.dateFormat(d,b.key+a.totalRange-1)),w(C[(c?"footer":"header")+"Format"],{point:v(b.point,{key:f}),series:x},m)):a.call(this,b,c)});D(d,"destroy",l.destroyGroupedData);D(d,"afterSetOptions",function(a){a=a.options;var c=this.type,p=this.chart.options.plotOptions,m=H[c].dataGrouping,x=this.useCommonDataGrouping&&b;if(f[c]||x)m||(m=y(b,f[c])),a.dataGrouping=y(x,m,p.series&&p.series.dataGrouping,
p[c].dataGrouping,this.userOptions.dataGrouping);this.chart.options.isStock&&(this.requireSorting=!0)});D(z,"afterSetScale",function(){A(this.series,function(a){a.hasProcessed=!1})});z.prototype.getGroupPixelWidth=function(){var a=this.series,b=a.length,c,m=0,x=!1,p;for(c=b;c--;)(p=a[c].options.dataGrouping)&&(m=Math.max(m,p.groupPixelWidth));for(c=b;c--;)(p=a[c].options.dataGrouping)&&a[c].hasProcessed&&(b=(a[c].processedXData||a[c].data).length,a[c].groupPixelWidth||b>this.chart.plotSizeX/m||b&&
p.forced)&&(x=!0);return x?m:0};z.prototype.setDataGrouping=function(a,b){var c;b=g(b,!0);a||(a={forced:!1,units:null});if(this instanceof z)for(c=this.series.length;c--;)this.series[c].update({dataGrouping:a},!1);else A(this.chart.options.series,function(b){b.dataGrouping=a},!1);this.ordinalSlope=null;b&&this.chart.redraw()}})(J);(function(a){var D=a.each,k=a.Point,F=a.seriesType,z=a.seriesTypes;F("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'\x3cspan class\x3d"highcharts-color-{point.colorIndex}"\x3e\u25cf\x3c/span\x3e \x3cb\x3e {series.name}\x3c/b\x3e\x3cbr/\x3eOpen: {point.open}\x3cbr/\x3eHigh: {point.high}\x3cbr/\x3eLow: {point.low}\x3cbr/\x3eClose: {point.close}\x3cbr/\x3e'},
threshold:null,stickyTracking:!0},{directTouch:!1,pointArrayMap:["open","high","low","close"],toYData:function(a){return[a.open,a.high,a.low,a.close]},pointValKey:"close",translate:function(){var a=this,k=a.yAxis,A=!!a.modifyValue,v=["plotOpen","plotHigh","plotLow","plotClose","yBottom"];z.column.prototype.translate.apply(a);D(a.points,function(w){D([w.open,w.high,w.low,w.close,w.low],function(u,y){null!==u&&(A&&(u=a.modifyValue(u)),w[v[y]]=k.toPixels(u,!0))});w.tooltipPos[1]=w.plotHigh+k.pos-a.chart.plotTop})},
drawPoints:function(){var a=this,k=a.chart;D(a.points,function(A){var v,w,u,y,g=A.graphic,e,d=!g;void 0!==A.plotY&&(g||(A.graphic=g=k.renderer.path().add(a.group)),w=g.strokeWidth()%2/2,e=Math.round(A.plotX)-w,u=Math.round(A.shapeArgs.width/2),y=["M",e,Math.round(A.yBottom),"L",e,Math.round(A.plotHigh)],null!==A.open&&(v=Math.round(A.plotOpen)+w,y.push("M",e,v,"L",e-u,v)),null!==A.close&&(v=Math.round(A.plotClose)+w,y.push("M",e,v,"L",e+u,v)),g[d?"attr":"animate"]({d:y}).addClass(A.getClassName(),
!0))})},animate:null},{getClassName:function(){return k.prototype.getClassName.call(this)+(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}})})(J);(function(a){var D=a.defaultPlotOptions,k=a.each,F=a.merge;a=a.seriesType;a("candlestick","ohlc",F(D.column,{states:{hover:{lineWidth:2}},tooltip:D.ohlc.tooltip,threshold:null,stickyTracking:!0}),{drawPoints:function(){var a=this,H=a.chart;k(a.points,function(k){var A=k.graphic,v,w,u,y,g,e,d,t=!A;void 0!==k.plotY&&(A||(k.graphic=A=
H.renderer.path().add(a.group)),g=A.strokeWidth()%2/2,e=Math.round(k.plotX)-g,v=k.plotOpen,w=k.plotClose,u=Math.min(v,w),v=Math.max(v,w),d=Math.round(k.shapeArgs.width/2),w=Math.round(u)!==Math.round(k.plotHigh),y=v!==k.yBottom,u=Math.round(u)+g,v=Math.round(v)+g,g=[],g.push("M",e-d,v,"L",e-d,u,"L",e+d,u,"L",e+d,v,"Z","M",e,u,"L",e,w?Math.round(k.plotHigh):u,"M",e,v,"L",e,y?Math.round(k.yBottom):v),A[t?"attr":"animate"]({d:g}).addClass(k.getClassName(),!0))})}})})(J);var V=function(a){var D=a.each,
k=a.defined,F=a.seriesTypes,z=a.stableSort;return{getPlotBox:function(){return a.Series.prototype.getPlotBox.call(this.options.onSeries&&this.chart.get(this.options.onSeries)||this)},translate:function(){F.column.prototype.translate.apply(this);var a=this.options,G=this.chart,A=this.points,v=A.length-1,w,u,y=a.onSeries,y=y&&G.get(y),a=a.onKey||"y",g=y&&y.options.step,e=y&&y.points,d=e&&e.length,t=G.inverted,r=this.xAxis,l=this.yAxis,p=0,c,b,f,q;if(y&&y.visible&&d)for(p=(y.pointXOffset||0)+(y.barW||
0)/2,w=y.currentDataGrouping,b=e[d-1].x+(w?w.totalRange:0),z(A,function(a,b){return a.x-b.x}),a="plot"+a[0].toUpperCase()+a.substr(1);d--&&A[v]&&!(c=e[d],w=A[v],w.y=c.y,c.x<=w.x&&void 0!==c[a]&&(w.x<=b&&(w.plotY=c[a],c.x<w.x&&!g&&(f=e[d+1])&&void 0!==f[a]&&(q=(w.x-c.x)/(f.x-c.x),w.plotY+=q*(f[a]-c[a]),w.y+=q*(f.y-c.y))),v--,d++,0>v)););D(A,function(a,b){var c;a.plotX+=p;if(void 0===a.plotY||t)0<=a.plotX&&a.plotX<=r.len?t?(a.plotY=r.translate(a.x,0,1,0,1),a.plotX=k(a.y)?l.translate(a.y,0,0,0,1):0):
a.plotY=G.chartHeight-r.bottom-(r.opposite?r.height:0)+r.offset-l.top:a.shapeArgs={};(u=A[b-1])&&u.plotX===a.plotX&&(void 0===u.stackIndex&&(u.stackIndex=0),c=u.stackIndex+1);a.stackIndex=c});this.onSeries=y}}}(J);(function(a,D){function k(a){v[a+"pin"]=function(u,k,g,e,d){var t=d&&d.anchorX;d=d&&d.anchorY;"circle"===a&&e>g&&(u-=Math.round((e-g)/2),g=e);u=v[a](u,k,g,e);t&&d&&(u.push("M","circle"===a?u[1]-u[4]:u[1]+u[4]/2,k>d?k:k+e,"L",t,d),u=u.concat(v.circle(t-1,d-1,2,2)));return u}}var F=a.addEvent,
z=a.each,H=a.noop,G=a.seriesType,A=a.TrackerMixin,v=a.SVGRenderer.prototype.symbols;G("flags","column",{pointRange:0,allowOverlapX:!1,shape:"flag",stackDistance:12,textAlign:"center",tooltip:{pointFormat:"{point.text}\x3cbr/\x3e"},threshold:null,y:-30},{sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:a.Series.prototype.init,translate:D.translate,getPlotBox:D.getPlotBox,drawPoints:function(){var k=this.points,u=this.chart,y=u.renderer,
g,e,d=u.inverted,t=this.options,r=t.y,l,p,c,b,f,q,n=this.yAxis,E={},h=[];for(p=k.length;p--;)c=k[p],q=(d?c.plotY:c.plotX)>this.xAxis.len,g=c.plotX,b=c.stackIndex,l=c.options.shape||t.shape,e=c.plotY,void 0!==e&&(e=c.plotY+r-(void 0!==b&&b*t.stackDistance)),c.anchorX=b?void 0:c.plotX,f=b?void 0:c.plotY,b=c.graphic,void 0!==e&&0<=g&&!q?(b||(b=c.graphic=y.label("",null,null,l,null,null,t.useHTML).attr({align:"flag"===l?"left":"center",width:t.width,height:t.height,"text-align":t.textAlign}).addClass("highcharts-point").add(this.markerGroup),
c.graphic.div&&(c.graphic.div.point=c),b.isNew=!0),0<g&&(g-=b.strokeWidth()%2),l={y:e,anchorY:f},t.allowOverlapX&&(l.x=g,l.anchorX=c.anchorX),b.attr({text:c.options.title||t.title||"A"})[b.isNew?"attr":"animate"](l),t.allowOverlapX||(E[c.plotX]?E[c.plotX].size=Math.max(E[c.plotX].size,b.width):E[c.plotX]={align:0,size:b.width,target:g,anchorX:g}),c.tooltipPos=[g,e+n.pos-u.plotTop]):b&&(c.graphic=b.destroy());t.allowOverlapX||(a.objectEach(E,function(a){a.plotX=a.anchorX;h.push(a)}),a.distribute(h,
d?n.len:this.xAxis.len,100),z(k,function(a){var b=a.graphic&&E[a.plotX];b&&(a.graphic[a.graphic.isNew?"attr":"animate"]({x:b.pos,anchorX:a.anchorX}),a.graphic.isNew=!1)}));t.useHTML&&a.wrap(this.markerGroup,"on",function(b){return a.SVGElement.prototype.on.apply(b.apply(this,[].slice.call(arguments,1)),[].slice.call(arguments,1))})},drawTracker:function(){var a=this.points;A.drawTrackerPoint.apply(this);z(a,function(k){var u=k.graphic;u&&F(u.element,"mouseover",function(){0<k.stackIndex&&!k.raised&&
(k._y=u.y,u.attr({y:k._y-8}),k.raised=!0);z(a,function(a){a!==k&&a.raised&&a.graphic&&(a.graphic.attr({y:a._y}),a.raised=!1)})})})},animate:H,buildKDTree:H,setClip:H,invertGroups:H});v.flag=function(a,k,y,g,e){var d=e&&e.anchorX||a;e=e&&e.anchorY||k;return v.circle(d-1,e-1,2,2).concat(["M",d,e,"L",a,k+g,a,k,a+y,k,a+y,k+g,a,k+g,"Z"])};k("circle");k("square")})(J,V);(function(a){function D(a,c,b){this.init(a,c,b)}var k=a.addEvent,F=a.Axis,z=a.correctFloat,H=a.defaultOptions,G=a.defined,A=a.destroyObjectProperties,
v=a.each,w=a.fireEvent,u=a.hasTouch,y=a.isTouchDevice,g=a.merge,e=a.pick,d=a.removeEvent,t=a.wrap,r,l={height:y?20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:a.svg&&!y,margin:10,minWidth:6,step:.2,zIndex:3};H.scrollbar=g(!0,l,H.scrollbar);a.swapXY=r=function(a,c){var b=a.length,f;if(c)for(c=0;c<b;c+=3)f=a[c+1],a[c+1]=a[c+2],a[c+2]=f;return a};D.prototype={init:function(a,c,b){this.scrollbarButtons=[];this.renderer=a;this.userOptions=c;this.options=g(l,c);this.chart=b;this.size=e(this.options.size,
this.options.height);c.enabled&&(this.render(),this.initEvents(),this.addEvents())},render:function(){var a=this.renderer,c=this.options,b=this.size,f;this.group=f=a.g("scrollbar").attr({zIndex:c.zIndex,translateY:-99999}).add();this.track=a.rect().addClass("highcharts-scrollbar-track").attr({x:0,r:c.trackBorderRadius||0,height:b,width:b}).add(f);this.trackBorderWidth=this.track.strokeWidth();this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=a.g().add(f);this.scrollbar=a.rect().addClass("highcharts-scrollbar-thumb").attr({height:b,
width:b,r:c.barBorderRadius||0}).add(this.scrollbarGroup);this.scrollbarRifles=a.path(r(["M",-3,b/4,"L",-3,2*b/3,"M",0,b/4,"L",0,2*b/3,"M",3,b/4,"L",3,2*b/3],c.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%2/2,-this.scrollbarStrokeWidth%2/2);this.drawScrollbarButton(0);this.drawScrollbarButton(1)},position:function(a,c,b,f){var d=this.options.vertical,p=0,e=
this.rendered?"animate":"attr";this.x=a;this.y=c+this.trackBorderWidth;this.width=b;this.xOffset=this.height=f;this.yOffset=p;d?(this.width=this.yOffset=b=p=this.size,this.xOffset=c=0,this.barWidth=f-2*b,this.x=a+=this.options.margin):(this.height=this.xOffset=f=c=this.size,this.barWidth=b-2*f,this.y+=this.options.margin);this.group[e]({translateX:a,translateY:this.y});this.track[e]({width:b,height:f});this.scrollbarButtons[1][e]({translateX:d?0:b-c,translateY:d?f-p:0})},drawScrollbarButton:function(a){var c=
this.renderer,b=this.scrollbarButtons,f=this.options,d=this.size,p;p=c.g().add(this.group);b.push(p);p=c.rect().addClass("highcharts-scrollbar-button").add(p);p.attr(p.crisp({x:-.5,y:-.5,width:d+1,height:d+1,r:f.buttonBorderRadius},p.strokeWidth()));c.path(r(["M",d/2+(a?-1:1),d/2-3,"L",d/2+(a?-1:1),d/2+3,"L",d/2+(a?2:-2),d/2],f.vertical)).addClass("highcharts-scrollbar-arrow").add(b[a])},setRange:function(a,c){var b=this.options,d=b.vertical,p=b.minWidth,e=this.barWidth,g,h,B=this.rendered&&!this.hasDragged?
"animate":"attr";G(e)&&(a=Math.max(a,0),g=Math.ceil(e*a),this.calculatedWidth=h=z(e*Math.min(c,1)-g),h<p&&(g=(e-p+h)*a,h=p),p=Math.floor(g+this.xOffset+this.yOffset),e=h/2-.5,this.from=a,this.to=c,d?(this.scrollbarGroup[B]({translateY:p}),this.scrollbar[B]({height:h}),this.scrollbarRifles[B]({translateY:e}),this.scrollbarTop=p,this.scrollbarLeft=0):(this.scrollbarGroup[B]({translateX:p}),this.scrollbar[B]({width:h}),this.scrollbarRifles[B]({translateX:e}),this.scrollbarLeft=p,this.scrollbarTop=0),
12>=h?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0),!1===b.showFull&&(0>=a&&1<=c?this.group.hide():this.group.show()),this.rendered=!0)},initEvents:function(){var a=this;a.mouseMoveHandler=function(c){var b=a.chart.pointer.normalize(c),d=a.options.vertical?"chartY":"chartX",e=a.initPositions;!a.grabbedCenter||c.touches&&0===c.touches[0][d]||(b=a.cursorToScrollbarPosition(b)[d],d=a[d],d=b-d,a.hasDragged=!0,a.updatePosition(e[0]+d,e[1]+d),a.hasDragged&&w(a,"changed",{from:a.from,to:a.to,
trigger:"scrollbar",DOMType:c.type,DOMEvent:c}))};a.mouseUpHandler=function(c){a.hasDragged&&w(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:c.type,DOMEvent:c});a.grabbedCenter=a.hasDragged=a.chartX=a.chartY=null};a.mouseDownHandler=function(c){c=a.chart.pointer.normalize(c);c=a.cursorToScrollbarPosition(c);a.chartX=c.chartX;a.chartY=c.chartY;a.initPositions=[a.from,a.to];a.grabbedCenter=!0};a.buttonToMinClick=function(c){var b=z(a.to-a.from)*a.options.step;a.updatePosition(z(a.from-
b),z(a.to-b));w(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:c})};a.buttonToMaxClick=function(c){var b=(a.to-a.from)*a.options.step;a.updatePosition(a.from+b,a.to+b);w(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:c})};a.trackClick=function(c){var b=a.chart.pointer.normalize(c),d=a.to-a.from,e=a.y+a.scrollbarTop,n=a.x+a.scrollbarLeft;a.options.vertical&&b.chartY>e||!a.options.vertical&&b.chartX>n?a.updatePosition(a.from+d,a.to+d):a.updatePosition(a.from-d,a.to-d);
w(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:c})}},cursorToScrollbarPosition:function(a){var c=this.options,c=c.minWidth>this.calculatedWidth?c.minWidth:0;return{chartX:(a.chartX-this.x-this.xOffset)/(this.barWidth-c),chartY:(a.chartY-this.y-this.yOffset)/(this.barWidth-c)}},updatePosition:function(a,c){1<c&&(a=z(1-z(c-a)),c=1);0>a&&(c=z(c-a),a=0);this.from=a;this.to=c},update:function(a){this.destroy();this.init(this.chart.renderer,g(!0,this.options,a),this.chart)},addEvents:function(){var a=
this.options.inverted?[1,0]:[0,1],c=this.scrollbarButtons,b=this.scrollbarGroup.element,d=this.mouseDownHandler,e=this.mouseMoveHandler,n=this.mouseUpHandler,a=[[c[a[0]].element,"click",this.buttonToMinClick],[c[a[1]].element,"click",this.buttonToMaxClick],[this.track.element,"click",this.trackClick],[b,"mousedown",d],[b.ownerDocument,"mousemove",e],[b.ownerDocument,"mouseup",n]];u&&a.push([b,"touchstart",d],[b.ownerDocument,"touchmove",e],[b.ownerDocument,"touchend",n]);v(a,function(a){k.apply(null,
a)});this._events=a},removeEvents:function(){v(this._events,function(a){d.apply(null,a)});this._events.length=0},destroy:function(){var a=this.chart.scroller;this.removeEvents();v(["track","scrollbarRifles","scrollbar","scrollbarGroup","group"],function(a){this[a]&&this[a].destroy&&(this[a]=this[a].destroy())},this);a&&this===a.scrollbar&&(a.scrollbar=null,A(a.scrollbarButtons))}};t(F.prototype,"init",function(a){var c=this;a.apply(c,Array.prototype.slice.call(arguments,1));c.options.scrollbar&&c.options.scrollbar.enabled&&
(c.options.scrollbar.vertical=!c.horiz,c.options.startOnTick=c.options.endOnTick=!1,c.scrollbar=new D(c.chart.renderer,c.options.scrollbar,c.chart),k(c.scrollbar,"changed",function(a){var b=Math.min(e(c.options.min,c.min),c.min,c.dataMin),d=Math.max(e(c.options.max,c.max),c.max,c.dataMax)-b,n;c.horiz&&!c.reversed||!c.horiz&&c.reversed?(n=b+d*this.to,b+=d*this.from):(n=b+d*(1-this.from),b+=d*(1-this.to));c.setExtremes(b,n,!0,!1,a)}))});t(F.prototype,"render",function(a){var c=Math.min(e(this.options.min,
this.min),this.min,e(this.dataMin,this.min)),b=Math.max(e(this.options.max,this.max),this.max,e(this.dataMax,this.max)),d=this.scrollbar,q=this.titleOffset||0;a.apply(this,Array.prototype.slice.call(arguments,1));if(d){this.horiz?(d.position(this.left,this.top+this.height+2+this.chart.scrollbarsOffsets[1]+(this.opposite?0:q+this.axisTitleMargin+this.offset),this.width,this.height),q=1):(d.position(this.left+this.width+2+this.chart.scrollbarsOffsets[0]+(this.opposite?q+this.axisTitleMargin+this.offset:
0),this.top,this.width,this.height),q=0);if(!this.opposite&&!this.horiz||this.opposite&&this.horiz)this.chart.scrollbarsOffsets[q]+=this.scrollbar.size+this.scrollbar.options.margin;isNaN(c)||isNaN(b)||!G(this.min)||!G(this.max)?d.setRange(0,0):(q=(this.min-c)/(b-c),c=(this.max-c)/(b-c),this.horiz&&!this.reversed||!this.horiz&&this.reversed?d.setRange(q,c):d.setRange(1-c,1-q))}});t(F.prototype,"getOffset",function(a){var c=this.horiz?2:1,b=this.scrollbar;a.apply(this,Array.prototype.slice.call(arguments,
1));b&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[c]+=b.size+b.options.margin)});t(F.prototype,"destroy",function(a){this.scrollbar&&(this.scrollbar=this.scrollbar.destroy());a.apply(this,Array.prototype.slice.call(arguments,1))});a.Scrollbar=D})(J);(function(a){function D(a){this.init(a)}var k=a.addEvent,F=a.Axis,z=a.Chart,H=a.defaultOptions,G=a.defined,A=a.destroyObjectProperties,v=a.each,w=a.erase,u=a.error,y=a.extend,g=a.grep,e=a.hasTouch,d=a.isArray,t=a.isNumber,r=a.isObject,l=
a.isTouchDevice,p=a.merge,c=a.pick,b=a.removeEvent,f=a.Scrollbar,q=a.Series,n=a.seriesTypes,E=a.wrap,h=[].concat(a.defaultDataGroupingUnits),B=function(a){var b=g(arguments,t);if(b.length)return Math[a].apply(0,b)};h[4]=["day",[1,2,3,4]];h[5]=["week",[1,2,3]];y(H,{navigator:{height:40,margin:25,maskInside:!0,handles:{width:7,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0},series:{type:void 0===n.areaspline?"line":"areaspline",compare:null,dataGrouping:{approximation:"average",
enabled:!0,groupPixelWidth:2,smoothed:!0,units:h},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},pointRange:0,threshold:null},xAxis:{overscroll:0,className:"highcharts-navigator-xaxis",tickLength:0,tickPixelInterval:200,labels:{align:"left",x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},
tickLength:0,tickWidth:0}}});a.Renderer.prototype.symbols["navigator-handle"]=function(a,b,c,d,e){a=e.width/2;b=Math.round(a/3)+.5;e=e.height;return["M",-a-1,.5,"L",a,.5,"L",a,e+.5,"L",-a-1,e+.5,"L",-a-1,.5,"M",-b,4,"L",-b,e-3,"M",b-1,4,"L",b-1,e-3]};D.prototype={drawHandle:function(a,b,c,d){var m=this.navigatorOptions.handles.height;this.handles[b][d](c?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+parseInt(a,10)+.5-m)}:{translateX:Math.round(this.left+parseInt(a,
10)),translateY:Math.round(this.top+this.height/2-m/2-1)})},drawOutline:function(a,b,c,d){var m=this.navigatorOptions.maskInside,x=this.outline.strokeWidth(),e=x/2,x=x%2/2,C=this.outlineHeight,f=this.scrollbarHeight,q=this.size,n=this.left-f,h=this.top;c?(n-=e,c=h+b+x,b=h+a+x,a=["M",n+C,h-f-x,"L",n+C,c,"L",n,c,"L",n,b,"L",n+C,b,"L",n+C,h+q+f].concat(m?["M",n+C,c-e,"L",n+C,b+e]:[])):(a+=n+f-x,b+=n+f-x,h+=e,a=["M",n,h,"L",a,h,"L",a,h+C,"L",b,h+C,"L",b,h,"L",n+q+2*f,h].concat(m?["M",a-e,h,"L",b+e,h]:
[]));this.outline[d]({d:a})},drawMasks:function(a,b,c,d){var m=this.left,x=this.top,e=this.height,C,f,q,n;c?(q=[m,m,m],n=[x,x+a,x+b],f=[e,e,e],C=[a,b-a,this.size-b]):(q=[m,m+a,m+b],n=[x,x,x],f=[a,b-a,this.size-b],C=[e,e,e]);v(this.shades,function(a,b){a[d]({x:q[b],y:n[b],width:f[b],height:C[b]})})},renderElements:function(){var a=this,b=a.navigatorOptions,c=b.maskInside,d=a.chart,e=d.renderer,f;a.navigatorGroup=f=e.g("navigator").attr({zIndex:8,visibility:"hidden"}).add();v([!c,c,!c],function(b,m){a.shades[m]=
e.rect().addClass("highcharts-navigator-mask"+(1===m?"-inside":"-outside")).add(f)});a.outline=e.path().addClass("highcharts-navigator-outline").add(f);b.handles.enabled&&v([0,1],function(m){b.handles.inverted=d.inverted;a.handles[m]=e.symbol(b.handles.symbols[m],-b.handles.width/2-1,0,b.handles.width,b.handles.height,b.handles);a.handles[m].attr({zIndex:7-m}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][m]).add(f)})},update:function(a){v(this.series||[],function(a){a.baseSeries&&
delete a.baseSeries.navigatorSeries});this.destroy();p(!0,this.chart.options.navigator,this.options,a);this.init(this.chart)},render:function(b,d,e,f){var m=this.chart,x,C,q=this.scrollbarHeight,n,h=this.xAxis;x=h.fake?m.xAxis[0]:h;var g=this.navigatorEnabled,K,B=this.rendered;C=m.inverted;var l,p=m.xAxis[0].minRange,k=m.xAxis[0].options.maxRange;if(!this.hasDragged||G(e)){if(!t(b)||!t(d))if(B)e=0,f=c(h.width,x.width);else return;this.left=c(h.left,m.plotLeft+q+(C?m.plotWidth:0));this.size=K=n=c(h.len,
(C?m.plotHeight:m.plotWidth)-2*q);m=C?q:n+2*q;e=c(e,h.toPixels(b,!0));f=c(f,h.toPixels(d,!0));t(e)&&Infinity!==Math.abs(e)||(e=0,f=m);b=h.toValue(e,!0);d=h.toValue(f,!0);l=Math.abs(a.correctFloat(d-b));l<p?this.grabbedLeft?e=h.toPixels(d-p,!0):this.grabbedRight&&(f=h.toPixels(b+p,!0)):G(k)&&l>k&&(this.grabbedLeft?e=h.toPixels(d-k,!0):this.grabbedRight&&(f=h.toPixels(b+k,!0)));this.zoomedMax=Math.min(Math.max(e,f,0),K);this.zoomedMin=Math.min(Math.max(this.fixedWidth?this.zoomedMax-this.fixedWidth:
Math.min(e,f),0),K);this.range=this.zoomedMax-this.zoomedMin;K=Math.round(this.zoomedMax);e=Math.round(this.zoomedMin);g&&(this.navigatorGroup.attr({visibility:"visible"}),B=B&&!this.hasDragged?"animate":"attr",this.drawMasks(e,K,C,B),this.drawOutline(e,K,C,B),this.navigatorOptions.handles.enabled&&(this.drawHandle(e,0,C,B),this.drawHandle(K,1,C,B)));this.scrollbar&&(C?(C=this.top-q,x=this.left-q+(g||!x.opposite?0:(x.titleOffset||0)+x.axisTitleMargin),q=n+2*q):(C=this.top+(g?this.height:-q),x=this.left-
q),this.scrollbar.position(x,C,m,q),this.scrollbar.setRange(this.zoomedMin/n,this.zoomedMax/n));this.rendered=!0}},addMouseEvents:function(){var a=this,b=a.chart,c=b.container,d=[],f,q;a.mouseMoveHandler=f=function(b){a.onMouseMove(b)};a.mouseUpHandler=q=function(b){a.onMouseUp(b)};d=a.getPartsEvents("mousedown");d.push(k(c,"mousemove",f),k(c.ownerDocument,"mouseup",q));e&&(d.push(k(c,"touchmove",f),k(c.ownerDocument,"touchend",q)),d.concat(a.getPartsEvents("touchstart")));a.eventsToUnbind=d;a.series&&
a.series[0]&&d.push(k(a.series[0].xAxis,"foundExtremes",function(){b.navigator.modifyNavigatorAxisExtremes()}))},getPartsEvents:function(a){var b=this,m=[];v(["shades","handles"],function(c){v(b[c],function(d,e){m.push(k(d.element,a,function(a){b[c+"Mousedown"](a,e)}))})});return m},shadesMousedown:function(a,b){a=this.chart.pointer.normalize(a);var m=this.chart,c=this.xAxis,d=this.zoomedMin,e=this.left,f=this.size,x=this.range,q=a.chartX,h,n;m.inverted&&(q=a.chartY,e=this.top);1===b?(this.grabbedCenter=
q,this.fixedWidth=x,this.dragOffset=q-d):(a=q-e-x/2,0===b?a=Math.max(0,a):2===b&&a+x>=f&&(a=f-x,c.reversed?(a-=x,n=this.getUnionExtremes().dataMin):h=this.getUnionExtremes().dataMax),a!==d&&(this.fixedWidth=x,b=c.toFixedRange(a,a+x,n,h),G(b.min)&&m.xAxis[0].setExtremes(Math.min(b.min,b.max),Math.max(b.min,b.max),!0,null,{trigger:"navigator"})))},handlesMousedown:function(a,b){this.chart.pointer.normalize(a);a=this.chart;var c=a.xAxis[0],m=a.inverted&&!c.reversed||!a.inverted&&c.reversed;0===b?(this.grabbedLeft=
!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=m?c.min:c.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=m?c.max:c.min);a.fixedRange=null},onMouseMove:function(a){var b=this,c=b.chart,m=b.left,d=b.navigatorSize,e=b.range,f=b.dragOffset,q=c.inverted;a.touches&&0===a.touches[0].pageX||(a=c.pointer.normalize(a),c=a.chartX,q&&(m=b.top,c=a.chartY),b.grabbedLeft?(b.hasDragged=!0,b.render(0,0,c-m,b.otherHandlePos)):b.grabbedRight?(b.hasDragged=!0,b.render(0,0,b.otherHandlePos,
c-m)):b.grabbedCenter&&(b.hasDragged=!0,c<f?c=f:c>d+f-e&&(c=d+f-e),b.render(0,0,c-f,c-f+e)),b.hasDragged&&b.scrollbar&&b.scrollbar.options.liveRedraw&&(a.DOMType=a.type,setTimeout(function(){b.onMouseUp(a)},0)))},onMouseUp:function(a){var b=this.chart,c=this.xAxis,d=c&&c.reversed,m=this.scrollbar,e,f,q=a.DOMEvent||a;(!this.hasDragged||m&&m.hasDragged)&&"scrollbar"!==a.trigger||(m=this.getUnionExtremes(),this.zoomedMin===this.otherHandlePos?e=this.fixedExtreme:this.zoomedMax===this.otherHandlePos&&
(f=this.fixedExtreme),this.zoomedMax===this.size&&(f=d?m.dataMin:m.dataMax),0===this.zoomedMin&&(e=d?m.dataMax:m.dataMin),c=c.toFixedRange(this.zoomedMin,this.zoomedMax,e,f),G(c.min)&&b.xAxis[0].setExtremes(Math.min(c.min,c.max),Math.max(c.min,c.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:q}));"mousemove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=
null)},removeEvents:function(){this.eventsToUnbind&&(v(this.eventsToUnbind,function(a){a()}),this.eventsToUnbind=void 0);this.removeBaseSeriesEvents()},removeBaseSeriesEvents:function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&v(a,function(a){b(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&b(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))},init:function(a){var b=a.options,d=b.navigator,m=d.enabled,e=b.scrollbar,q=
e.enabled,b=m?d.height:0,h=q?e.height:0;this.handles=[];this.shades=[];this.chart=a;this.setBaseSeries();this.height=b;this.scrollbarHeight=h;this.scrollbarEnabled=q;this.navigatorEnabled=m;this.navigatorOptions=d;this.scrollbarOptions=e;this.outlineHeight=b+h;this.opposite=c(d.opposite,!m&&a.inverted);var n=this,e=n.baseSeries,q=a.xAxis.length,g=a.yAxis.length,l=e&&e[0]&&e[0].xAxis||a.xAxis[0]||{options:{}};k(a,"getMargins",function(){var b=n.opposite?"plotTop":"marginBottom";a.inverted&&(b=n.opposite?
"marginRight":"plotLeft");a[b]=(a[b]||0)+(m||!a.inverted?n.outlineHeight:0)+d.margin});a.isDirtyBox=!0;n.navigatorEnabled?(n.xAxis=new F(a,p({breaks:l.options.breaks,ordinal:l.options.ordinal},d.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0,type:"datetime",index:q,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},a.inverted?{offsets:[h,0,-h,0],width:b}:{offsets:[0,-h,0,h],height:b})),n.yAxis=new F(a,p(d.yAxis,{id:"navigator-y-axis",
alignTicks:!1,offset:0,index:g,zoomEnabled:!1},a.inverted?{width:b}:{height:b})),e||d.series.data?n.updateNavigatorSeries(!1):0===a.series.length&&(n.unbindRedraw=k(a,"beforeRedraw",function(){0<a.series.length&&!n.series&&(n.setBaseSeries(),n.unbindRedraw())})),n.renderElements(),n.addMouseEvents()):n.xAxis={translate:function(b,c){var d=a.xAxis[0],e=d.getExtremes(),m=d.len-2*h,f=B("min",d.options.min,e.dataMin),d=B("max",d.options.max,e.dataMax)-f;return c?b*d/m+f:m*(b-f)/d},toPixels:function(a){return this.translate(a)},
toValue:function(a){return this.translate(a,!0)},toFixedRange:F.prototype.toFixedRange,fake:!0};a.options.scrollbar.enabled&&(a.scrollbar=n.scrollbar=new f(a.renderer,p(a.options.scrollbar,{margin:n.navigatorEnabled?0:10,vertical:a.inverted}),a),k(n.scrollbar,"changed",function(b){var c=n.size,d=c*this.to,c=c*this.from;n.hasDragged=n.scrollbar.hasDragged;n.render(0,0,c,d);(a.options.scrollbar.liveRedraw||"mousemove"!==b.DOMType&&"touchmove"!==b.DOMType)&&setTimeout(function(){n.onMouseUp(b)})}));
n.addBaseSeriesEvents();n.addChartEvents()},getUnionExtremes:function(a){var b=this.chart.xAxis[0],d=this.xAxis,e=d.options,m=b.options,f;a&&null===b.dataMin||(f={dataMin:c(e&&e.min,B("min",m.min,b.dataMin,d.dataMin,d.min)),dataMax:c(e&&e.max,B("max",m.max,b.dataMax,d.dataMax,d.max))});return f},setBaseSeries:function(a,b){var c=this.chart,d=this.baseSeries=[];a=a||c.options&&c.options.navigator.baseSeries||0;v(c.series||[],function(b,c){b.options.isInternal||!b.options.showInNavigator&&(c!==a&&b.options.id!==
a||!1===b.options.showInNavigator)||d.push(b)});this.xAxis&&!this.xAxis.fake&&this.updateNavigatorSeries(!0,b)},updateNavigatorSeries:function(c,e){var m=this,f=m.chart,n=m.baseSeries,q,h,x=m.navigatorOptions.series,g,B={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:!1,isInternal:!0},l=m.series=a.grep(m.series||[],function(c){var d=c.baseSeries;return 0>a.inArray(d,n)?(d&&(b(d,"updatedData",m.updatedDataHandler),
delete d.navigatorSeries),c.destroy(),!1):!0});n&&n.length&&v(n,function(a){var b=a.navigatorSeries,c=y({color:a.color,visible:a.visible},d(x)?H.navigator.series:x);b&&!1===m.navigatorOptions.adaptToUpdatedData||(B.name="Navigator "+n.length,q=a.options||{},g=q.navigatorOptions||{},h=p(q,B,c,g),c=g.data||c.data,m.hasNavigatorData=m.hasNavigatorData||!!c,h.data=c||q.data&&q.data.slice(0),b&&b.options?b.update(h,e):(a.navigatorSeries=f.initSeries(h),a.navigatorSeries.baseSeries=a,l.push(a.navigatorSeries)))});
if(x.data&&(!n||!n.length)||d(x))m.hasNavigatorData=!1,x=a.splat(x),v(x,function(a,b){B.name="Navigator "+(l.length+1);h=p(H.navigator.series,{color:f.series[b]&&!f.series[b].options.isInternal&&f.series[b].color||f.options.colors[b]||f.options.colors[0]},B,a);h.data=a.data;h.data&&(m.hasNavigatorData=!0,l.push(f.initSeries(h)))});c&&this.addBaseSeriesEvents()},addBaseSeriesEvents:function(){var a=this,b=a.baseSeries||[];b[0]&&b[0].xAxis&&k(b[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);
v(b,function(b){k(b,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)});k(b,"hide",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)});!1!==this.navigatorOptions.adaptToUpdatedData&&b.xAxis&&k(b,"updatedData",this.updatedDataHandler);k(b,"remove",function(){this.navigatorSeries&&(w(a.series,this.navigatorSeries),G(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1),delete this.navigatorSeries)})},this)},modifyNavigatorAxisExtremes:function(){var a=
this.xAxis,b;a.getExtremes&&(!(b=this.getUnionExtremes(!0))||b.dataMin===a.min&&b.dataMax===a.max||(a.min=b.dataMin,a.max=b.dataMax))},modifyBaseAxisExtremes:function(){var a=this.chart.navigator,b=this.getExtremes(),d=b.dataMin,e=b.dataMax,b=b.max-b.min,f=a.stickToMin,n=a.stickToMax,q=c(this.options.overscroll,0),h,g,B=a.series&&a.series[0],l=!!this.setExtremes;this.eventArgs&&"rangeSelectorButton"===this.eventArgs.trigger||(f&&(g=d,h=g+b),n&&(h=e+q,f||(g=Math.max(h-b,B&&B.xData?B.xData[0]:-Number.MAX_VALUE))),
l&&(f||n)&&t(g)&&(this.min=this.userMin=g,this.max=this.userMax=h));a.stickToMin=a.stickToMax=null},updatedDataHandler:function(){var a=this.chart.navigator,b=this.navigatorSeries;a.stickToMax=a.xAxis.reversed?0===Math.round(a.zoomedMin):Math.round(a.zoomedMax)>=Math.round(a.size);a.stickToMin=t(this.xAxis.min)&&this.xAxis.min<=this.xData[0]&&(!this.chart.fixedRange||!a.stickToMax);b&&!a.hasNavigatorData&&(b.options.pointStart=this.xData[0],b.setData(this.options.data,!1,null,!1))},addChartEvents:function(){k(this.chart,
"redraw",function(){var a=this.navigator,b=a&&(a.baseSeries&&a.baseSeries[0]&&a.baseSeries[0].xAxis||a.scrollbar&&this.xAxis[0]);b&&a.render(b.min,b.max)})},destroy:function(){this.removeEvents();this.xAxis&&(w(this.chart.xAxis,this.xAxis),w(this.chart.axes,this.xAxis));this.yAxis&&(w(this.chart.yAxis,this.yAxis),w(this.chart.axes,this.yAxis));v(this.series||[],function(a){a.destroy&&a.destroy()});v("series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" "),
function(a){this[a]&&this[a].destroy&&this[a].destroy();this[a]=null},this);v([this.handles],function(a){A(a)},this)}};a.Navigator=D;E(F.prototype,"zoom",function(a,b,c){var d=this.chart,e=d.options,f=e.chart.zoomType,m=e.chart.pinchType,n=e.navigator,e=e.rangeSelector,q;this.isXAxis&&(n&&n.enabled||e&&e.enabled)&&(!l&&"x"===f||l&&"x"===m?d.resetZoomButton="blocked":"y"===f?q=!1:(!l&&"xy"===f||l&&"xy"===m)&&this.options.range&&(d=this.previousZoom,G(b)?this.previousZoom=[this.min,this.max]:d&&(b=
d[0],c=d[1],delete this.previousZoom)));return void 0!==q?q:a.call(this,b,c)});k(z,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=this.navigator=new D(this)});k(z,"afterSetChartSize",function(){var a=this.legend,b=this.navigator,d,e,f,n;b&&(e=a&&a.options,f=b.xAxis,n=b.yAxis,d=b.scrollbarHeight,this.inverted?(b.left=b.opposite?this.chartWidth-d-b.height:this.spacing[3]+d,b.top=this.plotTop+d):(b.left=this.plotLeft+d,b.top=b.navigatorOptions.top||
this.chartHeight-b.height-d-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(e&&"bottom"===e.verticalAlign&&e.enabled&&!e.floating?a.legendHeight+c(e.margin,10):0)),f&&n&&(this.inverted?f.options.left=n.options.left=b.left:f.options.top=n.options.top=b.top,f.setAxisSize(),n.setAxisSize()))});k(z,"update",function(a){var b=a.options.navigator||{},c=a.options.scrollbar||{};this.navigator||this.scroller||!b.enabled&&!c.enabled||(p(!0,this.options.navigator,
b),p(!0,this.options.scrollbar,c),delete a.options.navigator,delete a.options.scrollbar)});k(z,"afterUpdate",function(){this.navigator||this.scroller||!this.options.navigator.enabled&&!this.options.scrollbar.enabled||(this.scroller=this.navigator=new D(this))});E(q.prototype,"addPoint",function(a,b,c,d,e){var f=this.options.turboThreshold;f&&this.xData.length>f&&r(b,!0)&&this.chart.navigator&&u(20,!0);a.call(this,b,c,d,e)});k(z,"afterAddSeries",function(){this.navigator&&this.navigator.setBaseSeries(null,
!1)});k(q,"afterUpdate",function(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)});z.prototype.callbacks.push(function(a){var b=a.navigator;b&&a.xAxis[0]&&(a=a.xAxis[0].getExtremes(),b.render(a.min,a.max))})})(J);(function(a){function D(a){this.init(a)}var k=a.addEvent,F=a.Axis,z=a.Chart,H=a.css,G=a.createElement,A=a.defaultOptions,v=a.defined,w=a.destroyObjectProperties,u=a.discardElement,y=a.each,g=a.extend,e=a.fireEvent,d=a.isNumber,t=a.merge,r=a.pick,
l=a.pInt,p=a.splat,c=a.wrap;g(A,{rangeSelector:{verticalAlign:"top",buttonTheme:{"stroke-width":0,width:28,height:18,padding:2,zIndex:7},floating:!1,x:0,y:0,height:void 0,inputPosition:{align:"right",x:0,y:0},buttonPosition:{align:"left",x:0,y:0}}});A.lang=t(A.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});D.prototype={clickButton:function(a,c){var b=this,e=b.chart,f=b.buttonOptions[a],h=e.xAxis[0],g=e.scroller&&e.scroller.getUnionExtremes()||h||{},m=g.dataMin,l=g.dataMax,
C,t=h&&Math.round(Math.min(h.max,r(l,h.max))),I=f.type,u,g=f._range,v,w,A,z=f.dataGrouping;if(null!==m&&null!==l){e.fixedRange=g;z&&(this.forcedDataGrouping=!0,F.prototype.setDataGrouping.call(h||{chart:this.chart},z,!1));if("month"===I||"year"===I)h?(I={range:f,max:t,chart:e,dataMin:m,dataMax:l},C=h.minFromRange.call(I),d(I.newMax)&&(t=I.newMax)):g=f;else if(g)C=Math.max(t-g,m),t=Math.min(C+g,l);else if("ytd"===I)if(h)void 0===l&&(m=Number.MAX_VALUE,l=Number.MIN_VALUE,y(e.series,function(a){a=a.xData;
m=Math.min(a[0],m);l=Math.max(a[a.length-1],l)}),c=!1),t=b.getYTDExtremes(l,m,e.time.useUTC),C=v=t.min,t=t.max;else{k(e,"beforeRender",function(){b.clickButton(a)});return}else"all"===I&&h&&(C=m,t=l);C+=f._offsetMin;t+=f._offsetMax;b.setSelected(a);h?h.setExtremes(C,t,r(c,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:f}):(u=p(e.options.xAxis)[0],A=u.range,u.range=g,w=u.min,u.min=v,k(e,"load",function(){u.range=A;u.min=w}))}},setSelected:function(a){this.selected=this.options.selected=
a},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var b=this,c=a.options.rangeSelector,d=c.buttons||[].concat(b.defaultButtons),g=c.selected,h=function(){var a=b.minInput,c=b.maxInput;a&&a.blur&&e(a,"blur");c&&c.blur&&e(c,"blur")};b.chart=a;b.options=c;b.buttons=[];a.extraTopMargin=c.height;b.buttonOptions=d;this.unMouseDown=k(a.container,
"mousedown",h);this.unResize=k(a,"resize",h);y(d,b.computeButtonRange);void 0!==g&&d[g]&&this.clickButton(g,!1);k(a,"load",function(){a.xAxis&&a.xAxis[0]&&k(a.xAxis[0],"setExtremes",function(c){this.max-this.min!==a.fixedRange&&"rangeSelectorButton"!==c.trigger&&"updatedData"!==c.trigger&&b.forcedDataGrouping&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var a=this.chart,c=a.xAxis[0],e=Math.round(c.max-c.min),n=!c.hasVisibleSeries,g=a.scroller&&a.scroller.getUnionExtremes()||c,h=
g.dataMin,l=g.dataMax,a=this.getYTDExtremes(l,h,a.time.useUTC),m=a.min,p=a.max,t=this.selected,k=d(t),r=this.options.allButtonsEnabled,u=this.buttons;y(this.buttonOptions,function(a,b){var d=a._range,f=a.type,q=a.count||1,g=u[b],B=0;a=a._offsetMax-a._offsetMin;b=b===t;var C=d>l-h,x=d<c.minRange,E=!1,I=!1,d=d===e;("month"===f||"year"===f)&&e+36E5>=864E5*{month:28,year:365}[f]*q-a&&e-36E5<=864E5*{month:31,year:366}[f]*q+a?d=!0:"ytd"===f?(d=p-m+a===e,E=!b):"all"===f&&(d=c.max-c.min>=l-h,I=!b&&k&&d);
f=!r&&(C||x||I||n);q=b&&d||d&&!k&&!E;f?B=3:q&&(k=!0,B=2);g.state!==B&&g.setState(B)})},computeButtonRange:function(a){var b=a.type,c=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*c;else if("month"===b||"year"===b)a._range=864E5*{month:30,year:365}[b]*c;a._offsetMin=r(a.offsetMin,0);a._offsetMax=r(a.offsetMax,0);a._range+=a._offsetMax-a._offsetMin},setInputValue:function(a,c){var b=this.chart.options.rangeSelector,d=this.chart.time,e=this[a+
"Input"];v(c)&&(e.previousValue=e.HCTime,e.HCTime=c);e.value=d.dateFormat(b.inputEditDateFormat||"%Y-%m-%d",e.HCTime);this[a+"DateBox"].attr({text:d.dateFormat(b.inputDateFormat||"%b %e, %Y",e.HCTime)})},showInput:function(a){var b=this.inputGroup,c=this[a+"DateBox"];H(this[a+"Input"],{left:b.translateX+c.x+"px",top:b.translateY+"px",width:c.width-2+"px",height:c.height-2+"px",border:"2px solid silver"})},hideInput:function(a){H(this[a+"Input"],{border:0,width:"1px",height:"1px"});this.setInputValue(a)},
drawInput:function(a){function b(){var a=k.value,b=(h.inputDateParser||Date.parse)(a),f=e.xAxis[0],n=e.scroller&&e.scroller.xAxis?e.scroller.xAxis:f,q=n.dataMin,n=n.dataMax;b!==k.previousValue&&(k.previousValue=b,d(b)||(b=a.split("-"),b=Date.UTC(l(b[0]),l(b[1])-1,l(b[2]))),d(b)&&(e.time.useUTC||(b+=6E4*(new Date).getTimezoneOffset()),m?b>c.maxInput.HCTime?b=void 0:b<q&&(b=q):b<c.minInput.HCTime?b=void 0:b>n&&(b=n),void 0!==b&&f.setExtremes(m?b:f.min,m?f.max:b,void 0,void 0,{trigger:"rangeSelectorInput"})))}
var c=this,e=c.chart,g=e.renderer,h=e.options.rangeSelector,p=c.div,m="min"===a,k,t,r=this.inputGroup;this[a+"Label"]=t=g.label(A.lang[m?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(r);r.offset+=t.width+5;this[a+"DateBox"]=g=g.label("",r.offset).addClass("highcharts-range-input").attr({padding:2,width:h.inputBoxWidth||90,height:h.inputBoxHeight||17,stroke:h.inputBoxBorderColor||"#cccccc","stroke-width":1,"text-align":"center"}).on("click",
function(){c.showInput(a);c[a+"Input"].focus()}).add(r);r.offset+=g.width+(m?10:0);this[a+"Input"]=k=G("input",{name:a,className:"highcharts-range-selector",type:"text"},{top:e.plotTop+"px"},p);k.onfocus=function(){c.showInput(a)};k.onblur=function(){c.hideInput(a)};k.onchange=b;k.onkeypress=function(a){13===a.keyCode&&b()}},getPosition:function(){var a=this.chart,c=a.options.rangeSelector,a="top"===c.verticalAlign?a.plotTop-a.axisOffset[0]:0;return{buttonTop:a+c.buttonPosition.y,inputTop:a+c.inputPosition.y-
10}},getYTDExtremes:function(a,c,d){var b=this.chart.time,e=new b.Date(a),f=b.get("FullYear",e);d=d?b.Date.UTC(f,0,1):+new b.Date(f,0,1);c=Math.max(c||0,d);e=e.getTime();return{max:Math.min(a||e,e),min:c}},render:function(a,c){var b=this,d=b.chart,e=d.renderer,f=d.container,g=d.options,m=g.exporting&&!1!==g.exporting.enabled&&g.navigation&&g.navigation.buttonOptions,l=A.lang,k=b.div,p=g.rangeSelector,g=p.floating,t=b.buttons,k=b.inputGroup,u=p.buttonTheme,v=p.buttonPosition,w=p.inputPosition,z=p.inputEnabled,
D=u&&u.states,F=d.plotLeft,H,L=b.buttonGroup,J;J=b.rendered;var P=b.options.verticalAlign,R=d.legend,S=R&&R.options,T=v.y,Q=w.y,U=J||!1,O=0,M=0,N;if(!1!==p.enabled){J||(b.group=J=e.g("range-selector-group").attr({zIndex:7}).add(),b.buttonGroup=L=e.g("range-selector-buttons").add(J),b.zoomText=e.text(l.rangeSelectorZoom,r(F+v.x,F),15).css(p.labelStyle).add(L),H=r(F+v.x,F)+b.zoomText.getBBox().width+5,y(b.buttonOptions,function(a,c){t[c]=e.button(a.text,H,0,function(){var d=a.events&&a.events.click,
e;d&&(e=d.call(a));!1!==e&&b.clickButton(c);b.isActive=!0},u,D&&D.hover,D&&D.select,D&&D.disabled).attr({"text-align":"center"}).add(L);H+=t[c].width+r(p.buttonSpacing,5)}),!1!==z&&(b.div=k=G("div",null,{position:"relative",height:0,zIndex:1}),f.parentNode.insertBefore(k,f),b.inputGroup=k=e.g("input-group").add(J),k.offset=0,b.drawInput("min"),b.drawInput("max")));F=d.plotLeft-d.spacing[3];b.updateButtonStates();m&&this.titleCollision(d)&&"top"===P&&"right"===v.align&&v.y+L.getBBox().height-12<(m.y||
0)+m.height&&(O=-40);"left"===v.align?N=v.x-d.spacing[3]:"right"===v.align&&(N=v.x+O-d.spacing[1]);L.align({y:v.y,width:L.getBBox().width,align:v.align,x:N},!0,d.spacingBox);b.group.placed=U;b.buttonGroup.placed=U;!1!==z&&(O=m&&this.titleCollision(d)&&"top"===P&&"right"===w.align&&w.y-k.getBBox().height-12<(m.y||0)+m.height+d.spacing[0]?-40:0,"left"===w.align?N=F:"right"===w.align&&(N=-Math.max(d.axisOffset[1],-O)),k.align({y:w.y,width:k.getBBox().width,align:w.align,x:w.x+N-2},!0,d.spacingBox),f=
k.alignAttr.translateX+k.alignOptions.x-O+k.getBBox().x+2,m=k.alignOptions.width,l=L.alignAttr.translateX+L.getBBox().x,N=L.getBBox().width+20,(w.align===v.align||l+N>f&&f+m>l&&T<Q+k.getBBox().height)&&k.attr({translateX:k.alignAttr.translateX+(d.axisOffset[1]>=-O?0:-O),translateY:k.alignAttr.translateY+L.getBBox().height+10}),b.setInputValue("min",a),b.setInputValue("max",c),b.inputGroup.placed=U);b.group.align({verticalAlign:P},!0,d.spacingBox);a=b.group.getBBox().height+20;c=b.group.alignAttr.translateY;
"bottom"===P&&(R=S&&"bottom"===S.verticalAlign&&S.enabled&&!S.floating?R.legendHeight+r(S.margin,10):0,a=a+R-20,M=c-a-(g?0:p.y)-10);if("top"===P)g&&(M=0),d.titleOffset&&(M=d.titleOffset+d.options.title.margin),M+=d.margin[0]-d.spacing[0]||0;else if("middle"===P)if(Q===T)M=0>Q?c+void 0:c;else if(Q||T)M=0>Q||0>T?M-Math.min(Q,T):c-a+NaN;b.group.translate(p.x,p.y+Math.floor(M));!1!==z&&(b.minInput.style.marginTop=b.group.translateY+"px",b.maxInput.style.marginTop=b.group.translateY+"px");b.rendered=!0}},
getHeight:function(){var a=this.options,c=this.group,d=a.y,e=a.buttonPosition.y,a=a.inputPosition.y,c=c?c.getBBox(!0).height+13+d:0,d=Math.min(a,e);if(0>a&&0>e||0<a&&0<e)c+=Math.abs(d);return c},titleCollision:function(a){return!(a.options.title.text||a.options.subtitle.text)},update:function(a){var b=this.chart;t(!0,b.options.rangeSelector,a);this.destroy();this.init(b);b.rangeSelector.render()},destroy:function(){var b=this,c=b.minInput,d=b.maxInput;b.unMouseDown();b.unResize();w(b.buttons);c&&
(c.onfocus=c.onblur=c.onchange=null);d&&(d.onfocus=d.onblur=d.onchange=null);a.objectEach(b,function(a,c){a&&"chart"!==c&&(a.destroy?a.destroy():a.nodeType&&u(this[c]));a!==D.prototype[c]&&(b[c]=null)},this)}};F.prototype.toFixedRange=function(a,c,e,g){var b=this.chart&&this.chart.fixedRange;a=r(e,this.translate(a,!0,!this.horiz));c=r(g,this.translate(c,!0,!this.horiz));e=b&&(c-a)/b;.7<e&&1.3>e&&(g?a=c-b:c=a+b);d(a)&&d(c)||(a=c=void 0);return{min:a,max:c}};F.prototype.minFromRange=function(){var a=
this.range,c={month:"Month",year:"FullYear"}[a.type],e,g=this.max,l,h,k=function(a,b){var d=new Date(a),e=d["get"+c]();d["set"+c](e+b);e===d["get"+c]()&&d.setDate(0);return d.getTime()-a};d(a)?(e=g-a,h=a):(e=g+k(g,-a.count),this.chart&&(this.chart.fixedRange=g-e));l=r(this.dataMin,Number.MIN_VALUE);d(e)||(e=l);e<=l&&(e=l,void 0===h&&(h=k(e,a.count)),this.newMax=Math.min(e+h,this.dataMax));d(g)||(e=void 0);return e};k(z,"afterGetContainer",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=
new D(this))});c(z.prototype,"render",function(a,c,d){var b=this.axes,e=this.rangeSelector;e&&(y(b,function(a){a.updateNames();a.setScale()}),this.getAxisMargins(),e.render(),b=e.options.verticalAlign,e.options.floating||("bottom"===b?this.extraBottomMargin=!0:"middle"!==b&&(this.extraTopMargin=!0)));a.call(this,c,d)});k(z,"update",function(a){var b=a.options;a=this.rangeSelector;this.extraTopMargin=this.extraBottomMargin=!1;this.isDirtyBox=!0;a&&(a.render(),b=b.rangeSelector&&b.rangeSelector.verticalAlign||
a.options&&a.options.verticalAlign,a.options.floating||("bottom"===b?this.extraBottomMargin=!0:"middle"!==b&&(this.extraTopMargin=!0)))});c(z.prototype,"redraw",function(a,c,d){var b=this.rangeSelector;b&&!b.options.floating&&(b.render(),b=b.options.verticalAlign,"bottom"===b?this.extraBottomMargin=!0:"middle"!==b&&(this.extraTopMargin=!0));a.call(this,c,d)});k(z,"getMargins",function(){var a=this.rangeSelector;a&&(a=a.getHeight(),this.extraTopMargin&&(this.plotTop+=a),this.extraBottomMargin&&(this.marginBottom+=
a))});z.prototype.callbacks.push(function(a){function b(){c=a.xAxis[0].getExtremes();d(c.min)&&e.render(c.min,c.max)}var c,e=a.rangeSelector,g,h;e&&(h=k(a.xAxis[0],"afterSetExtremes",function(a){e.render(a.min,a.max)}),g=k(a,"redraw",b),b());k(a,"destroy",function(){e&&(g(),h())})});a.RangeSelector=D})(J);(function(a){var D=a.addEvent,k=a.arrayMax,F=a.arrayMin,z=a.Axis,H=a.Chart,G=a.defined,A=a.each,v=a.format,w=a.grep,u=a.inArray,y=a.isNumber,g=a.isString,e=a.map,d=a.merge,t=a.pick,r=a.Point,l=a.Series,
p=a.splat,c=a.SVGRenderer,b=a.wrap,f=l.prototype,q=f.init,n=f.processData,E=r.prototype.tooltipFormatter;a.StockChart=a.stockChart=function(b,c,m){var f=g(b)||b.nodeName,h=arguments[f?1:0],l=h.series,k=a.getOptions(),n,q=t(h.navigator&&h.navigator.enabled,k.navigator.enabled,!0),r=q?{startOnTick:!1,endOnTick:!1}:null,B={marker:{enabled:!1,radius:2}},u={shadow:!1,borderWidth:0};h.xAxis=e(p(h.xAxis||{}),function(a,b){return d({minPadding:0,maxPadding:0,overscroll:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},
showLastLabel:!0},k.xAxis,k.xAxis&&k.xAxis[b],a,{type:"datetime",categories:null},r)});h.yAxis=e(p(h.yAxis||{}),function(a,b){n=t(a.opposite,!0);return d({labels:{y:-2},opposite:n,showLastLabel:!(!a.categories&&"category"!==a.type),title:{text:null}},k.yAxis,k.yAxis&&k.yAxis[b],a)});h.series=null;h=d({chart:{panning:!0,pinchType:"x"},navigator:{enabled:q},scrollbar:{enabled:t(k.scrollbar.enabled,!0)},rangeSelector:{enabled:t(k.rangeSelector.enabled,!0)},title:{text:null},tooltip:{split:t(k.tooltip.split,
!0),crosshairs:!0},legend:{enabled:!1},plotOptions:{line:B,spline:B,area:B,areaspline:B,arearange:B,areasplinerange:B,column:u,columnrange:u,candlestick:u,ohlc:u}},h,{isStock:!0});h.series=l;return f?new H(b,h,m):new H(h,c)};b(z.prototype,"autoLabelAlign",function(a){var b=this.chart,c=this.options,b=b._labelPanes=b._labelPanes||{},d=this.options.labels;return this.chart.options.isStock&&"yAxis"===this.coll&&(c=c.top+","+c.height,!b[c]&&d.enabled)?(15===d.x&&(d.x=0),void 0===d.align&&(d.align="right"),
b[c]=this,"right"):a.apply(this,[].slice.call(arguments,1))});D(z,"destroy",function(){var a=this.chart,b=this.options&&this.options.top+","+this.options.height;b&&a._labelPanes&&a._labelPanes[b]===this&&delete a._labelPanes[b]});b(z.prototype,"getPlotLinePath",function(b,c,d,f,k,l){var h=this,m=this.isLinked&&!this.series?this.linkedParent.series:this.series,n=h.chart,p=n.renderer,q=h.left,r=h.top,B,x,v,w,C=[],z=[],D,E;if("xAxis"!==h.coll&&"yAxis"!==h.coll)return b.apply(this,[].slice.call(arguments,
1));z=function(a){var b="xAxis"===a?"yAxis":"xAxis";a=h.options[b];return y(a)?[n[b][a]]:g(a)?[n.get(a)]:e(m,function(a){return a[b]})}(h.coll);A(h.isXAxis?n.yAxis:n.xAxis,function(a){if(G(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?"yAxis":"xAxis",b=G(a.options[b])?n[b][a.options[b]]:n[b][0];h===b&&z.push(a)}});D=z.length?[]:[h.isXAxis?n.yAxis[0]:n.xAxis[0]];A(z,function(b){-1!==u(b,D)||a.find(D,function(a){return a.pos===b.pos&&a.len&&b.len})||D.push(b)});E=t(l,h.translate(c,
null,null,f));y(E)&&(h.horiz?A(D,function(a){var b;x=a.pos;w=x+a.len;B=v=Math.round(E+h.transB);if(B<q||B>q+h.width)k?B=v=Math.min(Math.max(q,B),q+h.width):b=!0;b||C.push("M",B,x,"L",v,w)}):A(D,function(a){var b;B=a.pos;v=B+a.len;x=w=Math.round(r+h.height-E);if(x<r||x>r+h.height)k?x=w=Math.min(Math.max(r,x),h.top+h.height):b=!0;b||C.push("M",B,x,"L",v,w)}));return 0<C.length?p.crispPolyLine(C,d||1):null});c.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+
1]=a[c+4]=Math.round(a[c+1])-b%2/2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=Math.round(a[c+2])+b%2/2);return a};b(z.prototype,"hideCrosshair",function(a,b){a.call(this,b);this.crossLabel&&(this.crossLabel=this.crossLabel.hide())});D(z,"afterDrawCrosshair",function(a){var b,c;if(G(this.crosshair.label)&&this.crosshair.label.enabled&&this.cross){var d=this.chart,e=this.options.crosshair.label,f=this.horiz;b=this.opposite;c=this.left;var g=this.top,h=this.crossLabel,k=e.format,l="",n="inside"===this.options.tickPosition,
p=!1!==this.crosshair.snap,q=0,r=a.e||this.cross&&this.cross.e,u=a.point;a=f?"center":b?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";h||(h=this.crossLabel=d.renderer.label(null,null,null,e.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&&" highcharts-color-"+this.series[0].colorIndex)).attr({align:e.align||a,padding:t(e.padding,8),r:t(e.borderRadius,3),zIndex:2}).add(this.labelGroup));f?(a=p?u.plotX+c:r.chartX,g+=b?0:this.height):(a=b?this.width+
c:0,g=p?u.plotY+g:r.chartY);k||e.formatter||(this.isDatetimeAxis&&(l="%b %d, %Y"),k="{value"+(l?":"+l:"")+"}");l=p?u[this.isXAxis?"x":"y"]:this.toValue(f?r.chartX:r.chartY);h.attr({text:k?v(k,{value:l},d.time):e.formatter.call(this,l),x:a,y:g,visibility:l<this.min||l>this.max?"hidden":"visible"});e=h.getBBox();if(f){if(n&&!b||!n&&b)g=h.y-e.height}else g=h.y-e.height/2;f?(b=c-e.x,c=c+this.width-e.x):(b="left"===this.labelAlign?c:0,c="right"===this.labelAlign?c+this.width:d.chartWidth);h.translateX<
b&&(q=b-h.translateX);h.translateX+e.width>=c&&(q=-(h.translateX+e.width-c));h.attr({x:a+q,y:g,anchorX:f?a:this.opposite?0:d.chartWidth,anchorY:f?this.opposite?d.chartHeight:0:g+e.height/2})}});f.init=function(){q.apply(this,arguments);this.setCompare(this.options.compare)};f.setCompare=function(a){this.modifyValue="value"===a||"percent"===a?function(b,c){var d=this.compareValue;if(void 0!==b&&void 0!==d)return b="value"===a?b-d:b/d*100-(100===this.options.compareBase?0:100),c&&(c.change=b),b}:null;
this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty=!0)};f.processData=function(){var a,b=-1,c,d,e=!0===this.options.compareStart?0:1,f,g;n.apply(this,arguments);if(this.xAxis&&this.processedYData)for(c=this.processedXData,d=this.processedYData,f=d.length,this.pointArrayMap&&(b=u("close",this.pointArrayMap),-1===b&&(b=u(this.pointValKey||"y",this.pointArrayMap))),a=0;a<f-e;a++)if(g=d[a]&&-1<b?d[a][b]:d[a],y(g)&&c[a+e]>=this.xAxis.min&&0!==g){this.compareValue=g;break}};b(f,"getExtremes",
function(a){var b;a.apply(this,[].slice.call(arguments,1));this.modifyValue&&(b=[this.modifyValue(this.dataMin),this.modifyValue(this.dataMax)],this.dataMin=F(b),this.dataMax=k(b))});z.prototype.setCompare=function(a,b){this.isXAxis||(A(this.series,function(b){b.setCompare(a)}),t(b,!0)&&this.chart.redraw())};r.prototype.tooltipFormatter=function(b){b=b.replace("{point.change}",(0<this.change?"+":"")+a.numberFormat(this.change,t(this.series.tooltipOptions.changeDecimals,2)));return E.apply(this,[b])};
b(l.prototype,"render",function(a){var b;this.chart.is3d&&this.chart.is3d()||this.chart.polar||!this.xAxis||this.xAxis.isRadial||(b=this.yAxis.len-(this.xAxis.axisLine?Math.floor(this.xAxis.axisLine.strokeWidth()/2):0),!this.clipBox&&this.animate?(this.clipBox=d(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=b):this.chart[this.sharedClipKey]?this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:b}):this.clipBox&&(this.clipBox.width=this.xAxis.len,this.clipBox.height=
b));a.call(this)});b(H.prototype,"getSelectedPoints",function(a){var b=a.call(this);A(this.series,function(a){a.hasGroupedData&&(b=b.concat(w(a.points||[],function(a){return a.selected})))});return b});D(H,"update",function(a){a=a.options;"scrollbar"in a&&this.navigator&&(d(!0,this.options.scrollbar,a.scrollbar),this.navigator.update({},!1),delete a.scrollbar)})})(J)});
