/*
 Highcharts JS v8.0.0 (2019-12-10)

 Boost module

 (c) 2010-2019 Highsoft AS
 Author: Torstein Honsi

 License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/boost-canvas",["highcharts"],function(k){a(k);a.Highcharts=k;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function k(q,a,r,k){q.hasOwnProperty(a)||(q[a]=k.apply(null,r))}a=a?a._modules:{};k(a,"modules/boost-canvas.src.js",[a["parts/Globals.js"],a["parts/Utilities.js"]],function(a,k){var r=k.extend,q=k.isNumber,w=
k.wrap,y=a.win.document,aa=function(){},ba=a.Color,z=a.Series,l=a.seriesTypes,A=a.addEvent,ca=a.fireEvent,da=a.merge,ea=a.pick,K;a.initCanvasBoost=function(){a.seriesTypes.heatmap&&w(a.seriesTypes.heatmap.prototype,"drawPoints",function(){var b=this.chart,d=this.getContext(),e=this.chart.inverted,a=this.xAxis,c=this.yAxis;d?(this.points.forEach(function(f){var g=f.plotY;"undefined"===typeof g||isNaN(g)||null===f.y||(g=f.shapeArgs,f=b.styledMode?f.series.colorAttribs(f):f.series.pointAttribs(f),d.fillStyle=
f.fill,e?d.fillRect(c.len-g.y+a.left,a.len-g.x+c.top,-g.height,-g.width):d.fillRect(g.x+a.left,g.y+c.top,g.width,g.height))}),this.canvasToSVG()):this.chart.showLoading("Your browser doesn't support HTML5 canvas, <br>please use a modern browser")});r(z.prototype,{getContext:function(){var b=this.chart,a=b.chartWidth,e=b.chartHeight,f=b.seriesGroup||this.group,c=this,k=function(b,c,a,e,d,f,g){b.call(this,a,c,e,d,f,g)};b.isChartSeriesBoosting()&&(c=b,f=b.seriesGroup);var g=c.ctx;c.canvas||(c.canvas=
y.createElement("canvas"),c.renderTarget=b.renderer.image("",0,0,a,e).addClass("highcharts-boost-canvas").add(f),c.ctx=g=c.canvas.getContext("2d"),b.inverted&&["moveTo","lineTo","rect","arc"].forEach(function(b){w(g,b,k)}),c.boostCopy=function(){c.renderTarget.attr({href:c.canvas.toDataURL("image/png")})},c.boostClear=function(){g.clearRect(0,0,c.canvas.width,c.canvas.height);c===this&&c.renderTarget.attr({href:""})},c.boostClipRect=b.renderer.clipRect(),c.renderTarget.clip(c.boostClipRect));c.canvas.width!==
a&&(c.canvas.width=a);c.canvas.height!==e&&(c.canvas.height=e);c.renderTarget.attr({x:0,y:0,width:a,height:e,style:"pointer-events: none",href:""});c.boostClipRect.attr(b.getBoostClipRect(c));return g},canvasToSVG:function(){this.chart.isChartSeriesBoosting()?this.boostClear&&this.boostClear():(this.boostCopy||this.chart.boostCopy)&&(this.boostCopy||this.chart.boostCopy)()},cvsLineTo:function(b,a,e){b.lineTo(a,e)},renderCanvas:function(){var b=this,d=b.options,e=b.chart,f=this.xAxis,c=this.yAxis,
k=(e.options.boost||{}).timeRendering||!1,g=0,l=b.processedXData,w=b.processedYData,L=d.data,m=f.getExtremes(),B=m.min,C=m.max;m=c.getExtremes();var y=m.min,z=m.max,M={},D,fa=!!b.sampling,E=d.marker&&d.marker.radius,N=this.cvsDrawPoint,F=d.lineWidth?this.cvsLineTo:void 0,O=E&&1>=E?this.cvsMarkerSquare:this.cvsMarkerCircle,ha=this.cvsStrokeBatch||1E3,ia=!1!==d.enableMouseTracking,P;m=d.threshold;var u=c.getThreshold(m),Q=q(m),R=u,ja=this.fill,S=b.pointArrayMap&&"low,high"===b.pointArrayMap.join(","),
T=!!d.stacking,U=b.cropStart||0;m=e.options.loading;var ka=b.requireSorting,V,la=d.connectNulls,W=!l,G,H,v,x,I,t=T?b.data:l||L,ma=b.fillOpacity?(new ba(b.color)).setOpacity(ea(d.fillOpacity,.75)).get():b.color,X=function(){ja?(n.fillStyle=ma,n.fill()):(n.strokeStyle=b.color,n.lineWidth=d.lineWidth,n.stroke())},Y=function(a,c,d,f){0===g&&(n.beginPath(),F&&(n.lineJoin="round"));e.scroller&&"highcharts-navigator-series"===b.options.className?(c+=e.scroller.top,d&&(d+=e.scroller.top)):c+=e.plotTop;a+=
e.plotLeft;V?n.moveTo(a,c):N?N(n,a,c,d,P):F?F(n,a,c):O&&O.call(b,n,a,c,E,f);g+=1;g===ha&&(X(),g=0);P={clientX:a,plotY:c,yBottom:d}},na="x"===d.findNearestPointBy,Z=this.xData||this.options.xData||this.processedXData||!1,J=function(b,a,d){I=na?b:b+","+a;ia&&!M[I]&&(M[I]=!0,e.inverted&&(b=f.len-b,a=c.len-a),oa.push({x:Z?Z[U+d]:!1,clientX:b,plotX:b,plotY:a,i:U+d}))};this.renderTarget&&this.renderTarget.attr({href:""});(this.points||this.graph)&&this.destroyGraphics();b.plotGroup("group","series",b.visible?
"visible":"hidden",d.zIndex,e.seriesGroup);b.markerGroup=b.group;A(b,"destroy",function(){b.markerGroup=null});var oa=this.points=[];var n=this.getContext();b.buildKDTree=aa;this.boostClear&&this.boostClear();this.visible&&(99999<L.length&&(e.options.loading=da(m,{labelStyle:{backgroundColor:a.color("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),a.clearTimeout(K),e.showLoading("Drawing..."),e.options.loading=m),k&&console.time("canvas rendering"),
a.eachAsync(t,function(a,d){var g=!1,k=!1,l=!1,m=!1,n="undefined"===typeof e.index,r=!0;if(!n){if(W){var p=a[0];var h=a[1];t[d+1]&&(l=t[d+1][0]);t[d-1]&&(m=t[d-1][0])}else p=a,h=w[d],t[d+1]&&(l=t[d+1]),t[d-1]&&(m=t[d-1]);l&&l>=B&&l<=C&&(g=!0);m&&m>=B&&m<=C&&(k=!0);if(S){W&&(h=a.slice(1,3));var q=h[0];h=h[1]}else T&&(p=a.x,h=a.stackY,q=h-a.y);a=null===h;ka||(r=h>=y&&h<=z);if(!a&&(p>=B&&p<=C&&r||g||k))if(p=Math.round(f.toPixels(p,!0)),fa){if("undefined"===typeof v||p===D){S||(q=h);if("undefined"===
typeof x||h>H)H=h,x=d;if("undefined"===typeof v||q<G)G=q,v=d}p!==D&&("undefined"!==typeof v&&(h=c.toPixels(H,!0),u=c.toPixels(G,!0),Y(p,Q?Math.min(h,R):h,Q?Math.max(u,R):u,d),J(p,h,x),u!==h&&J(p,u,v)),v=x=void 0,D=p)}else h=Math.round(c.toPixels(h,!0)),Y(p,h,u,d),J(p,h,d);V=a&&!la;0===d%5E4&&(b.boostCopy||b.chart.boostCopy)&&(b.boostCopy||b.chart.boostCopy)()}return!n},function(){var a=e.loadingDiv,d=e.loadingShown;X();b.canvasToSVG();k&&console.timeEnd("canvas rendering");ca(b,"renderedCanvas");
d&&(r(a.style,{transition:"opacity 250ms",opacity:0}),e.loadingShown=!1,K=setTimeout(function(){a.parentNode&&a.parentNode.removeChild(a);e.loadingDiv=e.loadingSpan=null},250));delete b.buildKDTree;b.buildKDTree()},e.renderer.forExport?Number.MAX_VALUE:void 0))}});l.scatter.prototype.cvsMarkerCircle=function(b,a,e,f){b.moveTo(a,e);b.arc(a,e,f,0,2*Math.PI,!1)};l.scatter.prototype.cvsMarkerSquare=function(b,a,e,f){b.rect(a-f,e-f,2*f,2*f)};l.scatter.prototype.fill=!0;l.bubble&&(l.bubble.prototype.cvsMarkerCircle=
function(b,a,e,f,c){b.moveTo(a,e);b.arc(a,e,this.radii&&this.radii[c],0,2*Math.PI,!1)},l.bubble.prototype.cvsStrokeBatch=1);r(l.area.prototype,{cvsDrawPoint:function(a,d,e,f,c){c&&d!==c.clientX&&(a.moveTo(c.clientX,c.yBottom),a.lineTo(c.clientX,c.plotY),a.lineTo(d,e),a.lineTo(d,f))},fill:!0,fillOpacity:!0,sampling:!0});r(l.column.prototype,{cvsDrawPoint:function(a,d,e,f){a.rect(d-1,e,1,f-e)},fill:!0,sampling:!0});a.Chart.prototype.callbacks.push(function(a){A(a,"predraw",function(){a.renderTarget&&
a.renderTarget.attr({href:""});a.canvas&&a.canvas.getContext("2d").clearRect(0,0,a.canvas.width,a.canvas.height)});A(a,"render",function(){a.boostCopy&&a.boostCopy()})})}});k(a,"masters/modules/boost-canvas.src.js",[],function(){})});
//# sourceMappingURL=boost-canvas.js.map