apexcharts 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -11
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +545 -463
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +984 -801
- package/dist/apexcharts.js +519 -254
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +519 -254
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +20 -10
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +20 -10
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +20 -10
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +20 -10
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +545 -463
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +20 -10
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +199 -26
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +12 -14
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +14 -1
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +38 -38
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +11 -11
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +11 -11
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +172 -25
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +15 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +20 -10
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +20 -10
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +20 -10
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +79 -79
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +20 -10
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +20 -10
- package/package.json +2 -2
- package/src/apexcharts.js +39 -15
- package/src/charts/common/bar/Helpers.js +31 -12
- package/src/modules/Data.js +8 -2
- package/src/modules/Exports.js +14 -12
- package/src/modules/Formatters.js +24 -1
- package/src/modules/Range.js +28 -1
- package/src/modules/Toolbar.js +112 -2
- package/src/modules/ZoomPanSelection.js +85 -7
- package/src/modules/accessibility/KeyboardNavigation.js +14 -0
- package/src/modules/axes/YAxis.js +12 -15
- package/src/modules/helpers/UpdateHelpers.js +25 -8
- package/src/modules/settings/Globals.js +5 -10
- package/src/modules/settings/Options.js +15 -0
- package/src/modules/weave/PluginAPI.js +21 -1
- package/src/ssr/DOMShim.js +50 -0
- package/src/types/internal.d.ts +1 -1
- package/src/utils/Utils.js +6 -9
- package/types/apexcharts.d.ts +17 -0
|
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18
18
|
/*!
|
|
19
|
-
* ApexCharts v7.
|
|
19
|
+
* ApexCharts v7.4.0
|
|
20
20
|
* (c) 2018-2026 ApexCharts
|
|
21
21
|
*/
|
|
22
22
|
import ApexCharts from "apexcharts/core";
|
|
@@ -33,7 +33,7 @@ function getRegistry() {
|
|
|
33
33
|
function getPlugin(name) {
|
|
34
34
|
return getRegistry()[name] || null;
|
|
35
35
|
}
|
|
36
|
-
const WEAVE_API_VERSION =
|
|
36
|
+
const WEAVE_API_VERSION = 5;
|
|
37
37
|
const PLUGIN_CHART_METHODS = [
|
|
38
38
|
"updateOptions",
|
|
39
39
|
"updateSeries",
|
|
@@ -264,6 +264,19 @@ function buildPluginAPI(host, record) {
|
|
|
264
264
|
enabledOnSeries: Array.isArray(
|
|
265
265
|
w.config.dataLabels && w.config.dataLabels.enabledOnSeries
|
|
266
266
|
) ? w.config.dataLabels.enabledOnSeries.slice() : null
|
|
267
|
+
}),
|
|
268
|
+
// The caller's own dashing, reported for the same reason and against
|
|
269
|
+
// the same trap (v5). `stroke.dashArray` is indexed by series position
|
|
270
|
+
// with no per-series escape hatch, so a plugin that wants ITS OWN
|
|
271
|
+
// computed series dashed has to write the whole array, and writing one
|
|
272
|
+
// without knowing what was there discards the caller's dashed lines
|
|
273
|
+
// with nothing to restore them from.
|
|
274
|
+
//
|
|
275
|
+
// A scalar applies to every series and an array is per series. There is
|
|
276
|
+
// no "unset" to report: the option defaults to 0, and 0 already means
|
|
277
|
+
// no dashing, so restoring it restores exactly what was there.
|
|
278
|
+
stroke: Object.freeze({
|
|
279
|
+
dashArray: Array.isArray(w.config.stroke && w.config.stroke.dashArray) ? w.config.stroke.dashArray.slice() : w.config.stroke && w.config.stroke.dashArray || 0
|
|
267
280
|
})
|
|
268
281
|
});
|
|
269
282
|
},
|
package/dist/features/weave.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexWeave={})}(this,function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,n=(e,r,i)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,o=(e,t)=>{for(var o in t||(t={}))i.call(t,o)&&n(e,o,t[o]);if(r)for(var o of r(t))s.call(t,o)&&n(e,o,t[o]);return e};const a=globalThis.ApexCharts,l="__apexcharts_plugins__";function d(e){return function(){const e=globalThis;return e[l]||(e[l]={}),e[l]}()[e]||null}const c=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function h(e){const t={};return c.forEach(r=>{"function"==typeof e[r]&&(t[r]=e[r].bind(e))}),Object.freeze(t)}const u=class e{constructor(e,t){this.w=e,this.ctx=t,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._pointerSubs=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((e,t)=>({entry:e,order:null!=e.order?e.order:t})).sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(e){const t=d(e.name);if(!t)return void console.error(`[apexcharts] plugin "${e.name}" is not registered.`);const r=null!=t.apiVersion?Math.trunc(t.apiVersion):1;if(!(r>=1)||r>4)return void console.error(`[apexcharts] plugin "${t.name}" targets Weave API v${t.apiVersion}, host is v4; skipped.`);const i={def:t,options:Object.freeze(o({},e.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};i.api=function(e,t){const r=e.ctx,i=e.w,s={name:t.def.name,version:4,get options(){return t.options},on(e,r){const i=t.handlers;return i.has(e)||i.set(e,[]),i.get(e).push(r),s},off(e,r){const i=t.handlers.get(e);if(i){const e=i.indexOf(r);e>-1&&i.splice(e,1)}return s},store:{},layer:r=>e._layer(t.def.name,r||{}),get scales(){return e._currentScales},get data(){return e._lastData||(e._lastData=e._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:e=>i.globals.colors[e],token:t=>e._token(t)}),chart:h(r),get info(){return Object.freeze({type:String(i.config.chart&&(i.config.chart.requestedType||i.config.chart.type)||"line"),axisChart:!0===i.globals.axisCharts,datetimeX:!(!i.config.xaxis||"datetime"!==i.config.xaxis.type),horizontalBars:!!(i.config.plotOptions&&i.config.plotOptions.bar&&i.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!i.config.dataLabels||!i.config.dataLabels.enabled),enabledOnSeries:Array.isArray(i.config.dataLabels&&i.config.dataLabels.enabledOnSeries)?i.config.dataLabels.enabledOnSeries.slice():null})})},get categories(){return e._categories()},markDerived:r=>(e._markDerived(t.def.name,r),s),reserve:r=>(e._reserve(t.def.name,r),s),pointer:r=>e._onPointer(t.def.name,r),emit(e,i){r.events.fireEvent(`plugin:${t.def.name}:${e}`,[r,i])},get el(){return i.dom.baseEl}};return Object.freeze(s)}(this,i),this.active.push(i),this._guard(i,"setup",()=>t.setup(i.api))}dispatch(e,t){if("draw"===e&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===e?this._currentScales=null:t&&"xyRatios"in t&&this._setScales(t.xyRatios);const r=t&&t.pass||"full";let i=null;for(const t of this.active){if(t.disabled)continue;const s=t.handlers.get(e);if(!s||!s.length)continue;null===i&&(i=this._dataSnapshot(),this._lastData=i);const n={api:t.api,scales:this._currentScales,data:i,pass:r,hook:e};for(const r of s.slice())this._guard(t,e,()=>r(n))}}_guard(e,t,r){if(!e.disabled)try{r()}catch(r){console.error(`[apexcharts] plugin "${e.def.name}" threw in "${t}":`,r),e.failures=(e.failures||0)+1,e.failures>=3&&(e.disabled=!0,console.error(`[apexcharts] plugin "${e.def.name}" disabled after repeated errors.`))}}_setScales(e){const t=this.w,r=t.globals,i=t.layout;if(!e||!r.axisCharts)return void(this._currentScales=null);const s=e.xRatio,n=e.yRatio||[],o=e=>null!=r.maxYArr[e]?r.maxYArr[e]:r.maxY,a=e=>null!=r.minYArr[e]?r.minYArr[e]:r.minY,l=!t.axisFlags.isXNumeric&&!r.isBarHorizontal&&r.dataPoints>0,d=l?i.gridWidth/r.dataPoints:0;this._currentScales={x:l?e=>d*(e+.5):e=>(e-r.minX)/s,y:(e,t=0)=>(o(t)-e)/(e=>null!=n[e]?n[e]:n[0])(t),domainX:l?[-.5,r.dataPoints-.5]:[r.minX,r.maxX],domainY:(e=0)=>[a(e),o(e)],gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:e}}_dataSnapshot(){const e=this.w,t=e.globals,r=e.seriesData.series||[],i=e.seriesData.seriesX||[],s=Array.isArray(e.config.series)?e.config.series:[];return r.map((e,r)=>{const n=Array.isArray(e)?e:[e],o=i[r]||[],a=n.map((e,t)=>({x:null!=o[t]?o[t]:t,y:e})),l=s[r],d=l&&"object"==typeof l&&Array.isArray(l.data)?l.data:[];return{name:t.seriesNames?t.seriesNames[r]:void 0,hidden:(t.collapsedSeriesIndices||[]).includes(r),color:t.colors?t.colors[r]:void 0,points:a,raw:d}})}_categories(){const e=this.w,t=e.globals,r=e.config.xaxis&&Array.isArray(e.config.xaxis.categories)?e.config.xaxis.categories:[],i=Array.isArray(t.categoryLabels)?t.categoryLabels:[],s=Array.isArray(t.labels)?t.labels:[],n=r.length?r:i.length?i:s,o=e.seriesData.series||[];let a=0;for(let e=0;e<o.length;e++){const t=o[e];Array.isArray(t)&&t.length>a&&(a=t.length)}a||(a=n.length);const l=[];for(let e=0;e<a;e++){const t=n[e];l.push(String(null==t?e+1:t))}return l}_markDerived(e,t){this._derived||(this._derived=new Map);const r=Array.isArray(t)?t.map(e=>String(e)):[];r.length?this._derived.set(e,r):this._derived.delete(e),this._repairInitialSeries()}_onPointer(e,t){if("function"!=typeof t)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const r=this._pointerSubs.get(e)||[];return r.push(t),this._pointerSubs.set(e,r),this._wirePointer(),()=>{const r=this._pointerSubs&&this._pointerSubs.get(e);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const e=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[t,r]of e){const e=(e,r,i)=>{this._emitPointer(t,i)};this.ctx.addEventListener(r,e),this._pointerWired.push([r,e])}}_emitPointer(t,r){if(!this._pointerSubs||!this._pointerSubs.size)return;const i=r&&"number"==typeof r.seriesIndex?r.seriesIndex:-1,s=r&&"number"==typeof r.dataPointIndex?r.dataPointIndex:-1,n=this._categories()||[],o=this.w,a=o&&o.config&&o.config.series||[],l={type:t,seriesIndex:i,dataPointIndex:s,category:s>-1?n[s]:void 0,seriesName:e._seriesName(a,i),selected:"select"===t?e._isSelected(r,i,s):void 0};for(const[e,t]of this._pointerSubs)for(const r of t.slice())try{r(l)}catch(t){console.warn('[apexcharts] plugin "'+e+'" threw in a pointer handler',t)}}static _seriesName(e,t){if(t<0)return;const r=e[t];return r&&"object"==typeof r&&"string"==typeof r.name?r.name:void 0}static _isSelected(e,t,r){const i=e&&e.selectedDataPoints;if(!Array.isArray(i)||t<0)return;const s=i[t];return!!Array.isArray(s)&&s.indexOf(r)>-1}_reserve(t,r){const i=e._normaliseBox(r),s=this._reserved?this._reserved.get(t):void 0;if(i){if(s&&s.left===i.left&&s.right===i.right&&s.top===i.top&&s.bottom===i.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(t,i)}else{if(!s||!this._reserved)return;this._reserved.delete(t)}this._resizeForReservation()}static _normaliseBox(e){if(!e||"object"!=typeof e)return null;const t=e=>Number.isFinite(e)&&e>0?Math.round(e):0,r={left:t(e.left),right:t(e.right),top:t(e.top),bottom:t(e.bottom)};return r.left||r.right||r.top||r.bottom?r:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return e.NO_RESERVATION;const t={left:0,right:0,top:0,bottom:0};for(const e of this._reserved.values())t.left+=e.left,t.right+=e.right,t.top+=e.top,t.bottom+=e.bottom;return t}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const e=this.w.globals;if(!e.isDestroyed){e.resized=!0,e.dataChanged=!1;try{this.ctx.update()}catch(e){}}},0))}_derivedNames(){const e=new Set;if(!this._derived)return e;for(const t of this._derived.values())for(const r of t)e.add(r);return e}_repairInitialSeries(){const e=this._derivedNames();if(!e.size)return;const t=this.w,r=(Array.isArray(t.config.series)?t.config.series:[]).filter(t=>!e.has(String(t&&t.name)));if(r.length)try{t.globals.initialSeries=r,t.globals.initialConfig&&Array.isArray(t.globals.initialConfig.series)&&(t.globals.initialConfig.series=r)}catch(e){}}_token(e){const t=this.w,r=t.globals;switch(e){case"foreColor":return t.config.chart.foreColor;case"background":return t.config.chart.background;case"accent":case"primary":return r.colors?r.colors[0]:void 0;default:return/^series-\d+$/.test(e)&&r.colors?r.colors[Number(e.split("-")[1])]:void 0}}_layer(e,{z:t="front",className:r=""}={}){let i=this._layers.get(e);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${e} ${r}`.trim()});const s=this.w.dom.elGraphical.node;"behind"===t?s.insertBefore(i.node,s.firstChild):s.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(e,i)}return function(e,t){const r=t=>(t&&e.add(t),t),i={get node(){return e.node},path(e={}){const{d:i="",stroke:s="#000",width:n=1,fill:o="none",opacity:a=1,dash:l=0,className:d=""}=e;return r(t.drawPath({d:i,stroke:s,strokeWidth:n,fill:o,fillOpacity:"none"===o?0:a,strokeOpacity:a,strokeDashArray:l,classes:d}))},line(e={}){const{x1:i,y1:s,x2:n,y2:o,stroke:a="#000",width:l=1,dash:d=0}=e;return r(t.drawLine(i,s,n,o,a,d,l))},rect(e={}){const{x:i=0,y:s=0,w:n=0,h:o=0,r:a=0,fill:l="#000",stroke:d=null,opacity:c=1}=e;return r(t.drawRect(i,s,n,o,a,l,c,null!=d?1:null,d))},circle(e={}){const{cx:i=0,cy:s=0,r:n=0,fill:o="#000",stroke:a=null}=e;return r(t.drawCircle(n,{cx:i,cy:s,fill:o,stroke:a||"none"}))},text(e={}){const{x:i=0,y:s=0,text:n="",color:o,size:a,anchor:l="start",weight:d}=e;return r(t.drawText({x:i,y:s,text:n,textAnchor:l,fontSize:a,foreColor:o,fontWeight:d}))},clear(){const t=e.node;for(;t.firstChild;)t.removeChild(t.firstChild);return i}};return i}(i,this.ctx.graphics)}_resetLayers(){const e=this.w.dom.elGraphical,t=e&&e.node;if(t){const e=t.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(e,e=>e.remove())}this._layers.clear()}_reconcile(){const e=this.w.config.plugins||[];if(e===this._lastPluginsRef)return;this._lastPluginsRef=e;const t=new Map(e.map((e,t)=>[e.name,{entry:e,order:null!=e.order?e.order:t}]));for(let e=this.active.length-1;e>=0;e--){const r=this.active[e],i=t.get(r.def.name);i?r.options=Object.freeze(o({},i.entry.options||{})):(this._guard(r,"destroy",()=>r.def.destroy&&r.def.destroy(r.api)),this.active.splice(e,1),this._reserve(r.def.name,null))}const r=new Set(this.active.map(e=>e.def.name)),i=[];t.forEach((e,t)=>{r.has(t)||i.push(e)}),i.sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry))}teardown(e){if(!e){this.dispatch("destroy");for(const e of this.active)this._guard(e,"destroy",()=>e.def.destroy&&e.def.destroy(e.api));if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._pointerWired){for(const[e,t]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(e,t);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var f,p,g;f=u,p="NO_RESERVATION",g=Object.freeze({left:0,right:0,top:0,bottom:0}),n(f,"symbol"!=typeof p?p+"":p,g);let _=u;a.registerFeatures({weave:_}),e.default=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
5
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexWeave={})}(this,function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,n=(e,r,i)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,o=(e,t)=>{for(var o in t||(t={}))i.call(t,o)&&n(e,o,t[o]);if(r)for(var o of r(t))s.call(t,o)&&n(e,o,t[o]);return e};const a=globalThis.ApexCharts,l="__apexcharts_plugins__";function c(e){return function(){const e=globalThis;return e[l]||(e[l]={}),e[l]}()[e]||null}const d=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function h(e){const t={};return d.forEach(r=>{"function"==typeof e[r]&&(t[r]=e[r].bind(e))}),Object.freeze(t)}const f=class e{constructor(e,t){this.w=e,this.ctx=t,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._pointerSubs=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((e,t)=>({entry:e,order:null!=e.order?e.order:t})).sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(e){const t=c(e.name);if(!t)return void console.error(`[apexcharts] plugin "${e.name}" is not registered.`);const r=null!=t.apiVersion?Math.trunc(t.apiVersion):1;if(!(r>=1)||r>5)return void console.error(`[apexcharts] plugin "${t.name}" targets Weave API v${t.apiVersion}, host is v5; skipped.`);const i={def:t,options:Object.freeze(o({},e.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};i.api=function(e,t){const r=e.ctx,i=e.w,s={name:t.def.name,version:5,get options(){return t.options},on(e,r){const i=t.handlers;return i.has(e)||i.set(e,[]),i.get(e).push(r),s},off(e,r){const i=t.handlers.get(e);if(i){const e=i.indexOf(r);e>-1&&i.splice(e,1)}return s},store:{},layer:r=>e._layer(t.def.name,r||{}),get scales(){return e._currentScales},get data(){return e._lastData||(e._lastData=e._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:e=>i.globals.colors[e],token:t=>e._token(t)}),chart:h(r),get info(){return Object.freeze({type:String(i.config.chart&&(i.config.chart.requestedType||i.config.chart.type)||"line"),axisChart:!0===i.globals.axisCharts,datetimeX:!(!i.config.xaxis||"datetime"!==i.config.xaxis.type),horizontalBars:!!(i.config.plotOptions&&i.config.plotOptions.bar&&i.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!i.config.dataLabels||!i.config.dataLabels.enabled),enabledOnSeries:Array.isArray(i.config.dataLabels&&i.config.dataLabels.enabledOnSeries)?i.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(i.config.stroke&&i.config.stroke.dashArray)?i.config.stroke.dashArray.slice():i.config.stroke&&i.config.stroke.dashArray||0})})},get categories(){return e._categories()},markDerived:r=>(e._markDerived(t.def.name,r),s),reserve:r=>(e._reserve(t.def.name,r),s),pointer:r=>e._onPointer(t.def.name,r),emit(e,i){r.events.fireEvent(`plugin:${t.def.name}:${e}`,[r,i])},get el(){return i.dom.baseEl}};return Object.freeze(s)}(this,i),this.active.push(i),this._guard(i,"setup",()=>t.setup(i.api))}dispatch(e,t){if("draw"===e&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===e?this._currentScales=null:t&&"xyRatios"in t&&this._setScales(t.xyRatios);const r=t&&t.pass||"full";let i=null;for(const t of this.active){if(t.disabled)continue;const s=t.handlers.get(e);if(!s||!s.length)continue;null===i&&(i=this._dataSnapshot(),this._lastData=i);const n={api:t.api,scales:this._currentScales,data:i,pass:r,hook:e};for(const r of s.slice())this._guard(t,e,()=>r(n))}}_guard(e,t,r){if(!e.disabled)try{r()}catch(r){console.error(`[apexcharts] plugin "${e.def.name}" threw in "${t}":`,r),e.failures=(e.failures||0)+1,e.failures>=3&&(e.disabled=!0,console.error(`[apexcharts] plugin "${e.def.name}" disabled after repeated errors.`))}}_setScales(e){const t=this.w,r=t.globals,i=t.layout;if(!e||!r.axisCharts)return void(this._currentScales=null);const s=e.xRatio,n=e.yRatio||[],o=e=>null!=r.maxYArr[e]?r.maxYArr[e]:r.maxY,a=e=>null!=r.minYArr[e]?r.minYArr[e]:r.minY,l=!t.axisFlags.isXNumeric&&!r.isBarHorizontal&&r.dataPoints>0,c=l?i.gridWidth/r.dataPoints:0;this._currentScales={x:l?e=>c*(e+.5):e=>(e-r.minX)/s,y:(e,t=0)=>(o(t)-e)/(e=>null!=n[e]?n[e]:n[0])(t),domainX:l?[-.5,r.dataPoints-.5]:[r.minX,r.maxX],domainY:(e=0)=>[a(e),o(e)],gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:e}}_dataSnapshot(){const e=this.w,t=e.globals,r=e.seriesData.series||[],i=e.seriesData.seriesX||[],s=Array.isArray(e.config.series)?e.config.series:[];return r.map((e,r)=>{const n=Array.isArray(e)?e:[e],o=i[r]||[],a=n.map((e,t)=>({x:null!=o[t]?o[t]:t,y:e})),l=s[r],c=l&&"object"==typeof l&&Array.isArray(l.data)?l.data:[];return{name:t.seriesNames?t.seriesNames[r]:void 0,hidden:(t.collapsedSeriesIndices||[]).includes(r),color:t.colors?t.colors[r]:void 0,points:a,raw:c}})}_categories(){const e=this.w,t=e.globals,r=e.config.xaxis&&Array.isArray(e.config.xaxis.categories)?e.config.xaxis.categories:[],i=Array.isArray(t.categoryLabels)?t.categoryLabels:[],s=Array.isArray(t.labels)?t.labels:[],n=r.length?r:i.length?i:s,o=e.seriesData.series||[];let a=0;for(let e=0;e<o.length;e++){const t=o[e];Array.isArray(t)&&t.length>a&&(a=t.length)}a||(a=n.length);const l=[];for(let e=0;e<a;e++){const t=n[e];l.push(String(null==t?e+1:t))}return l}_markDerived(e,t){this._derived||(this._derived=new Map);const r=Array.isArray(t)?t.map(e=>String(e)):[];r.length?this._derived.set(e,r):this._derived.delete(e),this._repairInitialSeries()}_onPointer(e,t){if("function"!=typeof t)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const r=this._pointerSubs.get(e)||[];return r.push(t),this._pointerSubs.set(e,r),this._wirePointer(),()=>{const r=this._pointerSubs&&this._pointerSubs.get(e);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const e=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[t,r]of e){const e=(e,r,i)=>{this._emitPointer(t,i)};this.ctx.addEventListener(r,e),this._pointerWired.push([r,e])}}_emitPointer(t,r){if(!this._pointerSubs||!this._pointerSubs.size)return;const i=r&&"number"==typeof r.seriesIndex?r.seriesIndex:-1,s=r&&"number"==typeof r.dataPointIndex?r.dataPointIndex:-1,n=this._categories()||[],o=this.w,a=o&&o.config&&o.config.series||[],l={type:t,seriesIndex:i,dataPointIndex:s,category:s>-1?n[s]:void 0,seriesName:e._seriesName(a,i),selected:"select"===t?e._isSelected(r,i,s):void 0};for(const[e,t]of this._pointerSubs)for(const r of t.slice())try{r(l)}catch(t){console.warn('[apexcharts] plugin "'+e+'" threw in a pointer handler',t)}}static _seriesName(e,t){if(t<0)return;const r=e[t];return r&&"object"==typeof r&&"string"==typeof r.name?r.name:void 0}static _isSelected(e,t,r){const i=e&&e.selectedDataPoints;if(!Array.isArray(i)||t<0)return;const s=i[t];return!!Array.isArray(s)&&s.indexOf(r)>-1}_reserve(t,r){const i=e._normaliseBox(r),s=this._reserved?this._reserved.get(t):void 0;if(i){if(s&&s.left===i.left&&s.right===i.right&&s.top===i.top&&s.bottom===i.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(t,i)}else{if(!s||!this._reserved)return;this._reserved.delete(t)}this._resizeForReservation()}static _normaliseBox(e){if(!e||"object"!=typeof e)return null;const t=e=>Number.isFinite(e)&&e>0?Math.round(e):0,r={left:t(e.left),right:t(e.right),top:t(e.top),bottom:t(e.bottom)};return r.left||r.right||r.top||r.bottom?r:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return e.NO_RESERVATION;const t={left:0,right:0,top:0,bottom:0};for(const e of this._reserved.values())t.left+=e.left,t.right+=e.right,t.top+=e.top,t.bottom+=e.bottom;return t}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const e=this.w.globals;if(!e.isDestroyed){e.resized=!0,e.dataChanged=!1;try{this.ctx.update()}catch(e){}}},0))}_derivedNames(){const e=new Set;if(!this._derived)return e;for(const t of this._derived.values())for(const r of t)e.add(r);return e}_repairInitialSeries(){const e=this._derivedNames();if(!e.size)return;const t=this.w,r=(Array.isArray(t.config.series)?t.config.series:[]).filter(t=>!e.has(String(t&&t.name)));if(r.length)try{t.globals.initialSeries=r,t.globals.initialConfig&&Array.isArray(t.globals.initialConfig.series)&&(t.globals.initialConfig.series=r)}catch(e){}}_token(e){const t=this.w,r=t.globals;switch(e){case"foreColor":return t.config.chart.foreColor;case"background":return t.config.chart.background;case"accent":case"primary":return r.colors?r.colors[0]:void 0;default:return/^series-\d+$/.test(e)&&r.colors?r.colors[Number(e.split("-")[1])]:void 0}}_layer(e,{z:t="front",className:r=""}={}){let i=this._layers.get(e);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${e} ${r}`.trim()});const s=this.w.dom.elGraphical.node;"behind"===t?s.insertBefore(i.node,s.firstChild):s.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(e,i)}return function(e,t){const r=t=>(t&&e.add(t),t),i={get node(){return e.node},path(e={}){const{d:i="",stroke:s="#000",width:n=1,fill:o="none",opacity:a=1,dash:l=0,className:c=""}=e;return r(t.drawPath({d:i,stroke:s,strokeWidth:n,fill:o,fillOpacity:"none"===o?0:a,strokeOpacity:a,strokeDashArray:l,classes:c}))},line(e={}){const{x1:i,y1:s,x2:n,y2:o,stroke:a="#000",width:l=1,dash:c=0}=e;return r(t.drawLine(i,s,n,o,a,c,l))},rect(e={}){const{x:i=0,y:s=0,w:n=0,h:o=0,r:a=0,fill:l="#000",stroke:c=null,opacity:d=1}=e;return r(t.drawRect(i,s,n,o,a,l,d,null!=c?1:null,c))},circle(e={}){const{cx:i=0,cy:s=0,r:n=0,fill:o="#000",stroke:a=null}=e;return r(t.drawCircle(n,{cx:i,cy:s,fill:o,stroke:a||"none"}))},text(e={}){const{x:i=0,y:s=0,text:n="",color:o,size:a,anchor:l="start",weight:c}=e;return r(t.drawText({x:i,y:s,text:n,textAnchor:l,fontSize:a,foreColor:o,fontWeight:c}))},clear(){const t=e.node;for(;t.firstChild;)t.removeChild(t.firstChild);return i}};return i}(i,this.ctx.graphics)}_resetLayers(){const e=this.w.dom.elGraphical,t=e&&e.node;if(t){const e=t.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(e,e=>e.remove())}this._layers.clear()}_reconcile(){const e=this.w.config.plugins||[];if(e===this._lastPluginsRef)return;this._lastPluginsRef=e;const t=new Map(e.map((e,t)=>[e.name,{entry:e,order:null!=e.order?e.order:t}]));for(let e=this.active.length-1;e>=0;e--){const r=this.active[e],i=t.get(r.def.name);i?r.options=Object.freeze(o({},i.entry.options||{})):(this._guard(r,"destroy",()=>r.def.destroy&&r.def.destroy(r.api)),this.active.splice(e,1),this._reserve(r.def.name,null))}const r=new Set(this.active.map(e=>e.def.name)),i=[];t.forEach((e,t)=>{r.has(t)||i.push(e)}),i.sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry))}teardown(e){if(!e){this.dispatch("destroy");for(const e of this.active)this._guard(e,"destroy",()=>e.def.destroy&&e.def.destroy(e.api));if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._pointerWired){for(const[e,t]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(e,t);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var u,p,g;u=f,p="NO_RESERVATION",g=Object.freeze({left:0,right:0,top:0,bottom:0}),n(u,"symbol"!=typeof p?p+"":p,g);let _=f;a.registerFeatures({weave:_}),e.default=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/heatmap.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),a=t.__apex_Animations,i=t.__apex_Animations_computeStagger,s=t.__apex_Graphics,o=t.__apex_Fill,l=t.__apex_Series,r=t.__apex_Utils,n=t.__apex_DataLabels,c=(e,t,a,i)=>{if("function"!=typeof e)return e;const s=e({series:t.seriesData.series,seriesIndex:a,dataPointIndex:i,w:t});return Number.isFinite(s)?s:0};class h{constructor(e,t){this.ctx=t,this.w=e}checkColorRange(){const e=this.w;let t=!1;const a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(e=>{e.from<=0&&(t=!0)}),t}getShadeColor(e,t,a,i){const s=this.w;let o=1;const l=s.config.plotOptions[e].shadeIntensity,n=this.determineColor(e,t,a);s.globals.hasNegs||i?o=s.config.plotOptions[e].reverseNegativeShade?n.percent<0?n.percent/100*(1.25*l):(1-n.percent/100)*(1.25*l):n.percent<=0?1-(1+n.percent/100)*l:(1-n.percent/100)*l:(o=1-n.percent/100,"treemap"===e&&(o=(1-n.percent/100)*(1.25*l)));let c=n.color;const h=new r;if(s.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){const e=h.shadeColor(-1*o,n.color);c=r.hexToRgba(r.isColorHex(e)?e:r.rgb2hex(e),s.config.fill.opacity)}else{const e=h.shadeColor(o,n.color);c=r.hexToRgba(r.isColorHex(e)?e:r.rgb2hex(e),s.config.fill.opacity)}return{color:c,colorProps:n}}determineColor(e,t,a){const i=this.w,s=i.seriesData.series[t][a],o=i.config.plotOptions[e];let l=o.colorScale.inverse?a:t;o.distributed&&"treemap"===i.config.chart.type&&(l=a);let r,n,c=i.globals.colors[l],h=null;if(o.distributed||"heatmap"!==e){const e=i.seriesData.series[t];r=e.length?e[0]:0,n=r;for(let t=1;t<e.length;t++)e[t]<r&&(r=e[t]),e[t]>n&&(n=e[t])}else r=i.globals.minY,n=i.globals.maxY;const d=o.colorScale.min,g=o.colorScale.max;void 0!==d&&void 0!==g&&g>d?(r=d,n=g):void 0!==d&&(r=d<i.globals.minY?d:i.globals.minY,n=g>i.globals.maxY?g:i.globals.maxY);const p=Math.abs(n)+Math.abs(r),f=Math.min(Math.max(s,r),n);let m=0===p?0:100*f/p;if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(e=>{if(s>=e.from&&s<=e.to){c=e.color,h=e.foreColor?e.foreColor:null,r=e.from,n=e.to;const t=Math.abs(n)+Math.abs(r);m=0===t?0:100*s/t}})}return{color:c,foreColor:h,percent:m}}calculateDataLabels({text:e,x:t,y:a,i:i,j:o,colorProps:l,fontSize:r}){const h=this.w,d=h.config.dataLabels,g=new s(this.w),p=new n(this.w,this.ctx);let f=null;if(d.enabled){f=g.group({class:"apexcharts-data-labels"});const s=c(d.offsetX,h,i,o),n=c(d.offsetY,h,i,o),m=t+s,u=a+parseFloat(d.style.fontSize)/3+n;p.plotDataLabelsText({x:m,y:u,text:e,i:i,j:o,color:l.foreColor,parent:f,fontSize:r,dataLabelsConfig:d})}return f}}const d=t.__apex_Filters;const g=t.__apex_BrowserAPIs_BrowserAPIs,p=t.__apex_math_SVGNS;t.default.use({heatmap:class{constructor(e,t,a){this.ctx=t,this.w=e,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new h(e,t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(e){var t,i;const n=this.w,c=new s(this.w,this.ctx),h=c.group({class:"apexcharts-heatmap"}),g=n.layout.gridWidth/n.globals.dataPoints,p=n.layout.gridHeight/n.seriesData.series.length,f=("numeric"===n.config.xaxis.type||"datetime"===n.config.xaxis.type)&&n.axisFlags.isXNumeric&&this.xRatio>0;let m=g;if(f){const e=n.globals.minXDiff;m=Number.isFinite(e)&&e>0?e/this.xRatio:g}let u=this.shape;f&&"hexagon"===u&&(u="rect");const x=function(e,t){const a=e&&e.renderer;return a&&a.kind&&"svg"!==a.kind?a:t}(this.ctx,c),b="rect"===u&&x!==c&&"function"==typeof x.drawRectCell;"hexagon"===u?this.applyHexagonClipPath(h,c,g,p):h.attr("clip-path",`url(#gridRectMask${n.globals.cuid})`);const y=Array.isArray(n.config.fill.opacity)?null!=(t=n.config.fill.opacity[0])?t:1:null!=(i=n.config.fill.opacity)?i:1;let w=0,S=!1;this.negRange=this.helpers.checkColorRange();const _=e.slice();n.config.yaxis[0].reversed&&(S=!0,_.reverse());for(let t=S?0:_.length-1;S?t<_.length:t>=0;S?t++:t--){const i=c.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:r.escapeString(n.seriesData.seriesNames[t]),rel:t+1,"data:realIndex":t});if(l.addCollapsedClassToSeries(this.w,i,t),b||c.setupEventDelegation(i,".apexcharts-heatmap-rect"),n.config.chart.dropShadow.enabled){const e=n.config.chart.dropShadow;new d(this.w).dropShadow(i,e,t)}let s=0;const S=n.config.plotOptions.heatmap.shadeIntensity,C=Math.round(w/p),$="hexagon"===u?(C%2==0?-1:1)*g/4:0;let P=0;for(let l=0;l<n.globals.dataPoints;l++){if(!f&&n.seriesData.seriesX.length&&!n.globals.allSeriesHasEqualX&&n.globals.minX+n.globals.minXDiff*l<n.seriesData.seriesX[t][P]){s+=g;continue}if(P>=_[t].length)break;const h=f?m:g;if(f){const e=n.seriesData.seriesX[t]?n.seriesData.seriesX[t][P]:null;if(null==e||e!=e){P++;continue}s=(e-n.globals.minX)/this.xRatio-m/2}const d=this.helpers.getShadeColor(n.config.chart.type,t,P,this.negRange);let C=d.color;const D=d.colorProps;if("image"===n.config.fill.type){C=new o(this.w).fillPath({seriesNumber:t,dataPointIndex:P,opacity:n.globals.hasNegs?D.percent<0?1-(1+D.percent/100):S+D.percent/100:D.percent/100,patternID:r.randomId(),width:n.config.fill.image.width?n.config.fill.image.width:h,height:n.config.fill.image.height?n.config.fill.image.height:p})}const k=this.rectRadius,v=n.config.plotOptions.heatmap.useFillColorAsStroke?C:n.globals.stroke.colors[0];if(b)x.drawRectCell(s,w,h,p,{fill:C,fillOpacity:y,stroke:v,strokeWidth:this.strokeWidth,radius:k,seriesIndex:t,dataPointIndex:P});else{const o="rect"===u,l=o?c.drawRect(s,w,h,p,k):c.drawPath({d:this.cellShapePath(u,s+$,w,h,p),stroke:v,strokeWidth:this.strokeWidth,fill:C,fillOpacity:1});if(l.attr({cx:s+$,cy:w}),l.node.classList.add("apexcharts-heatmap-rect"),i.add(l),l.attr({fill:C,i:t,index:t,j:P,val:e[t][P],"stroke-width":this.strokeWidth,stroke:v,color:C}),o||l.attr({width:h,height:p}),n.config.chart.animations.enabled&&!n.globals.dataChanged){let e=1;if(n.globals.resized||(e=n.config.chart.animations.speed),o)this.animateHeatMap(l,s,w,h,p,e,t,P);else{const i=new a(this.w);i.animatePop(l,{speed:e,delay:this.enterStaggerDelay(e,t,P),onComplete:()=>{i.animationCompleted(l)}})}}if(n.globals.dataChanged){let e=1;if(this.dynamicAnim.enabled&&n.globals.shouldAnimate){e=this.dynamicAnim.speed;let a=n.globals.previousPaths[t]&&n.globals.previousPaths[t][P]&&n.globals.previousPaths[t][P].color;a||(a="rgba(255, 255, 255, 0)"),this.animateHeatColor(l,r.isColorHex(a)?a:r.rgb2hex(a),r.isColorHex(C)?C:r.rgb2hex(C),e)}}}const M=(0,n.config.dataLabels.formatter)(n.seriesData.series[t][P],{value:n.seriesData.series[t][P],seriesIndex:t,dataPointIndex:P,w:n}),R=this.helpers.calculateDataLabels({text:M,x:s+$+h/2,y:w+p/2,i:t,j:P,colorProps:D,series:_});null!==R&&i.add(R),f||(s+=g),P++}w+=p,h.add(i)}const C=n.globals.yAxisScale[0].result.slice();return n.config.yaxis[0].reversed?C.unshift(""):C.push(""),n.globals.yAxisScale[0].result=C,h}animateHeatMap(e,t,i,s,o,l,r=0,n=0){const c=new a(this.w),h=this.enterStaggerDelay(l,r,n);c.animateRect(e,{x:t+s/2,y:i+o/2,width:0,height:0},{x:t,y:i,width:s,height:o},l,()=>{c.animationCompleted(e)},h)}enterStaggerDelay(e,t,a){const s=this.w,o=s.config.chart.animations.animateGradually;if(!o||!1===o.enabled)return 0;const l=((s.seriesData.series||[]).length||1)+(s.globals.dataPoints||1)-2,r=Math.min(o.delay||0,.5*e/Math.max(1,l));return i({style:"diagonal",index:a,row:t,col:a,baseDelay:r})}cellShapePath(e,t,a,i,s){const o=t+i/2,l=a+s/2;if("circle"===e){const e=Math.min(i,s)/2;return`M ${o-e} ${l} a ${e} ${e} 0 1 0 ${2*e} 0 a ${e} ${e} 0 1 0 ${2*-e} 0 Z`}if("diamond"===e)return`M ${o} ${a} L ${t+i} ${l} L ${o} ${a+s} L ${t} ${l} Z`;const r=t+i;return`M ${o} ${a-s/6} L ${r} ${a+s/6} L ${r} ${a+5*s/6} L ${o} ${a+7*s/6} L ${t} ${a+5*s/6} L ${t} ${a+s/6} Z`}applyHexagonClipPath(e,t,a,i){const s=this.w,o=this.strokeWidth/2+2,l=`heatmapHexMask${s.globals.cuid}`,r=s.dom.elDefs.node,n=r.querySelector(`clipPath[id="${l}"]`);n&&n.parentNode&&n.parentNode.removeChild(n);const c=g.createElementNS(p,"clipPath");c.setAttribute("id",l),c.appendChild(t.drawRect(-a/4-o,-i/6-o,s.layout.gridWidth+a/2+2*o,s.layout.gridHeight+i/3+2*o,0,"#fff").node),r.appendChild(c),e.attr("clip-path",`url(#${l})`)}animateHeatColor(e,t,a,i){e.attr({fill:t}).animate(i).attr({fill:a})}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
|
package/dist/heatmap.esm.js
CHANGED
package/dist/heatmap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexHeatmap={})}(this,function(e){"use strict";const t=globalThis.ApexCharts,a=globalThis.ApexCharts.__internals,i=a.__apex_Animations,s=a.__apex_Animations_computeStagger;a.__apex_Animations_applyAnimationPolicy,a.__apex_Animations_prefersReducedMotion,a.__apex_Animations_applyProgressiveReveal;const o=globalThis.ApexCharts.__internals.__apex_Graphics,l=globalThis.ApexCharts.__internals.__apex_Fill,n=globalThis.ApexCharts.__internals.__apex_Series,r=globalThis.ApexCharts.__internals.__apex_Utils,c=globalThis.ApexCharts.__internals.__apex_DataLabels,h=(e,t,a,i)=>{if("function"!=typeof e)return e;const s=e({series:t.seriesData.series,seriesIndex:a,dataPointIndex:i,w:t});return Number.isFinite(s)?s:0};class p{constructor(e,t){this.ctx=t,this.w=e}checkColorRange(){const e=this.w;let t=!1;const a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(e=>{e.from<=0&&(t=!0)}),t}getShadeColor(e,t,a,i){const s=this.w;let o=1;const l=s.config.plotOptions[e].shadeIntensity,n=this.determineColor(e,t,a);s.globals.hasNegs||i?o=s.config.plotOptions[e].reverseNegativeShade?n.percent<0?n.percent/100*(1.25*l):(1-n.percent/100)*(1.25*l):n.percent<=0?1-(1+n.percent/100)*l:(1-n.percent/100)*l:(o=1-n.percent/100,"treemap"===e&&(o=(1-n.percent/100)*(1.25*l)));let c=n.color;const h=new r;if(s.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){const e=h.shadeColor(-1*o,n.color);c=r.hexToRgba(r.isColorHex(e)?e:r.rgb2hex(e),s.config.fill.opacity)}else{const e=h.shadeColor(o,n.color);c=r.hexToRgba(r.isColorHex(e)?e:r.rgb2hex(e),s.config.fill.opacity)}return{color:c,colorProps:n}}determineColor(e,t,a){const i=this.w,s=i.seriesData.series[t][a],o=i.config.plotOptions[e];let l=o.colorScale.inverse?a:t;o.distributed&&"treemap"===i.config.chart.type&&(l=a);let n,r,c=i.globals.colors[l],h=null;if(o.distributed||"heatmap"!==e){const e=i.seriesData.series[t];n=e.length?e[0]:0,r=n;for(let t=1;t<e.length;t++)e[t]<n&&(n=e[t]),e[t]>r&&(r=e[t])}else n=i.globals.minY,r=i.globals.maxY;const p=o.colorScale.min,d=o.colorScale.max;void 0!==p&&void 0!==d&&d>p?(n=p,r=d):void 0!==p&&(n=p<i.globals.minY?p:i.globals.minY,r=d>i.globals.maxY?d:i.globals.maxY);const g=Math.abs(r)+Math.abs(n),f=Math.min(Math.max(s,n),r);let m=0===g?0:100*f/g;if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(e=>{if(s>=e.from&&s<=e.to){c=e.color,h=e.foreColor?e.foreColor:null,n=e.from,r=e.to;const t=Math.abs(r)+Math.abs(n);m=0===t?0:100*s/t}})}return{color:c,foreColor:h,percent:m}}calculateDataLabels({text:e,x:t,y:a,i:i,j:s,colorProps:l,fontSize:n}){const r=this.w,p=r.config.dataLabels,d=new o(this.w),g=new c(this.w,this.ctx);let f=null;if(p.enabled){f=d.group({class:"apexcharts-data-labels"});const o=h(p.offsetX,r,i,s),c=h(p.offsetY,r,i,s),m=t+o,x=a+parseFloat(p.style.fontSize)/3+c;g.plotDataLabelsText({x:m,y:x,text:e,i:i,j:s,color:l.foreColor,parent:f,fontSize:n,dataLabelsConfig:p})}return f}}const d=globalThis.ApexCharts.__internals.__apex_Filters;const g=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,f=globalThis.ApexCharts.__internals,m=f.__apex_math_SVGNS;f.__apex_math_Point,f.__apex_math_Matrix,f.__apex_math_Box;t.use({heatmap:class{constructor(e,t,a){this.ctx=t,this.w=e,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new p(e,t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(e){var t,a;const s=this.w,c=new o(this.w,this.ctx),h=c.group({class:"apexcharts-heatmap"}),p=s.layout.gridWidth/s.globals.dataPoints,g=s.layout.gridHeight/s.seriesData.series.length,f=("numeric"===s.config.xaxis.type||"datetime"===s.config.xaxis.type)&&s.axisFlags.isXNumeric&&this.xRatio>0;let m=p;if(f){const e=s.globals.minXDiff;m=Number.isFinite(e)&&e>0?e/this.xRatio:p}let x=this.shape;f&&"hexagon"===x&&(x="rect");const u=function(e,t){const a=e&&e.renderer;return a&&a.kind&&"svg"!==a.kind?a:t}(this.ctx,c),b="rect"===x&&u!==c&&"function"==typeof u.drawRectCell;"hexagon"===x?this.applyHexagonClipPath(h,c,p,g):h.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`);const _=Array.isArray(s.config.fill.opacity)?null!=(t=s.config.fill.opacity[0])?t:1:null!=(a=s.config.fill.opacity)?a:1;let y=0,w=!1;this.negRange=this.helpers.checkColorRange();const C=e.slice();s.config.yaxis[0].reversed&&(w=!0,C.reverse());for(let t=w?0:C.length-1;w?t<C.length:t>=0;w?t++:t--){const a=c.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:r.escapeString(s.seriesData.seriesNames[t]),rel:t+1,"data:realIndex":t});if(n.addCollapsedClassToSeries(this.w,a,t),b||c.setupEventDelegation(a,".apexcharts-heatmap-rect"),s.config.chart.dropShadow.enabled){const e=s.config.chart.dropShadow;new d(this.w).dropShadow(a,e,t)}let o=0;const w=s.config.plotOptions.heatmap.shadeIntensity,S=Math.round(y/g),$="hexagon"===x?(S%2==0?-1:1)*p/4:0;let A=0;for(let n=0;n<s.globals.dataPoints;n++){if(!f&&s.seriesData.seriesX.length&&!s.globals.allSeriesHasEqualX&&s.globals.minX+s.globals.minXDiff*n<s.seriesData.seriesX[t][A]){o+=p;continue}if(A>=C[t].length)break;const h=f?m:p;if(f){const e=s.seriesData.seriesX[t]?s.seriesData.seriesX[t][A]:null;if(null==e||e!=e){A++;continue}o=(e-s.globals.minX)/this.xRatio-m/2}const d=this.helpers.getShadeColor(s.config.chart.type,t,A,this.negRange);let S=d.color;const P=d.colorProps;if("image"===s.config.fill.type){S=new l(this.w).fillPath({seriesNumber:t,dataPointIndex:A,opacity:s.globals.hasNegs?P.percent<0?1-(1+P.percent/100):w+P.percent/100:P.percent/100,patternID:r.randomId(),width:s.config.fill.image.width?s.config.fill.image.width:h,height:s.config.fill.image.height?s.config.fill.image.height:g})}const D=this.rectRadius,k=s.config.plotOptions.heatmap.useFillColorAsStroke?S:s.globals.stroke.colors[0];if(b)u.drawRectCell(o,y,h,g,{fill:S,fillOpacity:_,stroke:k,strokeWidth:this.strokeWidth,radius:D,seriesIndex:t,dataPointIndex:A});else{const l="rect"===x,n=l?c.drawRect(o,y,h,g,D):c.drawPath({d:this.cellShapePath(x,o+$,y,h,g),stroke:k,strokeWidth:this.strokeWidth,fill:S,fillOpacity:1});if(n.attr({cx:o+$,cy:y}),n.node.classList.add("apexcharts-heatmap-rect"),a.add(n),n.attr({fill:S,i:t,index:t,j:A,val:e[t][A],"stroke-width":this.strokeWidth,stroke:k,color:S}),l||n.attr({width:h,height:g}),s.config.chart.animations.enabled&&!s.globals.dataChanged){let e=1;if(s.globals.resized||(e=s.config.chart.animations.speed),l)this.animateHeatMap(n,o,y,h,g,e,t,A);else{const a=new i(this.w);a.animatePop(n,{speed:e,delay:this.enterStaggerDelay(e,t,A),onComplete:()=>{a.animationCompleted(n)}})}}if(s.globals.dataChanged){let e=1;if(this.dynamicAnim.enabled&&s.globals.shouldAnimate){e=this.dynamicAnim.speed;let a=s.globals.previousPaths[t]&&s.globals.previousPaths[t][A]&&s.globals.previousPaths[t][A].color;a||(a="rgba(255, 255, 255, 0)"),this.animateHeatColor(n,r.isColorHex(a)?a:r.rgb2hex(a),r.isColorHex(S)?S:r.rgb2hex(S),e)}}}const R=(0,s.config.dataLabels.formatter)(s.seriesData.series[t][A],{value:s.seriesData.series[t][A],seriesIndex:t,dataPointIndex:A,w:s}),v=this.helpers.calculateDataLabels({text:R,x:o+$+h/2,y:y+g/2,i:t,j:A,colorProps:P,series:C});null!==v&&a.add(v),f||(o+=p),A++}y+=g,h.add(a)}const S=s.globals.yAxisScale[0].result.slice();return s.config.yaxis[0].reversed?S.unshift(""):S.push(""),s.globals.yAxisScale[0].result=S,h}animateHeatMap(e,t,a,s,o,l,n=0,r=0){const c=new i(this.w),h=this.enterStaggerDelay(l,n,r);c.animateRect(e,{x:t+s/2,y:a+o/2,width:0,height:0},{x:t,y:a,width:s,height:o},l,()=>{c.animationCompleted(e)},h)}enterStaggerDelay(e,t,a){const i=this.w,o=i.config.chart.animations.animateGradually;if(!o||!1===o.enabled)return 0;const l=((i.seriesData.series||[]).length||1)+(i.globals.dataPoints||1)-2,n=Math.min(o.delay||0,.5*e/Math.max(1,l));return s({style:"diagonal",index:a,row:t,col:a,baseDelay:n})}cellShapePath(e,t,a,i,s){const o=t+i/2,l=a+s/2;if("circle"===e){const e=Math.min(i,s)/2;return`M ${o-e} ${l} a ${e} ${e} 0 1 0 ${2*e} 0 a ${e} ${e} 0 1 0 ${2*-e} 0 Z`}if("diamond"===e)return`M ${o} ${a} L ${t+i} ${l} L ${o} ${a+s} L ${t} ${l} Z`;const n=t+i;return`M ${o} ${a-s/6} L ${n} ${a+s/6} L ${n} ${a+5*s/6} L ${o} ${a+7*s/6} L ${t} ${a+5*s/6} L ${t} ${a+s/6} Z`}applyHexagonClipPath(e,t,a,i){const s=this.w,o=this.strokeWidth/2+2,l=`heatmapHexMask${s.globals.cuid}`,n=s.dom.elDefs.node,r=n.querySelector(`clipPath[id="${l}"]`);r&&r.parentNode&&r.parentNode.removeChild(r);const c=g.createElementNS(m,"clipPath");c.setAttribute("id",l),c.appendChild(t.drawRect(-a/4-o,-i/6-o,s.layout.gridWidth+a/2+2*o,s.layout.gridHeight+i/3+2*o,0,"#fff").node),n.appendChild(c),e.attr("clip-path",`url(#${l})`)}animateHeatColor(e,t,a,i){e.attr({fill:t}).animate(i).attr({fill:a})}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/histogram.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,n=(t,e)=>{for(var s in e||(e={}))r.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))i.call(e,s)&&o(t,s,e[s]);return t},l=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Utils,u="__apexcharts_series_transforms__";function b(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[u][t]=e)}globalThis[u]||(globalThis[u]={});const g="__apexcharts_row_sources__";function p(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[g][t]=e)}globalThis[g]||(globalThis[g]={});function x(t,e){const s=t.length;if(0===s)return NaN;if(1===s)return t[0];const a=(s-1)*e,r=Math.floor(a),i=Math.ceil(a);return r===i?t[r]:t[r]+(t[i]-t[r])*(a-r)}function f(t){const e=t.length;if(e<2)return 0;let s=0;for(let a=0;a<e;a++)s+=t[a];const a=s/e;let r=0;for(let s=0;s<e;s++){const e=t[s]-a;r+=e*e}return Math.sqrt(r/e)}function y(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e);let a=s[0],r=s[s.length-1];const i=e.range;if(Array.isArray(i)&&2===i.length){const t=Number(i[0]),e=Number(i[1]);isFinite(t)&&isFinite(e)&&e>t&&(a=t,r=e)}if(!(r>a)){const t=Math.abs(a)>0?.05*Math.abs(a):.5;return{edges:[a-t,a+t],binWidth:2*t,rule:"single",capped:!1}}const o=r-a;let n,l;if("number"==typeof e.binWidth&&e.binWidth>0)n=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)n=o/Math.floor(e.bins),l="count";else{const t=function(t,e,s){const a=t.length,r=t=>e/Math.max(1,Math.ceil(t));switch(s){case"sqrt":return{width:r(Math.sqrt(a)),rule:"sqrt"};case"rice":return{width:r(2*Math.cbrt(a)),rule:"rice"};case"scott":{const e=f(t);return e>0?{width:3.49*e*Math.pow(a,-1/3),rule:"scott"}:{width:r(Math.log2(a)+1),rule:"sturges"}}case"fd":{const e=x(t,.75)-x(t,.25);return e>0?{width:2*e*Math.pow(a,-1/3),rule:"fd"}:{width:r(Math.log2(a)+1),rule:"sturges"}}case"auto":{const e=r(Math.log2(a)+1),s=x(t,.75)-x(t,.25);if(s<=0)return{width:e,rule:"sturges"};const i=2*s*Math.pow(a,-1/3);return i<e?{width:i,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(Math.log2(a)+1),rule:"sturges"}}}(s,o,"string"==typeof e.bins?e.bins:"auto");n=t.width,l=t.rule}(!isFinite(n)||n<=0)&&(n=o);let h=Math.ceil(o/n);(!isFinite(h)||h<1)&&(h=1);let d=!1;h>1e3&&(h=1e3,n=o/h,d=!0),n=o/h;const c=new Array(h+1);for(let t=0;t<=h;t++)c[t]=a+t*n;return c[h]=Math.max(c[h],r),{edges:c,binWidth:n,rule:l,capped:d}}function m(t,e){const s=e.length-1;if(!(t>=e[0])||t>e[s])return-1;if(t===e[s])return s-1;const a=(e[s]-e[0])/s;if(a>0){let r=Math.floor((t-e[0])/a);return r<0&&(r=0),r>s-1&&(r=s-1),t<e[r]?r--:t>=e[r+1]&&r++,r<0||r>s-1?-1:r}let r=0,i=s-1;for(;r<=i;){const s=r+i>>1;if(t<e[s])i=s-1;else{if(!(t>=e[s+1]))return s;r=s+1}}return-1}function v(t,e){var s;if(!t||"object"!=typeof t||Array.isArray(t))return null;let a=null;if(Array.isArray(t.points)?a=t.points:Array.isArray(null==(s=t.y)?void 0:s.points)?a=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(a=t.y),!a)return null;const r=[];for(let t=0;t<a.length;t++){const e=c.parseNumber(a[t]);null!==e&&isFinite(e)&&r.push(e)}return r.length?r:null}function C(t){const e=[];if(!Array.isArray(t))return e;for(let s=0;s<t.length;s++){const a=t[s];let r=a;Array.isArray(a)?r=1===a.length?a[0]:a[1]:a&&"object"==typeof a&&(r=void 0!==a.y?a.y:a.x);const i=c.parseNumber(r);null!==i&&isFinite(i)&&e.push(i)}return e}const w=new WeakSet;function I(t,e,s){const a=s&&null!=s.maxRows?s.maxRows:3e3,r=function(t,e){let s=0,a=0;for(const e of t)s+=e.length,e.length>a&&(a=e.length);if(s<=e)return{clusters:t,stride:1,total:s,kept:s};const r=e=>{let s=0;for(const a of t)s+=Math.ceil(a.length/e);return s};let i=Math.max(2,Math.ceil(s/e));for(;i<a&&r(i)>e;)i++;let o=0;return{clusters:t.map(t=>{const e=[];for(let s=0;s<t.length;s+=i)e.push(t[s]);return o+=e.length,e}),stride:i,total:s,kept:o}}(e.map(t=>t.rows),a);r.stride;const i=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const s=i[t.realIndex]||i[0];return{name:t.name,data:r.clusters[e].map((a,r)=>n({id:`${t.realIndex}:${e}:${r}`,x:t.name,y:a},s?{fillColor:s}:{}))}})}function P(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function A(t){return(e,s)=>{var a;const r=t(e);if(!Array.isArray(r)||!r.length)return null;const i=e.globals&&e.globals.collapsedSeriesIndices||[],o=e.globals&&((null==(a=e.globals.categoryLabels)?void 0:a.length)?e.globals.categoryLabels:e.globals.labels)||[],n=[];return r.forEach((t,s)=>{var a;if(-1!==i.indexOf(s))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(a=e.seriesData.seriesNames)?void 0:a[s]);t.forEach((t,e)=>{const a=null!=o[e]?String(o[e]):`#${e+1}`;n.push({name:r.length>1&&l?`${l} ${a}`:a,realIndex:s,rows:Array.isArray(t)?t.slice():[]})})}),n.length?I(e,n,s):null}}const S=A(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),L=A(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});b("histogram",function(t,e){var s;const a=e.config,r=e.globals;if(!Array.isArray(t))return t;r.histogramRawSeries||(r.histogramRawSeries=t.map(t=>l(n({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const i=r.histogramRawSeries,o=(null==(s=a.plotOptions)?void 0:s.histogram)||{},h=i.map(t=>C(null==t?void 0:t.data));let d=[];if(1===h.length)d=h[0];else for(const t of h)d=d.concat(t);const c=y(d,{bins:o.bins,binWidth:o.binWidth,range:o.range});if(!c)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},i;const{edges:u,binWidth:b}=c,g=h.map(t=>function(t,e){const s=new Array(Math.max(0,e.length-1)).fill(0);for(let a=0;a<t.length;a++){const r=m(t[a],e);r>=0&&s[r]++}return s}(t,u));e.histogramData={edges:u,binWidth:b,counts:g,rule:c.rule,capped:c.capped};const p=r.collapsedSeriesIndices||[];return i.map((t,e)=>{if(-1!==p.indexOf(e))return l(n({},t),{data:[]});const s=function(t,e={}){let s=t.slice();if(e.cumulative){let t=0;s=s.map(e=>t+=e)}const a=t.reduce((t,e)=>t+e,0);if(a<=0)return s;if("relative"===e.normalize)return s.map(t=>t/a*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return s.map(e=>e/(a*t))}return s}(g[e],{normalize:o.normalize,cumulative:o.cumulative,binWidth:b}),a=[];for(let t=0;t<s.length;t++)a.push({x:(u[t]+u[t+1])/2,y:s[t]});return l(n({},t),{data:a})})}),b("boxPlot",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.boxPlot)?void 0:a.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const s=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!w.has(t))return t;const s=v(t,!1);if(!s)return t;const a=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=x(s,.25),r=x(s,.5),i=x(s,.75),o=i-a;let n=s[0],l=s[s.length-1],h=[];if("tukey"===e.whiskers&&o>0){const t=a-1.5*o,e=i+1.5*o;let r=0;for(;r<s.length&&s[r]<t;)r++;let d=s.length-1;for(;d>=0&&s[d]>e;)d--;r<=d&&(n=s[r],l=s[d],h=s.slice(0,r).concat(s.slice(d+1)))}return{summary:[n,a,r,i,l],outliers:h,iqr:o}}(s,{whiskers:r});if(!a)return t;e=!0;const i=l(n({},t),{y:a.summary,points:s});return w.add(i),i});return e?l(n({},t),{data:s}):t})}),b("violin",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.violin)?void 0:a.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const s=t.data.map(t=>{var s;if(Array.isArray(null==(s=null==t?void 0:t.y)?void 0:s.density)&&t.y.density.length&&!w.has(t))return t;const a=v(t,!0);if(!a)return t;const i=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=s.length;let r=e.bandwidth;if(!("number"==typeof r&&r>0)){const t=f(s),e=x(s,.75)-x(s,.25);r=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(a,-.2)}if(!isFinite(r)||r<=0){const t=s[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const i=Math.max(8,Math.floor(e.resolution||64)),o=s[0]-2*r,n=(s[a-1]+2*r-o)/(i-1),l=1/(a*r*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<i;t++){const e=o+t*n;let i=0;for(let t=0;t<a;t++){const a=(e-s[t])/r;i+=Math.exp(-.5*a*a)}h.push([e,i*l])}return{density:h,bandwidth:r}}(a,{bandwidth:r.bandwidth,resolution:r.resolution});if(!i)return t;e=!0;const o=l(n({},t),{y:{density:i.density,points:a}});return w.add(o),o});return e?l(n({},t),{data:s}):t})}),p("histogram",function(t,e){const s=t.globals,a=t.histogramData,r=s&&s.histogramRawSeries;if(!a||!Array.isArray(a.edges)||a.edges.length<2)return null;if(!Array.isArray(r)||!r.length)return null;const i=s&&s.collapsedSeriesIndices||[],o=a.edges,n=[];return r.forEach((e,s)=>{var a;if(-1!==i.indexOf(s))return;const l=function(t,e){const s=Math.max(0,e.length-1),a=new Array(s);for(let t=0;t<s;t++)a[t]=[];for(let s=0;s<t.length;s++){const r=m(t[s],e);r>=0&&a[r].push(t[s])}return a}(C(e&&e.data),o),h=t.seriesData&&(null==(a=t.seriesData.seriesNames)?void 0:a[s])||(null==e?void 0:e.name);l.forEach((t,e)=>{const a=`${P(o[e])}-${P(o[e+1])}`;n.push({name:r.length>1&&h?`${h} ${a}`:a,realIndex:s,rows:t})})}),n.length?I(t,n,e):null}),p("boxPlot",S),p("violin",L);const D=d.__apex_Graphics,H=d.__apex_DataLabels,k=(t,e,s,a)=>{if("function"!=typeof t)return t;const r=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(r)?r:0},R=d.__apex_BrowserAPIs_BrowserAPIs,W=d.__apex_Environment_Environment;function X(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(W.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function F(t,e,s){var a,r,i,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(i=null==(r=t.seriesData)?void 0:r.seriesX)?void 0:i[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function O(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function Y(t,e,s=!1,a=!1){var r,i;if(!X(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(r=o.seriesY)?void 0:r[e],l=null==(i=t.seriesData.series)?void 0:i[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=O(n.map((t,s)=>function(t,e,s){var a,r;if(t.isXNumeric){const r=null==(a=t.seriesX)?void 0:a[e];if(r&&r.length&&null!=r[s])return"x:"+r[s]}const i=null==(r=t.labels)?void 0:r[s];return null!=i&&""!==String(i)?"c:"+(Array.isArray(i)?i.join(" "):String(i)):"j:"+s}(o,e,s))),d=O(l.map((s,a)=>F(t,e,a))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),r=new Set;let i=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!r.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(r.add(l),l<i&&(o=!1),i=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)r.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function M({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:r,speed:i}){var o;if(!X(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new D(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(s=>{let a=s.fill||d||"#c8c8c8";0===String(a).indexOf("url(")&&(a=d||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:a,fillOpacity:1,classes:"apexcharts-bar-ghost"}),n=o.node;n.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(n,e.node.firstChild);const l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(s.d);let c=r?"left center":"center bottom";try{const t=n.getBBox();l&&t&&(c=r?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const u=n.style;u.transformBox="fill-box",u.transformOrigin=c;const b=Math.max(1,i||1),g=performance.now(),p=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-g)/b)),a=1-Math.pow(1-s,3),i=1-a;u.transform=r?`scaleX(${i})`:`scaleY(${i})`,u.opacity=String(1-a),s<1?R.requestAnimationFrame(p):n.parentNode.removeChild(n)};R.requestAnimationFrame(p)})}class T{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s;const{x:a,y:r,y1:i,y2:o,i:h,j:d,realIndex:c,columnGroupIndex:u,barHeight:b,barWidth:g,barXPosition:p,barYPosition:x,visibleSeries:f}=t,y=this.w,m=new D(this.barCtx.w),v=y.waterfallData&&y.waterfallData.values,C=v&&v[c]&&null!=v[c][d]?v[c][d]:null,w=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;let I,P;y.axisFlags.isXNumeric&&!y.globals.isBarHorizontal?(I=a+g*(f+1),P=r+b*(f+1)-w):(I=a+g*f,P=r+b*f);let A=null,S=null,L=a,H=r,R={};const W=y.config.dataLabels,X=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(P=x,H=x),void 0!==p&&this.barCtx.isVerticalGroupedRangeBar&&(I=p,L=p);const O=k(W.offsetX,y,c,d),Y=k(W.offsetY,y,c,d);let M={width:0,height:0};if(y.config.dataLabels.enabled){const t=null!==C?C:y.seriesData.series[c][d];M=m.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,l(n({},y),{seriesIndex:c,dataPointIndex:d,w:y})):y.formatters.yLabelFormatters[0](t),parseFloat(W.style.fontSize).toString(),W.style.fontFamily,void 0,!0,W.style.fontWeight)}const T={x:a,y:r,i:h,j:d,realIndex:c,columnGroupIndex:u,bcx:I,bcy:P,barHeight:b,barWidth:g,textRects:M,strokeWidth:w,dataLabelsX:L,dataLabelsY:H,dataLabelsConfig:W,barDataLabelsConfig:X,barTotalDataLabelsConfig:F,offX:O,offY:Y};if(R=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(T):this.calculateColumnsDataLabelsPosition(T),null!==C&&this.barCtx.isHorizontal&&"center"===X.position){const t=null==(s=null==(e=y.waterfallData.geometry)?void 0:e[c])?void 0:s[d];t&&t.horizontal&&(R.dataLabelsX=(t.levelStart+t.levelEnd)/2+O)}return A=this.drawCalculatedDataLabels({x:R.dataLabelsX,y:R.dataLabelsY,val:null!==C?C:this.barCtx.isRangeBar?[i,o]:"100%"===y.config.chart.stackType?y.globals.seriesPercent[c][d]:y.seriesData.series[c][d],i:c,j:d,barWidth:g,barHeight:b,textRects:M,dataLabelsConfig:W}),y.config.chart.stacked&&F.enabled&&(S=this.drawTotalDataLabels({x:R.totalDataLabelsX,y:R.totalDataLabelsY,barWidth:g,barHeight:b,realIndex:c,j:d,textAnchor:R.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:d}),rawVal:this.getStackedTotalValue({realIndex:c,j:d}),dataLabelsConfig:W,barTotalDataLabelsConfig:F})),{dataLabelsPos:R,dataLabels:A,totalDataLabels:S}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const s=this.w,a=this.getTotalGroupContext(t),r=s.seriesData.stackedSeriesTotalsByGroups;return a&&r&&r[a.groupIndex]?r[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:r,j:i,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:d,textRects:c,dataLabelsX:u,dataLabelsY:b,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,strokeWidth:f,offX:y,offY:m}=t;const v=l;d=Math.abs(d);const C="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:w}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:i});l-=f/2;const I=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=e.axisFlags.isXNumeric?l-h/2+y:l-I+h/2+y,!e.config.chart.stacked&&w>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*w)),C){const t=2;u=u+c.height/2-f/2-t}const P=e.seriesData.series[r][i]<0;let A=n;switch(this.barCtx.isReversed&&(A=n+(P?d:-d)),p.position){case"center":b=C?P?A-d/2+m:A+d/2-m:P?A-d/2+c.height/2+m:A+d/2+c.height/2-m;break;case"bottom":b=C?P?A-d+m:A+d-m:P?A-d+c.height+f+m:A+d-c.height/2+f-m;break;case"top":b=C?P?A+m:A-m:P?A-c.height/2-m:A+c.height+m}let S=A;const L=this.getTotalGroupContext(o);if((L?[L.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{S=P?Math.max(t[i],S):Math.min(t[i],S)})}),this.drawsStackedTotal(o)&&x.enabled){const t=18,r=new D(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:i}),g.fontSize);s=P?S-r.height/2-m-x.offsetY+t:S+r.height+m+x.offsetY-t;const n=I;a=v+(e.axisFlags.isXNumeric?-h/2:h/2-n)+x.offsetX}return e.config.chart.stacked||(b<0?b=0+f:b+c.height/3>e.layout.gridHeight&&(b=e.layout.gridHeight-f)),{bcx:l,bcy:n,dataLabelsX:u,dataLabelsY:b,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:r,j:i,realIndex:o,bcy:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:u,dataLabelsConfig:b,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,offX:x,offY:f}=t;const y=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:i});let v,C,w;if(h=Math.abs(h),this.barCtx.isPyramid){v=n+l/2+f-(null!=(e=d.centerOffset)?e:0)}else v=n-(this.barCtx.isRangeBar?0:y)+l/2+d.height/2+f-3;!s.config.chart.stacked&&m>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v-=l*m);let I="start";const P=s.seriesData.series[r][i]<0;let A=a;if(this.barCtx.isReversed&&(A=a+(P?-h:h),I=P?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+x;else switch(g.position){case"center":c=P?A+h/2-x:Math.max(d.width/2,A-h/2)+x;break;case"bottom":c=P?A+h-u-x:A-h+u+x;break;case"top":c=P?A-u-x:A-u+x}let S=A;const L=this.getTotalGroupContext(o);if((L?[L.group]:s.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{S=P?Math.min(t[i],S):Math.max(t[i],S)})}),this.drawsStackedTotal(o)&&p.enabled){const t=new D(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:i}),b.fontSize);P?(C=S-u-x-p.offsetX,I="end"):C=S+x+p.offsetX+(this.barCtx.isReversed?-(h+u):u),w=v-d.height/2+t.height/2+p.offsetY+u,s.globals.barGroups.length>1&&!L&&(w-=s.globals.barGroups.length/2*(l/2))}if(!s.config.chart.stacked){const t=P&&"middle"!==b.textAnchor?"start"===b.textAnchor?"end":"start":b.textAnchor;let e;e="vertical"===g.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const a=("vertical"===g.orientation?d.height:d.width)-e;c+a>s.layout.gridWidth-u&&(c=s.layout.gridWidth-a-u),c-e<u&&(c=e+u)}return{bcx:a,bcy:n,dataLabelsX:c,dataLabelsY:v,totalDataLabelsX:C,totalDataLabelsY:w,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:r,textRects:i,barHeight:o,barWidth:h,dataLabelsConfig:d}){var c,u,b;const g=this.w;let p="rotate(0)";"vertical"===g.config.plotOptions.bar.dataLabels.orientation&&(p=`rotate(-90, ${t}, ${e})`);const x=new H(this.barCtx.w,this.barCtx.ctx),f=new D(this.barCtx.w),y=d.formatter;let m=null;const v=g.globals.collapsedSeriesIndices.indexOf(a)>-1,C=(g.globals.collapsingSeriesIndices||[]).indexOf(a)>-1;if(C){const t=null==(c=g.globals.prevDataLabels)?void 0:c.get(`${a}::${F(g,a,r)}`);t&&isFinite(t.val)&&(s=t.val)}if(d.enabled&&(!v||C)){m=f.group({class:"apexcharts-data-labels",transform:p});const c=g.config.dataLabels;((null==(u=c.animate)?void 0:u.enabled)||(null==(b=c.countUp)?void 0:b.enabled))&&(m.node.setAttribute("data:dlKey",`${a}::${F(g,a,r)}`),m.node.setAttribute("data:dlJ",String(r)),"number"==typeof s&&isFinite(s)&&m.node.setAttribute("data:dlVal",String(s)));let v="";void 0!==s&&(v=y(s,l(n({},g),{seriesIndex:a,dataPointIndex:r,w:g}))),!s&&g.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v="");const w=g.seriesData.series[a][r]<0,I=g.config.plotOptions.bar.dataLabels.position;if("vertical"===g.config.plotOptions.bar.dataLabels.orientation&&("top"===I&&(d.textAnchor=w?"end":"start"),"center"===I&&(d.textAnchor="middle"),"bottom"===I&&(d.textAnchor=w?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<f.getTextRects(v,parseFloat(d.style.fontSize).toString()).width&&(v="")}g.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!C&&(this.barCtx.isHorizontal?i.width/1.6>Math.abs(h)&&(v=""):i.height/1.6>Math.abs(o)&&(v=""));const P=n({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?P.textAnchor="end":"end"===d.textAnchor&&(P.textAnchor="start")),x.plotDataLabelsText({x:t,y:e,text:v,i:a,j:r,parent:m,dataLabelsConfig:P,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return m}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:r,j:i,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new D(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(r)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(r);c.node.setAttribute("data:dlTotalKey",`${t}::${F(this.w,r,i)}`),c.node.setAttribute("data:dlTotalSeries",String(r)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const B=d.__apex_Series,j=d.__apex_Fill;function z(t){var e,s,a,r,i,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(r=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:r.overlap)&&(null!=(n=null==(o=null==(i=t.seriesData)?void 0:i.series)?void 0:o.length)?n:0)>1)}class G{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),c.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,r=1/0;for(;;){let t=1/0,i=-1;for(let a=0;a<e.length;a++){const r=e[a];for(;s[a]<r.length&&"number"!=typeof r[s[a]];)s[a]++;if(s[a]>=r.length)continue;const o=r[s[a]];o==o?o<t&&(t=o,i=a):(s[a]++,a--)}if(-1===i)break;if(s[i]++,a==a){const e=t-a;e>0&&e<r&&(r=e)}a=t}return isFinite(r)?r:0}initialPositions(t){const e=this.w;let s,a,r,i,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let u=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||z(e))&&(u=1),this.barCtx.isHorizontal)r=e.layout.gridHeight/d,o=r/u,e.axisFlags.isXNumeric&&(r=e.layout.gridHeight/this.barCtx.totalItems,o=r/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(r-o*this.barCtx.seriesLen)/2;else{if(i=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(i=e.layout.gridWidth/e.globals.dataPoints),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(i=e/t),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+c.noExponents(i-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:r,xDivision:i,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,a){var r;const i=this.w,o=new j(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(r=i.config.series[e].data[s])?void 0:r.fill),c=this.barCtx.barOptions.isDumbbell?i.config.plotOptions.bar.dumbbell.connector:null;let u;c&&c.color&&(n=c.color,u=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:u,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(i.config.fill.type)?i.config.fill.type[a]:i.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const r=s.config.plotOptions.bar.dumbbell.connector;if(r.color)return null;const i=a.order[e];if(!i)return null;const o=s.globals.colors[i[0]],n=s.globals.colors[i[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:r.opacity,opacityTo:r.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const r=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===r.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,r.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,r=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(r);return e.length?[e]:[]}const i=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!r(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?i[t].push(e):o.push(e)}return o.length&&i.push(o),i.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,r=t.length,i=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:r},()=>Array(i).fill(a?"top":"none"));if(a)return o;const n="bar"===this.w.config.chart.type&&1===i,l=n?"top":"both",h=n?"top":"bottom";for(const e of this.getStackedSeriesIndices(r))for(let s=0;s<i;s++){const a=[],r=[];for(const i of e){const e=t[i][s];e>0?a.push(i):e<0&&r.push(i)}if(a.length>0&&0===r.length)if(1===a.length)o[a[0]][s]=l;else{const t=a[0],e=a[a.length-1];for(const r of a)o[r][s]=r===t?h:r===e?"top":"none"}else if(r.length>0&&0===a.length)if(1===r.length)o[r[0]][s]="both";else{const t=Math.max(...r),e=Math.min(...r);for(const a of r)o[a][s]=a===t?"bottom":a===e?"top":"none"}else if(a.length>0&&r.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...r);for(const t of r)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:r,y2:i,elSeries:o}){const n=this.w,l=new D(this.barCtx.w),h=new B(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==r?r:0,void 0!==a?a:n.layout.gridWidth,void 0!==i?i:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:r,isReversed:i,series:o,seriesGroup:n,realIndex:l,i:h,j:d,w:c}){var u,b,g;const p=new D(this.barCtx.w);(r=Array.isArray(r)?r[l]:r)||(r=0);let x=t,f=e;(null==(u=c.config.series[l].data[d])?void 0:u.columnWidthOffset)&&(f=e-c.config.series[l].data[d].columnWidthOffset/2,x=t+c.config.series[l].data[d].columnWidthOffset);const y=r/2,m=f+y,v=f+x-y,C=(o[h][d]>=0?1:-1)*(i?-1:1);s+=.001-y*C,a+=.001+y*C;const w=p.line(v,s),I="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",P=p.move(m,s)+p.line(m,a)+p.line(v,a)+w+I;let A=P;"none"!==this.arrBorderRadius[l][d]&&(A=p.roundPathCorners(A,c.config.plotOptions.bar.borderRadius));let S=null;const L=null==(g=null==(b=this.barCtx.ctx)?void 0:b.morphTypeChange)?void 0:g.getInitialPathFor(l,d);if(L?S=L:c.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(l,d,A,P)),null==S&&(S=p.move(m,s)+p.line(m,s)+w+w+w+w+w+p.line(m,s)+I),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.yArrj.push(a-y*C),t.yArrjF.push(Math.abs(s-a+r*C)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:A,pathFrom:S,drawnBox:{x1:m,x2:v,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:r,realIndex:i,strokeWidth:o,w:n}){var l,h;const d=new D(this.barCtx.w),c=n.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,b=u(s[a][r]),g=r===s[a].length-1,p="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===p?0:b:u(s[a][r+1]);const f=o/2,y=t+f,m=t+e-f,v=c-b,C=c+b,w=c-x,I=c+x,P=d.move(v,y)+d.line(C,y)+d.line(I,m)+d.line(w,m)+" Z";let A=null;const S=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return S?A=S:n.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(i,r,P)),null==A&&(A=d.move(c,y)+d.line(c,y)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:P,pathFrom:A,x:C,x1:v,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,r=t.map(t=>Math.abs(Number(t)||0)),i=r.reduce((t,e)=>t+e,0);if(0===i||s<=0)return r.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let n=0;const l=[];for(let t=0;t<r.length;t++){const e=n/i;n+=r[t];const a=n/i,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:r,j:i,strokeWidth:o,w:n}){var l,h;const d=new D(this.barCtx.w),c=n.layout.gridWidth/2,u=o/2,b=t+u,g=t+e-u,p=c-s,x=c+s,f=c-a,y=c+a,m=d.move(p,b)+d.line(x,b)+d.line(y,g)+d.line(f,g)+" Z";let v=null;const C=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return C?v=C:n.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(r,i,m)),null==v&&(v=d.move(c,b)+d.line(c,b)+d.line(c,g)+d.line(c,g)+" Z"),{pathTo:m,pathFrom:v,x:x,x1:p,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:r,isReversed:i,series:o,seriesGroup:n,realIndex:l,i:h,j:d,w:c}){var u,b,g;const p=new D(this.barCtx.w);(r=Array.isArray(r)?r[l]:r)||(r=0);let x=t,f=e;(null==(u=c.config.series[l].data[d])?void 0:u.barHeightOffset)&&(x=t-c.config.series[l].data[d].barHeightOffset/2,f=e+c.config.series[l].data[d].barHeightOffset);const y=r/2,m=x+y,v=x+f-y,C=(o[h][d]>=0?1:-1)*(i?-1:1);s+=.001+y*C,a+=.001-y*C;const w=this.barCtx.isFunnel,I=w?(s+a)/2:s,P=p.line(s,v),A="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",S=p.move(s,m)+p.line(a,m)+p.line(a,v)+P+A;let L=S;"none"!==this.arrBorderRadius[l][d]&&(L=p.roundPathCorners(L,c.config.plotOptions.bar.borderRadius));let H=null;const k=null==(g=null==(b=this.barCtx.ctx)?void 0:b.morphTypeChange)?void 0:g.getInitialPathFor(l,d);if(k?H=k:c.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(l,d,L,S)),null==H){const t=w?p.line(I,v):P;H=p.move(I,m)+p.line(I,m)+t+t+t+t+t+p.line(I,m)+A}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.xArrj.push(a+y*C),t.xArrjF.push(Math.abs(s-a-r*C)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:L,pathFrom:H,drawnBox:{x1:s,x2:a,y1:m,y2:v}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let r=a?e:null;return null!=t&&(r=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),r}getGoalValues(t,e,s,a,r,i){const o=this.w,h=[],d=(a,r)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,i,!1),attrs:r})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][r]&&Array.isArray(o.seriesData.seriesGoals[a][r])&&o.seriesData.seriesGoals[a][r].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,r);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let i=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[i].value&&(i=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},s),{strokeColor:t.color});!c.enabled||e!==i&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,r,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===i&&i!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],r=s.dumbbellData;if(r&&"series"===r.form){const t=r.values[e]||[];for(let e=0;e<t.length;e++){const i=t[e];null!==i&&-1===r.hidden.indexOf(e)&&a.push({value:i,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const i=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(i[t])?i[t][e]:i[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const r=this.w,i=r.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof i.formatter)return i.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:r});const o=this.barCtx.isHorizontal?r.formatters.xLabelFormatter:r.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,r):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:r,barHeight:i}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new D(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:i/2,a=e+s+i/2;l=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:r/2,a=t+s+r/2;l=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new D(s),r=s.config.plotOptions.bar.dumbbell.dataLabels,i=e.markerSize/2+r.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?i*o:0),y:e.y-(e.horizontal?0:i*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:r.style.fontSize,fontFamily:r.style.fontFamily,fontWeight:r.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:r}){const i=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:u}=e,b=l+e.barHeight,g=new D(this.barCtx.w),p=new c,x=g.move(n,b)+g.line(o,b)+g.line(h,u)+g.line(d,u)+g.line(n,b)+("around"===i.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][r]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,c.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let r=0,i=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&r++,s<t&&0===o&&i++}),{nonZeroColumns:r,zeroEncounters:i}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let r=a.indexOf(s);return r<0&&(a.push(s),r=a.length-1),{groupIndex:s,columnGroupIndex:r}}}const _=d.__apex_CoreUtils,N=d.__apex_Filters,V=d.__apex_Animations_computeStagger;class E{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/E.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*E.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const r=a.getBoundingClientRect(),i=t.globals.svgWidth?r.width/t.globals.svgWidth:1;return(e-r.left)/(i||1)-t.layout.translateX}}class ${constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new B(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const r=a.getBarSeriesIndices(),i=new _(this.w);this.stackedSeriesTotals=i.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===r.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new G(this)}draw(t,e){var s,a,r;const i=this.w,o=new D(this.w),h=new _(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=o.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,u=0;h<t.length;h++,u++){let b,g;const p=[],x=[],f=i.globals.comboCharts?e[h]:h,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(f),m=o.group({class:"apexcharts-series",rel:h+1,seriesName:c.escapeString(i.seriesData.seriesNames[f]),"data:realIndex":f});B.addCollapsedClassToSeries(this.w,m,f),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[f],this.translationsIndex=f);const v=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const C=this.barHelpers.initialPositions(f),{y:w,yDivision:I,zeroW:P,x:A,xDivision:S,zeroH:L}=C;let D=C.barHeight,H=C.barWidth;g=w,b=A,this.isHorizontal||x.push(b+(null!=H?H:0)/2);const k=o.group({class:"apexcharts-datalabels","data:realIndex":f});i.globals.delayedElements.push({el:k.node,holdUntilComplete:!(null==(s=i.config.dataLabels.animate)?void 0:s.enabled)&&this.isLengthTransition(f)}),k.node.classList.add("apexcharts-element-hidden");const R=o.group({class:"apexcharts-bar-goals-markers"}),W=o.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:W.node}),W.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const s=this.barHelpers.getStrokeWidth(h,e,f);let o=null;const d={indexes:{i:h,j:e,realIndex:f,translationsIndex:v,bc:u},x:b,y:g,strokeWidth:s,elSeries:m};this.isHorizontal?(o=this.drawBarPaths(l(n({},d),{barHeight:D,zeroW:P,yDivision:I})),H=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(l(n({},d),{xDivision:S,barWidth:H,zeroH:L})),D=this.series[h][e]/this.yRatio[v]);const C=this.barHelpers.getPathFillColor(t,h,e,f);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(a=i.config.plotOptions.funnel)?void 0:a.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof C.color&&-1===(null==(r=C.color)?void 0:r.indexOf("url"))?C.color:c.hexToRgba(i.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:f,j:e});if(W.add(t),i.config.chart.dropShadow.enabled){new N(this.w).dropShadow(t,i.config.chart.dropShadow,f)}}this.pathArr.push(o);const w=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:D,barWidth:H});w&&R.add(w),g=o.y,b=o.x,e>0&&x.push(b+(null!=H?H:0)/2),p.push(g),this.renderSeries(l(n({realIndex:f,pathFill:C.color},C.useRangeColor?{lineFill:C.color}:{}),{j:e,i:h,columnGroupIndex:y,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:s,elSeries:m,x:b,y:g,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:D),barWidth:Math.abs(o.barWidth?o.barWidth:H),elDataLabelsWrap:k,elGoalsMarkers:R,elBarShadows:W,visibleSeries:this.visibleI,type:"bar"}))}if(i.globals.seriesXvalues[f]=x,i.globals.seriesYvalues[f]=p,i.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[h].length;s++)e.push(F(i,f,s));M({w:i,elSeries:m,record:this._prevRecord(f),newKeys:e,isHorizontal:this.isHorizontal,speed:i.config.chart.animations.dynamicAnimation.speed})}d.add(m)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:r,columnGroupIndex:i,pathFrom:o,pathTo:n,strokeWidth:l,elSeries:h,x:d,y:c,y1:u,y2:b,series:g,barHeight:p,barWidth:x,barXPosition:f,barYPosition:y,elDataLabelsWrap:m,elGoalsMarkers:v,elBarShadows:C,visibleSeries:w,type:I,classes:P}){var A,S,L,H,k,R,W;const X=this.w,O=new D(this.w,this.ctx),Y=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,O);let M=!1;const B=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,O.setupEventDelegation(h,`.apexcharts-${I}-area`)),!s){let e=function(t){const e=X.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:X.seriesData.series[t][a],dataPointIndex:a,w:X}):s};const r="function"==typeof X.globals.stroke.colors[t]?e(t):X.globals.stroke.colors[t];s=this.barOptions.distributed?X.globals.stroke.colors[a]:r}const j=X.config.chart.animations,z=j.animateGradually;let G=0,_=0;if(z&&!1!==z.enabled&&!(X.globals.dataChanged&&this.isLayoutShift(t))){const t=X.globals.dataPoints||1,e=z.delay||0,s=Math.min(e,.5*j.speed/Math.max(1,t));_=V({style:"sequential",index:a,baseDelay:s}),X.config.chart.stacked&&!X.globals.dataChanged&&(_+=r*s*.5);G=_/(e||1)}const E=new T(this).handleBarDataLabels({x:d,y:c,y1:u,y2:b,i:r,j:a,series:g,realIndex:t,columnGroupIndex:i,barHeight:p,barWidth:x,barXPosition:f,barYPosition:y,visibleSeries:w});if(_>0){const t=X.config.dataLabels;if((null==(A=t.animate)?void 0:A.enabled)||(null==(S=t.countUp)?void 0:S.enabled)){const t=String(Math.round(_));null==(H=null==(L=E.dataLabels)?void 0:L.node)||H.setAttribute("data:dlDelay",t),null==(R=null==(k=E.totalDataLabels)?void 0:k.node)||R.setAttribute("data:dlDelay",t)}}if(X.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(x,X.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(x,X.globals.barPadForNumericAxis)>X.layout.gridWidth)&&(M=!0),X.config.series[r].data[a]&&X.config.series[r].data[a].strokeColor&&(s=X.config.series[r].data[a].strokeColor),this.isNullValue&&-1===X.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!M){const i=!0===(null==(W=this.ctx.morphTypeChange)?void 0:W.isActive()),d=i?this.ctx.morphTypeChange.getSpeed():X.config.chart.animations.dynamicAnimation.speed,c=i&&this.ctx.morphTypeChange.claimsTargetMark(t,a);c&&(o=n,G=0);const g=Y.renderPaths({i:r,j:a,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:X.config.stroke.lineCap,fill:e,pathToInterp:B,animationDelay:G,initialSpeed:X.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${I}-area${P?` ${P}`:""}`,chartType:I,bindEventsOnPaths:!1});g.attr("clip-path",`url(#gridRectBarMask${X.globals.cuid})`),c&&(g.node.setAttribute("opacity","0"),g.node.setAttribute("data-piece-hidden","1"));const f=X.config.forecastDataPoints;f.count>0&&a>=X.globals.dataPoints-f.count&&(g.node.setAttribute("stroke-dasharray",f.dashArray),g.node.setAttribute("stroke-width",f.strokeWidth),g.node.setAttribute("fill-opacity",f.fillOpacity)),void 0!==u&&void 0!==b&&(g.attr("data-range-y1",u),g.attr("data-range-y2",b));new N(this.w).setSelectionFilter(g,t,a),h.add(g),g.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:a,val:X.seriesData.series[r][a],barHeight:p,barWidth:x,"data:pathKey":F(X,t,a)}),"canvas"===Y.kind&&(X.globals.barCanvasCoords||(X.globals.barCanvasCoords={}),X.globals.barCanvasCoords[t]||(X.globals.barCanvasCoords[t]={}),X.globals.barCanvasCoords[t][a]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:x}),null!==E.dataLabels&&m.add(E.dataLabels),E.totalDataLabels&&m.add(E.totalDataLabels),h.add(m),v&&h.add(v),C&&h.add(C)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.axisFlags.isXNumeric)c=(i=(l.seriesData.seriesX[h][d]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=i+e*this.visibleI,c-=e*s}else c=i+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,b=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!b;if(b)c=b.y,e=b.height;else if(this.isFunnel&&!u){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return r=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=b?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:b.topHalf,bottomHalf:b.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(u||g)&&(a=p.x1,r=p.x),l.axisFlags.isXNumeric||g||(i+=o),g&&(i=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:r,y:i,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,u=t.j,b=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:r});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:u});t>0&&(r=this.seriesLen*r/t),g=e+r*this.visibleI,g-=r*s}else g=e+r*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][u],i,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:r,y1:i,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:u,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:b,j:u,i:c,x1:g-o/2-r*this.visibleI,x2:r*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,i,h,u,d),barXPosition:g,barWidth:r}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const r=this.w;let i=s;return r.seriesData.seriesX[s].length||(i=r.globals.maxValsInArrayIndex),c.isNumber(r.seriesData.seriesX[i][a])&&(t=E.dataXToPx(r,r.seriesData.seriesX[i][a])-e*this.seriesLen/2),{barXPosition:t+(z(r)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const r=e.globals.previousPaths[a];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(String(t),10)&&(s=r)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let r=!1;if(X(a)&&a.globals.previousPaths.length>0){const i=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(i)if(i.paths.length!==o)r=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(F(a,t,s))){r=!0;break}}else r=o>0}return this._ltCache[t]=r,r}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=Y(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const r=this.w;this._pathToInterp=null;const i=this._prevRecord(t);if(!i)return X(r)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(F(r,t,e));s?o=s.d:n=!0}else void 0!==i.paths[e]?o=i.paths[e].d:n=!0;if(o){const t=$.pathCommandCount(o),e=$.pathCommandCount(s);if(t===e)return o;const i=new D(r),n=t=>{const e=$.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=t<e?n(o)>1:n(s)>1;if(t<e){const t=i.roundPathCorners(o,0);if($.pathCommandCount(t)===e){if(l&&a){const t=i.roundPathCorners(a,0);$.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=i.roundPathCorners(s,0);if($.pathCommandCount(e)===t){if(this._pathToInterp=e,l){const e=$.squareLike(o),s=e?i.roundPathCorners(e,0):null;if(s&&$.pathCommandCount(s)===t)return s}return o}}}return n&&X(r)?null:s}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const r=e.map(t=>t[0]),i=e.map(t=>t[1]);return{minX:Math.min(...r),maxX:Math.max(...r),minY:Math.min(...i),maxY:Math.max(...i),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=$.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:r,maxY:i,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,u;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,u]=l(o[1],r,i)):(c=Math.abs(o[1]-r)<=Math.abs(o[1]-i)?r:i,u=c===r?i:r,[h,d]=l(o[0],s,a));const b=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${u} L ${d} ${u} L ${d} ${c}${b}`:`M ${h} ${c} L ${d} ${c} L ${d} ${u} L ${h} ${u}${b}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const r=this._prevKeyedPaths(t),i=r?r.get(F(s,t,e)):a.paths[e];return i?!!i.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}d.default.use({bar:$,column:$,barStacked:class extends ${draw(t,e){const s=this.w;this.graphics=new D(this.w),this.bar=new $(this.w,this.ctx,this.xyRatios);const a=new _(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const r=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let i=0,o=0;const h=s.config.chart.animations,d=h.enabled&&h.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let u=!1;for(let a=0,h=0;a<t.length;a++,h++){const b=s.globals.comboCharts?e[a]:a,{groupIndex:g,columnGroupIndex:p}=this.barHelpers.getGroupIndex(b);this.groupCtx=this[s.labelData.seriesGroups[g]];const x=[],f=[];let y=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[b][0],y=b),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let m=this.graphics.group({class:"apexcharts-series",seriesName:c.escapeString(s.seriesData.seriesNames[b]),rel:a+1,"data:realIndex":b});B.addCollapsedClassToSeries(this.w,m,b);const v=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":b});B.addCollapsedClassToSeries(this.w,v,b),(s.globals.collapsingSeriesIndices||[]).indexOf(b)>-1&&v.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const C=this.graphics.group({class:"apexcharts-bar-goals-markers"}),w=this.initialPositions(i,o,void 0,void 0,void 0,void 0,y),{xDivision:I,yDivision:P,zeroH:A,zeroW:S}=w;let L=w.barHeight,D=w.barWidth;o=w.y,i=w.x,s.globals.barHeight=L,s.globals.barWidth=D,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>A),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const r=this.barHelpers.getStrokeWidth(a,e,b),c={indexes:{i:a,j:e,realIndex:b,translationsIndex:y,bc:h},strokeWidth:r,x:i,y:o,elSeries:m,columnGroupIndex:p,seriesGroup:s.labelData.seriesGroups[g]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(l(n({},c),{zeroW:S,barHeight:L,yDivision:P})),D=this.series[a][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(l(n({},c),{xDivision:I,barWidth:D,zeroH:A})),L=this.series[a][e]/this.yRatio[y]);const H=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:L,barWidth:D});H&&C.add(H),o=w.y,i=w.x,x.push(i),f.push(o);const k=this.barHelpers.getPathFillColor(t,a,e,b);let R="";const W=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",X="bottom"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]>0||"top"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]<0,F=d&&!X&&this.getPreviousFlip(b,e);(X||F)&&(R=W),F&&(R+=" apexcharts-flip-held",u=!0),m=this.renderSeries(l(n({realIndex:b,pathFill:k.color},k.useRangeColor?{lineFill:k.color}:{}),{j:e,i:a,columnGroupIndex:p,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:r,elSeries:m,x:i,y:o,series:t,barHeight:L,barWidth:D,elDataLabelsWrap:v,elGoalsMarkers:C,type:"bar",visibleSeries:p,classes:R}))}s.globals.seriesXvalues[b]=x,s.globals.seriesYvalues[b]=f,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),r.add(m)}return u&&this.settleHeldMirrors(),r}settleHeldMirrors(){const t=this.w;if(!W.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&c.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,s,a,r,i,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,i=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),r=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:r,zeroW:i}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,columnGroupIndex:o,seriesGroup:n,yDivision:l,elSeries:h}){var d,c,u,b,g;const p=this.w,x=i+o*e;let f;const y=t.i,m=t.j,v=t.realIndex,C=t.translationsIndex;let w=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)w+=this.groupCtx.prevXF[t][m];const I=this.groupCtx.prevX.length;if(I>0){let t=a;this.groupCtx.prevXVal[I-1][m]<0?t=(null==(d=this.series[y])?void 0:d[m])>=0?this.groupCtx.prevX[I-1][m]+w-2*(this.isReversed?w:0):this.groupCtx.prevX[I-1][m]:this.groupCtx.prevXVal[I-1][m]>=0&&(t=(null==(c=this.series[y])?void 0:c[m])>=0?this.groupCtx.prevX[I-1][m]:this.groupCtx.prevX[I-1][m]-w+2*(this.isReversed?w:0)),f=t}else f=a;r=null===(null==(u=this.series[y])?void 0:u[m])?f:f+(null==(b=this.series[y])?void 0:b[m])/this.invertedYRatio-2*(this.isReversed?(null==(g=this.series[y])?void 0:g[m])/this.invertedYRatio:0);const P=this.barHelpers.getBarpaths({barYPosition:x,barHeight:e,x1:f,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:n,i:y,j:m,w:p});return this.barHelpers.barBackground({j:m,i:y,y1:x,y2:e,elSeries:h}),i+=l,{pathTo:P.pathTo,pathFrom:P.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,v,m,C),barXPosition:f,barYPosition:x,x:r,y:i}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,columnGroupIndex:o,seriesGroup:n,elSeries:l}){var h,d,c,u,b,g,p,x,f;const y=this.w,m=t.i,v=t.j,C=t.bc,w=t.realIndex,I=t.translationsIndex;if(y.axisFlags.isXNumeric){let t=y.seriesData.seriesX[w][v];t||(t=0),e=(t-y.globals.minX)/this.xRatio-r/2*y.globals.barGroups.length}const P=e+o*r;let A,S=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)S+=isNaN(this.groupCtx.prevYF[t][v])?0:this.groupCtx.prevYF[t][v];const L=this.groupCtx.prevY.length;if(L>0&&!y.axisFlags.isXNumeric||L>0&&y.axisFlags.isXNumeric&&y.seriesData.seriesX[w-1][v]===y.seriesData.seriesX[w][v]){let t,e;const s=Math.min(this.yRatio.length+1,w+1);if(void 0!==this.groupCtx.prevY[L-1]&&this.groupCtx.prevY[L-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[L-t])?void 0:h[v])){e=this.groupCtx.prevY[L-t][v];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[L-a])?void 0:d[v])<0){t=(null==(c=this.series[m])?void 0:c[v])>=0?e-S+2*(this.isReversed?S:0):e;break}if((null==(u=this.groupCtx.prevYVal[L-a])?void 0:u[v])>=0){t=(null==(b=this.series[m])?void 0:b[v])>=0?e:e+S-2*(this.isReversed?S:0);break}}void 0===t&&(t=y.layout.gridHeight),A=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,L).every(t=>t.every(t=>isNaN(t)))?i:t}else A=i;s=(null==(p=this.series[m])?void 0:p[v])?A-(null==(x=this.series[m])?void 0:x[v])/this.yRatio[I]+2*(this.isReversed?(null==(f=this.series[m])?void 0:f[v])/this.yRatio[I]:0):A;const D=this.barHelpers.getColumnPaths({barXPosition:P,barWidth:r,y1:A,y2:s,yRatio:this.yRatio[I],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:n,realIndex:t.realIndex,i:m,j:v,w:y});return this.barHelpers.barBackground({bc:C,j:v,i:m,x1:P,x2:r,elSeries:l}),{pathTo:D.pathTo,pathFrom:D.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,i,w,v,0),barXPosition:P,x:y.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends ${draw(t,e){var s,a,r,i,o,l,h,d,u;const b=this.w,g=new D(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=b.rangeData.seriesRangeStart,this.seriesRangeEnd=b.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const p=g.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let x=0;x<t.length;x++){let f,y;const m=b.globals.comboCharts?e[x]:x,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(m),C=g.group({class:"apexcharts-series",seriesName:c.escapeString(b.seriesData.seriesNames[m]),rel:x+1,"data:realIndex":m});B.addCollapsedClassToSeries(this.w,C,m),t[x].length>0&&(this.visibleI=this.visibleI+1);let w=0;this.yRatio.length>1&&(this.yaxisIndex=b.globals.seriesYAxisReverseMap[m][0],w=m);const I=this.barHelpers.initialPositions(m),{y:P,zeroW:A,x:S,zeroH:L}=I;let D=null!=(s=I.barWidth)?s:0,H=null!=(a=I.barHeight)?a:0;const k=null!=(r=I.yDivision)?r:0,R=null!=(i=I.xDivision)?i:0;y=P,f=S;const W=g.group({class:"apexcharts-datalabels","data:realIndex":m}),X=g.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<b.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(x,e,m),a=this.seriesRangeStart[x][e],r=this.seriesRangeEnd[x][e];let i=null,c=null,g=null;const p={x:f,y:y,strokeWidth:s,elSeries:C};let P=this.seriesLen;if(b.config.plotOptions.bar.rangeBarGroupRows&&(P=1),void 0===(null==(o=b.config.series[x].data)?void 0:o[e]))break;if(this.isHorizontal){g=y+H*this.visibleI;const t=(k-H*P)/2;if(null==(h=null==(l=b.config.series[x].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:g,srty:t,barHeight:H,yDivision:k,initPositions:I});H=s.barHeight,g=s.barYPosition}i=this.drawRangeBarPaths(n({indexes:{i:x,j:e,realIndex:m},barHeight:H,barYPosition:g,zeroW:A,yDivision:k,y1:a,y2:r},p)),D=i.barWidth}else{b.axisFlags.isXNumeric&&(f=(b.seriesData.seriesX[x][e]-b.globals.minX)/this.xRatio-D/2),c=f+D*this.visibleI;const t=(R-D*P)/2;if(null==(u=null==(d=b.config.series[x].data)?void 0:d[e])?void 0:u.x){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:c,srtx:t,barWidth:D,xDivision:R,initPositions:I});D=s.barWidth,c=s.barXPosition}i=this.drawRangeColumnPaths(n({indexes:{i:x,j:e,realIndex:m,translationsIndex:w},barWidth:D,barXPosition:c,zeroH:L,xDivision:R},p)),H=i.barHeight}const S=this.barHelpers.drawGoalLine({barXPosition:i.barXPosition,barYPosition:g,goalX:i.goalX,goalY:i.goalY,barHeight:H,barWidth:D});S&&X.add(S),y=i.y,f=i.x;const F=this.barHelpers.getPathFillColor(t,x,e,m);this.renderSeries({realIndex:m,pathFill:F.color,lineFill:F.useRangeColor?F.color:b.globals.stroke.colors[m],j:e,i:x,x:f,y:y,y1:a,y2:r,pathFrom:i.pathFrom,pathTo:i.pathTo,strokeWidth:s,elSeries:C,series:t,barHeight:H,barWidth:D,barXPosition:c,barYPosition:g,columnGroupIndex:v,elDataLabelsWrap:W,elGoalsMarkers:X,visibleSeries:this.visibleI,type:"rangebar"})}p.add(C)}return p}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:r,srtx:i,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,u,b,g;const p=this.w;let x=[];const f=null==(u=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:u[e],y=null==(g=null==(b=p.config.series[t].data)?void 0:b[e])?void 0:g.x,m=Array.isArray(y)?y.join(" "):y,v=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(m),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===m&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?r+l*v:r+o*this.visibleI+l*v,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(o=d.barHeight/x.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+l*v))):(v>-1&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?i+h*v:i+n*this.visibleI+h*v),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*v))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:r,zeroH:i}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:u}=t,b=this.yRatio[u],g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=i-p/b,x=i-x/b):p=i;const y=Math.abs(x-p),m=this.barHelpers.getColumnPaths({barXPosition:r,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=m.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,r=t.barXPosition}else e+=s;return{pathTo:m.pathTo,pathFrom:m.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,i,c,d,u),barXPosition:r}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:r,barHeight:i,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.preventBarOverflow(n+s/this.invertedYRatio),u=this.preventBarOverflow(n+a/this.invertedYRatio),b=this.getRangeValue(h,d),g=Math.abs(u-c),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:i,x1:c,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=b.start&&null!=b.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=r),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:g,x:b.start<0&&b.end<0?c:u,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,n=(t,e)=>{for(var s in e||(e={}))r.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))i.call(e,s)&&o(t,s,e[s]);return t},l=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Utils,u="__apexcharts_series_transforms__";function b(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[u][t]=e)}globalThis[u]||(globalThis[u]={});const g="__apexcharts_row_sources__";function p(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[g][t]=e)}globalThis[g]||(globalThis[g]={});function x(t,e){const s=t.length;if(0===s)return NaN;if(1===s)return t[0];const a=(s-1)*e,r=Math.floor(a),i=Math.ceil(a);return r===i?t[r]:t[r]+(t[i]-t[r])*(a-r)}function f(t){const e=t.length;if(e<2)return 0;let s=0;for(let a=0;a<e;a++)s+=t[a];const a=s/e;let r=0;for(let s=0;s<e;s++){const e=t[s]-a;r+=e*e}return Math.sqrt(r/e)}function y(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e);let a=s[0],r=s[s.length-1];const i=e.range;if(Array.isArray(i)&&2===i.length){const t=Number(i[0]),e=Number(i[1]);isFinite(t)&&isFinite(e)&&e>t&&(a=t,r=e)}if(!(r>a)){const t=Math.abs(a)>0?.05*Math.abs(a):.5;return{edges:[a-t,a+t],binWidth:2*t,rule:"single",capped:!1}}const o=r-a;let n,l;if("number"==typeof e.binWidth&&e.binWidth>0)n=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)n=o/Math.floor(e.bins),l="count";else{const t=function(t,e,s){const a=t.length,r=t=>e/Math.max(1,Math.ceil(t));switch(s){case"sqrt":return{width:r(Math.sqrt(a)),rule:"sqrt"};case"rice":return{width:r(2*Math.cbrt(a)),rule:"rice"};case"scott":{const e=f(t);return e>0?{width:3.49*e*Math.pow(a,-1/3),rule:"scott"}:{width:r(Math.log2(a)+1),rule:"sturges"}}case"fd":{const e=x(t,.75)-x(t,.25);return e>0?{width:2*e*Math.pow(a,-1/3),rule:"fd"}:{width:r(Math.log2(a)+1),rule:"sturges"}}case"auto":{const e=r(Math.log2(a)+1),s=x(t,.75)-x(t,.25);if(s<=0)return{width:e,rule:"sturges"};const i=2*s*Math.pow(a,-1/3);return i<e?{width:i,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(Math.log2(a)+1),rule:"sturges"}}}(s,o,"string"==typeof e.bins?e.bins:"auto");n=t.width,l=t.rule}(!isFinite(n)||n<=0)&&(n=o);let h=Math.ceil(o/n);(!isFinite(h)||h<1)&&(h=1);let d=!1;h>1e3&&(h=1e3,n=o/h,d=!0),n=o/h;const c=new Array(h+1);for(let t=0;t<=h;t++)c[t]=a+t*n;return c[h]=Math.max(c[h],r),{edges:c,binWidth:n,rule:l,capped:d}}function m(t,e){const s=e.length-1;if(!(t>=e[0])||t>e[s])return-1;if(t===e[s])return s-1;const a=(e[s]-e[0])/s;if(a>0){let r=Math.floor((t-e[0])/a);return r<0&&(r=0),r>s-1&&(r=s-1),t<e[r]?r--:t>=e[r+1]&&r++,r<0||r>s-1?-1:r}let r=0,i=s-1;for(;r<=i;){const s=r+i>>1;if(t<e[s])i=s-1;else{if(!(t>=e[s+1]))return s;r=s+1}}return-1}function v(t,e){var s;if(!t||"object"!=typeof t||Array.isArray(t))return null;let a=null;if(Array.isArray(t.points)?a=t.points:Array.isArray(null==(s=t.y)?void 0:s.points)?a=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(a=t.y),!a)return null;const r=[];for(let t=0;t<a.length;t++){const e=c.parseNumber(a[t]);null!==e&&isFinite(e)&&r.push(e)}return r.length?r:null}function C(t){const e=[];if(!Array.isArray(t))return e;for(let s=0;s<t.length;s++){const a=t[s];let r=a;Array.isArray(a)?r=1===a.length?a[0]:a[1]:a&&"object"==typeof a&&(r=void 0!==a.y?a.y:a.x);const i=c.parseNumber(r);null!==i&&isFinite(i)&&e.push(i)}return e}const w=new WeakSet;function I(t,e,s){const a=s&&null!=s.maxRows?s.maxRows:3e3,r=function(t,e){let s=0,a=0;for(const e of t)s+=e.length,e.length>a&&(a=e.length);if(s<=e)return{clusters:t,stride:1,total:s,kept:s};const r=e=>{let s=0;for(const a of t)s+=Math.ceil(a.length/e);return s};let i=Math.max(2,Math.ceil(s/e));for(;i<a&&r(i)>e;)i++;let o=0;return{clusters:t.map(t=>{const e=[];for(let s=0;s<t.length;s+=i)e.push(t[s]);return o+=e.length,e}),stride:i,total:s,kept:o}}(e.map(t=>t.rows),a);r.stride;const i=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const s=i[t.realIndex]||i[0];return{name:t.name,data:r.clusters[e].map((a,r)=>n({id:`${t.realIndex}:${e}:${r}`,x:t.name,y:a},s?{fillColor:s}:{}))}})}function P(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function A(t){return(e,s)=>{var a;const r=t(e);if(!Array.isArray(r)||!r.length)return null;const i=e.globals&&e.globals.collapsedSeriesIndices||[],o=e.globals&&((null==(a=e.globals.categoryLabels)?void 0:a.length)?e.globals.categoryLabels:e.globals.labels)||[],n=[];return r.forEach((t,s)=>{var a;if(-1!==i.indexOf(s))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(a=e.seriesData.seriesNames)?void 0:a[s]);t.forEach((t,e)=>{const a=null!=o[e]?String(o[e]):`#${e+1}`;n.push({name:r.length>1&&l?`${l} ${a}`:a,realIndex:s,rows:Array.isArray(t)?t.slice():[]})})}),n.length?I(e,n,s):null}}const S=A(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),L=A(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});b("histogram",function(t,e){var s;const a=e.config,r=e.globals;if(!Array.isArray(t))return t;r.histogramRawSeries||(r.histogramRawSeries=t.map(t=>l(n({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const i=r.histogramRawSeries,o=(null==(s=a.plotOptions)?void 0:s.histogram)||{},h=i.map(t=>C(null==t?void 0:t.data));let d=[];if(1===h.length)d=h[0];else for(const t of h)d=d.concat(t);const c=y(d,{bins:o.bins,binWidth:o.binWidth,range:o.range});if(!c)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},i;const{edges:u,binWidth:b}=c,g=h.map(t=>function(t,e){const s=new Array(Math.max(0,e.length-1)).fill(0);for(let a=0;a<t.length;a++){const r=m(t[a],e);r>=0&&s[r]++}return s}(t,u));e.histogramData={edges:u,binWidth:b,counts:g,rule:c.rule,capped:c.capped};const p=r.collapsedSeriesIndices||[];return i.map((t,e)=>{if(-1!==p.indexOf(e))return l(n({},t),{data:[]});const s=function(t,e={}){let s=t.slice();if(e.cumulative){let t=0;s=s.map(e=>t+=e)}const a=t.reduce((t,e)=>t+e,0);if(a<=0)return s;if("relative"===e.normalize)return s.map(t=>t/a*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return s.map(e=>e/(a*t))}return s}(g[e],{normalize:o.normalize,cumulative:o.cumulative,binWidth:b}),a=[];for(let t=0;t<s.length;t++)a.push({x:(u[t]+u[t+1])/2,y:s[t]});return l(n({},t),{data:a})})}),b("boxPlot",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.boxPlot)?void 0:a.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const s=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!w.has(t))return t;const s=v(t,!1);if(!s)return t;const a=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=x(s,.25),r=x(s,.5),i=x(s,.75),o=i-a;let n=s[0],l=s[s.length-1],h=[];if("tukey"===e.whiskers&&o>0){const t=a-1.5*o,e=i+1.5*o;let r=0;for(;r<s.length&&s[r]<t;)r++;let d=s.length-1;for(;d>=0&&s[d]>e;)d--;r<=d&&(n=s[r],l=s[d],h=s.slice(0,r).concat(s.slice(d+1)))}return{summary:[n,a,r,i,l],outliers:h,iqr:o}}(s,{whiskers:r});if(!a)return t;e=!0;const i=l(n({},t),{y:a.summary,points:s});return w.add(i),i});return e?l(n({},t),{data:s}):t})}),b("violin",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.violin)?void 0:a.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const s=t.data.map(t=>{var s;if(Array.isArray(null==(s=null==t?void 0:t.y)?void 0:s.density)&&t.y.density.length&&!w.has(t))return t;const a=v(t,!0);if(!a)return t;const i=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=s.length;let r=e.bandwidth;if(!("number"==typeof r&&r>0)){const t=f(s),e=x(s,.75)-x(s,.25);r=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(a,-.2)}if(!isFinite(r)||r<=0){const t=s[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const i=Math.max(8,Math.floor(e.resolution||64)),o=s[0]-2*r,n=(s[a-1]+2*r-o)/(i-1),l=1/(a*r*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<i;t++){const e=o+t*n;let i=0;for(let t=0;t<a;t++){const a=(e-s[t])/r;i+=Math.exp(-.5*a*a)}h.push([e,i*l])}return{density:h,bandwidth:r}}(a,{bandwidth:r.bandwidth,resolution:r.resolution});if(!i)return t;e=!0;const o=l(n({},t),{y:{density:i.density,points:a}});return w.add(o),o});return e?l(n({},t),{data:s}):t})}),p("histogram",function(t,e){const s=t.globals,a=t.histogramData,r=s&&s.histogramRawSeries;if(!a||!Array.isArray(a.edges)||a.edges.length<2)return null;if(!Array.isArray(r)||!r.length)return null;const i=s&&s.collapsedSeriesIndices||[],o=a.edges,n=[];return r.forEach((e,s)=>{var a;if(-1!==i.indexOf(s))return;const l=function(t,e){const s=Math.max(0,e.length-1),a=new Array(s);for(let t=0;t<s;t++)a[t]=[];for(let s=0;s<t.length;s++){const r=m(t[s],e);r>=0&&a[r].push(t[s])}return a}(C(e&&e.data),o),h=t.seriesData&&(null==(a=t.seriesData.seriesNames)?void 0:a[s])||(null==e?void 0:e.name);l.forEach((t,e)=>{const a=`${P(o[e])}-${P(o[e+1])}`;n.push({name:r.length>1&&h?`${h} ${a}`:a,realIndex:s,rows:t})})}),n.length?I(t,n,e):null}),p("boxPlot",S),p("violin",L);const D=d.__apex_Graphics,H=d.__apex_DataLabels,k=(t,e,s,a)=>{if("function"!=typeof t)return t;const r=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(r)?r:0},R=d.__apex_BrowserAPIs_BrowserAPIs,W=d.__apex_Environment_Environment;function X(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(W.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function F(t,e,s){var a,r,i,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(i=null==(r=t.seriesData)?void 0:r.seriesX)?void 0:i[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function O(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function Y(t,e,s=!1,a=!1){var r,i;if(!X(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(r=o.seriesY)?void 0:r[e],l=null==(i=t.seriesData.series)?void 0:i[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=O(n.map((t,s)=>function(t,e,s){var a,r;if(t.isXNumeric){const r=null==(a=t.seriesX)?void 0:a[e];if(r&&r.length&&null!=r[s])return"x:"+r[s]}const i=null==(r=t.labels)?void 0:r[s];return null!=i&&""!==String(i)?"c:"+(Array.isArray(i)?i.join(" "):String(i)):"j:"+s}(o,e,s))),d=O(l.map((s,a)=>F(t,e,a))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),r=new Set;let i=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!r.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(r.add(l),l<i&&(o=!1),i=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)r.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function M({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:r,speed:i}){var o;if(!X(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new D(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(s=>{let a=s.fill||d||"#c8c8c8";0===String(a).indexOf("url(")&&(a=d||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:a,fillOpacity:1,classes:"apexcharts-bar-ghost"}),n=o.node;n.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(n,e.node.firstChild);const l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(s.d);let c=r?"left center":"center bottom";try{const t=n.getBBox();l&&t&&(c=r?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const u=n.style;u.transformBox="fill-box",u.transformOrigin=c;const b=Math.max(1,i||1),g=performance.now(),p=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-g)/b)),a=1-Math.pow(1-s,3),i=1-a;u.transform=r?`scaleX(${i})`:`scaleY(${i})`,u.opacity=String(1-a),s<1?R.requestAnimationFrame(p):n.parentNode.removeChild(n)};R.requestAnimationFrame(p)})}class T{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s;const{x:a,y:r,y1:i,y2:o,i:h,j:d,realIndex:c,columnGroupIndex:u,barHeight:b,barWidth:g,barXPosition:p,barYPosition:x,visibleSeries:f}=t,y=this.w,m=new D(this.barCtx.w),v=y.waterfallData&&y.waterfallData.values,C=v&&v[c]&&null!=v[c][d]?v[c][d]:null,w=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;let I,P;y.axisFlags.isXNumeric&&!y.globals.isBarHorizontal?(I=a+g*(f+1),P=r+b*(f+1)-w):(I=a+g*f,P=r+b*f);let A=null,S=null,L=a,H=r,R={};const W=y.config.dataLabels,X=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(P=x,H=x),void 0!==p&&this.barCtx.isVerticalGroupedRangeBar&&(I=p,L=p);const O=k(W.offsetX,y,c,d),Y=k(W.offsetY,y,c,d);let M={width:0,height:0};if(y.config.dataLabels.enabled){const t=null!==C?C:y.seriesData.series[c][d];M=m.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,l(n({},y),{seriesIndex:c,dataPointIndex:d,w:y})):y.formatters.yLabelFormatters[0](t),parseFloat(W.style.fontSize).toString(),W.style.fontFamily,void 0,!0,W.style.fontWeight)}const T={x:a,y:r,i:h,j:d,realIndex:c,columnGroupIndex:u,bcx:I,bcy:P,barHeight:b,barWidth:g,textRects:M,strokeWidth:w,dataLabelsX:L,dataLabelsY:H,dataLabelsConfig:W,barDataLabelsConfig:X,barTotalDataLabelsConfig:F,offX:O,offY:Y};if(R=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(T):this.calculateColumnsDataLabelsPosition(T),null!==C&&this.barCtx.isHorizontal&&"center"===X.position){const t=null==(s=null==(e=y.waterfallData.geometry)?void 0:e[c])?void 0:s[d];t&&t.horizontal&&(R.dataLabelsX=(t.levelStart+t.levelEnd)/2+O)}return A=this.drawCalculatedDataLabels({x:R.dataLabelsX,y:R.dataLabelsY,val:null!==C?C:this.barCtx.isRangeBar?[i,o]:"100%"===y.config.chart.stackType?y.globals.seriesPercent[c][d]:y.seriesData.series[c][d],i:c,j:d,barWidth:g,barHeight:b,textRects:M,dataLabelsConfig:W}),y.config.chart.stacked&&F.enabled&&(S=this.drawTotalDataLabels({x:R.totalDataLabelsX,y:R.totalDataLabelsY,barWidth:g,barHeight:b,realIndex:c,j:d,textAnchor:R.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:d}),rawVal:this.getStackedTotalValue({realIndex:c,j:d}),dataLabelsConfig:W,barTotalDataLabelsConfig:F})),{dataLabelsPos:R,dataLabels:A,totalDataLabels:S}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const s=this.w,a=this.getTotalGroupContext(t),r=s.seriesData.stackedSeriesTotalsByGroups;return a&&r&&r[a.groupIndex]?r[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:r,j:i,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:d,textRects:c,dataLabelsX:u,dataLabelsY:b,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,strokeWidth:f,offX:y,offY:m}=t;const v=l;d=Math.abs(d);const C="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:w}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:i});l-=f/2;const I=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=e.axisFlags.isXNumeric?l-h/2+y:l-I+h/2+y,!e.config.chart.stacked&&w>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*w)),C){const t=2;u=u+c.height/2-f/2-t}const P=e.seriesData.series[r][i]<0;let A=n;switch(this.barCtx.isReversed&&(A=n+(P?d:-d)),p.position){case"center":b=C?P?A-d/2+m:A+d/2-m:P?A-d/2+c.height/2+m:A+d/2+c.height/2-m;break;case"bottom":b=C?P?A-d+m:A+d-m:P?A-d+c.height+f+m:A+d-c.height/2+f-m;break;case"top":b=C?P?A+m:A-m:P?A-c.height/2-m:A+c.height+m}let S=A;const L=this.getTotalGroupContext(o);if((L?[L.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{S=P?Math.max(t[i],S):Math.min(t[i],S)})}),this.drawsStackedTotal(o)&&x.enabled){const t=18,r=new D(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:i}),g.fontSize);s=P?S-r.height/2-m-x.offsetY+t:S+r.height+m+x.offsetY-t;const n=I;a=v+(e.axisFlags.isXNumeric?-h/2:h/2-n)+x.offsetX}return e.config.chart.stacked||(b<0?b=0+f:b+c.height/3>e.layout.gridHeight&&(b=e.layout.gridHeight-f)),{bcx:l,bcy:n,dataLabelsX:u,dataLabelsY:b,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:r,j:i,realIndex:o,bcy:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:u,dataLabelsConfig:b,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,offX:x,offY:f}=t;const y=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:i});let v,C,w;if(h=Math.abs(h),this.barCtx.isPyramid){v=n+l/2+f-(null!=(e=d.centerOffset)?e:0)}else v=n-(this.barCtx.isRangeBar?0:y)+l/2+d.height/2+f-3;!s.config.chart.stacked&&m>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v-=l*m);let I="start";const P=s.seriesData.series[r][i]<0;let A=a;if(this.barCtx.isReversed&&(A=a+(P?-h:h),I=P?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+x;else switch(g.position){case"center":c=P?A+h/2-x:Math.max(d.width/2,A-h/2)+x;break;case"bottom":c=P?A+h-u-x:A-h+u+x;break;case"top":c=P?A-u-x:A-u+x}let S=A;const L=this.getTotalGroupContext(o);if((L?[L.group]:s.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{S=P?Math.min(t[i],S):Math.max(t[i],S)})}),this.drawsStackedTotal(o)&&p.enabled){const t=new D(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:i}),b.fontSize);P?(C=S-u-x-p.offsetX,I="end"):C=S+x+p.offsetX+(this.barCtx.isReversed?-(h+u):u),w=v-d.height/2+t.height/2+p.offsetY+u,s.globals.barGroups.length>1&&!L&&(w-=s.globals.barGroups.length/2*(l/2))}if(!s.config.chart.stacked){const t=P&&"middle"!==b.textAnchor?"start"===b.textAnchor?"end":"start":b.textAnchor;let e;e="vertical"===g.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const a=("vertical"===g.orientation?d.height:d.width)-e;c+a>s.layout.gridWidth-u&&(c=s.layout.gridWidth-a-u),c-e<u&&(c=e+u)}return{bcx:a,bcy:n,dataLabelsX:c,dataLabelsY:v,totalDataLabelsX:C,totalDataLabelsY:w,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:r,textRects:i,barHeight:o,barWidth:h,dataLabelsConfig:d}){var c,u,b;const g=this.w;let p="rotate(0)";"vertical"===g.config.plotOptions.bar.dataLabels.orientation&&(p=`rotate(-90, ${t}, ${e})`);const x=new H(this.barCtx.w,this.barCtx.ctx),f=new D(this.barCtx.w),y=d.formatter;let m=null;const v=g.globals.collapsedSeriesIndices.indexOf(a)>-1,C=(g.globals.collapsingSeriesIndices||[]).indexOf(a)>-1;if(C){const t=null==(c=g.globals.prevDataLabels)?void 0:c.get(`${a}::${F(g,a,r)}`);t&&isFinite(t.val)&&(s=t.val)}if(d.enabled&&(!v||C)){m=f.group({class:"apexcharts-data-labels",transform:p});const c=g.config.dataLabels;((null==(u=c.animate)?void 0:u.enabled)||(null==(b=c.countUp)?void 0:b.enabled))&&(m.node.setAttribute("data:dlKey",`${a}::${F(g,a,r)}`),m.node.setAttribute("data:dlJ",String(r)),"number"==typeof s&&isFinite(s)&&m.node.setAttribute("data:dlVal",String(s)));let v="";void 0!==s&&(v=y(s,l(n({},g),{seriesIndex:a,dataPointIndex:r,w:g}))),!s&&g.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v="");const w=g.seriesData.series[a][r]<0,I=g.config.plotOptions.bar.dataLabels.position;if("vertical"===g.config.plotOptions.bar.dataLabels.orientation&&("top"===I&&(d.textAnchor=w?"end":"start"),"center"===I&&(d.textAnchor="middle"),"bottom"===I&&(d.textAnchor=w?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<f.getTextRects(v,parseFloat(d.style.fontSize).toString()).width&&(v="")}g.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!C&&(this.barCtx.isHorizontal?i.width/1.6>Math.abs(h)&&(v=""):i.height/1.6>Math.abs(o)&&(v=""));const P=n({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?P.textAnchor="end":"end"===d.textAnchor&&(P.textAnchor="start")),x.plotDataLabelsText({x:t,y:e,text:v,i:a,j:r,parent:m,dataLabelsConfig:P,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return m}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:r,j:i,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new D(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(r)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(r);c.node.setAttribute("data:dlTotalKey",`${t}::${F(this.w,r,i)}`),c.node.setAttribute("data:dlTotalSeries",String(r)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const B=d.__apex_Series,j=d.__apex_Fill;function z(t){var e,s,a,r,i,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(r=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:r.overlap)&&(null!=(n=null==(o=null==(i=t.seriesData)?void 0:i.series)?void 0:o.length)?n:0)>1)}class G{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),c.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,r=1/0;for(;;){let t=1/0,i=-1;for(let a=0;a<e.length;a++){const r=e[a];for(;s[a]<r.length&&"number"!=typeof r[s[a]];)s[a]++;if(s[a]>=r.length)continue;const o=r[s[a]];o==o?o<t&&(t=o,i=a):(s[a]++,a--)}if(-1===i)break;if(s[i]++,a==a){const e=t-a;e>0&&e<r&&(r=e)}a=t}return isFinite(r)?r:0}initialPositions(t){const e=this.w;let s,a,r,i,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let u=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||z(e))&&(u=1),this.barCtx.isHorizontal)r=e.layout.gridHeight/d,o=r/u,e.axisFlags.isXNumeric&&(r=e.layout.gridHeight/this.barCtx.totalItems,o=r/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(r-o*this.barCtx.seriesLen)/2;else{if(i=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(i=e.layout.gridWidth/e.globals.dataPoints),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(i=e/t),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+c.noExponents(i-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:r,xDivision:i,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,a){var r;const i=this.w,o=new j(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(r=i.config.series[e].data[s])?void 0:r.fill),c=this.barCtx.barOptions.isDumbbell?i.config.plotOptions.bar.dumbbell.connector:null;let u;c&&c.color&&(n=c.color,u=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:u,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(i.config.fill.type)?i.config.fill.type[a]:i.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const r=s.config.plotOptions.bar.dumbbell.connector;if(r.color)return null;const i=a.order[e];if(!i)return null;const o=s.globals.colors[i[0]],n=s.globals.colors[i[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:r.opacity,opacityTo:r.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const r=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===r.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,r.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,r=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(r);return e.length?[e]:[]}const i=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!r(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?i[t].push(e):o.push(e)}return o.length&&i.push(o),i.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,r=t.length,i=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:r},()=>Array(i).fill(a?"top":"none"));if(a)return o;const n="last"===s.config.plotOptions.bar.borderRadiusWhenStacked,l=n?"top":"both",h=n?"bottom":"both",d=n?"none":"bottom",c=n?"none":"top";for(const e of this.getStackedSeriesIndices(r))for(let s=0;s<i;s++){const a=[],r=[];for(const i of e){const e=t[i][s];e>0?a.push(i):e<0&&r.push(i)}if(a.length>0&&0===r.length)if(1===a.length)o[a[0]][s]=l;else{const t=a[0],e=a[a.length-1];for(const r of a)o[r][s]=r===t?d:r===e?"top":"none"}else if(r.length>0&&0===a.length)if(1===r.length)o[r[0]][s]=h;else{const t=Math.min(...r),e=Math.max(...r);for(const a of r)o[a][s]=a===t?c:a===e?"bottom":"none"}else if(a.length>0&&r.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...r);for(const t of r)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:r,y2:i,elSeries:o}){const n=this.w,l=new D(this.barCtx.w),h=new B(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==r?r:0,void 0!==a?a:n.layout.gridWidth,void 0!==i?i:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:r,isReversed:i,series:o,seriesGroup:n,realIndex:l,i:h,j:d,w:c}){var u,b,g;const p=new D(this.barCtx.w);(r=Array.isArray(r)?r[l]:r)||(r=0);let x=t,f=e;(null==(u=c.config.series[l].data[d])?void 0:u.columnWidthOffset)&&(f=e-c.config.series[l].data[d].columnWidthOffset/2,x=t+c.config.series[l].data[d].columnWidthOffset);const y=r/2,m=f+y,v=f+x-y,C=(o[h][d]>=0?1:-1)*(i?-1:1);s+=.001-y*C,a+=.001+y*C;const w=p.line(v,s),I="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",P=p.move(m,s)+p.line(m,a)+p.line(v,a)+w+I;let A=P;"none"!==this.arrBorderRadius[l][d]&&(A=p.roundPathCorners(A,c.config.plotOptions.bar.borderRadius));let S=null;const L=null==(g=null==(b=this.barCtx.ctx)?void 0:b.morphTypeChange)?void 0:g.getInitialPathFor(l,d);if(L?S=L:c.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(l,d,A,P)),null==S&&(S=p.move(m,s)+p.line(m,s)+w+w+w+w+w+p.line(m,s)+I),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.yArrj.push(a-y*C),t.yArrjF.push(Math.abs(s-a+r*C)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:A,pathFrom:S,drawnBox:{x1:m,x2:v,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:r,realIndex:i,strokeWidth:o,w:n}){var l,h;const d=new D(this.barCtx.w),c=n.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,b=u(s[a][r]),g=r===s[a].length-1,p="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===p?0:b:u(s[a][r+1]);const f=o/2,y=t+f,m=t+e-f,v=c-b,C=c+b,w=c-x,I=c+x,P=d.move(v,y)+d.line(C,y)+d.line(I,m)+d.line(w,m)+" Z";let A=null;const S=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return S?A=S:n.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(i,r,P)),null==A&&(A=d.move(c,y)+d.line(c,y)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:P,pathFrom:A,x:C,x1:v,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,r=t.map(t=>Math.abs(Number(t)||0)),i=r.reduce((t,e)=>t+e,0);if(0===i||s<=0)return r.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let n=0;const l=[];for(let t=0;t<r.length;t++){const e=n/i;n+=r[t];const a=n/i,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:r,j:i,strokeWidth:o,w:n}){var l,h;const d=new D(this.barCtx.w),c=n.layout.gridWidth/2,u=o/2,b=t+u,g=t+e-u,p=c-s,x=c+s,f=c-a,y=c+a,m=d.move(p,b)+d.line(x,b)+d.line(y,g)+d.line(f,g)+" Z";let v=null;const C=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return C?v=C:n.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(r,i,m)),null==v&&(v=d.move(c,b)+d.line(c,b)+d.line(c,g)+d.line(c,g)+" Z"),{pathTo:m,pathFrom:v,x:x,x1:p,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:r,isReversed:i,series:o,seriesGroup:n,realIndex:l,i:h,j:d,w:c}){var u,b,g;const p=new D(this.barCtx.w);(r=Array.isArray(r)?r[l]:r)||(r=0);let x=t,f=e;(null==(u=c.config.series[l].data[d])?void 0:u.barHeightOffset)&&(x=t-c.config.series[l].data[d].barHeightOffset/2,f=e+c.config.series[l].data[d].barHeightOffset);const y=r/2,m=x+y,v=x+f-y,C=(o[h][d]>=0?1:-1)*(i?-1:1);s+=.001+y*C,a+=.001-y*C;const w=this.barCtx.isFunnel,I=w?(s+a)/2:s,P=p.line(s,v),A="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",S=p.move(s,m)+p.line(a,m)+p.line(a,v)+P+A;let L=S;"none"!==this.arrBorderRadius[l][d]&&(L=p.roundPathCorners(L,c.config.plotOptions.bar.borderRadius));let H=null;const k=null==(g=null==(b=this.barCtx.ctx)?void 0:b.morphTypeChange)?void 0:g.getInitialPathFor(l,d);if(k?H=k:c.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(l,d,L,S)),null==H){const t=w?p.line(I,v):P;H=p.move(I,m)+p.line(I,m)+t+t+t+t+t+p.line(I,m)+A}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.xArrj.push(a+y*C),t.xArrjF.push(Math.abs(s-a-r*C)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:L,pathFrom:H,drawnBox:{x1:s,x2:a,y1:m,y2:v}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let r=a?e:null;return null!=t&&(r=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),r}getGoalValues(t,e,s,a,r,i){const o=this.w,h=[],d=(a,r)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,i,!1),attrs:r})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][r]&&Array.isArray(o.seriesData.seriesGoals[a][r])&&o.seriesData.seriesGoals[a][r].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,r);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let i=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[i].value&&(i=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},s),{strokeColor:t.color});!c.enabled||e!==i&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,r,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===i&&i!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],r=s.dumbbellData;if(r&&"series"===r.form){const t=r.values[e]||[];for(let e=0;e<t.length;e++){const i=t[e];null!==i&&-1===r.hidden.indexOf(e)&&a.push({value:i,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const i=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(i[t])?i[t][e]:i[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const r=this.w,i=r.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof i.formatter)return i.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:r});const o=this.barCtx.isHorizontal?r.formatters.xLabelFormatter:r.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,r):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:r,barHeight:i}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new D(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:i/2,a=e+s+i/2;l=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:r/2,a=t+s+r/2;l=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new D(s),r=s.config.plotOptions.bar.dumbbell.dataLabels,i=e.markerSize/2+r.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?i*o:0),y:e.y-(e.horizontal?0:i*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:r.style.fontSize,fontFamily:r.style.fontFamily,fontWeight:r.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:r}){const i=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:u}=e,b=l+e.barHeight,g=new D(this.barCtx.w),p=new c,x=g.move(n,b)+g.line(o,b)+g.line(h,u)+g.line(d,u)+g.line(n,b)+("around"===i.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][r]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,c.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let r=0,i=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&r++,s<t&&0===o&&i++}),{nonZeroColumns:r,zeroEncounters:i}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let r=a.indexOf(s);return r<0&&(a.push(s),r=a.length-1),{groupIndex:s,columnGroupIndex:r}}}const _=d.__apex_CoreUtils,N=d.__apex_Filters,V=d.__apex_Animations_computeStagger;class E{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/E.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*E.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const r=a.getBoundingClientRect(),i=t.globals.svgWidth?r.width/t.globals.svgWidth:1;return(e-r.left)/(i||1)-t.layout.translateX}}class ${constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new B(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const r=a.getBarSeriesIndices(),i=new _(this.w);this.stackedSeriesTotals=i.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===r.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new G(this)}draw(t,e){var s,a,r;const i=this.w,o=new D(this.w),h=new _(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=o.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,u=0;h<t.length;h++,u++){let b,g;const p=[],x=[],f=i.globals.comboCharts?e[h]:h,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(f),m=o.group({class:"apexcharts-series",rel:h+1,seriesName:c.escapeString(i.seriesData.seriesNames[f]),"data:realIndex":f});B.addCollapsedClassToSeries(this.w,m,f),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[f],this.translationsIndex=f);const v=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const C=this.barHelpers.initialPositions(f),{y:w,yDivision:I,zeroW:P,x:A,xDivision:S,zeroH:L}=C;let D=C.barHeight,H=C.barWidth;g=w,b=A,this.isHorizontal||x.push(b+(null!=H?H:0)/2);const k=o.group({class:"apexcharts-datalabels","data:realIndex":f});i.globals.delayedElements.push({el:k.node,holdUntilComplete:!(null==(s=i.config.dataLabels.animate)?void 0:s.enabled)&&this.isLengthTransition(f)}),k.node.classList.add("apexcharts-element-hidden");const R=o.group({class:"apexcharts-bar-goals-markers"}),W=o.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:W.node}),W.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const s=this.barHelpers.getStrokeWidth(h,e,f);let o=null;const d={indexes:{i:h,j:e,realIndex:f,translationsIndex:v,bc:u},x:b,y:g,strokeWidth:s,elSeries:m};this.isHorizontal?(o=this.drawBarPaths(l(n({},d),{barHeight:D,zeroW:P,yDivision:I})),H=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(l(n({},d),{xDivision:S,barWidth:H,zeroH:L})),D=this.series[h][e]/this.yRatio[v]);const C=this.barHelpers.getPathFillColor(t,h,e,f);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(a=i.config.plotOptions.funnel)?void 0:a.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof C.color&&-1===(null==(r=C.color)?void 0:r.indexOf("url"))?C.color:c.hexToRgba(i.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:f,j:e});if(W.add(t),i.config.chart.dropShadow.enabled){new N(this.w).dropShadow(t,i.config.chart.dropShadow,f)}}this.pathArr.push(o);const w=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:D,barWidth:H});w&&R.add(w),g=o.y,b=o.x,e>0&&x.push(b+(null!=H?H:0)/2),p.push(g),this.renderSeries(l(n({realIndex:f,pathFill:C.color},C.useRangeColor?{lineFill:C.color}:{}),{j:e,i:h,columnGroupIndex:y,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:s,elSeries:m,x:b,y:g,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:D),barWidth:Math.abs(o.barWidth?o.barWidth:H),elDataLabelsWrap:k,elGoalsMarkers:R,elBarShadows:W,visibleSeries:this.visibleI,type:"bar"}))}if(i.globals.seriesXvalues[f]=x,i.globals.seriesYvalues[f]=p,i.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[h].length;s++)e.push(F(i,f,s));M({w:i,elSeries:m,record:this._prevRecord(f),newKeys:e,isHorizontal:this.isHorizontal,speed:i.config.chart.animations.dynamicAnimation.speed})}d.add(m)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:r,columnGroupIndex:i,pathFrom:o,pathTo:n,strokeWidth:l,elSeries:h,x:d,y:c,y1:u,y2:b,series:g,barHeight:p,barWidth:x,barXPosition:f,barYPosition:y,elDataLabelsWrap:m,elGoalsMarkers:v,elBarShadows:C,visibleSeries:w,type:I,classes:P}){var A,S,L,H,k,R,W;const X=this.w,O=new D(this.w,this.ctx),Y=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,O);let M=!1;const B=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,O.setupEventDelegation(h,`.apexcharts-${I}-area`)),!s){let e=function(t){const e=X.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:X.seriesData.series[t][a],dataPointIndex:a,w:X}):s};const r="function"==typeof X.globals.stroke.colors[t]?e(t):X.globals.stroke.colors[t];s=this.barOptions.distributed?X.globals.stroke.colors[a]:r}const j=X.config.chart.animations,z=j.animateGradually;let G=0,_=0;if(z&&!1!==z.enabled&&!(X.globals.dataChanged&&this.isLayoutShift(t))){const t=X.globals.dataPoints||1,e=z.delay||0,s=Math.min(e,.5*j.speed/Math.max(1,t));_=V({style:"sequential",index:a,baseDelay:s}),X.config.chart.stacked&&!X.globals.dataChanged&&(_+=r*s*.5);G=_/(e||1)}const E=new T(this).handleBarDataLabels({x:d,y:c,y1:u,y2:b,i:r,j:a,series:g,realIndex:t,columnGroupIndex:i,barHeight:p,barWidth:x,barXPosition:f,barYPosition:y,visibleSeries:w});if(_>0){const t=X.config.dataLabels;if((null==(A=t.animate)?void 0:A.enabled)||(null==(S=t.countUp)?void 0:S.enabled)){const t=String(Math.round(_));null==(H=null==(L=E.dataLabels)?void 0:L.node)||H.setAttribute("data:dlDelay",t),null==(R=null==(k=E.totalDataLabels)?void 0:k.node)||R.setAttribute("data:dlDelay",t)}}if(X.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(x,X.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(x,X.globals.barPadForNumericAxis)>X.layout.gridWidth)&&(M=!0),X.config.series[r].data[a]&&X.config.series[r].data[a].strokeColor&&(s=X.config.series[r].data[a].strokeColor),this.isNullValue&&-1===X.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!M){const i=!0===(null==(W=this.ctx.morphTypeChange)?void 0:W.isActive()),d=i?this.ctx.morphTypeChange.getSpeed():X.config.chart.animations.dynamicAnimation.speed,c=i&&this.ctx.morphTypeChange.claimsTargetMark(t,a);c&&(o=n,G=0);const g=Y.renderPaths({i:r,j:a,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:X.config.stroke.lineCap,fill:e,pathToInterp:B,animationDelay:G,initialSpeed:X.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${I}-area${P?` ${P}`:""}`,chartType:I,bindEventsOnPaths:!1});g.attr("clip-path",`url(#gridRectBarMask${X.globals.cuid})`),c&&(g.node.setAttribute("opacity","0"),g.node.setAttribute("data-piece-hidden","1"));const f=X.config.forecastDataPoints;f.count>0&&a>=X.globals.dataPoints-f.count&&(g.node.setAttribute("stroke-dasharray",f.dashArray),g.node.setAttribute("stroke-width",f.strokeWidth),g.node.setAttribute("fill-opacity",f.fillOpacity)),void 0!==u&&void 0!==b&&(g.attr("data-range-y1",u),g.attr("data-range-y2",b));new N(this.w).setSelectionFilter(g,t,a),h.add(g),g.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:a,val:X.seriesData.series[r][a],barHeight:p,barWidth:x,"data:pathKey":F(X,t,a)}),"canvas"===Y.kind&&(X.globals.barCanvasCoords||(X.globals.barCanvasCoords={}),X.globals.barCanvasCoords[t]||(X.globals.barCanvasCoords[t]={}),X.globals.barCanvasCoords[t][a]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:x}),null!==E.dataLabels&&m.add(E.dataLabels),E.totalDataLabels&&m.add(E.totalDataLabels),h.add(m),v&&h.add(v),C&&h.add(C)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.axisFlags.isXNumeric)c=(i=(l.seriesData.seriesX[h][d]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=i+e*this.visibleI,c-=e*s}else c=i+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,b=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!b;if(b)c=b.y,e=b.height;else if(this.isFunnel&&!u){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return r=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=b?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:b.topHalf,bottomHalf:b.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(u||g)&&(a=p.x1,r=p.x),l.axisFlags.isXNumeric||g||(i+=o),g&&(i=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:r,y:i,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,u=t.j,b=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:r});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:u});t>0&&(r=this.seriesLen*r/t),g=e+r*this.visibleI,g-=r*s}else g=e+r*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][u],i,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:r,y1:i,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:u,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:b,j:u,i:c,x1:g-o/2-r*this.visibleI,x2:r*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,i,h,u,d),barXPosition:g,barWidth:r}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const r=this.w;let i=s;return r.seriesData.seriesX[s].length||(i=r.globals.maxValsInArrayIndex),c.isNumber(r.seriesData.seriesX[i][a])&&(t=E.dataXToPx(r,r.seriesData.seriesX[i][a])-e*this.seriesLen/2),{barXPosition:t+(z(r)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const r=e.globals.previousPaths[a];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(String(t),10)&&(s=r)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let r=!1;if(X(a)&&a.globals.previousPaths.length>0){const i=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(i)if(i.paths.length!==o)r=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(F(a,t,s))){r=!0;break}}else r=o>0}return this._ltCache[t]=r,r}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=Y(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const r=this.w;this._pathToInterp=null;const i=this._prevRecord(t);if(!i)return X(r)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(F(r,t,e));s?o=s.d:n=!0}else void 0!==i.paths[e]?o=i.paths[e].d:n=!0;if(o){const t=$.pathCommandCount(o),e=$.pathCommandCount(s);if(t===e)return o;const i=new D(r),n=t=>{const e=$.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=t<e?n(o)>1:n(s)>1;if(t<e){const t=i.roundPathCorners(o,0);if($.pathCommandCount(t)===e){if(l&&a){const t=i.roundPathCorners(a,0);$.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=i.roundPathCorners(s,0);if($.pathCommandCount(e)===t){if(this._pathToInterp=e,l){const e=$.squareLike(o),s=e?i.roundPathCorners(e,0):null;if(s&&$.pathCommandCount(s)===t)return s}return o}}}return n&&X(r)?null:s}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const r=e.map(t=>t[0]),i=e.map(t=>t[1]);return{minX:Math.min(...r),maxX:Math.max(...r),minY:Math.min(...i),maxY:Math.max(...i),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=$.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:r,maxY:i,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,u;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,u]=l(o[1],r,i)):(c=Math.abs(o[1]-r)<=Math.abs(o[1]-i)?r:i,u=c===r?i:r,[h,d]=l(o[0],s,a));const b=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${u} L ${d} ${u} L ${d} ${c}${b}`:`M ${h} ${c} L ${d} ${c} L ${d} ${u} L ${h} ${u}${b}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const r=this._prevKeyedPaths(t),i=r?r.get(F(s,t,e)):a.paths[e];return i?!!i.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}d.default.use({bar:$,column:$,barStacked:class extends ${draw(t,e){const s=this.w;this.graphics=new D(this.w),this.bar=new $(this.w,this.ctx,this.xyRatios);const a=new _(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const r=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let i=0,o=0;const h=s.config.chart.animations,d=h.enabled&&h.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let u=!1;for(let a=0,h=0;a<t.length;a++,h++){const b=s.globals.comboCharts?e[a]:a,{groupIndex:g,columnGroupIndex:p}=this.barHelpers.getGroupIndex(b);this.groupCtx=this[s.labelData.seriesGroups[g]];const x=[],f=[];let y=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[b][0],y=b),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let m=this.graphics.group({class:"apexcharts-series",seriesName:c.escapeString(s.seriesData.seriesNames[b]),rel:a+1,"data:realIndex":b});B.addCollapsedClassToSeries(this.w,m,b);const v=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":b});B.addCollapsedClassToSeries(this.w,v,b),(s.globals.collapsingSeriesIndices||[]).indexOf(b)>-1&&v.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const C=this.graphics.group({class:"apexcharts-bar-goals-markers"}),w=this.initialPositions(i,o,void 0,void 0,void 0,void 0,y),{xDivision:I,yDivision:P,zeroH:A,zeroW:S}=w;let L=w.barHeight,D=w.barWidth;o=w.y,i=w.x,s.globals.barHeight=L,s.globals.barWidth=D,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>A),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const r=this.barHelpers.getStrokeWidth(a,e,b),c={indexes:{i:a,j:e,realIndex:b,translationsIndex:y,bc:h},strokeWidth:r,x:i,y:o,elSeries:m,columnGroupIndex:p,seriesGroup:s.labelData.seriesGroups[g]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(l(n({},c),{zeroW:S,barHeight:L,yDivision:P})),D=this.series[a][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(l(n({},c),{xDivision:I,barWidth:D,zeroH:A})),L=this.series[a][e]/this.yRatio[y]);const H=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:L,barWidth:D});H&&C.add(H),o=w.y,i=w.x,x.push(i),f.push(o);const k=this.barHelpers.getPathFillColor(t,a,e,b);let R="";const W=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",X="bottom"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]>0||"top"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]<0,F=d&&!X&&this.getPreviousFlip(b,e);(X||F)&&(R=W),F&&(R+=" apexcharts-flip-held",u=!0),m=this.renderSeries(l(n({realIndex:b,pathFill:k.color},k.useRangeColor?{lineFill:k.color}:{}),{j:e,i:a,columnGroupIndex:p,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:r,elSeries:m,x:i,y:o,series:t,barHeight:L,barWidth:D,elDataLabelsWrap:v,elGoalsMarkers:C,type:"bar",visibleSeries:p,classes:R}))}s.globals.seriesXvalues[b]=x,s.globals.seriesYvalues[b]=f,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),r.add(m)}return u&&this.settleHeldMirrors(),r}settleHeldMirrors(){const t=this.w;if(!W.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&c.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,s,a,r,i,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,i=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),r=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:r,zeroW:i}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,columnGroupIndex:o,seriesGroup:n,yDivision:l,elSeries:h}){var d,c,u,b,g;const p=this.w,x=i+o*e;let f;const y=t.i,m=t.j,v=t.realIndex,C=t.translationsIndex;let w=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)w+=this.groupCtx.prevXF[t][m];const I=this.groupCtx.prevX.length;if(I>0){let t=a;this.groupCtx.prevXVal[I-1][m]<0?t=(null==(d=this.series[y])?void 0:d[m])>=0?this.groupCtx.prevX[I-1][m]+w-2*(this.isReversed?w:0):this.groupCtx.prevX[I-1][m]:this.groupCtx.prevXVal[I-1][m]>=0&&(t=(null==(c=this.series[y])?void 0:c[m])>=0?this.groupCtx.prevX[I-1][m]:this.groupCtx.prevX[I-1][m]-w+2*(this.isReversed?w:0)),f=t}else f=a;r=null===(null==(u=this.series[y])?void 0:u[m])?f:f+(null==(b=this.series[y])?void 0:b[m])/this.invertedYRatio-2*(this.isReversed?(null==(g=this.series[y])?void 0:g[m])/this.invertedYRatio:0);const P=this.barHelpers.getBarpaths({barYPosition:x,barHeight:e,x1:f,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:n,i:y,j:m,w:p});return this.barHelpers.barBackground({j:m,i:y,y1:x,y2:e,elSeries:h}),i+=l,{pathTo:P.pathTo,pathFrom:P.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,v,m,C),barXPosition:f,barYPosition:x,x:r,y:i}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,columnGroupIndex:o,seriesGroup:n,elSeries:l}){var h,d,c,u,b,g,p,x,f;const y=this.w,m=t.i,v=t.j,C=t.bc,w=t.realIndex,I=t.translationsIndex;if(y.axisFlags.isXNumeric){let t=y.seriesData.seriesX[w][v];t||(t=0),e=(t-y.globals.minX)/this.xRatio-r/2*y.globals.barGroups.length}const P=e+o*r;let A,S=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)S+=isNaN(this.groupCtx.prevYF[t][v])?0:this.groupCtx.prevYF[t][v];const L=this.groupCtx.prevY.length;if(L>0&&!y.axisFlags.isXNumeric||L>0&&y.axisFlags.isXNumeric&&y.seriesData.seriesX[w-1][v]===y.seriesData.seriesX[w][v]){let t,e;const s=Math.min(this.yRatio.length+1,w+1);if(void 0!==this.groupCtx.prevY[L-1]&&this.groupCtx.prevY[L-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[L-t])?void 0:h[v])){e=this.groupCtx.prevY[L-t][v];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[L-a])?void 0:d[v])<0){t=(null==(c=this.series[m])?void 0:c[v])>=0?e-S+2*(this.isReversed?S:0):e;break}if((null==(u=this.groupCtx.prevYVal[L-a])?void 0:u[v])>=0){t=(null==(b=this.series[m])?void 0:b[v])>=0?e:e+S-2*(this.isReversed?S:0);break}}void 0===t&&(t=y.layout.gridHeight),A=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,L).every(t=>t.every(t=>isNaN(t)))?i:t}else A=i;s=(null==(p=this.series[m])?void 0:p[v])?A-(null==(x=this.series[m])?void 0:x[v])/this.yRatio[I]+2*(this.isReversed?(null==(f=this.series[m])?void 0:f[v])/this.yRatio[I]:0):A;const D=this.barHelpers.getColumnPaths({barXPosition:P,barWidth:r,y1:A,y2:s,yRatio:this.yRatio[I],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:n,realIndex:t.realIndex,i:m,j:v,w:y});return this.barHelpers.barBackground({bc:C,j:v,i:m,x1:P,x2:r,elSeries:l}),{pathTo:D.pathTo,pathFrom:D.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,i,w,v,0),barXPosition:P,x:y.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends ${draw(t,e){var s,a,r,i,o,l,h,d,u;const b=this.w,g=new D(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=b.rangeData.seriesRangeStart,this.seriesRangeEnd=b.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const p=g.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let x=0;x<t.length;x++){let f,y;const m=b.globals.comboCharts?e[x]:x,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(m),C=g.group({class:"apexcharts-series",seriesName:c.escapeString(b.seriesData.seriesNames[m]),rel:x+1,"data:realIndex":m});B.addCollapsedClassToSeries(this.w,C,m),t[x].length>0&&(this.visibleI=this.visibleI+1);let w=0;this.yRatio.length>1&&(this.yaxisIndex=b.globals.seriesYAxisReverseMap[m][0],w=m);const I=this.barHelpers.initialPositions(m),{y:P,zeroW:A,x:S,zeroH:L}=I;let D=null!=(s=I.barWidth)?s:0,H=null!=(a=I.barHeight)?a:0;const k=null!=(r=I.yDivision)?r:0,R=null!=(i=I.xDivision)?i:0;y=P,f=S;const W=g.group({class:"apexcharts-datalabels","data:realIndex":m}),X=g.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<b.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(x,e,m),a=this.seriesRangeStart[x][e],r=this.seriesRangeEnd[x][e];let i=null,c=null,g=null;const p={x:f,y:y,strokeWidth:s,elSeries:C};let P=this.seriesLen;if(b.config.plotOptions.bar.rangeBarGroupRows&&(P=1),void 0===(null==(o=b.config.series[x].data)?void 0:o[e]))break;if(this.isHorizontal){g=y+H*this.visibleI;const t=(k-H*P)/2;if(null==(h=null==(l=b.config.series[x].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:g,srty:t,barHeight:H,yDivision:k,initPositions:I});H=s.barHeight,g=s.barYPosition}i=this.drawRangeBarPaths(n({indexes:{i:x,j:e,realIndex:m},barHeight:H,barYPosition:g,zeroW:A,yDivision:k,y1:a,y2:r},p)),D=i.barWidth}else{b.axisFlags.isXNumeric&&(f=(b.seriesData.seriesX[x][e]-b.globals.minX)/this.xRatio-D/2),c=f+D*this.visibleI;const t=(R-D*P)/2;if(null==(u=null==(d=b.config.series[x].data)?void 0:d[e])?void 0:u.x){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:c,srtx:t,barWidth:D,xDivision:R,initPositions:I});D=s.barWidth,c=s.barXPosition}i=this.drawRangeColumnPaths(n({indexes:{i:x,j:e,realIndex:m,translationsIndex:w},barWidth:D,barXPosition:c,zeroH:L,xDivision:R},p)),H=i.barHeight}const S=this.barHelpers.drawGoalLine({barXPosition:i.barXPosition,barYPosition:g,goalX:i.goalX,goalY:i.goalY,barHeight:H,barWidth:D});S&&X.add(S),y=i.y,f=i.x;const F=this.barHelpers.getPathFillColor(t,x,e,m);this.renderSeries({realIndex:m,pathFill:F.color,lineFill:F.useRangeColor?F.color:b.globals.stroke.colors[m],j:e,i:x,x:f,y:y,y1:a,y2:r,pathFrom:i.pathFrom,pathTo:i.pathTo,strokeWidth:s,elSeries:C,series:t,barHeight:H,barWidth:D,barXPosition:c,barYPosition:g,columnGroupIndex:v,elDataLabelsWrap:W,elGoalsMarkers:X,visibleSeries:this.visibleI,type:"rangebar"})}p.add(C)}return p}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:r,srtx:i,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,u,b,g;const p=this.w;let x=[];const f=null==(u=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:u[e],y=null==(g=null==(b=p.config.series[t].data)?void 0:b[e])?void 0:g.x,m=Array.isArray(y)?y.join(" "):y,v=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(m),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===m&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?r+l*v:r+o*this.visibleI+l*v,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(o=d.barHeight/x.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+l*v))):(v>-1&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?i+h*v:i+n*this.visibleI+h*v),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*v))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:r,zeroH:i}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:u}=t,b=this.yRatio[u],g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=i-p/b,x=i-x/b):p=i;const y=Math.abs(x-p),m=this.barHelpers.getColumnPaths({barXPosition:r,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=m.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,r=t.barXPosition}else e+=s;return{pathTo:m.pathTo,pathFrom:m.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,i,c,d,u),barXPosition:r}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:r,barHeight:i,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.preventBarOverflow(n+s/this.invertedYRatio),u=this.preventBarOverflow(n+a/this.invertedYRatio),b=this.getRangeValue(h,d),g=Math.abs(u-c),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:i,x1:c,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=b.start&&null!=b.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=r),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:g,x:b.start<0&&b.end<0?c:u,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|