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

 (c) 2017 Torstein Honsi

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