/*
 Highcharts JS v5.0.7 (2017-01-17)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

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