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

 (c) 2017 Torstein Honsi

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