UNPKG

highcharts

Version:
14 lines 46.7 kB
let e,t,i;/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/boost * @requires highcharts * * Boost module * * (c) 2010-2026 Highsoft AS * Author: Torstein Hønsi * * A commercial license may be required depending on use, * see www.highcharts.com/license * * */import*as r from"../highcharts.js";let s={};s.n=e=>{let t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],o=t[i++];s.o(e,r)?0===o&&i++:0===o?Object.defineProperty(e,r,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:o})}else for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let o=r.default;var n,a,l,h,d,f,u=s.n(o);let g=["area","areaspline","arearange","column","columnrange","bar","line","scatter","heatmap","bubble","treemap"],m={};g.forEach(e=>{m[e]=!0});let{composed:c}=u();function b(e){let t=e.series,i=e.boost=e.boost||{},r=e.options.boost||{},s=(0,o.pick)(r.seriesThreshold,50);if(t.length>=s)return!0;if(1===t.length)return!1;let n=r.allowForce;if(void 0===n){for(let t of(n=!0,e.xAxis))if((0,o.pick)(t.min,-1/0)>(0,o.pick)(t.dataMin,-1/0)||(0,o.pick)(t.max,1/0)<(0,o.pick)(t.dataMax,1/0)){n=!1;break}}if(void 0!==i.forceChartBoost){if(n)return i.forceChartBoost;i.forceChartBoost=void 0}let a=0,l=0,h=0,d;for(let e of t)0!==(d=e.options).boostThreshold&&!1!==e.visible&&"heatmap"!==e.type&&(++l,m[e.type]&&++a,function(...e){let t=-Number.MAX_VALUE;return e.forEach(e=>{if(null!=e&&void 0!==e.length&&e.length>0)return t=e.length,!0}),t}(e.getColumn("x",!0),d.data||[],e.points)>=(d.boostThreshold||Number.MAX_VALUE)&&++h);return i.forceChartBoost=n&&(a===t.length&&h===a||!!i.markerGroup&&a===l&&h===a||h>5),i.forceChartBoost}function p(e){function t(){e.boost&&e.boost.wgl&&b(e)&&e.boost.wgl.render(e)}(0,o.addEvent)(e,"predraw",function(){e.boost=e.boost||{},e.boost.forceChartBoost=void 0,e.boosted=!1,e.axes.some(e=>e.isPanning)||e.boost.clear?.(),e.boost.canvas&&e.boost.wgl&&b(e)&&e.boost.wgl.allocateBuffer(e),e.boost.markerGroup&&e.xAxis&&e.xAxis.length>0&&e.yAxis&&e.yAxis.length>0&&e.boost.markerGroup.translate(e.xAxis[0].pos,e.yAxis[0].pos)}),(0,o.addEvent)(e,"load",t,{order:-1}),(0,o.addEvent)(e,"redraw",t);let i=-1,r=-1;(0,o.addEvent)(e.pointer,"afterGetHoverData",t=>{let s=t.hoverPoint?.series;if(e.boost=e.boost||{},e.boost.markerGroup&&s){let t=e.inverted?s.yAxis:s.xAxis,o=e.inverted?s.xAxis:s.yAxis;(t&&t.pos!==i||o&&o.pos!==r)&&(e.series.forEach(e=>{e.halo?.hide()}),e.boost.markerGroup.translate(t.pos,o.pos),i=t.pos,r=o.pos)}})}let x={compose:function(e,t){return t&&(0,o.pushUnique)(c,"Boost.Chart")&&e.prototype.callbacks.push(p),e},getBoostClipRect:function(e,t){let i=e.navigator,r={x:e.plotLeft,y:e.plotTop,width:e.plotWidth,height:e.plotHeight};if(i&&e.inverted?(r.width+=i.top+i.height,i.opposite||(r.x=i.left)):i&&!e.inverted&&(r.height=i.top+i.height-e.plotTop),t.is){let{xAxis:i,yAxis:s}=t;if(r=e.getClipBox(t),e.inverted){let e=r.width;r.width=r.height,r.height=e,r.x=s.pos,r.y=i.pos}else r.x=i.pos,r.y=s.pos}if(t===e){let t=e.inverted?e.xAxis:e.yAxis;t.length<=1&&(r.y=Math.min(t[0].pos,r.y),r.height=t[0].pos-e.plotTop+t[0].len)}return r},isChartSeriesBoosting:b},A=r.default.Color;var y=s.n(A);let v={area:"LINES",arearange:"LINES",areaspline:"LINES",column:"LINES",columnrange:"LINES",bar:"LINES",line:"LINE_STRIP",scatter:"POINTS",heatmap:"TRIANGLES",treemap:"TRIANGLES",bubble:"POINTS"},P=class{constructor(e){if(this.errors=[],this.uLocations={},this.gl=e,e&&!this.createShader())return}bind(){this.gl&&this.shaderProgram&&this.gl.useProgram(this.shaderProgram)}createShader(){let e=this.stringToProgram("#version 100\n#define LN10 2.302585092994046\nprecision highp float;\nattribute vec4 aVertexPosition;\nattribute vec4 aColor;\nvarying highp vec2 position;\nvarying highp vec4 vColor;\nuniform mat4 uPMatrix;\nuniform float pSize;\nuniform float translatedThreshold;\nuniform bool hasThreshold;\nuniform bool skipTranslation;\nuniform float xAxisTrans;\nuniform float xAxisMin;\nuniform float xAxisMax;\nuniform float xAxisMinPad;\nuniform float xAxisPointRange;\nuniform float xAxisLen;\nuniform bool xAxisPostTranslate;\nuniform float xAxisOrdinalSlope;\nuniform float xAxisOrdinalOffset;\nuniform float xAxisPos;\nuniform bool xAxisCVSCoord;\nuniform bool xAxisIsLog;\nuniform bool xAxisReversed;\nuniform float yAxisTrans;\nuniform float yAxisMin;\nuniform float yAxisMax;\nuniform float yAxisMinPad;\nuniform float yAxisPointRange;\nuniform float yAxisLen;\nuniform bool yAxisPostTranslate;\nuniform float yAxisOrdinalSlope;\nuniform float yAxisOrdinalOffset;\nuniform float yAxisPos;\nuniform bool yAxisCVSCoord;\nuniform bool yAxisIsLog;\nuniform bool yAxisReversed;\nuniform bool isCircle;\nuniform bool isBubble;\nuniform bool bubbleSizeByArea;\nuniform float bubbleZMin;\nuniform float bubbleZMax;\nuniform float bubbleZThreshold;\nuniform float bubbleMinSize;\nuniform float bubbleMaxSize;\nuniform bool bubbleSizeAbs;\nuniform bool isInverted;\nfloat bubbleRadius(){\nfloat value = aVertexPosition.w;\nfloat zMax = bubbleZMax;\nfloat zMin = bubbleZMin;\nfloat radius = 0.0;\nfloat pos = 0.0;\nfloat zRange = zMax - zMin;\nif (bubbleSizeAbs){\nvalue = value - bubbleZThreshold;\nzMax = max(zMax - bubbleZThreshold, zMin - bubbleZThreshold);\nzMin = 0.0;\n}\nif (value < zMin){\nradius = bubbleZMin / 2.0 - 1.0;\n} else {\npos = zRange > 0.0 ? (value - zMin) / zRange : 0.5;\nif (bubbleSizeByArea && pos > 0.0){\npos = sqrt(pos);\n}\nradius = ceil(bubbleMinSize + pos * (bubbleMaxSize - bubbleMinSize)) / 2.0;\n}\nreturn radius * 2.0;\n}\nfloat translate(float val,\nfloat pointPlacement,\nfloat localA,\nfloat localMin,\nfloat minPixelPadding,\nfloat pointRange,\nfloat len,\nbool cvsCoord,\nbool isLog,\nbool reversed\n){\nfloat sign = 1.0;\nfloat cvsOffset = 0.0;\nif (cvsCoord) {\nsign *= -1.0;\ncvsOffset = len;\n}\nif (isLog) {\nval = log(val) / LN10;\n}\nif (reversed) {\nsign *= -1.0;\ncvsOffset -= sign * len;\n}\nreturn sign * (val - localMin) * localA + cvsOffset + \n(sign * minPixelPadding);\n}\nfloat xToPixels(float value) {\nif (skipTranslation){\nreturn value;// + xAxisPos;\n}\nreturn translate(value, 0.0, xAxisTrans, xAxisMin, xAxisMinPad, xAxisPointRange, xAxisLen, xAxisCVSCoord, xAxisIsLog, xAxisReversed);// + xAxisPos;\n}\nfloat yToPixels(float value, float checkThreshold) {\nfloat v;\nif (skipTranslation){\nv = value;// + yAxisPos;\n} else {\nv = translate(value, 0.0, yAxisTrans, yAxisMin, yAxisMinPad, yAxisPointRange, yAxisLen, yAxisCVSCoord, yAxisIsLog, yAxisReversed);// + yAxisPos;\nif (v > yAxisLen) {\nv = yAxisLen;\n}\n}\nif (checkThreshold > 0.0 && hasThreshold) {\nv = min(v, translatedThreshold);\n}\nreturn v;\n}\nvoid main(void) {\nif (isBubble){\ngl_PointSize = bubbleRadius();\n} else {\ngl_PointSize = pSize;\n}\nvColor = aColor;\nif (!skipTranslation && isCircle && (\naVertexPosition.x < xAxisMin ||\naVertexPosition.x > xAxisMax ||\naVertexPosition.y < yAxisMin ||\naVertexPosition.y > yAxisMax\n)) {\ngl_Position = uPMatrix * vec4(2.0, 2.0, 2.0, 1.0);\n} else if (skipTranslation && isInverted) {\ngl_Position = uPMatrix * vec4(aVertexPosition.y + yAxisPos, aVertexPosition.x + xAxisPos, 0.0, 1.0);\n} else if (isInverted) {\ngl_Position = uPMatrix * vec4(yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, xToPixels(aVertexPosition.x) + xAxisPos, 0.0, 1.0);\n} else {\ngl_Position = uPMatrix * vec4(xToPixels(aVertexPosition.x) + xAxisPos, yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, 0.0, 1.0);\n}\n}","vertex"),t=this.stringToProgram("precision highp float;\nuniform vec4 fillColor;\nvarying highp vec2 position;\nvarying highp vec4 vColor;\nuniform sampler2D uSampler;\nuniform bool isCircle;\nuniform bool hasColor;\nvoid main(void) {\nvec4 col = fillColor;\nvec4 tcol = texture2D(uSampler, gl_PointCoord.st);\nif (hasColor) {\ncol = vColor;\n}\nif (isCircle) {\ncol *= tcol;\nif (tcol.r < 0.0) {\ndiscard;\n} else {\ngl_FragColor = col;\n}\n} else {\ngl_FragColor = col;\n}\n}","fragment"),i=e=>this.gl.getUniformLocation(this.shaderProgram,e);return e&&t?(this.shaderProgram=this.gl.createProgram(),this.gl.attachShader(this.shaderProgram,e),this.gl.attachShader(this.shaderProgram,t),this.gl.linkProgram(this.shaderProgram),this.gl.getProgramParameter(this.shaderProgram,this.gl.LINK_STATUS))?(this.gl.useProgram(this.shaderProgram),this.gl.bindAttribLocation(this.shaderProgram,0,"aVertexPosition"),this.pUniform=i("uPMatrix"),this.psUniform=i("pSize"),this.fcUniform=i("fillColor"),this.isBubbleUniform=i("isBubble"),this.bubbleSizeAbsUniform=i("bubbleSizeAbs"),this.bubbleSizeAreaUniform=i("bubbleSizeByArea"),this.uSamplerUniform=i("uSampler"),this.skipTranslationUniform=i("skipTranslation"),this.isCircleUniform=i("isCircle"),this.isInverted=i("isInverted"),!0):(this.errors.push(this.gl.getProgramInfoLog(this.shaderProgram)),this.handleErrors(),this.shaderProgram=!1,!1):(this.shaderProgram=!1,this.handleErrors(),!1)}handleErrors(){this.errors.length&&(0,o.error)("[highcharts boost] shader error - "+this.errors.join("\n"))}stringToProgram(e,t){let i=this.gl.createShader("vertex"===t?this.gl.VERTEX_SHADER:this.gl.FRAGMENT_SHADER);return(this.gl.shaderSource(i,e),this.gl.compileShader(i),this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS))?i:(this.errors.push("when compiling "+t+" shader:\n"+this.gl.getShaderInfoLog(i)),!1)}destroy(){this.gl&&this.shaderProgram&&(this.gl.deleteProgram(this.shaderProgram),this.shaderProgram=!1)}fillColorUniform(){return this.fcUniform}getProgram(){return this.shaderProgram}pointSizeUniform(){return this.psUniform}perspectiveUniform(){return this.pUniform}reset(){this.gl&&this.shaderProgram&&(this.gl.uniform1i(this.isBubbleUniform,0),this.gl.uniform1i(this.isCircleUniform,0))}setBubbleUniforms(e,t,i,r=1){let s=e.options,n=Number.MAX_VALUE,a=-Number.MAX_VALUE;if(this.gl&&this.shaderProgram&&e.is("bubble")){let l=e.getPxExtremes();n=(0,o.pick)(s.zMin,(0,o.clamp)(t,!1===s.displayNegative?s.zThreshold:-Number.MAX_VALUE,n)),a=(0,o.pick)(s.zMax,Math.max(a,i)),this.gl.uniform1i(this.isBubbleUniform,1),this.gl.uniform1i(this.isCircleUniform,1),this.gl.uniform1i(this.bubbleSizeAreaUniform,"width"!==e.options.sizeBy),this.gl.uniform1i(this.bubbleSizeAbsUniform,e.options.sizeByAbsoluteValue),this.setUniform("bubbleMinSize",l.minPxSize*r),this.setUniform("bubbleMaxSize",l.maxPxSize*r),this.setUniform("bubbleZMin",n),this.setUniform("bubbleZMax",a),this.setUniform("bubbleZThreshold",e.options.zThreshold)}}setColor(e){this.gl&&this.shaderProgram&&this.gl.uniform4f(this.fcUniform,e[0]/255,e[1]/255,e[2]/255,e[3])}setDrawAsCircle(e){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.isCircleUniform,+!!e)}setInverted(e){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.isInverted,e)}setPMatrix(e){this.gl&&this.shaderProgram&&this.gl.uniformMatrix4fv(this.pUniform,!1,e)}setPointSize(e){this.gl&&this.shaderProgram&&this.gl.uniform1f(this.psUniform,e)}setSkipTranslation(e){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.skipTranslationUniform,+(!0===e))}setTexture(e){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.uSamplerUniform,e)}setUniform(e,t){if(this.gl&&this.shaderProgram){let i=this.uLocations[e]=this.uLocations[e]||this.gl.getUniformLocation(this.shaderProgram,e);this.gl.uniform1f(i,t)}}},T=class{constructor(e,t,i){this.buffer=!1,this.iterator=0,this.preAllocated=!1,this.vertAttribute=!1,this.components=i||2,this.dataComponents=i,this.gl=e,this.shader=t}allocate(e){this.iterator=-1,this.preAllocated=new Float32Array(4*e)}bind(){if(!this.buffer)return!1;this.gl.vertexAttribPointer(this.vertAttribute,this.components,this.gl.FLOAT,!1,0,0)}build(e,t,i){let r;return(this.data=e||[],this.data&&0!==this.data.length||this.preAllocated)?(this.components=i||this.components,this.buffer&&this.gl.deleteBuffer(this.buffer),this.preAllocated||(r=new Float32Array(this.data)),this.buffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.preAllocated||r,this.gl.STATIC_DRAW),this.vertAttribute=this.gl.getAttribLocation(this.shader.getProgram(),t),this.gl.enableVertexAttribArray(this.vertAttribute),r=!1,!0):(this.destroy(),!1)}destroy(){this.buffer&&(this.gl.deleteBuffer(this.buffer),this.buffer=!1,this.vertAttribute=!1),this.iterator=0,this.components=this.dataComponents||2,this.data=[]}push(e,t,i,r){this.preAllocated&&(this.preAllocated[++this.iterator]=e,this.preAllocated[++this.iterator]=t,this.preAllocated[++this.iterator]=i,this.preAllocated[++this.iterator]=r)}render(e,t,i){let r=this.preAllocated?this.preAllocated.length:this.data?.length||0;return!!this.buffer&&!!r&&((!e||e>r||e<0)&&(e=0),(!t||t>r)&&(t=r),!(e>=t)&&(i=i||"POINTS",this.gl.drawArrays(this.gl[i],e/this.components,(t-e)/this.components),!0))}},{getBoostClipRect:k}=x,{parse:C}=y(),{doc:E,win:M}=u(),w={column:!0,columnrange:!0,bar:!0,area:!0,areaspline:!0,arearange:!0},S={scatter:!0,bubble:!0},U=["webgl","experimental-webgl","moz-webgl","webkit-3d"],R={},N=(e,t)=>{if(R[t])return R[t];let i=0===t.indexOf("var(")&&e[t.slice(4,-1).trim()];if(i)return R[t]=i,i;if(0===t.indexOf("color-mix(")){let i=/^color-mix\(in srgb,([a-z0-9\(\)\-\#]+),([a-z0-9\(\)\-\#]+) ([0-9\.%]+)/.exec(t);if(i){let r=parseFloat(i[3])/100,s=N(e,i[1]),o=N(e,i[2]),n=new(y())(s).tweenTo(new(y())(o),r);return R[t]=n,n}}return t};class L{static orthoMatrix(e,t){return[2/e,0,0,0,0,-(2/t),0,0,0,0,-2,0,-1,1,-1,1]}static seriesPointCount(e){let t,i,r;return e.boosted?(t=!!e.options.stacking,i=(e.getColumn("x").length?e.getColumn("x"):void 0)||e.options.xData||e.getColumn("x",!0),r=(t?e.data:i||e.options.data).length,"treemap"===e.type?r*=12:"heatmap"===e.type?r*=6:w[e.type]&&(r*=2),r):0}constructor(e){this.data=[],this.height=0,this.isInited=!1,this.markerData=[],this.series=[],this.textureHandles={},this.width=0,this.postRenderCallback=e,this.settings={pointSize:1,lineWidth:1,fillColor:"#AA00AA",useAlpha:!0,usePreallocated:!1,useGPUTranslations:!1,debug:{timeRendering:!1,timeSeriesProcessing:!1,timeSetup:!1,timeBufferCopy:!1,timeKDTree:!1,showSkipSummary:!1}}}getPixelRatio(){return this.settings.pixelRatio||M.devicePixelRatio||1}setOptions(e){"pixelRatio"in e||(e.pixelRatio=1),(0,o.merge)(!0,this.settings,e)}allocateBuffer(e){let t=this.vbuffer,i=0;this.settings.usePreallocated&&(e.series.forEach(e=>{e.boosted&&(i+=L.seriesPointCount(e))}),t&&t.allocate(i))}allocateBufferForSingleSeries(e){let t=this.vbuffer,i=0;this.settings.usePreallocated&&(e.boosted&&(i=L.seriesPointCount(e)),t&&t.allocate(i))}clear(){let e=this.gl;e&&e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}pushSeriesData(e,t){let i=this.data,r=this.settings,s=this.vbuffer,n=e.pointArrayMap&&"low,high"===e.pointArrayMap.join(","),{chart:a,options:l,sorted:h,xAxis:d,yAxis:f}=e,u=!!l.stacking,g=l.data,m=e.xAxis.getExtremes(),c=m.min-(e.xAxis.minPointOffset||0),b=m.max+(e.xAxis.minPointOffset||0),p=e.yAxis.getExtremes(),x=p.min-(e.yAxis.minPointOffset||0),A=p.max+(e.yAxis.minPointOffset||0),v=(e.getColumn("x").length?e.getColumn("x"):void 0)||l.xData||e.getColumn("x",!0),P=(e.getColumn("y").length?e.getColumn("y"):void 0)||l.yData||e.getColumn("y",!0),T=(e.getColumn("z").length?e.getColumn("z"):void 0)||l.zData||e.getColumn("z",!0),k=!v||0===v.length,{colorByPoint:E,connectNulls:M,threshold:S,zoneAxis:U="y",zones:R}=l,L=e.points||!1,_=u?e.data:v||g,z={x:Number.MAX_VALUE,y:0},D={x:-Number.MAX_VALUE,y:0},O=void 0===a.index,I=w[e.type],G=this.getPixelRatio(),B=a.options.colors||[],V=e.chart.plotWidth,X=!1,F=!1,j,q,H=0,W=!1,Y,K,Z,Q,$=-1,J=!1,ee=!1,et,ei=!1,er=!1,es,eo=!1,en=!0,ea=!0,el=[],eh=!1,ed=!1,ef=0,eu=0;if(l.boostData&&l.boostData.length>0)return;if(l.gapSize&&(ed="value"!==l.gapUnit?l.gapSize*e.closestPointRange:l.gapSize),a.boost){let e=a.renderer.circle(0,0,1).attr({fill:"var(--highcharts-background-color)"}).add(),t=new(y())(getComputedStyle(e.element).getPropertyValue("fill")).get(),i=new(y())(a.palette?.cssVars.dark["--highcharts-background-color"]||"").get();e.destroy(),a.boost.cssVars=a.palette?.cssVars[t===i?"dark":"light"]}let eg=a.boost?.cssVars||{};if(R?.length&&(el=[],R.forEach((e,t)=>{if("string"==typeof e.color){let i=C(N(eg,e.color)).rgba;i[0]/=255,i[1]/=255,i[2]/=255,el[t]=i,eh||void 0!==e.value||(eh=i)}}),!eh)){let t=e.pointAttribs&&e.pointAttribs().fill||e.color;eh=C("string"==typeof t?N(eg,t):"").rgba,eh[0]/=255,eh[1]/=255,eh[2]/=255}a.inverted&&(V=e.chart.plotHeight),e.closestPointRangePx=Number.MAX_VALUE;let em=e=>{e&&(t.colorData.push(e[0]),t.colorData.push(e[1]),t.colorData.push(e[2]),t.colorData.push(e[3]))},ec=(e,o,n,a=1,l)=>{em(l),1!==G&&(!r.useGPUTranslations||t.skipTranslation)&&(e*=G,o*=G,a*=G),r.usePreallocated&&s?(s.push(e,o,+!!n,a),ef+=4):(i.push(e),i.push(o),i.push(n?G:0),i.push(a))},eb=()=>{t.segments.length&&(t.segments[t.segments.length-1].to=i.length||ef)},ep=()=>{t.segments.length&&t.segments[t.segments.length-1].from===(i.length||ef)||(eb(),t.segments.push({from:i.length||ef}))},ex=(e,t,i,r,s)=>{em(s),ec(e+i,t),em(s),ec(e,t),em(s),ec(e,t+r),em(s),ec(e,t+r),em(s),ec(e+i,t+r),em(s),ec(e+i,t)};if(ep(),L&&L.length>0){t.skipTranslation=!0,t.drawMode="TRIANGLES",L[0].node&&L[0].node.levelDynamic&&L.sort((e,t)=>{if(e.node){if(e.node.levelDynamic>t.node.levelDynamic)return 1;if(e.node.levelDynamic<t.node.levelDynamic)return -1}return 0}),L.forEach(t=>{let i,r,s=t.plotY;if(void 0!==s&&!isNaN(s)&&null!==t.y&&t.shapeArgs){let{x:s=0,y:o=0,width:n=0,height:l=0}=t.shapeArgs;i=(r=a.styledMode?t.series.colorAttribs(t):r=t.series.pointAttribs(t))["stroke-width"]||0,"string"==typeof r.fill&&(r.fill=N(eg,r.fill)),es=C(r.fill).rgba,es[0]/=255,es[1]/=255,es[2]/=255,e.is("treemap")&&(i=i||1,"string"==typeof r.stroke&&(r.stroke=N(eg,r.stroke)),q=C(r.stroke).rgba,q[0]/=255,q[1]/=255,q[2]/=255,ex(s,o,n,l,q),i/=2),e.is("heatmap")&&a.inverted&&(s=d.len-s,o=f.len-o,n=-n,l=-l),ex(s+i,o+i,n-2*i,l-2*i,es)}}),eb();return}for(;$<_.length-1;){if(void 0===(Z=_[++$]))continue;if(O)break;let i=g&&g[$];if(!k){let t;(0,o.isObject)(i,!0)&&i.color&&(t=C(i.color).rgba);let r=e.options.keys?.indexOf("color");Array.isArray(i)&&r&&"string"==typeof i[r]?t=C(i[r]).rgba:E&&(eu%=B.length,t=C(N(eg,B[eu])).rgba),t&&((es=t)[0]=t[0]/255,es[1]=t[1]/255,es[2]=t[2]/255,es[3]=t[3]),eu++}if(k?(Y=Z[0],K=Z[1],_[$+1]&&(ee=_[$+1][0]),_[$-1]&&(J=_[$-1][0]),Z.length>=3&&(Q=Z[2],Z[2]>t.zMax&&(t.zMax=Z[2]),Z[2]<t.zMin&&(t.zMin=Z[2]))):(Y=Z,K=P?.[$],_[$+1]&&(ee=_[$+1]),_[$-1]&&(J=_[$-1]),T&&T.length&&(Q=T[$],T[$]>t.zMax&&(t.zMax=T[$]),T[$]<t.zMin&&(t.zMin=T[$]))),!M&&(null===Y||null===K)){ep();continue}if(ee&&ee>=c&&ee<=b&&(ei=!0),J&&J>=c&&J<=b&&(er=!0),n?(k&&(K=Z.slice(1,3)),et=e.getColumn("low",!0)?.[$],K=e.getColumn("high",!0)?.[$]||0):u&&(Y=Z.x,et=(K=Z.stackY)-Z.y),null!=x&&null!=A&&(en=K>=x&&K<=A),!h&&!en||(Y>b&&D.x<b&&(D.x=Y,D.y=K),Y<c&&z.x>c&&(z.x=Y,z.y=K),null===K&&M))continue;if(null===K||!en&&_.length>1&&!ei&&!er){ep();continue}if((h&&(ee>=c||Y>=c)&&(J<=b||Y<=b)||!h&&Y>=c&&Y<=b)&&(eo=!0),eo||ei||er){if(ed&&Y-J>ed&&ep(),R?.length){let e,t,i="x"===U?Y:K;R.some((e,r)=>void 0!==e.value&&i<e.value&&(t=r,!0)),void 0!==t&&el[t]&&(e=el[t]),es=e||eh||es}if(r.useGPUTranslations||(t.skipTranslation=!0,Y=d.toPixels(Y,!0),K=f.toPixels(K,!0),!(Y>V)||"POINTS"!==t.drawMode)){if(t.hasMarkers&&eo&&!1!==X&&(e.closestPointRangePx=Math.min(e.closestPointRangePx,Math.abs(Y-X))),!r.useGPUTranslations&&!r.usePreallocated&&X&&1>Math.abs(Y-X)&&F&&1>Math.abs(K-F)){r.debug.showSkipSummary&&++H;continue}I&&(j=et||0,(!1===et||void 0===et)&&(j=K<0?K:0),(n||u)&&!f.logarithmic||(j=Math.max(S??x,x)),r.useGPUTranslations||(j=f.toPixels(j,!0)),ec(Y,j,!1,0,es)),l.step&&!ea&&ec(Y,F,!1,2,es),ec(Y,K,!1,"bubble"===e.type?Q||1:2,es),X=Y,F=K,W=!0,ea=!1}}}r.debug.showSkipSummary&&console.log("skipped points:",H);let eA=(e,i)=>{if(r.useGPUTranslations||(t.skipTranslation=!0,e.x=d.toPixels(e.x,!0),e.y=f.toPixels(e.y,!0)),i){this.data=[e.x,e.y,0,2].concat(this.data);return}ec(e.x,e.y,0,2)};!W&&!1!==M&&"line_strip"===e.drawMode&&(z.x<Number.MAX_VALUE&&eA(z,!0),D.x>-Number.MAX_VALUE&&eA(D)),eb()}pushSeries(e){let t=this.markerData,i=this.series,r=this.settings;i.length>0&&i[i.length-1].hasMarkers&&(i[i.length-1].markerTo=t.length),r.debug.timeSeriesProcessing&&console.time("building "+e.type+" series");let s={segments:[],markerFrom:t.length,colorData:[],series:e,zMin:Number.MAX_VALUE,zMax:-Number.MAX_VALUE,hasMarkers:!!e.options.marker&&!1!==e.options.marker.enabled,showMarkers:!0,drawMode:v[e.type]||"LINE_STRIP"};e.index>=i.length?i.push(s):i[e.index]=s,this.pushSeriesData(e,s),r.debug.timeSeriesProcessing&&console.timeEnd("building "+e.type+" series")}flush(){let e=this.vbuffer;this.data=[],this.markerData=[],this.series=[],e&&e.destroy()}setXAxis(e){let t=this.shader;if(!t)return;let i=this.getPixelRatio();t.setUniform("xAxisTrans",e.transA*i),t.setUniform("xAxisMin",e.min),t.setUniform("xAxisMax",e.max),t.setUniform("xAxisMinPad",e.minPixelPadding*i),t.setUniform("xAxisPointRange",e.pointRange),t.setUniform("xAxisLen",e.len*i),t.setUniform("xAxisPos",e.pos*i),t.setUniform("xAxisCVSCoord",!e.horiz),t.setUniform("xAxisIsLog",!!e.logarithmic),t.setUniform("xAxisReversed",!!e.reversed)}setYAxis(e){let t=this.shader;if(!t)return;let i=this.getPixelRatio();t.setUniform("yAxisTrans",e.transA*i),t.setUniform("yAxisMin",e.min),t.setUniform("yAxisMax",e.max),t.setUniform("yAxisMinPad",e.minPixelPadding*i),t.setUniform("yAxisPointRange",e.pointRange),t.setUniform("yAxisLen",e.len*i),t.setUniform("yAxisPos",e.pos*i),t.setUniform("yAxisCVSCoord",!e.horiz),t.setUniform("yAxisIsLog",!!e.logarithmic),t.setUniform("yAxisReversed",!!e.reversed)}setThreshold(e,t){let i=this.shader;i&&(i.setUniform("hasThreshold",e),i.setUniform("translatedThreshold",t))}renderChart(e){let t=this.gl,i=this.settings,r=this.shader,s=this.vbuffer;R={};let n=this.getPixelRatio();if(!e)return!1;this.width=e.chartWidth*n,this.height=e.chartHeight*n;let a=this.height,l=this.width,h=e.options.colors||[];if(!t||!r||!l||!a)return!1;i.debug.timeRendering&&console.time("gl rendering"),t.canvas.width=l,t.canvas.height=a,r.bind(),t.viewport(0,0,l,a),r.setPMatrix(L.orthoMatrix(l,a)),i.lineWidth>1&&!u().isMS&&t.lineWidth(i.lineWidth),s&&(s.build(this.data,"aVertexPosition",4),s.bind()),r.setInverted(e.inverted),this.series.forEach((l,d)=>{let f=l.series.options,u=f.marker,g=void 0!==f.lineWidth?f.lineWidth:1,m=f.threshold,c=(0,o.isNumber)(m),b=l.series.yAxis.getThreshold(m),p=(0,o.pick)(f.marker?f.marker.enabled:null,!!l.series.xAxis.isRadial||null,l.series.closestPointRangePx>2*((f.marker?f.marker.radius:10)||10)),x=this.textureHandles[u&&u.symbol||l.series.symbol]||this.textureHandles.circle,A,v,P,E=[];if(0!==l.segments.length&&l.segments[0].from!==l.segments[0].to&&(x.isReady&&(t.bindTexture(t.TEXTURE_2D,x.handle),r.setTexture(x.handle)),e.styledMode?l.series.markerGroup===l.series.chart.boost?.markerGroup?(delete l.series.markerGroup,l.series.markerGroup=l.series.plotGroup("markerGroup","markers","visible",1,e.seriesGroup).addClass("highcharts-tracker"),P=l.series.markerGroup.getStyle("fill"),l.series.markerGroup.destroy(),l.series.markerGroup=l.series.chart.boost?.markerGroup):P=l.series.markerGroup?.getStyle("fill"):(P="POINTS"===l.drawMode&&l.series.pointAttribs&&l.series.pointAttribs().fill||l.series.color,f.colorByPoint&&"string"==typeof h[d]&&(P=h[d])),l.series.fillOpacity&&f.fillOpacity&&P&&(P=new(y())(P).setOpacity((0,o.pick)(f.fillOpacity,1)).get()),"string"==typeof P&&(P=N(e.boost?.cssVars||{},P)),E=C(P).rgba,i.useAlpha||(E[3]=1),"add"===f.boostBlending?(t.blendFunc(t.SRC_ALPHA,t.ONE),t.blendEquation(t.FUNC_ADD)):"mult"===f.boostBlending||"multiply"===f.boostBlending?t.blendFunc(t.DST_COLOR,t.ZERO):"darken"===f.boostBlending?(t.blendFunc(t.ONE,t.ONE),t.blendEquation(t.FUNC_MIN)):t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),r.reset(),l.colorData.length>0?(r.setUniform("hasColor",1),(v=new T(t,r)).build(Array(l.segments[0].from).concat(l.colorData),"aColor",4),v.bind()):(r.setUniform("hasColor",0),t.disableVertexAttribArray(t.getAttribLocation(r.getProgram(),"aColor"))),r.setColor(E),this.setXAxis(l.series.xAxis),this.setYAxis(l.series.yAxis),this.setThreshold(c,b),"POINTS"===l.drawMode&&r.setPointSize(2*(0,o.pick)(f.marker&&f.marker.radius,.5)*n),r.setSkipTranslation(l.skipTranslation),"bubble"===l.series.type&&r.setBubbleUniforms(l.series,l.zMin,l.zMax,n),r.setDrawAsCircle(S[l.series.type]||!1),s)){if(g>0||"LINE_STRIP"!==l.drawMode){let{x:i,y:r,width:o,height:h}=k(e,l.series);for(t.enable(t.SCISSOR_TEST),t.scissor(i*n,a-(r+h)*n,o*n,h*n),A=0;A<l.segments.length;A++)s.render(l.segments[A].from,l.segments[A].to,l.drawMode);t.disable(t.SCISSOR_TEST)}if(l.hasMarkers&&p)for(r.setPointSize(2*(0,o.pick)(f.marker&&f.marker.radius,5)*n),r.setDrawAsCircle(!0),A=0;A<l.segments.length;A++)s.render(l.segments[A].from,l.segments[A].to,"POINTS")}}),i.debug.timeRendering&&console.timeEnd("gl rendering"),this.postRenderCallback&&this.postRenderCallback(this),this.flush()}render(e){if(this.clear(),e.renderer.forExport)return this.renderChart(e);this.isInited?this.renderChart(e):setTimeout(()=>{this.render(e)},1)}setSize(e,t){let i=this.shader;i&&(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,i.bind(),i.setPMatrix(L.orthoMatrix(e,t)))}init(e,t){let i=this.settings;if(this.isInited=!1,!e)return!1;i.debug.timeSetup&&console.time("gl setup");for(let t=0;t<U.length&&(this.gl=e.getContext(U[t],{}),!this.gl);++t);let r=this.gl;if(!r)return!1;t||this.flush(),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),r.depthFunc(r.LESS);let s=this.shader=new P(r);if(!s)return!1;this.vbuffer=new T(r,s);let o=(e,t)=>{let i={isReady:!1,texture:E.createElement("canvas"),handle:r.createTexture()},s=i.texture.getContext("2d");this.textureHandles[e]=i,i.texture.width=512,i.texture.height=512,s.mozImageSmoothingEnabled=!1,s.webkitImageSmoothingEnabled=!1,s.msImageSmoothingEnabled=!1,s.imageSmoothingEnabled=!1,s.strokeStyle="rgba(255, 255, 255, 0)",s.fillStyle="#FFF",t(s);try{r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,i.handle),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.bindTexture(r.TEXTURE_2D,null),i.isReady=!0}catch{}};return o("circle",e=>{e.beginPath(),e.arc(256,256,256,0,2*Math.PI),e.stroke(),e.fill()}),o("square",e=>{e.fillRect(0,0,512,512)}),o("diamond",e=>{e.beginPath(),e.moveTo(256,0),e.lineTo(512,256),e.lineTo(256,512),e.lineTo(0,256),e.lineTo(256,0),e.fill()}),o("triangle",e=>{e.beginPath(),e.moveTo(0,512),e.lineTo(256,0),e.lineTo(512,512),e.lineTo(0,512),e.fill()}),o("triangle-down",e=>{e.beginPath(),e.moveTo(0,0),e.lineTo(256,512),e.lineTo(512,0),e.lineTo(0,0),e.fill()}),this.isInited=!0,i.debug.timeSetup&&console.timeEnd("gl setup"),!0}destroy(){let e=this.gl,t=this.shader,i=this.vbuffer;this.flush(),i&&i.destroy(),t&&t.destroy(),e&&((0,o.objectEach)(this.textureHandles,t=>{t.handle&&e.deleteTexture(t.handle)}),e.canvas.width=1,e.canvas.height=1)}}let{setLength:_,splice:z}={convertToNumber:function(e,t){switch(typeof e){case"boolean":return+!!e;case"number":return isNaN(e)&&!t?null:e;default:return isNaN(e=parseFloat(`${e??""}`))&&!t?null:e}},setLength:function(e,t,i){return Array.isArray(e)?(e.length=t,e):e[i?"subarray":"slice"](0,t)},splice:function(e,t,i,r,s=[]){if(Array.isArray(e))return Array.isArray(s)||(s=Array.from(s)),{removed:e.splice(t,i,...s),array:e};let o=Object.getPrototypeOf(e).constructor,n=e[r?"subarray":"slice"](t,t+i),a=new o(e.length-i+s.length);return a.set(e.subarray(0,t),0),a.set(s,t),a.set(e.subarray(t+i),t+s.length),{removed:n,array:a}}},D=class{constructor(e={}){this.isDataTable=!0,this.autoId=!e.id,this.columns={},this.id=e.id||(0,o.uniqueKey)(),this.rowCount=0,this.versionTag=(0,o.uniqueKey)();let t=0;(0,o.objectEach)(e.columns||{},(e,i)=>{this.columns[i]=e.slice(),t=Math.max(t,e.length)}),this.applyRowCount(t)}applyRowCount(e){this.rowCount=e,(0,o.objectEach)(this.columns,(t,i)=>{t.length!==e&&(this.columns[i]=_(t,e))})}deleteRows(e,t=1){if(t>0&&e<this.rowCount){let i=0;(0,o.objectEach)(this.columns,(r,s)=>{this.columns[s]=z(r,e,t).array,i=r.length}),this.rowCount=i}(0,o.fireEvent)(this,"afterDeleteRows",{rowIndex:e,rowCount:t}),this.versionTag=(0,o.uniqueKey)()}getColumn(e,t){return this.columns[e]}getColumns(e,t){return(e||Object.keys(this.columns)).reduce((e,t)=>(e[t]=this.columns[t],e),{})}getRowObject(e,t){let i={},r=this.columns;for(let s of(t??(t=Object.keys(this.columns)),t))i[s]=r[s]?.[e];return i}setColumn(e,t=[],i=0,r){this.setColumns({[e]:t},i,r)}setColumns(e,t,i){let r=this.rowCount;(0,o.objectEach)(e,(e,t)=>{this.columns[t]=e.slice(),r=e.length}),this.applyRowCount(r),i?.silent||((0,o.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,o.uniqueKey)())}setRow(e,t=this.rowCount,i,r){var s;let{columns:n}=this,a=i?this.rowCount+1:t+1,l=Object.keys(e);if(r?.addColumns!==!1)for(let e=0,t=l.length;e<t;e++)n[s=l[e]]||(n[s]=Array(this.rowCount));(0,o.objectEach)(n,(r,s)=>{r&&(i?r=z(r,t,0,!0,[e[s]]).array:r[t]=s in e?e[s]:r[t],n[s]=r)}),this.applyRowCount(Math.max(a,this.rowCount)),r?.silent||((0,o.fireEvent)(this,"afterSetRows",{rowIndex:t}),this.versionTag=(0,o.uniqueKey)())}getModified(){return this.modified||this}},{getBoostClipRect:O,isChartSeriesBoosting:I}=x,{getOptions:G}=u(),{composed:B,doc:V,noop:X,win:F}=u();function j(e,t){let i=t.boost;e&&i&&i.target&&i.canvas&&!I(t.chart)&&e.allocateBufferForSingleSeries(t)}function q(e){return(0,o.pick)(e&&e.options&&e.options.boost&&e.options.boost.enabled,!0)}function H(e,i){let r=e.constructor,s=e.seriesGroup||i.group,n=e.chartWidth,a=e.chartHeight,l=e,h="u">typeof SVGForeignObjectElement,d=!1;I(e)?l=e:(l=i,d=!!(i.options.events?.click||i.options.point?.events?.click));let f=l.boost=l.boost||{};if(h=!1,t||(t=V.createElement("canvas")),!f.target&&(f.canvas=t,e.renderer.forExport||!h?(l.renderTarget=f.target=e.renderer.image("",0,0,n,a).addClass("highcharts-boost-canvas").add(s),f.clear=function(){f.target.attr({href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="})},f.copy=function(){f.resize(),f.target.attr({href:f.canvas.toDataURL("image/png")})}):(f.targetFo=e.renderer.createElement("foreignObject").add(s),l.renderTarget=f.target=V.createElement("canvas"),f.targetCtx=f.target.getContext("2d"),f.targetFo.element.appendChild(f.target),f.clear=function(){f.target.width=f.canvas.width,f.target.height=f.canvas.height},f.copy=function(){f.target.width=f.canvas.width,f.target.height=f.canvas.height,f.targetCtx.drawImage(f.canvas,0,0)}),f.resize=function(){n=e.chartWidth,a=e.chartHeight,(f.targetFo||f.target).attr({x:0,y:0,width:n,height:a}).css({pointerEvents:d?void 0:"none",mixedBlendMode:"normal",opacity:1}).addClass(d?"highcharts-tracker":""),l instanceof r&&l.boost?.markerGroup?.translate(e.plotLeft,e.plotTop)},f.clipRect=e.renderer.clipRect(),(f.targetFo||f.target).attr({zIndex:i.options.zIndex}),l instanceof r&&(l.boost.markerGroup=l.renderer.g().add(s).translate(i.xAxis.pos,i.yAxis.pos))),f.canvas.width=n,f.canvas.height=a,f.clipRect){let t=O(e,l);f.clipRect.attr(t),e.navigator||t.width!==e.clipBox.width||t.height!==e.clipBox.height?(f.targetFo||f.target).clip(f.clipRect):s?.clip(e.renderer.clipRect(t.x-4,t.y,t.width+4,t.height+4))}return f.resize(),f.clear(),!f.wgl&&(f.wgl=new L(e=>{e.settings.debug.timeBufferCopy&&console.time("buffer copy"),f.copy(),e.settings.debug.timeBufferCopy&&console.timeEnd("buffer copy")}),f.wgl.init(f.canvas)||(0,o.error)("[highcharts boost] - unable to init WebGL renderer"),f.wgl.setOptions(e.options.boost||{}),l instanceof r&&f.wgl.allocateBuffer(e)),f.wgl.setSize(n,a),f.wgl}function W(e){let t=e.points;if(t){let e,i;for(i=0;i<t.length;i+=1)(e=t[i])&&e.destroyElements&&e.destroyElements()}for(let t of(["graph","area","tracker"].forEach(t=>{let i=e[t];i&&(e[t]=i.destroy())}),e.zones))(0,o.destroyObjectProperties)(t,void 0,!0)}function Y(e,t,i,r,s,o){let n=(s=s||0)+(r=r||3e3),a=!0;for(;a&&s<n&&s<e.length;)a=t(e[s],s),++s;a&&(s<e.length?o?Y(e,t,i,r,s,o):F.requestAnimationFrame?F.requestAnimationFrame(function(){Y(e,t,i,r,s)}):setTimeout(Y,0,e,t,i,r,s):i&&i())}function K(e,t){let i=e.options,r=(0,o.pick)(i.boostThreshold,Number.MAX_VALUE);if(0===r)return!1;let s=e.dataTable.getModified().rowCount,n=e.xAxis&&e.xAxis.options,a=e.yAxis&&e.yAxis.options,l=e.colorAxis&&e.colorAxis.options;return s>=r&&(0,o.isNumber)(a?.min)&&(0,o.isNumber)(a?.max)&&(!t||(0,o.isNumber)(n?.min)&&(0,o.isNumber)(n?.max))&&(!l||(0,o.isNumber)(l.min)&&(0,o.isNumber)(l.max))}let Z=(e,t)=>{let{options:i,forceCrop:r,chart:s}=e,n=(0,o.pick)(i.boostThreshold,Number.MAX_VALUE);return!r&&0!==n&&(I(s)||(t?.length??0)>=n)};function Q(){let e=this,t=e.chart;t.boost&&t.boost.markerGroup===e.markerGroup&&(e.markerGroup=void 0),t.hoverPoints&&(t.hoverPoints=t.hoverPoints.filter(function(t){return t.series===e})),t.hoverPoint&&t.hoverPoint.series===e&&(t.hoverPoint=void 0)}function $(){let e=this.boost,t=this.chart.boost,i=t?.markerGroup;e&&e.canvas&&e.target&&(e.wgl&&e.wgl.clear(),e.clear&&e.clear()),i&&this.markerGroup===i&&this.chart.series.some(e=>e.visible&&e.markerGroup===i)&&i.show()}function J(e){let t=e.boost;t&&t.canvas&&t.target&&t.wgl&&!I(e.chart)&&t.wgl.render(e.chart)}function ee(e,t){let i=e.options,r=e.xAxis,s=e.pointClass;if(t instanceof s)return t;let n=i.data,a=e.is("scatter"),l=(a&&e.getColumn("x",!0).length?e.getColumn("x",!0):void 0)||(e.getColumn("x").length?e.getColumn("x"):void 0)||i.xData||e.getColumn("x",!0)||!1,h=e.getColumn("y",!0)||i.yData||!1,d=t.i,f=n?.[d]?.color,u=new s(e,a&&l&&h?[l[d],h[d]]:((0,o.isArray)(n)?n:[])[d],l?l[d]:void 0);if(a&&i?.keys?.length){let e=i.keys;for(let t=e.length-1;t>-1;t--)u[e[t]]=n[d][t]}return u.category=(0,o.pick)(r.categories?r.categories[u.x]:u.x,u.x),u.key=u.name??u.category,u.dist=t.dist,u.distX=t.distX,u.plotX=t.plotX,u.plotY=t.plotY,u.percentage=t.percentage,u.isInside=e.isPointInside(u),f&&(u.color=f),u}function et(e){let{options:t,xAxis:i,yAxis:r}=this;if(!this.isDirty&&!i.isDirty&&!r.isDirty&&!e)return!1;this.yAxis.setTickInterval();let s=t.boostThreshold||0,n=t.cropThreshold,a=this.getColumn("x"),l=i.getExtremes(),h=l.max??Number.MAX_VALUE,d=l.min??-Number.MAX_VALUE,f=this.getColumn("y"),u=r.getExtremes(),g=u.max??Number.MAX_VALUE,m=u.min??-Number.MAX_VALUE,c=r.userMin??((0,o.isNumber)(r.options.min)?r.options.min:-Number.MAX_VALUE),b=r.userMax??((0,o.isNumber)(r.options.max)?r.options.max:Number.MAX_VALUE);if(!this.boosted&&i.old&&r.old&&d>=(i.old.min??-Number.MAX_VALUE)&&h<=(i.old.max??Number.MAX_VALUE)&&m>=(r.old.min??-Number.MAX_VALUE)&&g<=(r.old.max??Number.MAX_VALUE))return this.dataTable.getModified().setColumns({x:a,y:f}),!0;let p=this.dataTable.rowCount;if(!s||p<s||n&&!this.forceCrop&&!this.getExtremesFromAll&&!t.getExtremesFromAll&&p<n)return this.dataTable.getModified().setColumns({x:a,y:f}),!0;let x=[],A=[],y=[],v=!((0,o.isNumber)(l.max)||(0,o.isNumber)(l.min)),P=!((0,o.isNumber)(u.max)||(0,o.isNumber)(u.min)),T=!1,k,C=a[0],E=a[0],M,w=f?.[0],S=f?.[0];for(let e=0,t=a.length;e<t;++e)k=a[e],M=f?.[e],k>=d&&k<=h&&M>=c&&M<=b?(x.push(k),A.push(M),y.push(e),v&&(C=Math.max(C,k),E=Math.min(E,k)),P&&(w=Math.max(w,M),S=Math.min(S,M))):T=!0;return v&&(i.dataMax=Math.max(C,i.dataMax||0),i.dataMin=Math.min(E,i.dataMin||0)),P&&(r.dataMax=Math.max(w,r.dataMax||0),r.dataMin=Math.min(S,r.dataMin||0)),this.cropped=T,this.cropStart=0,T&&!this.dataTable.modified&&(this.dataTable.modified=new D,this.hasProcessedDataTable=!0),this.dataTable.getModified().setColumns({x:x,y:A}),!0}function ei(){let t=this.options||{},i=this.chart,r=i.boost,s=this.boost,n=this.xAxis,a=this.yAxis,l=t.xData||this.getColumn("x",!0),h=t.yData||this.getColumn("y",!0),d=this.getColumn("low",!0),f=this.getColumn("high",!0),u=t.data,g=n.getExtremes(),m=g.min-(n.minPointOffset||0),c=g.max+(n.minPointOffset||0),b=a.getExtremes(),p=b.min-(a.minPointOffset||0),x=b.max+(a.minPointOffset||0),A={},y=!!this.sampling,v=t.enableMouseTracking,P=t.threshold,T=this.pointArrayMap&&"low,high"===this.pointArrayMap.join(","),k=!!t.stacking,C=this.cropStart||0,E=this.requireSorting,M=!l,w="x"===t.findNearestPointBy,S=(this.getColumn("x").length?this.getColumn("x"):void 0)||this.options.xData||this.getColumn("x",!0),U=(0,o.pick)(t.lineWidth,1),R=t.nullInteraction&&p,N=i.tooltip,L=!1,_,z=a.getThreshold(P),D,O,G,B;if(!this.boosted||(this.points?.forEach(e=>{e?.destroyElements?.()}),this.points=[],N&&!N.isHidden?(i.hoverPoint?.series===this||i.hoverPoints?.some(e=>e.series===this))&&(i.hoverPoint=i.hoverPoints=void 0,N.hide(0)):i.hoverPoints&&(i.hoverPoints=i.hoverPoints.filter(e=>e.series!==this)),n.isPanning||a.isPanning)||(L=H(i,this),i.boosted=!0,!this.visible))return;(this.points||this.graph)&&W(this),I(i)?(this.markerGroup&&this.markerGroup!==r?.markerGroup&&this.markerGroup.destroy(),this.markerGroup=r?.markerGroup,s&&s.target&&(this.renderTarget=s.target=s.target.destroy())):(this.markerGroup===r?.markerGroup&&(this.markerGroup=void 0),this.markerGroup=this.plotGroup("markerGroup","markers","visible",1,i.seriesGroup).addClass("highcharts-tracker"));let V=this.points=[],F=(t,r,s,o)=>{let l=!!S&&S[C+s],h=e=>{i.inverted&&(e=n.len-e,r=a.len-r),V.push({destroy:X,x:l,clientX:e,plotX:e,plotY:r,i:C+s,percentage:o})};t=Math.ceil(t),e=w?t:t+","+r,v&&(A[e]?l===S[S.length-1]&&(V.length--,h(t)):(A[e]=!0,h(t)))};this.buildKDTree=X,(0,o.fireEvent)(this,"renderCanvas"),r&&U>1&&this.is("line")&&(r.lineWidthFilter?.remove(),r.lineWidthFilter=i.renderer.definition({tagName:"filter",children:[{tagName:"feMorphology",attributes:{operator:"dilate",radius:.25*U}}],attributes:{id:"linewidth"}}),(s?.target||r.target)?.attr({filter:"url(#linewidth)"})),L&&(j(L,this),L.pushSeries(this),J(this));let q=L.settings,K=(0,o.isNumber)(q.chunkSize)&&q.chunkSize>0?q.chunkSize:3e3,Z=()=>{(0,o.fireEvent)(this,"renderedCanvas"),delete this.buildKDTree,this.options&&this.buildKDTree(),q.debug.timeKDTree&&console.timeEnd("kd tree building")};i.renderer.forExport||(q.debug.timeKDTree&&console.time("kd tree building"),Y(k?this.data.slice(C):l||u,function(e,t){let r=void 0===i.index,s,l,u,g,b,A=!1,v=!0;return!(0,o.defined)(e)||(!r&&(M?(s=e[0],l=e[1]):(s=e,l=h[t]??R??null),T?(M&&(l=e.slice(1,3)),A=d[t],l=f[t]):k&&(s=e.x,A=(l=e.stackY)-e.y,b=e.percentage),E||(v=(l||0)>=p&&l<=x),null!==l&&s>=m&&s<=c&&v&&(u=n.toPixels(s,!0),y?((void 0===G||u===_)&&(T||(A=l),(void 0===B||l>O)&&(O=l,B=t),(void 0===G||A<D)&&(D=A,G=t)),w&&u===_||(void 0!==G&&(g=a.toPixels(O,!0),z=a.toPixels(D,!0),F(u,g,B,b),z!==g&&F(u,z,G,b)),G=B=void 0,_=u)):F(u,g=Math.ceil(a.toPixels(l,!0)),t,b))),!r)},Z,K))}function er(e){let t=!0;if(this.chart.options&&this.chart.options.boost&&(t=void 0===this.chart.options.boost.enabled||this.chart.options.boost.enabled),!t||!this.boosted)return e.call(this);this.chart.boosted=!0;let i=H(this.chart,this);i&&(j(i,this),i.pushSeries(this)),J(this)}function es(e){if(this.boosted){if(K(this,!0))return{};if(this.xAxis?.isPanning||this.yAxis?.isPanning)return this}return e.apply(this,[].slice.call(arguments,1))}function eo(e){let t=this.options.data;if(q(this.chart)&&m[this.type]){let r=this.is("scatter")&&!this.is("bubble")&&!this.is("treemap")&&!this.is("heatmap");if(!Z(this,t)||r||this.is("treemap")||this.options.stacking||!K(this,!0)){if(this.boosted&&(this.xAxis?.isPanning||this.yAxis?.isPanning))return;r&&"treegrid"!==this.yAxis.type?et.call(this,arguments[1]):e.apply(this,[].slice.call(arguments,1)),t=this.getColumn("x",!0)}if(this.boosted=Z(this,t),this.boosted){let e;this.options.data?.length&&(e=this.getFirstValidPoint(this.options.data),(0,o.isNumber)(e)||(0,o.isArray)(e)||this.is("treemap")||(0,o.error)(12,!1,this.chart));var i=this;i.boost=i.boost||{getPoint:e=>ee(i,e)};let t=i.boost.altered=[];if(["allowDG","directTouch","stickyTracking"].forEach(e=>{t.push({prop:e,val:i[e],own:Object.hasOwnProperty.call(i,e)})}),i.allowDG=!1,i.directTouch=!1,i.stickyTracking=!0,i.finishedAnimating=!0,i.labelBySeries&&(i.labelBySeries=i.labelBySeries.destroy()),i.is("scatter")&&!i.is("treemap")&&i.data.length){for(let e of i.data)e?.destroy?.();i.data.length=0,i.points.length=0}}else!function(e){let t=e.boost,i=e.chart,r=i.boost;if(r?.markerGroup)for(let e of(r.markerGroup.destroy(),r.markerGroup=void 0,i.series))e.markerGroup=void 0,e.markerGroup=e.plotGroup("markerGroup","markers","visible",1,i.seriesGroup).addClass("highcharts-tracker");t&&((t.altered||[]).forEach(t=>{t.own?e[t.prop]=t.val:delete e[t.prop]}),t.clear&&t.clear()),(i.seriesGroup||e.group)?.clip()}(this)}else e.apply(this,[].slice.call(arguments,1))}function en(e){let t=e.apply(this,[].slice.call(arguments,1));return this.boost&&t?this.boost.getPoint(t):t}let ea=function(e,t,i,r){if((0,o.pushUnique)(B,"Boost.Series")){let s=G().plotOptions,n=e.prototype;if((0,o.addEvent)(e,"destroy",Q),(0,o.addEvent)(e,"hide",$),r&&(n.renderCanvas=ei),(0,o.wrap)(n,"getExtremes",es),(0,o.wrap)(n,"processData",eo),(0,o.wrap)(n,"searchPoint",en),["translate","generatePoints","drawTracker","drawPoints","render"].forEach(e=>(function(e,t,i){function r(e){let t=this.options.stacking&&("translate"===i||"generatePoints"===i);this.boosted&&!t&&q(this.chart)&&"heatmap"!==this.type&&"treemap"!==this.type&&m[this.type]&&0!==this.options.boostThreshold?"render"===i&&this.renderCanvas&&this.renderCanvas():e.call(this)}if((0,o.wrap)(e,i,r),"translate"===i)for(let e of["column","arearange","columnrange","heatmap","treemap"])t[e]&&(0,o.wrap)(t[e].prototype,i,r)})(n,t,e)),(0,o.wrap)(i.prototype,"firePointEvent",function(e,t,i){if("click"===t&&this.series.boosted){let e=i.point;if((e.dist||e.distX)>=(e.series.options.marker?.radius??10))return}return e.apply(this,[].slice.call(arguments,1))}),g.forEach(e=>{let i=s[e];i&&(i.boostThreshold=5e3,i.boostData=[],t[e].prototype.fillOpacity=!0)}),r){let{area:e,areaspline:i,bubble:r,column:s,heatmap:n,scatter:a,treemap:l}=t;if(e&&(0,o.extend)(e.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),i&&(0,o.extend)(i.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),r){let e=r.prototype;delete e.buildKDTree,(0,o.wrap)(e,"markerAttribs",function(e){return!this.boosted&&e.apply(this,[].slice.call(arguments,1))})}s&&(0,o.extend)(s.prototype,{fill:!0,sampling:!0}),a&&(a.prototype.fill=!0),[n,l].forEach(e=>{e&&(0,o.wrap)(e.prototype,"drawPoints",er)})}}return e},el={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",feldspar:"#d19275",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslateblue:"#8470ff",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",violetred:"#d02090",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},{doc:eh,win:ed}=u(),ef=["webgl","experimental-webgl","moz-webgl","webkit-3d"];function eu(){let e;if(void 0!==ed.WebGLRenderingContext){e=eh.createElement("canvas");for(let t=0;t<ef.length;++t)try{if(null!=e.getContext(ef[t]))return!0}catch{}}return!1}let eg=u();eg.hasWebGLSupport=eu,n=eg.Chart,a=eg.Axis,l=eg.Series,h=eg.seriesTypes,d=eg.Point,f=eg.Color,(i=eu())||(void 0!==u().initCanvasBoost?u().initCanvasBoost():(0,o.error)(26)),f&&!f.names.lightgoldenrodyellow&&(f.names={...f.names,...el}),x.compose(n,i),ea(l,h,d,i),(0,o.addEvent)(a,"setExtremes",function(e){for(let t of[this.chart,...this.series].map(e=>e.renderTarget).filter(Boolean)){let{horiz:i,pos:r}=this,s=i?"scaleX":"scaleY",o=i?"translateX":"translateY",n=t?.[s]??1,a=1,l=0,h=1,d="none";this.isPanning&&(a=(e.scale??1)*n,l=(t?.[o]||0)-a*(e.move||0)+n*r-a*r,h=.7,d="blur(3px)"),t?.attr({[s]:a,[o]:l}).css({transition:"250ms filter, 250ms opacity",filter:d,opacity:h})}if(!this.isPanning)for(let e of this.series)e.boost&&e.is("scatter")&&!e.is("bubble")&&!e.is("treemap")&&!e.is("heatmap")&&(e.isDirty=!0)});let em=u();export{em as default};