/*
 Highcharts JS v6.1.4 (2018-09-25)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

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