/*
 Highcharts JS v6.0.1 (2017-10-05)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

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